From 67654112970dae18c8458abe9b9732488fe2d71b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nedd=20Chairi=20Mu=C3=B1oz?= <91211902+NeddM@users.noreply.github.com> Date: Sun, 5 Jul 2026 04:57:36 +0200 Subject: [PATCH] Include Rust attributes in function textobjects (#15778) --- runtime/queries/rust/textobjects.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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 -- 2.51.2