aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/rust
diff options
context:
space:
mode:
authorMichael Davis2022-06-20 02:36:33 +0000
committerMichael Davis2022-06-21 16:32:03 +0000
commit9f676dab57e6421dd4c33a7ccf16e12cfb9b62cf (patch)
tree10555a5cbc5dc3b6af56fcc00c05307bb3e1b780 /runtime/queries/rust
parent67f6c85792dbdbe0ff3f9328874c7ab23ff5569b (diff)
add test textobjects queries for erlang,gleam,go,python,rust
Diffstat (limited to 'runtime/queries/rust')
-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"))