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

Syntax highlight in sigil_H only works if it ends exactly in """ #7

Open
bamorim opened this issue Nov 29, 2021 · 2 comments · May be fixed by #25
Open

Syntax highlight in sigil_H only works if it ends exactly in """ #7

bamorim opened this issue Nov 29, 2021 · 2 comments · May be fixed by #25

Comments

@bamorim
Copy link

bamorim commented Nov 29, 2021

imagem
imagem

I'm not sure if just adding the case for """) is enough or if we need to be more "elixir-aware".

Other scenarios would be having ~H inside arrays, so we could have """, but then it can also be inside a tuple, which depending on the scenario can be formatted with """, anything here}

I think the main problem is that the elixir formatter changes

foo(
  ~H"""
    <div>something</div>
  """
)

into

foo(~H"""
  <div>something</div>
""")

Which makes so that the "correct format" doesn't highlight properly.

Is there anything I can do to help with that?

@bamorim
Copy link
Author

bamorim commented Nov 29, 2021

My current workaround is to either change my formatter so rendered_to_string is no-parens or to assign the result to a variable and then call the rendered_to_string afterwards.

@Sgoettschkes
Copy link

I'm having the same issue. Seems like the regex at https://github.com/phoenixframework/vscode-phoenix/blob/main/syntaxes/elixir-heex.json#L14 is too strict. I don't have any experience with VScode extension and highlights and am wondering if not matching for the line end would work: "end": "^\\s*(\"\"\")",?

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

Successfully merging a pull request may close this issue.

2 participants