aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/v/textobjects.scm
diff options
context:
space:
mode:
authorErasin Wang2023-03-15 21:22:24 +0000
committerGitHub2023-03-15 21:22:24 +0000
commitfb56a4bb75121f4797d80e14bceee9feb870cfb2 (patch)
tree07d59a181f3e9cec1a64dbc6a65273fb18d9bb50 /runtime/queries/v/textobjects.scm
parent64c137bd3d7ac7f82f538f5dd520e3aa8bca0d1a (diff)
Improve tree-sitter queries for vlang (#6279)
- Update hightlight - add indents - add textobject - add injections
Diffstat (limited to 'runtime/queries/v/textobjects.scm')
-rw-r--r--runtime/queries/v/textobjects.scm27
1 files changed, 27 insertions, 0 deletions
diff --git a/runtime/queries/v/textobjects.scm b/runtime/queries/v/textobjects.scm
new file mode 100644
index 00000000..40eb101f
--- /dev/null
+++ b/runtime/queries/v/textobjects.scm
@@ -0,0 +1,27 @@
+(function_declaration
+ body: (block)? @function.inside) @function.around
+
+((function_declaration
+ name: (identifier) @_name
+ body: (block)? @test.inside) @test.around
+ (#match? @_name "^test"))
+
+(fn_literal
+ body: (block)? @function.inside) @function.around
+
+(parameter_list
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
+(call_expression
+ (argument_list
+ ((_) @parameter.inside) @parameter.around))
+
+(struct_declaration
+ (struct_field_declaration_list) @class.inside) @class.around
+
+(struct_field_declaration_list
+ ((_) @parameter.inside) @parameter.around)
+
+(comment) @comment.inside
+(comment)+ @comment.around
+