From 78c34194b5c83beb26ca04f12bf9d53fd5aba801 Mon Sep 17 00:00:00 2001 From: melted-brownie <66597133+melted-brownie@users.noreply.github.com> Date: Sat, 17 Feb 2024 16:09:21 +0000 Subject: [PATCH] Improve textobjects for parameter/argument for Dart (#9644) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Blondiau --- runtime/queries/dart/textobjects.scm | 29 ++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/runtime/queries/dart/textobjects.scm b/runtime/queries/dart/textobjects.scm index 028276156..b88b97bc9 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 +) -(formal_parameter_list) @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 +) + +(type_arguments + ( + ((_) . ("." . (_) @parameter.inside @parameter.around)?) @parameter.inside + . ","? @parameter.around + ) @parameter.around +) (expression_statement ((identifier) @_name (#any-of? @_name "test" "testWidgets"))