From f0c17dc8597eceb859aa77ab4247a11242b3a6a2 Mon Sep 17 00:00:00 2001 From: ginnyTheCat Date: Sat, 8 Mar 2025 18:49:06 +0100 Subject: [PATCH] fix(rust): inject html and json in macro invocations (#7715) --- queries/rust/injections.scm | 14 ++++---------- 1 file 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