From 476e6baf8f664bb08114aa5bf6bc839925d8d329 Mon Sep 17 00:00:00 2001 From: Joey Hain Date: Sun, 17 Mar 2024 16:11:28 -0700 Subject: [PATCH] Add textobject queries for vala (#8541) --- book/src/generated/lang-support.md | 2 +- runtime/queries/vala/textobjects.scm | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/vala/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 97ea8e863..4a0b4b0a9 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -190,7 +190,7 @@ | unison | ✓ | | ✓ | | | uxntal | ✓ | | | | | v | ✓ | ✓ | ✓ | `v-analyzer` | -| vala | ✓ | | | `vala-language-server` | +| vala | ✓ | ✓ | | `vala-language-server` | | verilog | ✓ | ✓ | | `svlangserver` | | vhdl | ✓ | | | `vhdl_ls` | | vhs | ✓ | | | | diff --git a/runtime/queries/vala/textobjects.scm b/runtime/queries/vala/textobjects.scm new file mode 100644 index 000000000..b84d9a200 --- /dev/null +++ b/runtime/queries/vala/textobjects.scm @@ -0,0 +1,27 @@ +(method_declaration + (block) @function.inside) @function.around + +(creation_method_declaration + (block) @function.inside) @function.around + +(method_declaration + ((parameter) @parameter.inside . ","? @parameter.around) @parameter.around) + +[ + (class_declaration) + (struct_declaration) + (interface_declaration) +] @class.around + +(type_arguments + ((_) @parameter.inside . ","? @parameter.around) @parameter.around) + +(creation_method_declaration + ((parameter) @parameter.inside . ","? @parameter.around) @parameter.around) + +(method_call_expression + ((argument) @parameter.inside . ","? @parameter.around) @parameter.around) + +(comment) @comment.inside + +(comment)+ @comment.around