vscode-phoenix
vscode-phoenix copied to clipboard
Incorrect syntax highlighting in heex `case` expression
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>
The tokens look OK, most likely it's unmatched bracket
it appears the ->
isn't being marked as non-bracket
This line is the culprit here https://github.com/phoenixframework/vscode-phoenix/blob/f98531327c04210d6d04affd35cac4cfa00fa805/language-configuration.json#L6 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 https://github.com/elixir-lsp/vscode-elixir-ls/issues/353
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"
]