From 664064b3cca49479c3e893f4865e64cb587d2f61 Mon Sep 17 00:00:00 2001 From: Sora Date: Sat, 22 Oct 2022 00:32:29 +0200 Subject: Add textobjects.scm for zig (#4409) --- runtime/queries/zig/textobjects.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 runtime/queries/zig/textobjects.scm (limited to 'runtime/queries/zig/textobjects.scm') 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 -- cgit v1.2.3-70-g09d2