[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treesit-fold ac1461d364 338/417: feat: Add LLVM support
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treesit-fold ac1461d364 338/417: feat: Add LLVM support |
Date: |
Mon, 1 Jul 2024 10:03:02 -0400 (EDT) |
branch: elpa/treesit-fold
commit ac1461d364a1eacb99b77b919f7ab31650b83b9d
Author: Jen-Chieh <jcs090218@gmail.com>
Commit: Jen-Chieh Shen <jcs090218@gmail.com>
feat: Add LLVM support
---
CHANGELOG.md | 2 +-
README.md | 3 +++
ts-fold-parsers.el | 8 ++++++++
ts-fold-summary.el | 1 +
ts-fold-util.el | 5 ++++-
ts-fold.el | 1 +
6 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fea738b863..3ffe356e03 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for
recommendations on how
## 0.4.0 (Unreleased)
> Released N/A
-* N/A
+* Add `LLVM` support (#102)
## 0.3.0
> Released Nov 29, 2023
diff --git a/README.md b/README.md
index fd14ed0dcf..8c87de1ded 100644
--- a/README.md
+++ b/README.md
@@ -144,6 +144,9 @@ These languages are in development:
- Pascal
- Smithy
+*P.S. We don't list trivial languages here. e.g., LLVM IR (`.ll`) files, etc.
+Please see the variable `ts-fold-range-alist` for the fully supported list!*
+
## 📝 Customization
Although ts-fold aims to have good folding out of the box for all supported
diff --git a/ts-fold-parsers.el b/ts-fold-parsers.el
index 7bfdcbf35c..b08a7c2b2d 100644
--- a/ts-fold-parsers.el
+++ b/ts-fold-parsers.el
@@ -357,6 +357,14 @@
(ts-fold--cons-add offset '(0 . -1))
";;")))))
+(defun ts-fold-parsers-llvm ()
+ "Rule set for LLVM."
+ '((function_body . ts-fold-range-seq)
+ (label . ts-fold-range-asm-label)
+ (comment
+ . (lambda (node offset)
+ (ts-fold-range-line-comment node offset ";;")))))
+
(defun ts-fold-parsers-lua ()
"Rule set for Lua."
'((expression_list . ts-fold-range-seq)
diff --git a/ts-fold-summary.el b/ts-fold-summary.el
index d9fc5bc52c..be9bf42443 100644
--- a/ts-fold-summary.el
+++ b/ts-fold-summary.el
@@ -259,6 +259,7 @@ type of content by checking the word boundary's existence."
(latex-mode . ts-fold-summary-tex-doc)
(lisp-mode . ts-fold-summary-elisp)
(lisp-interaction-mode . ts-fold-summary-elisp)
+ (llvm-mode . ts-fold-summary-elisp)
(lua-mode . ts-fold-summary-lua-doc)
(makefile-mode . ts-fold-summary-ruby-doc)
(makefile-automake-mode . ts-fold-summary-ruby-doc)
diff --git a/ts-fold-util.el b/ts-fold-util.el
index 8d160e32cb..4f0ef253b6 100644
--- a/ts-fold-util.el
+++ b/ts-fold-util.el
@@ -96,7 +96,10 @@ Like function `s-count-matches' but faster."
(defun ts-fold--get-face (obj trim)
"Return face name from OBJ.
If argument TRIM is non-nil, trim the OBJ."
- (get-text-property 0 'face (if trim (string-trim obj) obj)))
+ (let ((obj (if trim (string-trim obj) obj))
+ (len (length obj)))
+ (or (get-text-property 0 'face obj)
+ (get-text-property (max 0 (1- len)) 'face obj))))
(defun ts-fold--is-face (obj lst-face &optional trim)
"Return non-nil if OBJ's face is define inside list LST-FACE.
diff --git a/ts-fold.el b/ts-fold.el
index c05b05ca1e..e0f3e35d42 100644
--- a/ts-fold.el
+++ b/ts-fold.el
@@ -100,6 +100,7 @@
(latex-mode . ,(ts-fold-parsers-latex))
(lisp-mode . ,(ts-fold-parsers-lisp))
(lisp-interaction-mode . ,(ts-fold-parsers-lisp))
+ (llvm-mode . ,(ts-fold-parsers-llvm))
(lua-mode . ,(ts-fold-parsers-lua))
(makefile-mode . ,(ts-fold-parsers-make))
(makefile-automake-mode . ,(ts-fold-parsers-make))
- [nongnu] elpa/treesit-fold b5664b1c1c 306/417: feat: Add Assembly support (#87), (continued)
- [nongnu] elpa/treesit-fold b5664b1c1c 306/417: feat: Add Assembly support (#87), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold a860af5c66 302/417: feat(ts): Include more rules for TS, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 58adaef135 328/417: Support k8s-mode, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold e82256dd27 393/417: fix: missing treesit prefix, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold d705c12059 299/417: feat: Add Zig support (#82), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 7a7bd70185 295/417: feat: Add VHDL support (#79), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 0c13c0e4ed 374/417: ci: Bump Emacs 29.x to 3, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold e015c9a3eb 297/417: feat: Add Jsonnet support (#81), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold d50f5dd2f8 398/417: feat(parser): Add token_tree to Rust, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 6dda55a29a 298/417: doc: Add development languages, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold ac1461d364 338/417: feat: Add LLVM support,
ELPA Syncer <=
- [nongnu] elpa/treesit-fold 9f82f1e632 400/417: Support for treesit.el (#3), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 1d8d9352a1 369/417: feat: Add Svelte support, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold c0e9bb7f3e 344/417: fix: Improve Julia rules, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 9f48ef560c 322/417: fix: render all frames, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 12ae1d0457 356/417: Added section & environment folding to latex-parser, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold ee0c0eb252 312/417: fix(make): Folding recipe, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 57c1bb8e0a 317/417: feat: Add Arduino support (#95), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 15811f4465 386/417: fix: on fold hook in recursive open, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 9945282f03 349/417: Added a matlab parser for folding., ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold a549e4050c 367/417: chore: Test 29.2, ELPA Syncer, 2024/07/01