diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm index e9ecb8ba..d309e969 100644 --- a/runtime/queries/rust/textobjects.scm +++ b/runtime/queries/rust/textobjects.scm @@ -1,5 +1,9 @@ -(function_item - body: (_) @function.inside) @function.around +( + (attribute_item)* @function.around + . + (function_item + body: (_) @function.inside) @function.around +) (closure_expression body: (_) @function.inside) @function.around @@ -49,12 +53,13 @@ (; #[test] (attribute_item (attribute - (identifier) @_test_attribute)) + (identifier) @_test_attribute)) @test.around ; allow other attributes like #[should_panic] and comments [ - (attribute_item) - (line_comment) + (attribute_item) @test.around + (line_comment) @test.around ]* + . ; the test function (function_item body: (_) @test.inside) @test.around