mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
Fix HEEx directive injections
This commit is contained in:
parent
93ee00cd9d
commit
11d79aa0f7
1 changed files with 20 additions and 9 deletions
|
|
@ -1,14 +1,25 @@
|
||||||
; HEEx directives can span multiple interpolated lines of Elixir
|
; directives are standalone tags like '<%= @x %>'
|
||||||
(directive [
|
;
|
||||||
(expression_value)
|
; partial_expression_values are elixir code that is part of an expression that
|
||||||
(partial_expression_value)
|
; spans multiple directive nodes, so they must be combined. For example:
|
||||||
] @injection.content
|
; <%= if true do %>
|
||||||
|
; <p>hello, tree-sitter!</p>
|
||||||
|
; <% end %>
|
||||||
|
(directive
|
||||||
|
(partial_expression_value) @injection.content
|
||||||
(#set! injection.language "elixir")
|
(#set! injection.language "elixir")
|
||||||
(#set! injection.combined))
|
(#set! injection.include-children)
|
||||||
|
(#set! injection.combined))
|
||||||
|
|
||||||
; HEEx Elixir expressions are always within a tag or component
|
; Regular expression_values do not need to be combined
|
||||||
(expression
|
((directive
|
||||||
(expression_value) @injection.content
|
(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"))
|
(#set! injection.language "elixir"))
|
||||||
|
|
||||||
; HEEx comments
|
; HEEx comments
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue