Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid negative line numbers in elvis diagnostics. #1233

Merged
merged 1 commit into from
Mar 8, 2022

Conversation

ztion
Copy link
Contributor

@ztion ztion commented Mar 2, 2022

Description

I noticed that elvis will set line number to 0 for the atom_naming_convention diagnostic, which results in ErlangLS sending -1 as line number to the LSP client. This makes at least VS code not show any other elvis diagnostics, even other diagnostics with valid line numbers.

This fix will set line number to 1 if we get 0 or below from elvis.

Will try to make a pull request to elvis_core as well to make it send an actual line number, but I think this precaution can still be good.

@robertoaloi
Copy link
Member

Thanks! Yes, a fix to Elvis would be lovely.

@robertoaloi robertoaloi merged commit 4e288d3 into erlang-ls:main Mar 8, 2022
@ztion
Copy link
Contributor Author

ztion commented Mar 8, 2022

The fix for elvis is already merged too, and in fact they even put out a new version on hex.pm! Nice guys.

inaka/elvis_core#223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants