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

Incorrect syntax highlighting in heex case expression #22

Open
lukaszsamson opened this issue Jan 17, 2024 · 3 comments
Open

Incorrect syntax highlighting in heex case expression #22

lukaszsamson opened this issue Jan 17, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@lukaszsamson
Copy link

VSCode version: 1.85.1
vscode-phoenix version: 0.1.2

The following snippet is incorrectly highlighted

  <li>
    <strong>Some:</strong>
    <%= case some do %>
      <% map when is_map(map) -> %>
        <dl>
          Map
        </dl>
      <% other -> %>
        Other
    <% end %>
  </li>
Screenshot 2024-01-17 at 13 58 33

The tokens look OK, most likely it's unmatched bracket

Screenshot 2024-01-17 at 13 59 37 Screenshot 2024-01-17 at 14 00 04
@RedCMD
Copy link

RedCMD commented Jan 17, 2024

it appears the -> isn't being marked as non-bracket

@chrismccord chrismccord added the help wanted Extra attention is needed label Jan 17, 2024
@lukaszsamson
Copy link
Author

This line is the culprit here

as it defines < > as bracket pair.

This may not be easy to fix without removing it. AFAIK VSCode does not support negative matches nor regex on brackets https://code.visualstudio.com/api/language-extensions/language-configuration-guide#brackets-definition

I had similar issues in elixir-lsp/vscode-elixir-ls#353

@RedCMD
Copy link

RedCMD commented Jan 17, 2024

you can disable symbols being used as brackets with "unbalancedBracketScopes"
for example:

"unbalancedBracketScopes": [
	"invalid.illegal.characters-not-allowed-here.html",
	"entity.other.attribute-name.html"
]

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants