From e3cef1178a96a2d8926598264fd1c0abe4f84275 Mon Sep 17 00:00:00 2001 From: David-Else <12832280+David-Else@users.noreply.github.com> Date: Sun, 28 Aug 2022 20:07:18 +0100 Subject: [PATCH 1/2] Fix rust text objects --- runtime/queries/rust/textobjects.scm | 64 ++++++---------------------- 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm index 94c8c9f8bd2d..2af8f2061729 100644 --- a/runtime/queries/rust/textobjects.scm +++ b/runtime/queries/rust/textobjects.scm @@ -1,58 +1,20 @@ -( - [ - (attribute_item)+ - (line_comment)+ - ]* - . - (function_item - body: (_) @function.inside)) @function.around +(function_item + body: (_) @function.inside) @function.around(closure_expression body: (_) @function.inside) @function.around -(closure_expression body: (_) @function.inside) @function.around +(struct_item + body: (_) @class.inside) @class.around -( - [ - (attribute_item)+ - (line_comment)+ - ]* - . - (struct_item - body: (_) @class.inside)) @class.around +(enum_item + body: (_) @class.inside) @class.around -( - [ - (attribute_item)+ - (line_comment)+ - ]* - . - (enum_item - body: (_) @class.inside)) @class.around +(union_item + body: (_) @class.inside) @class.around -( - [ - (attribute_item)+ - (line_comment)+ - ]* - . - (union_item - body: (_) @class.inside)) @class.around +(trait_item + body: (_) @class.inside) @class.around -( - [ - (attribute_item)+ - (line_comment)+ - ]* - . - (trait_item - body: (_) @class.inside)) @class.around - -( - [ - (attribute_item)+ - (line_comment)+ - ]* - . - (impl_item - body: (_) @class.inside)) @class.around +(impl_item + body: (_) @class.inside) @class.around (parameters ((_) @parameter.inside . ","? @parameter.around) @parameter.around) @@ -90,4 +52,4 @@ ; the test function (function_item body: (_) @test.inside) @test.around - (#eq? @_test_attribute "test")) + (#eq? @_test_attribute "test")) \ No newline at end of file From bbead16bbf8cd7e4240b5671ca39741d4ff357c9 Mon Sep 17 00:00:00 2001 From: David-Else <12832280+David-Else@users.noreply.github.com> Date: Sun, 28 Aug 2022 20:30:47 +0100 Subject: [PATCH 2/2] Add newline at end of file --- runtime/queries/rust/textobjects.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm index 2af8f2061729..7005d9c73a05 100644 --- a/runtime/queries/rust/textobjects.scm +++ b/runtime/queries/rust/textobjects.scm @@ -52,4 +52,4 @@ ; the test function (function_item body: (_) @test.inside) @test.around - (#eq? @_test_attribute "test")) \ No newline at end of file + (#eq? @_test_attribute "test"))