Skip to content

Commit

Permalink
Fix rust text objects (helix-editor#3590)
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Else authored and jdrst committed Sep 13, 2022
1 parent ea7700b commit 657b646
Showing 1 changed file with 12 additions and 50 deletions.
62 changes: 12 additions & 50 deletions runtime/queries/rust/textobjects.scm
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 657b646

Please sign in to comment.