Unnamed repository; edit this file 'description' to name the repository.
queries: Reorder Slint and HTML injections in Rust
This fixes injections of Slint and HTML in Rust macros. These patterns must be moved after the generic `(macro_invocation (token_tree))` pattern since they are more specific, and later patterns now take priority. See <https://redirect.github.com/helix-editor/helix/pull/12972#issuecomment-2888300442>.
Michael Davis 9 months ago
parent e606652 · commit 05ae617
-rw-r--r--runtime/queries/rust/injections.scm20
1 files changed, 10 insertions, 10 deletions
diff --git a/runtime/queries/rust/injections.scm b/runtime/queries/rust/injections.scm
index 42ca12b5..1f83c6e7 100644
--- a/runtime/queries/rust/injections.scm
+++ b/runtime/queries/rust/injections.scm
@@ -6,6 +6,16 @@
(#set! injection.combined))
((macro_invocation
+ (token_tree) @injection.content)
+ (#set! injection.language "rust")
+ (#set! injection.include-children))
+
+((macro_rule
+ (token_tree) @injection.content)
+ (#set! injection.language "rust")
+ (#set! injection.include-children))
+
+((macro_invocation
macro:
[
(scoped_identifier
@@ -30,16 +40,6 @@
(#set! injection.include-children))
((macro_invocation
- (token_tree) @injection.content)
- (#set! injection.language "rust")
- (#set! injection.include-children))
-
-((macro_rule
- (token_tree) @injection.content)
- (#set! injection.language "rust")
- (#set! injection.include-children))
-
-((macro_invocation
macro:
[
(scoped_identifier name: (_) @_macro_name)