aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/zig/textobjects.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/runtime/queries/zig/textobjects.scm b/runtime/queries/zig/textobjects.scm
new file mode 100644
index 00000000..67528943
--- /dev/null
+++ b/runtime/queries/zig/textobjects.scm
@@ -0,0 +1,23 @@
+(TopLevelDecl (FnProto)
+ (_) @function.inside) @function.around
+
+(TestDecl (_) @test.inside) @test.around
+
+; matches all of: struct, enum, union
+; this unfortunately cannot be split up because
+; of the way struct "container" types are defined
+(TopLevelDecl (VarDecl (ErrorUnionExpr (SuffixExpr (ContainerDecl
+ (_) @class.inside))))) @class.around
+
+(TopLevelDecl (VarDecl (ErrorUnionExpr (SuffixExpr (ErrorSetDecl
+ (_) @class.inside))))) @class.around
+
+(ParamDeclList
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
+[
+ (doc_comment)
+ (line_comment)
+] @comment.inside
+(line_comment)+ @comment.around
+(doc_comment)+ @comment.around