Add textobjects.scm for zig (#4409)
This commit is contained in:
parent
79ef39ab3a
commit
664064b3cc
2 changed files with 24 additions and 1 deletions
|
@ -126,4 +126,4 @@
|
||||||
| wgsl | ✓ | | | `wgsl_analyzer` |
|
| wgsl | ✓ | | | `wgsl_analyzer` |
|
||||||
| xit | ✓ | | | |
|
| xit | ✓ | | | |
|
||||||
| yaml | ✓ | | ✓ | `yaml-language-server` |
|
| yaml | ✓ | | ✓ | `yaml-language-server` |
|
||||||
| zig | ✓ | | ✓ | `zls` |
|
| zig | ✓ | ✓ | ✓ | `zls` |
|
||||||
|
|
23
runtime/queries/zig/textobjects.scm
Normal file
23
runtime/queries/zig/textobjects.scm
Normal file
|
@ -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
|
Loading…
Reference in a new issue