mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
fix(rust): inject html and json in macro invocations (#7715)
This commit is contained in:
parent
ee8e149a4f
commit
f0c17dc859
1 changed files with 4 additions and 10 deletions
|
|
@ -5,20 +5,19 @@
|
||||||
(identifier) @_macro_name
|
(identifier) @_macro_name
|
||||||
]
|
]
|
||||||
(token_tree) @injection.content
|
(token_tree) @injection.content
|
||||||
(#not-eq? @_macro_name "slint")
|
(#not-any-of? @_macro_name "slint" "html" "json")
|
||||||
(#set! injection.language "rust")
|
(#set! injection.language "rust")
|
||||||
(#set! injection.include-children))
|
(#set! injection.include-children))
|
||||||
|
|
||||||
(macro_invocation
|
(macro_invocation
|
||||||
macro: [
|
macro: [
|
||||||
(scoped_identifier
|
(scoped_identifier
|
||||||
name: (_) @_macro_name)
|
name: (_) @injection.language)
|
||||||
(identifier) @_macro_name
|
(identifier) @injection.language
|
||||||
]
|
]
|
||||||
(token_tree) @injection.content
|
(token_tree) @injection.content
|
||||||
(#eq? @_macro_name "slint")
|
(#any-of? @injection.language "slint" "html" "json")
|
||||||
(#offset! @injection.content 0 1 0 -1)
|
(#offset! @injection.content 0 1 0 -1)
|
||||||
(#set! injection.language "slint")
|
|
||||||
(#set! injection.include-children))
|
(#set! injection.include-children))
|
||||||
|
|
||||||
(macro_definition
|
(macro_definition
|
||||||
|
|
@ -37,11 +36,6 @@
|
||||||
] @injection.content
|
] @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#set! injection.language "comment"))
|
||||||
|
|
||||||
((macro_invocation
|
|
||||||
macro: (identifier) @injection.language
|
|
||||||
(token_tree) @injection.content)
|
|
||||||
(#any-of? @injection.language "html" "json"))
|
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (scoped_identifier
|
function: (scoped_identifier
|
||||||
path: (identifier) @_regex
|
path: (identifier) @_regex
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue