-
Notifications
You must be signed in to change notification settings - Fork 57
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
-> at the beginning of the line makes the linter crash #183
Labels
Comments
robertoaloi
added a commit
to erlang-ls/erlang_ls
that referenced
this issue
Mar 13, 2021
Issue is in this function: -spec character_at_location(Position::atom(),
Lines::[binary()],
Operator::string(),
Location::{integer(), integer()},
Encoding::latin1|utf8) -> char().
character_at_location(Position, Lines, Operator, {LineNo, Col}, Encoding) ->
Line = lists:nth(LineNo, Lines),
OperatorLineStr = unicode:characters_to_list(Line, Encoding),
ColToCheck = case Position of
left -> Col - 1;
right -> Col + length(Operator)
end,
% If ColToCheck is greater than the length of OperatorLineStr variable, it
% means the end of line was reached so return " " to make the check pass,
% otherwise return the character at the given column.
% NOTE: text below only applies when the given Position is equal to `right`.
SpaceChar = $\s,
case {Position, (ColToCheck > length(OperatorLineStr))} of
{right, true} -> SpaceChar;
_ -> lists:nth(ColToCheck, OperatorLineStr)
end. I'll try to fix soon. |
robertoaloi
added a commit
to erlang-ls/erlang_ls
that referenced
this issue
Mar 13, 2021
* Upgrade linter (elvis_core, rebar3_lint) * Fetch linter from Hex rather than git * Run linter via its plugin and not as a compiler hook * Fix current linting issues * Update Elvis config in test application Found an elvis_core bug: inaka/elvis_core#183 Not using wildcards for `dirs` in the Elvis config, since they are still not supported.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code:
Causes the linter to fail with:
Moving the
->
away from the beginning of the line solves the issue.The text was updated successfully, but these errors were encountered: