nvim-treesitter/runtime/queries/heex/injections.scm

31 lines
925 B
Scheme
Raw Permalink Normal View History

2023-08-14 20:59:27 +02:00
; directives are standalone tags like '<%= @x %>'
;
; partial_expression_values are elixir code that is part of an expression that
; spans multiple directive nodes, so they must be combined. For example:
; <%= if true do %>
; <p>hello, tree-sitter!</p>
; <% end %>
(directive
[
(partial_expression_value)
(ending_expression_value)
] @injection.content
(#set! injection.language "elixir")
2023-08-14 20:59:27 +02:00
(#set! injection.include-children)
(#set! injection.combined))
2021-08-16 15:53:10 -07:00
2023-08-14 20:59:27 +02:00
; Regular expression_values do not need to be combined
((directive
(expression_value) @injection.content)
(#set! injection.language "elixir"))
; expressions live within HTML tags, and do not need to be combined
; <link href={ Routes.static_path(..) } />
(expression
(expression_value) @injection.content
(#set! injection.language "elixir"))
2022-01-30 16:15:24 -08:00
; HEEx comments
((comment) @injection.content
2024-01-06 15:05:50 +09:00
(#set! injection.language "comment"))