[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c7202e7f4a 2/7: ; Fix docstrings in treesit.el
From: |
Yuan Fu |
Subject: |
master c7202e7f4a 2/7: ; Fix docstrings in treesit.el |
Date: |
Tue, 22 Nov 2022 04:07:10 -0500 (EST) |
branch: master
commit c7202e7f4aedee607f26727de52b85819bf64dab
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
; Fix docstrings in treesit.el
* lisp/treesit.el (treesit--explorer--nodes-to-highlight)
(treesit--explorer-draw-node): Fix docstrings.
---
lisp/treesit.el | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 24387c287a..015f780078 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1765,10 +1765,11 @@ to the offending pattern and highlight the pattern."
(defun treesit--explorer--nodes-to-highlight (language)
"Return nodes for LANGUAGE covered in region.
-This function tries to return the largest node possible. So it
-will return a single large node rather than a bunch of small
-nodes. If it end up returning multiple small nodes, it only
-returns the first and last node, and omits the ones in between."
+This function tries to return the largest node possible. If the
+region covers exactly one node, that node is returned (in a
+list). If the region covers more than one node, two nodes are
+returned: the very first one in the region and the very last one
+in the region."
(let* ((beg (region-beginning))
(end (region-end))
(node (treesit-node-on beg end language))
@@ -1887,13 +1888,10 @@ Return the start of the syntax tree text corresponding
to NODE."
(defun treesit--explorer-draw-node (node)
"Draw the syntax tree of NODE.
-If NODE and NODE-HIGHLIGHT are the same node, highlight it.
-When this function is called, point should be at an empty line,
-when appropriate indent in front of point. When this function
-returns, it leaves point at the end of the last line of NODE.
-
-Return the start position of NODE-HIGHLIGHT in the buffer, if any."
+When this function is called, point should be at the position
+where the node should start. When this function returns, it
+leaves point at the end of the last line of NODE."
(let* ((type (treesit-node-type node))
(field-name (treesit-node-field-name node))
(children (treesit-node-children node))
- master updated (b32f50c6d8 -> 1161c96cc9), Yuan Fu, 2022/11/22
- master 74892eefc8 1/7: * lisp/treesit.el (treesit-max-buffer-size): Enlarge value., Yuan Fu, 2022/11/22
- master d6d4adf3bd 5/7: Tweak faces in Java and TypeScript, Yuan Fu, 2022/11/22
- master c7202e7f4a 2/7: ; Fix docstrings in treesit.el,
Yuan Fu <=
- master cb60342c01 3/7: Tweak c-ts-mode fontification, Yuan Fu, 2022/11/22
- master 6e07838051 4/7: treesit-font-lock-recompute-features now has two modes of operation, Yuan Fu, 2022/11/22
- master e494ca4f4d 6/7: Fix treesit_record_change in casify_region, Yuan Fu, 2022/11/22
- master 1161c96cc9 7/7: Separate tree-sitter and non-tree-sitter variant of sh-mode, Yuan Fu, 2022/11/22