-
-
Notifications
You must be signed in to change notification settings - Fork 160
Add language support for HEEx #3696
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
base: main
Are you sure you want to change the base?
Conversation
Currently there's a small issue with interpolated braces inside of HTML/component tags. The following:
Looking at the PSI, the Don't think I'm going to be able to look at this until next week. |
Thanks for your work on this -- I'll take a look tonight. I've managed to upgrade the deprecated code from Kotlin 1.7 -> 2.2 as required by IntelliJ 2025.1, so we should be good to go with that. I've also started looking at upgrading the base Elixir version/dependencies, as [email protected] is deprecated, and a PITA to install. It might be possible to even use something like Burrito, I had a quick play and it looks possible, could even provide our own ERTS. I'm super keen to get this and the injection stuff in, as it'll make building Live View apps a joy. |
…HTML Lexer being in the wrong state during injections
… Lexer in out TemplateData class
…e not being parsed in HEEx
Right, I've managed to find some time and got this in a much better place. In the last few commits:
The only very minor issue I can currently see is that relative component tags ( I'd be keen to get some eyes on these changes to make sure it's working for a variety of HEEx templates . Either way, it's a massive improvement on what was there before. |
Adding a custom highlighter was actually easy enough so that issue is resolved. |
Hey @joshuataylor, I've just started using Elixir and noticed that HEEx wasn't yet properly supported. Having recently created a plugin for a surprisingly similar language, I thought I'd have a crack.
This will add support for
.heex
files. This is mostly similar to EEx, and in fact originally copied from EEx, but with a few customisations:.
. This was surprisingly hard to get around, but I ended up creating a wrapper for the lexer that changes<.
and</.
to<C
and</C
. This only affects the lexing, so autocomplete, etc. still work.Anything you'd like me to do in terms of testing/improving the codebase. I'm used to Kotlin, but stuck with Java here since the EEx section was Java. I also tried making this an experimental feature, but couldn't figure out how in the end.