aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/rust/textobjects.scm
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-06-21 16:38:21 +0000
committerGitHub2022-06-21 16:38:21 +0000
commit458b89e21dcf76bbf9ca6ba237bd334f4922722d (patch)
treef859642d007db7274d3cd657ecaa59b1ec014cd8 /runtime/queries/rust/textobjects.scm
parent5f7c247430998fabceb55d4689118dd75e2bdfb1 (diff)
parent6a3f7f2c399f0b92cef97b0c85ebe976fd7cfcac (diff)
Merge branch 'master' into test-harness
Diffstat (limited to 'runtime/queries/rust/textobjects.scm')
-rw-r--r--runtime/queries/rust/textobjects.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm
index ba86050b..94c8c9f8 100644
--- a/runtime/queries/rust/textobjects.scm
+++ b/runtime/queries/rust/textobjects.scm
@@ -77,3 +77,17 @@
(line_comment)+ @comment.around
(block_comment) @comment.around
+
+(; #[test]
+ (attribute_item
+ (meta_item
+ (identifier) @_test_attribute))
+ ; allow other attributes like #[should_panic] and comments
+ [
+ (attribute_item)
+ (line_comment)
+ ]*
+ ; the test function
+ (function_item
+ body: (_) @test.inside) @test.around
+ (#eq? @_test_attribute "test"))