aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/dart/textobjects.scm
diff options
context:
space:
mode:
authormelted-brownie2024-02-17 16:09:21 +0000
committerGitHub2024-02-17 16:09:21 +0000
commit78c34194b5c83beb26ca04f12bf9d53fd5aba801 (patch)
tree3568eb7061909fd2043109cc82011405007d0e13 /runtime/queries/dart/textobjects.scm
parent3e963b3c1b5eb4b5cd7f33b8ef6d6642de210a9b (diff)
Improve textobjects for parameter/argument for Dart (#9644)
Co-authored-by: Sébastien Blondiau <sebastien.blondiau@iot-d.com>
Diffstat (limited to 'runtime/queries/dart/textobjects.scm')
-rw-r--r--runtime/queries/dart/textobjects.scm29
1 files changed, 27 insertions, 2 deletions
diff --git a/runtime/queries/dart/textobjects.scm b/runtime/queries/dart/textobjects.scm
index 02827615..b88b97bc 100644
--- a/runtime/queries/dart/textobjects.scm
+++ b/runtime/queries/dart/textobjects.scm
@@ -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"))