on master help sign in
Add textobjects.scm for zig (#4409)
commit664064b3cca49479c3e893f4865e64cb587d2f61 authorSora <dream@neoncity.dev> dateSat 22 Oct 2022, 00:32 (4 years ago) parent79ef39a
2 files changed+24−1
book/src/generated/lang-support.md+1−1 runtime/queries/zig/textobjects.scm+23
book/src/generated/lang-support.md+1−1
@@ -126,4 +126,4 @@
126126| wgsl | ✓ | | | `wgsl_analyzer` |
127127| xit | ✓ | | | |
128128| yaml | ✓ | | ✓ | `yaml-language-server` |
129−| zig | ✓ | | ✓ | `zls` |
129+| zig | ✓ | ✓ | ✓ | `zls` |
runtime/queries/zig/textobjects.scmnew file+23
@@ -0,0 +1,23 @@
1+(TopLevelDecl (FnProto)
2+ (_) @function.inside) @function.around
3+
4+(TestDecl (_) @test.inside) @test.around
5+
6+; matches all of: struct, enum, union
7+; this unfortunately cannot be split up because
8+; of the way struct "container" types are defined
9+(TopLevelDecl (VarDecl (ErrorUnionExpr (SuffixExpr (ContainerDecl
10+ (_) @class.inside))))) @class.around
11+
12+(TopLevelDecl (VarDecl (ErrorUnionExpr (SuffixExpr (ErrorSetDecl
13+ (_) @class.inside))))) @class.around
14+
15+(ParamDeclList
16+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
17+
18+[
19+ (doc_comment)
20+ (line_comment)
21+] @comment.inside
22+(line_comment)+ @comment.around
23+(doc_comment)+ @comment.around