diff options
author | Andrey Tkachenko | 2022-05-20 01:19:46 +0000 |
---|---|---|
committer | GitHub | 2022-05-20 01:19:46 +0000 |
commit | 62fd1f699988bdf7bba4a9ada511b5303b01d328 (patch) | |
tree | 882cf4f4825c1fcb59830432330f6b6dd24a55e9 /runtime/queries/rust | |
parent | 301ed9b48f3a331233a4d707a728e1a572702233 (diff) |
Include macro attributes to impls, structs, enums, functions etc. textobjects (#2494)
Diffstat (limited to 'runtime/queries/rust')
-rw-r--r-- | runtime/queries/rust/textobjects.scm | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm index 086db67a..99b5eb4d 100644 --- a/runtime/queries/rust/textobjects.scm +++ b/runtime/queries/rust/textobjects.scm @@ -1,23 +1,62 @@ -(function_item - body: (_) @function.inside) @function.around +( + [ + (attribute_item)+ + (line_comment)+ + ]* + . + (function_item + 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 -(impl_item - body: (_) @class.inside) @class.around +( + [ + (attribute_item)+ + (line_comment)+ + ]* + . + (impl_item + body: (_) @class.inside)) @class.around (parameters (_) @parameter.inside) + +(type_parameters + (_) @parameter.inside) (closure_parameters (_) @parameter.inside) |