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 highlighting for curly brackets on heex #28

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

nettinho
Copy link

@nettinho nettinho commented Dec 4, 2024

I've forked this repo to get syntax highlight working with the newly added curly brackets syntax.
I'm not sure if this is the way to submit a possible contribution, and it definitely needs revision.

@SteffenDE
Copy link

Do you think it would be possible to respect phx-no-curly-interpolation and not treat curly interpolation inside tags with that attribute as Elixir expression?

Also, is there a specific reason to create a new elixir-curly-embedded definition? From my testing it looks the same when I just add

{
  "include": "#interpolation"
}

to the root patterns. And I don't think we need the special handling for a comment.

@SteffenDE
Copy link

I experimented with phx-no-curly-interpolation in #30, but I don't think it's possible.

@msaraiva
Copy link
Contributor

@SteffenDE I believe you're correct. Adding:

{
  "include": "#interpolation"
}

to the root patterns node should be enough. That's how we've been using it in Surface. I might have missed some edge cases, but if they exist, they just haven't been reported yet.

@nettinho
Copy link
Author

Strangely, this was the first thing I tried, but for some reason it didn't work for me (probably because of something else). So I moved on.
Trying it again, it did work.
I've updated the merge request, just to add #interpolation to the root patterns.

@SteffenDE
Copy link

LGTM! :)

@msaraiva msaraiva merged commit dd21dcb into phoenixframework:main Dec 16, 2024
@nettinho
Copy link
Author

Is there no need to update the version or generate a new .vsix file?

@msaraiva
Copy link
Contributor

It depends on how it's going to be published. If using, for instance, vsce publish 0.1.3 -m "Bump version to v%s", it already updates the version in package.json, creates a commit/tag for the release and publishes it. Otherwise, each one of those steps has to be done manually.

@msaraiva
Copy link
Contributor

@nettinho BTW, thank you for the PR! 💜

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 this pull request may close these issues.

3 participants