mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -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
|
||||
]
|
||||
(token_tree) @injection.content
|
||||
(#not-eq? @_macro_name "slint")
|
||||
(#not-any-of? @_macro_name "slint" "html" "json")
|
||||
(#set! injection.language "rust")
|
||||
(#set! injection.include-children))
|
||||
|
||||
(macro_invocation
|
||||
macro: [
|
||||
(scoped_identifier
|
||||
name: (_) @_macro_name)
|
||||
(identifier) @_macro_name
|
||||
name: (_) @injection.language)
|
||||
(identifier) @injection.language
|
||||
]
|
||||
(token_tree) @injection.content
|
||||
(#eq? @_macro_name "slint")
|
||||
(#any-of? @injection.language "slint" "html" "json")
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "slint")
|
||||
(#set! injection.include-children))
|
||||
|
||||
(macro_definition
|
||||
|
|
@ -37,11 +36,6 @@
|
|||
] @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((macro_invocation
|
||||
macro: (identifier) @injection.language
|
||||
(token_tree) @injection.content)
|
||||
(#any-of? @injection.language "html" "json"))
|
||||
|
||||
(call_expression
|
||||
function: (scoped_identifier
|
||||
path: (identifier) @_regex
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue