aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/elixir
diff options
context:
space:
mode:
authorMichael Davis2022-04-13 01:57:07 +0000
committerBlaž Hrastnik2022-04-13 05:28:51 +0000
commit4836bb38d3c13c9f1ebd3533bc35a54f80c7e118 (patch)
treef39037bc640054e67da289caa9bf433122d2f429 /runtime/queries/elixir
parent9d095e0fdc78ad42c033193dd980b6218c9484d6 (diff)
add tree-sitter-heex
HEEx is a templating engine on top of Elixir's EEx templating language specific to HTML that is included in Phoenix.LiveView (though I think the plan is to eventually include it in base Phoenix). It's a superset of EEx with some additional features like components and slots. The injections don't work perfectly because the Elixir grammar is newline sensitive (the _terminator rule). See https://github.com/elixir-lang/tree-sitter-elixir/issues/24 for more information.
Diffstat (limited to 'runtime/queries/elixir')
-rw-r--r--runtime/queries/elixir/injections.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/queries/elixir/injections.scm b/runtime/queries/elixir/injections.scm
index 8370a0d8..c8882534 100644
--- a/runtime/queries/elixir/injections.scm
+++ b/runtime/queries/elixir/injections.scm
@@ -7,3 +7,10 @@
(#match? @_sigil_name "^(r|R)$")
(#set! injection.language "regex")
(#set! injection.combined))
+
+((sigil
+ (sigil_name) @_sigil_name
+ (quoted_content) @injection.content)
+ (#match? @_sigil_name "^(h|H)$")
+ (#set! injection.language "heex")
+ (#set! injection.combined))