-
Notifications
You must be signed in to change notification settings - Fork 3
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
Font lock for embedded Elixir #2
Comments
I agree :) but not sure how to approach this yet. We don't get much information from the tree-sitter-heex grammar as a directive ( embedded expressions ) might look like this:
where the directive neither encloses or reveals the content. Another option would be to overlay elixir syntax on top of the heex syntax, but currently elixir-ts-mode requires heex-ts-mode, so then we fall into the circular dependency. Unfortunately with the MELPA commit requirements we have to have 2 separate packages for these two modes, but we can combine elixir and heex-mode on emacs master ( only for emacs 30 ) and we can then overlay, but it will be at least a year from now, so will be nice to have an interim solution. The option I am hoping for is to enhance the tree-sitter-heex grammar with enough information to apply some faces. |
I think that is a good idea. To move all the common code (like queries and indentation rules) from |
Could we do something like injecting the elixir grammar into the enclosed regions? From what I know injecting grammars into ranges is pretty common in the tree-sitter world, and last I checked it is supported in Emacs' tree-sitter (treesit) implementation as well. |
We can probably do something like this here. Neovim is able to take advantage of these |
I pull request would be welcome, I won't be able to work on this in the near future. |
I'll try my hand at it then! |
Hi!
Currently, code in
<%= "embedded expressions" >
gets the default face. It would be nice to have Elixir syntax highlight in those blocks.The text was updated successfully, but these errors were encountered: