Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Whole module is highlighted on a local do..end mismatch #451

Copy link
Copy link
@nicnilov

Description

@nicnilov
Issue body actions

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.
Image

Here is a non-matching curly bracket, similar behavior, still acceptable:
Image

And here is a non-matching do..end block where the whole module gets highlighted which is not only distracting, but also useless:
Image

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:
Image

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.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.