Skip to content

Commit

Permalink
Add textobjects.scm for zig (helix-editor#4409)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraTenshi authored and pathwave committed Nov 4, 2022
1 parent 14c0b51 commit 297bbc8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@
| wgsl || | | `wgsl_analyzer` |
| xit || | | |
| yaml || || `yaml-language-server` |
| zig || || `zls` |
| zig || || `zls` |
23 changes: 23 additions & 0 deletions runtime/queries/zig/textobjects.scm
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 297bbc8

Please sign in to comment.