on master help sign in
Add textobjects.scm for zig (#4409)
664064bSora
book/src/generated/lang-support.md+1−1
@@ -126,4 +126,4 @@
126| wgsl | ✓ | | | `wgsl_analyzer` |
126| wgsl | ✓ | | | `wgsl_analyzer` |
127| xit | ✓ | | | |
127| xit | ✓ | | | |
128| yaml | ✓ | | ✓ | `yaml-language-server` |
128| 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