aboutsummaryrefslogtreecommitdiffstats
path: root/queries/rust
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@gmail.com>2024-02-09 14:46:57 +0100
committerGitHub <noreply@github.com>2024-02-09 13:46:57 +0000
commit0f3183dda8df688a77223b9762475dee5b27271f (patch)
treefede30d0f59f5fa4c7ef65e16d8c495d47e0ad28 /queries/rust
parentUpdate parsers: ruby (diff)
downloadnvim-treesitter-0f3183dda8df688a77223b9762475dee5b27271f.tar
nvim-treesitter-0f3183dda8df688a77223b9762475dee5b27271f.tar.gz
nvim-treesitter-0f3183dda8df688a77223b9762475dee5b27271f.tar.bz2
nvim-treesitter-0f3183dda8df688a77223b9762475dee5b27271f.tar.lz
nvim-treesitter-0f3183dda8df688a77223b9762475dee5b27271f.tar.xz
nvim-treesitter-0f3183dda8df688a77223b9762475dee5b27271f.tar.zst
nvim-treesitter-0f3183dda8df688a77223b9762475dee5b27271f.zip
feat(slint)!: change to the official parser (#6027)
This change replaces the slint parser written and maintained by @jrmoulton with the official one hosted in the slint-ui organization on github. A huge thank you to @jrmoulton for all his work on the tree-sitter parser! --------- Co-authored-by: jrmoulton <jaredmoulton3@gmail.com>
Diffstat (limited to 'queries/rust')
-rw-r--r--queries/rust/injections.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/queries/rust/injections.scm b/queries/rust/injections.scm
index 1537568c1..d561d4ec9 100644
--- a/queries/rust/injections.scm
+++ b/queries/rust/injections.scm
@@ -1,8 +1,28 @@
(macro_invocation
+ macro:
+ [
+ (scoped_identifier
+ name: (_) @_macro_name)
+ (identifier) @_macro_name
+ ]
(token_tree) @injection.content
+ (#not-eq? @_macro_name "slint")
(#set! injection.language "rust")
(#set! injection.include-children))
+(macro_invocation
+ macro:
+ [
+ (scoped_identifier
+ name: (_) @_macro_name)
+ (identifier) @_macro_name
+ ]
+ (token_tree) @injection.content
+ (#eq? @_macro_name "slint")
+ (#offset! @injection.content 0 1 0 -1)
+ (#set! injection.language "slint")
+ (#set! injection.include-children))
+
(macro_definition
(macro_rule
left: (token_tree_pattern) @injection.content