Skip to content

Commit

Permalink
Improve textobjects for parameter/argument for Dart (helix-editor#9644)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Blondiau <sebastien.blondiau@iot-d.com>
  • Loading branch information
2 people authored and Vulpesx committed Jun 7, 2024
1 parent 636e0f1 commit 207df4d
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions runtime/queries/dart/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,34 @@

(documentation_comment)+ @comment.around

(formal_parameter) @parameter.inside
(formal_parameter_list
(
(formal_parameter) @parameter.inside . ","? @parameter.around
) @parameter.around
)

(optional_formal_parameters
(
(formal_parameter) @parameter.inside . ","? @parameter.around
) @parameter.around
)

(arguments
(
[
(argument) @parameter.inside
(named_argument (label) . (_)* @parameter.inside)
]
. ","? @parameter.around
) @parameter.around
)

(formal_parameter_list) @parameter.around
(type_arguments
(
((_) . ("." . (_) @parameter.inside @parameter.around)?) @parameter.inside
. ","? @parameter.around
) @parameter.around
)

(expression_statement
((identifier) @_name (#any-of? @_name "test" "testWidgets"))
Expand Down

0 comments on commit 207df4d

Please sign in to comment.