branch: elpa/treesit-fold
commit c8638d41be3a04bc1eef71c2bb2cca2cc2a4a540
Author: JenChieh <[email protected]>
Commit: Jen-Chieh Shen <[email protected]>
feat(Zig): Add more Zig folding rules
---
ts-fold-parsers.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/ts-fold-parsers.el b/ts-fold-parsers.el
index 77c416c6e3..6116829a81 100644
--- a/ts-fold-parsers.el
+++ b/ts-fold-parsers.el
@@ -660,8 +660,15 @@
(defun ts-fold-parsers-zig ()
"Rule set for Zig."
- '((Block . ts-fold-range-seq)
- (line_comment . ts-fold-range-c-like-comment)))
+ '((ErrorSetDecl . (lambda (node offset)
+ (ts-fold-range-markers node offset "{")))
+ (ContainerDecl . (lambda (node offset)
+ (ts-fold-range-markers node offset "{")))
+ (SwitchExpr . (lambda (node offset)
+ (ts-fold-range-markers node offset "{")))
+ (Block . ts-fold-range-seq)
+ (InitList . ts-fold-range-seq)
+ (line_comment . ts-fold-range-c-like-comment)))
(provide 'ts-fold-parsers)
;;; ts-fold-parsers.el ends here