From 6bc3637af87e5b28e8ff6af296a6b5ef5720a49d Mon Sep 17 00:00:00 2001 From: David <12832280+David-Else@users.noreply.github.com> Date: Sun, 28 Aug 2022 22:03:39 +0100 Subject: [PATCH] Fix rust text objects (#3590) --- runtime/queries/rust/textobjects.scm | 62 ++++++---------------------- 1 file changed, 12 insertions(+), 50 deletions(-) diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm index 94c8c9f8bd2d..7005d9c73a05 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)