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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with < and > in Elixir Code #19

Open
aj-foster opened this issue Mar 10, 2023 · 2 comments
Open

Issues with < and > in Elixir Code #19

aj-foster opened this issue Mar 10, 2023 · 2 comments

Comments

@aj-foster
Copy link

aj-foster commented Mar 10, 2023

Hi there 馃憢馃徏

Recently I reopened a project with HEEx files, and found that the syntax highlighing no longer handled some cases.

image

Specifically, it appears that any use of the < or > characters in the embedded Elixir code causes issues with the surrounding brackets and braces. While the exact cause is unclear to me, I imagine the highlighter may think of these characters as tag open or close markers despite the change in context.


Versions of things:

VS Code: 1.76.1
phoenixframework extension: v0.1.2
ElixirLS extension: v0.13.0

@aj-foster
Copy link
Author

Upon further review, it appears this issue is not related to the grammar, and instead is related to VS Code's built-in bracket pair colorization. This issue has a related story for embedded TypeScript. However, the proposed solution may also require changes to the grammar.

In the meantime, users may selectively disable bracket pair colorization for HEEx using the following addition to their settings.json:

  "[phoenix-heex]": {
    "editor.bracketPairColorization.enabled": false
  },

Note that this will work for separate .heex files. There may also be a way to target this configuration for the ~H sigil.

@RedCMD
Copy link

RedCMD commented Dec 31, 2023

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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants