emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/treesit-fold d705c12059 299/417: feat: Add Zig support (#8


From: ELPA Syncer
Subject: [nongnu] elpa/treesit-fold d705c12059 299/417: feat: Add Zig support (#82)
Date: Mon, 1 Jul 2024 10:02:39 -0400 (EDT)

branch: elpa/treesit-fold
commit d705c1205961d61409687426bf9326c08487f62e
Author: Jen-Chieh Shen <jcs090218@gmail.com>
Commit: GitHub <noreply@github.com>

    feat: Add Zig support (#82)
    
    * feat: Add Zig support
    
    * fix yaml summary
---
 CHANGELOG.md       | 1 +
 README.md          | 2 +-
 ts-fold-parsers.el | 5 +++++
 ts-fold-summary.el | 4 +++-
 ts-fold.el         | 3 ++-
 5 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ba0099f33..125493831f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for 
recommendations on how
 * Add VHDL support (#79)
 * Add XML support (#80)
 * Add Jsonnet support (#81)
+* Add Zig support (#82)
 
 ## 0.2.0
 > Released Sep 01, 2023
diff --git a/README.md b/README.md
index 737bb826db..32628a53b1 100644
--- a/README.md
+++ b/README.md
@@ -131,13 +131,13 @@ These languages are fairly complete:
 - Verilog / VHDL
 - XML
 - YAML
+- Zig
 
 These languages are in development:
 
 - Ada
 - Agda
 - Elm / Erlang
-- Zig
 
 ## 📝 Customization
 
diff --git a/ts-fold-parsers.el b/ts-fold-parsers.el
index c280504a2f..380ac522f0 100644
--- a/ts-fold-parsers.el
+++ b/ts-fold-parsers.el
@@ -440,5 +440,10 @@
           (ts-fold-range-markers node offset ":"))
         0 1))))
 
+(defun ts-fold-parsers-zig ()
+  "Rule set for Zig."
+  '((Block        . ts-fold-range-seq)
+    (line_comment . ts-fold-range-c-like-comment)))
+
 (provide 'ts-fold-parsers)
 ;;; ts-fold-parsers.el ends here
diff --git a/ts-fold-summary.el b/ts-fold-summary.el
index ee6fbabdff..fdd9da7148 100644
--- a/ts-fold-summary.el
+++ b/ts-fold-summary.el
@@ -253,7 +253,9 @@ type of content by checking the word boundary's existence."
     (typescript-mode   . ts-fold-summary-javadoc)
     (verilog-mode      . ts-fold-summary-javadoc)
     (vhdl-mode         . ts-fold-summary-lua-doc)
-    (nxml-mode         . ts-fold-summary-xml))
+    (nxml-mode         . ts-fold-summary-xml)
+    (yaml-mode         . ts-fold-summary-ruby-doc)
+    (zig-mode          . ts-fold-summary-go))
   "Alist mapping `major-mode' to doc parser function."
   :type '(alist :key-type symbol :value-type function)
   :group 'ts-fold)
diff --git a/ts-fold.el b/ts-fold.el
index eecd10a869..51c5b26b3e 100644
--- a/ts-fold.el
+++ b/ts-fold.el
@@ -110,7 +110,8 @@
     (verilog-mode    . ,(ts-fold-parsers-verilog))
     (vhdl-mode       . ,(ts-fold-parsers-vhdl))
     (nxml-mode       . ,(ts-fold-parsers-xml))
-    (yaml-mode       . ,(ts-fold-parsers-yaml)))
+    (yaml-mode       . ,(ts-fold-parsers-yaml))
+    (zig-mode        . ,(ts-fold-parsers-zig)))
   "An alist of (major-mode . (foldable-node-type . function)).
 
 FUNCTION is used to determine where the beginning and end for 
FOLDABLE-NODE-TYPE



reply via email to

[Prev in Thread] Current Thread [Next in Thread]