aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries
diff options
context:
space:
mode:
authorAndrey Tkachenko2022-05-23 12:24:30 +0000
committerBlaž Hrastnik2022-05-25 12:26:06 +0000
commit10463fe32c789f49c65d53c9d22621e415a854ea (patch)
tree610d40f68cc6d314c2a3dba658faf440389728ef /runtime/queries
parentda2952725880d132fdfc2117dedebfe56ffdb646 (diff)
Add `parameter.around` text object query
Diffstat (limited to 'runtime/queries')
-rw-r--r--runtime/queries/c/textobjects.scm6
-rw-r--r--runtime/queries/go/textobjects.scm7
-rw-r--r--runtime/queries/php/textobjects.scm12
-rw-r--r--runtime/queries/python/textobjects.scm6
-rw-r--r--runtime/queries/rust/textobjects.scm15
5 files changed, 31 insertions, 15 deletions
diff --git a/runtime/queries/c/textobjects.scm b/runtime/queries/c/textobjects.scm
index 45f554e2..2a3da66f 100644
--- a/runtime/queries/c/textobjects.scm
+++ b/runtime/queries/c/textobjects.scm
@@ -10,7 +10,11 @@
(union_specifier
body: (_) @class.inside) @class.around
-(parameter_declaration) @parameter.inside
+(parameter_list
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
+(argument_list
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(comment) @comment.inside
diff --git a/runtime/queries/go/textobjects.scm b/runtime/queries/go/textobjects.scm
index 3cdf6203..a48ccce1 100644
--- a/runtime/queries/go/textobjects.scm
+++ b/runtime/queries/go/textobjects.scm
@@ -14,11 +14,14 @@
(type_declaration
(type_spec (type_identifier) (interface_type (method_spec)+ @class.inside))) @class.around
+(type_parameter_list
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
(parameter_list
- (_) @parameter.inside)
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(argument_list
- (_) @parameter.inside)
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(comment) @comment.inside
diff --git a/runtime/queries/php/textobjects.scm b/runtime/queries/php/textobjects.scm
index 51abe5c7..e35eebd7 100644
--- a/runtime/queries/php/textobjects.scm
+++ b/runtime/queries/php/textobjects.scm
@@ -21,13 +21,19 @@
(anonymous_function_creation_expression
body: (_) @function.inside) @function.around
-
+
+(anonymous_function_use_clause
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
(formal_parameters
- [
+ ([
(simple_parameter)
(variadic_parameter)
(property_promotion_parameter)
- ] @parameter.inside)
+ ] @parameter.inside . ","? @parameter.around) @parameter.around)
+
+(arguments
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(comment) @comment.inside
diff --git a/runtime/queries/python/textobjects.scm b/runtime/queries/python/textobjects.scm
index 0ca26089..5c6a61d1 100644
--- a/runtime/queries/python/textobjects.scm
+++ b/runtime/queries/python/textobjects.scm
@@ -5,13 +5,13 @@
body: (block)? @class.inside) @class.around
(parameters
- (_) @parameter.inside)
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(lambda_parameters
- (_) @parameter.inside)
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(argument_list
- (_) @parameter.inside)
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(comment) @comment.inside
diff --git a/runtime/queries/rust/textobjects.scm b/runtime/queries/rust/textobjects.scm
index 99b5eb4d..b2769c13 100644
--- a/runtime/queries/rust/textobjects.scm
+++ b/runtime/queries/rust/textobjects.scm
@@ -52,17 +52,20 @@
(impl_item
body: (_) @class.inside)) @class.around
-(parameters
- (_) @parameter.inside)
-
+(parameters
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
(type_parameters
- (_) @parameter.inside)
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
+(type_arguments
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(closure_parameters
- (_) @parameter.inside)
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
(arguments
- (_) @parameter.inside)
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
[
(line_comment)