-
Notifications
You must be signed in to change notification settings - Fork 107
Description
This is in VSCode with the ElixirLS extension version 0.26.4, under Elixir 1.17.3 / OTP 27.
There is a distracting behavior of an error highlighting I was trying to figure out and so far couldn't. On pretty much any non-matching do..end
block the whole module gets highlighted with squiggles which is quite distracting. As during editing it is not rare to have non-matching do..end
blocks, this happens a lot.
I couldn't find a way to disable this behavior, please point me at it if there is one. For me the desired behavior on non-matching blocks would be to only have the opening bit of the deepest affected block selected, and not the whole of it, and of course not anything outside.
Details
What seems notable, the information about the locality of the error is present in the error message and maybe can be used to limit the error selection to the relevant area.
Here is an example of a non-matching square bracket, the effect is reasonably local squiggles, although could be made better by only highlighting the unmatched opening bracket. Maybe it could also rely on indentation to not highlight anything below the expected location, but this is debatable.
Here is a non-matching curly bracket, similar behavior, still acceptable:
And here is a non-matching do..end
block where the whole module gets highlighted which is not only distracting, but also useless:
Notably, if we look at the error details, there is a hint on the actual locality of the non-matched do
, which happens to be at line 9:
In a situation with a deeper nested do..end
the behavior is similarly undesirable, but in this case the locality is not detected correctly, as the erroneous line is now 23, and not 9. Even then, limiting the selection to the block starting at line 9 would be helpful.