aboutsummaryrefslogtreecommitdiffstats
path: root/queries
diff options
context:
space:
mode:
authorginnyTheCat <ginnythecat@lelux.net>2025-03-08 18:49:06 +0100
committerGitHub <noreply@github.com>2025-03-08 17:49:06 +0000
commitf0c17dc8597eceb859aa77ab4247a11242b3a6a2 (patch)
tree3522a812824b6fef094eac78602692444c398160 /queries
parentbot(lockfile): update ocaml, ocaml_interface (diff)
downloadnvim-treesitter-f0c17dc8597eceb859aa77ab4247a11242b3a6a2.tar
nvim-treesitter-f0c17dc8597eceb859aa77ab4247a11242b3a6a2.tar.gz
nvim-treesitter-f0c17dc8597eceb859aa77ab4247a11242b3a6a2.tar.bz2
nvim-treesitter-f0c17dc8597eceb859aa77ab4247a11242b3a6a2.tar.lz
nvim-treesitter-f0c17dc8597eceb859aa77ab4247a11242b3a6a2.tar.xz
nvim-treesitter-f0c17dc8597eceb859aa77ab4247a11242b3a6a2.tar.zst
nvim-treesitter-f0c17dc8597eceb859aa77ab4247a11242b3a6a2.zip
fix(rust): inject html and json in macro invocations (#7715)
Diffstat (limited to 'queries')
-rw-r--r--queries/rust/injections.scm14
1 files changed, 4 insertions, 10 deletions
diff --git a/queries/rust/injections.scm b/queries/rust/injections.scm
index d8aa98245..d6d8d46ab 100644
--- a/queries/rust/injections.scm
+++ b/queries/rust/injections.scm
@@ -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