aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/rust/injections.scm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/rust/injections.scm')
-rw-r--r--runtime/queries/rust/injections.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/queries/rust/injections.scm b/runtime/queries/rust/injections.scm
index 6035d418..77c70805 100644
--- a/runtime/queries/rust/injections.scm
+++ b/runtime/queries/rust/injections.scm
@@ -1,3 +1,6 @@
+([(line_comment) (block_comment)] @injection.content
+ (#set! injection.language "comment"))
+
((macro_invocation
(token_tree) @injection.content)
(#set! injection.language "rust")
@@ -7,3 +10,17 @@
(token_tree) @injection.content)
(#set! injection.language "rust")
(#set! injection.include-children))
+
+(call_expression
+ function: (scoped_identifier
+ path: (identifier) @_regex (#eq? @_regex "Regex")
+ name: (identifier) @_new (#eq? @_new "new"))
+ arguments: (arguments (raw_string_literal) @injection.content)
+ (#set! injection.language "regex"))
+
+(call_expression
+ function: (scoped_identifier
+ path: (scoped_identifier (identifier) @_regex (#eq? @_regex "Regex") .)
+ name: (identifier) @_new (#eq? @_new "new"))
+ arguments: (arguments (raw_string_literal) @injection.content)
+ (#set! injection.language "regex"))