elixir-lang / tree-sitter-elixir

Elixir grammar for tree-sitter
https://elixir-lang.org/tree-sitter-elixir
Apache License 2.0
248 stars 25 forks source link

Inject Markdown in heredocs? #61

Closed georgeguimaraes closed 1 year ago

georgeguimaraes commented 1 year ago

Would it be possible to inject markdown for heredocs?

This would make highlighting, snippets, and supposedly linters for Markdown on Neovim work inside .ex files.

Does it even make sense?

josevalim commented 1 year ago

Yes, but I believe those injections typically are done inside the editors themselves. :) So you would need to check with the Neovim folks. :)

the-mikedavis commented 1 year ago

We do this in Helix for example: https://github.com/helix-editor/helix/blob/68c7537de522cf6b38705a7af51eeaac260fdc98/runtime/queries/elixir/injections.scm#L13-L21

Screenshot 2023-10-24 at 09 20 01

It looks like nvim-treesitter already has this injection too so I assume it should work but I haven't tried it: https://github.com/nvim-treesitter/nvim-treesitter/blob/4199be485cd85662d8ff1dc8c4cc78d819fad6cd/queries/elixir/injections.scm#L5-L14

georgeguimaraes commented 1 year ago

Nice, I thought it was supposed to go here https://github.com/elixir-lang/tree-sitter-elixir/blob/main/queries/injections.scm