Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rust text objects #3590

Merged
merged 2 commits into from
Aug 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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