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

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

[nongnu] elpa/treesit-fold b1021c2acb 293/417: feat: Add Noir support (#


From: ELPA Syncer
Subject: [nongnu] elpa/treesit-fold b1021c2acb 293/417: feat: Add Noir support (#77)
Date: Mon, 1 Jul 2024 10:02:37 -0400 (EDT)

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

    feat: Add Noir support (#77)
---
 CHANGELOG.md       |  2 +-
 README.md          |  2 +-
 ts-fold-parsers.el | 10 +++++++++-
 ts-fold-summary.el |  2 ++
 ts-fold.el         |  1 +
 5 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index aaaa69a400..fae8f63aa8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for 
recommendations on how
 ## 0.2.1 (Unreleased)
 > Released N/A
 
-* N/A
+* Add Noir support (#77)
 
 ## 0.2.0
 > Released Sep 01, 2023
diff --git a/README.md b/README.md
index 07ed19f153..95056e670f 100644
--- a/README.md
+++ b/README.md
@@ -122,7 +122,7 @@ These languages are fairly complete:
 - Kotlin
 - LaTex / Lua
 - Markdown
-- Nix
+- Nix / Noir
 - Perl / PHP / Python
 - R / Ruby / Rust
 - Scala / Scheme / Swift
diff --git a/ts-fold-parsers.el b/ts-fold-parsers.el
index a2c0c78a91..3bd2059b55 100644
--- a/ts-fold-parsers.el
+++ b/ts-fold-parsers.el
@@ -282,11 +282,19 @@
   '((fenced_code_block . (ts-fold-range-seq 2 -2))
     (html_block        . ts-fold-range-html)))
 
+(defun ts-fold-parsers-noir ()
+  "Rule set for Noir."
+  '((body    . ts-fold-range-seq)
+    (comment . ts-fold-range-c-like-comment)))
+
 (defun ts-fold-parsers-nix ()
   "Rule set for Nix."
   '((attrset_expression . ts-fold-range-seq)
     (interpolation      . ts-fold-range-seq)
-    (list_expression    . ts-fold-range-seq)))
+    (list_expression    . ts-fold-range-seq)
+    (comment
+     . (lambda (node offset)
+         (ts-fold-range-line-comment node offset "#")))))
 
 (defun ts-fold-parsers-ocaml ()
   "Rule set for OCaml."
diff --git a/ts-fold-summary.el b/ts-fold-summary.el
index caa6f70614..705eb29256 100644
--- a/ts-fold-summary.el
+++ b/ts-fold-summary.el
@@ -233,6 +233,8 @@ type of content by checking the word boundary's existence."
     (latex-mode        . ts-fold-summary-tex-doc)
     (lua-mode          . ts-fold-summary-lua-doc)
     (markdown-mode     . ts-fold-summary-markdown)
+    (nix-mode          . ts-fold-summary-ruby-doc)
+    (noir-mode         . ts-fold-summary-rust-doc)
     (objc-mode         . ts-fold-summary-c)
     (org-mode          . ts-fold-summary-org)
     (perl-mode         . ts-fold-summary-ruby-doc)
diff --git a/ts-fold.el b/ts-fold.el
index 0b6b1b31ad..41fb901f2a 100644
--- a/ts-fold.el
+++ b/ts-fold.el
@@ -88,6 +88,7 @@
     (latex-mode      . ,(ts-fold-parsers-latex))
     (lua-mode        . ,(ts-fold-parsers-lua))
     (markdown-mode   . ,(ts-fold-parsers-markdown))
+    (noir-mode       . ,(ts-fold-parsers-noir))
     (nix-mode        . ,(ts-fold-parsers-nix))
     (ocaml-mode      . ,(ts-fold-parsers-ocaml))
     (perl-mode       . ,(ts-fold-parsers-perl))



reply via email to

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