[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treesit-fold 41103496f2 206/417: up
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treesit-fold 41103496f2 206/417: up |
Date: |
Mon, 1 Jul 2024 10:02:26 -0400 (EDT) |
branch: elpa/treesit-fold
commit 41103496f2228cd07130e0d302a9d96cf19ecce2
Author: Jen-Chieh <jcs090218@gmail.com>
Commit: Jen-Chieh <jcs090218@gmail.com>
up
---
README.md | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 46c3f3e3ea..e2b932e47a 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,7 @@ to provide code folding base on the tree-sitter syntax tree.
- [How to write a parser?](#how-to-write-a-parser)
- [Where can I look for tree-sitter
node?](#where-can-i-look-for-tree-sitter-node)
- [How do I create the function for the corresponding
node?](#how-do-i-create-the-function-for-the-corresponding-node)
+ - [Register to parsers alist!](#register-to-parsers-alist)
<!-- markdown-toc end -->
@@ -220,5 +221,30 @@ targeting node.
* `offset` - (optiona) a cons consist of two integers. This is handy when you
have
a similar rule with little of positioning adjustment.
-> `tree-sitter-[lang]` parsers are generally integrated with different authors,
-> hence their naming and ruling are slightly different (+1/-1 position).
+`tree-sitter-[lang]` parsers are generally integrated with different authors,
+hence their naming and ruling are slightly different (+1/-1 position).
+
+Let's look at function `ts-fold-range-seq` for better understanding,
+
+```elisp
+(defun ts-fold-range-seq (node offset)
+ "..."
+ (let ((beg (1+ (tsc-node-start-position node))) ; node beginning position
(from Rust layer)
+ (end (1- (tsc-node-end-position node)))) ; node end position (from
Rust layer)
+ (ts-fold--cons-add (cons beg end) offset))) ; return fold range
+```
+
+#### Register to parsers alist!
+
+Don't get to add your parsers to entry alist.
+
+```elisp
+(defcustom ts-fold-range-alist
+ `((agda-mode . ,(ts-fold-parsers-agda))
+ (sh-mode . ,(ts-fold-parsers-bash))
+ (c-mode . ,(ts-fold-parsers-c))
+ (c++-mode . ,(ts-fold-parsers-c++))
+ ...
+```
+
+This variable is defined in package main file, `ts-fold.el`.
- [nongnu] elpa/treesit-fold abd12c8fda 146/417: Fix toc, (continued)
- [nongnu] elpa/treesit-fold abd12c8fda 146/417: Fix toc, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 790247d439 157/417: Swap demo, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 03872ff486 169/417: Update readme, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold f1297ee040 170/417: Add elpa badge, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 7c2b421d04 163/417: Fill gap, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 9d48ee7937 176/417: Update CI, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 28ec4b244f 192/417: Update ts-fold.el, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 53b78381e9 190/417: Fix installation instruction for straight, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold e4f47602eb 197/417: Update ts-fold.el, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 5be52cde9c 207/417: up, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 41103496f2 206/417: up,
ELPA Syncer <=
- [nongnu] elpa/treesit-fold 551bfeb13a 211/417: doc, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold ae12dd8717 217/417: Support elixir (#10), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 54babe5336 222/417: docs(CHANGELOG): update, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 0d884a4217 224/417: refactor(checkdoc): Fix checkdoc warnings (#23), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 1cb784167a 235/417: Add FUNDING.yml, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold c3da5520b9 237/417: tests(test.yml): Add test for Emacs 28.2, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 85db0117ea 240/417: tests: Avoid actions' warnings, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold a64f5252a6 244/417: Add .dir-locals.el (#40), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 9776e2fa2c 247/417: Update copyright year, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 56e6743bac 252/417: feat: Improve folding for C preproc operators (#46), ELPA Syncer, 2024/07/01