[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/tree-sitter 007d8c4859 3/6: ; * lisp/treesit.el (treesit-simple-
From: |
Yuan Fu |
Subject: |
feature/tree-sitter 007d8c4859 3/6: ; * lisp/treesit.el (treesit-simple-indent-presets): Add TODO. |
Date: |
Fri, 28 Oct 2022 04:18:49 -0400 (EDT) |
branch: feature/tree-sitter
commit 007d8c485906be46d40e74ddb8046e065c722786
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
; * lisp/treesit.el (treesit-simple-indent-presets): Add TODO.
---
lisp/treesit.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 84583d2c62..3f9b9de1eb 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -661,6 +661,7 @@ See `treesit-simple-indent-presets'.")
(or (null ,node-index-max)
(<= (treesit-node-index node t)
,node-index-max))))))
+ ;; TODO: Document if genuinely useful.
(n-p-gp . (lambda (node-t parent-t grand-parent-t)
`(lambda (node parent bol &rest _)
(and (or (null ,node-t)
@@ -688,6 +689,7 @@ See `treesit-simple-indent-presets'.")
`(lambda (node parent bol &rest _)
(string-match-p
,name (or (treesit-node-field-name node) "")))))
+ ;; TODO: Document.
(catch-all . (lambda (&rest _) t))
(query . (lambda (pattern)
@@ -701,12 +703,14 @@ See `treesit-simple-indent-presets'.")
(first-sibling . (lambda (node parent bol &rest _)
(treesit-node-start
(treesit-node-child parent 0))))
+ ;; TODO: Document.
(nth-sibling . (lambda (n &optional named)
`(lambda (node parent bol &rest _)
(treesit-node-start
(treesit-node-child parent ,n ,named)))))
(parent . (lambda (node parent bol &rest _)
(treesit-node-start parent)))
+ ;; TODO: Document.
(grand-parent . (lambda (node parent bol &rest _)
(treesit-node-start (treesit-node-parent parent))))
(parent-bol . (lambda (node parent bol &rest _)
@@ -723,6 +727,7 @@ See `treesit-simple-indent-presets'.")
(goto-char bol)
(forward-line -1)
(skip-chars-forward " \t"))))
+ ;; TODO: Document.
(and . (lambda (&rest fns)
`(lambda (node parent bol &rest _)
(cl-reduce (lambda (a b) (and a b))
@@ -760,6 +765,8 @@ MATCHER:
(match nil \"argument_list\" nil nil 0 0).
+ NODE-TYPE, PARENT-TYPE, and NODE-FIELD are regexps.
+
no-node
Matches the case where node is nil, i.e., there is no node
@@ -768,11 +775,11 @@ no-node
\(parent-is TYPE)
- Check that the parent has type TYPE.
+ Check that the parent's type matches regexp TYPE.
\(node-is TYPE)
- Checks that the node has type TYPE.
+ Checks that the node's type matches regexp TYPE.
\(query QUERY)
- feature/tree-sitter updated (e7b09065da -> 629f222ba2), Yuan Fu, 2022/10/28
- feature/tree-sitter bb0a427e9d 1/6: * configure.ac (WINDOW_SYSTEM_OBJ): Move tree-sitter placement., Yuan Fu, 2022/10/28
- feature/tree-sitter 3a44069753 2/6: Remove tree-sitter-indent's integration with cc-mode, Yuan Fu, 2022/10/28
- feature/tree-sitter 629f222ba2 6/6: Reflect tree-sitter indent rule presets change in manual, Yuan Fu, 2022/10/28
- feature/tree-sitter 007d8c4859 3/6: ; * lisp/treesit.el (treesit-simple-indent-presets): Add TODO.,
Yuan Fu <=
- feature/tree-sitter 9c4dddad45 4/6: Add some js-mode tree-sitter indent rules, Yuan Fu, 2022/10/28
- feature/tree-sitter 75c8cc5eab 5/6: Improve tree-sitter indent rules in ts-mode and js-mode, Yuan Fu, 2022/10/28