Skip to content

Commit

Permalink
Improve textobjects for parameter/argument for Dart (#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
melted-brownie and Sébastien Blondiau authored Feb 17, 2024
1 parent 3e963b3 commit 78c3419
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 78c3419

Please sign in to comment.