fxbois / web-mode

web template editing mode for emacs
https://web-mode.org
GNU General Public License v3.0
1.63k stars 262 forks source link

Improvements for Elixir .heex #1215

Closed aparkerdavid closed 1 year ago

aparkerdavid commented 2 years ago

In a heex template, web-mode should be able to recognize tags with leading periods, e.g. <.some_component> , </.some_component>, <.some_component />.

Inside of tags, curly braces should be handled as EEX code delimiters. e.g. <div class={some_function(@something)}>

Cgboal commented 2 years ago

I would also like this feature, it makes working with heex filex very difficult without it, especially in cases where components are heavily used such as here:

image

Syntax highlighting doesn't work, nor does formatting.

I don't know elisp (I know other lisps though), but I would be happy to take a look at implementing what's required to make this work if you can point me in the right direction.

vfsoraki commented 2 years ago

I also want this.

For the time being, is there anyway to make it consider . and : legit characters for tag names?

knoebber commented 2 years ago

I'd also appreciate this feature :+1: Also, thank you web-mode maintainers for work thus far!

fxbois commented 2 years ago

@Cgboal could you provide your example on gist please

knoebber commented 2 years ago

@fxbois https://gist.github.com/knoebber/0834d29b8a5f0710de239041e6a7627b

jsmestad commented 1 year ago

While this is being worked on, here is an option to create a derived mode for .heex files that uses tree-sitter.