[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/tree-sitter 4ef50ccd3f 3/8: ; Explain the BEG and END argument i
From: |
Yuan Fu |
Subject: |
feature/tree-sitter 4ef50ccd3f 3/8: ; Explain the BEG and END argument in treesit-query-capture better |
Date: |
Tue, 1 Nov 2022 16:28:16 -0400 (EDT) |
branch: feature/tree-sitter
commit 4ef50ccd3f8bc177ef6dd7183a9268bb8057f064
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
; Explain the BEG and END argument in treesit-query-capture better
* doc/lispref/parsing.texi (Pattern Matching): Update manual.
* src/treesit.c (Ftreesit_query_capture): Update docstring.
---
doc/lispref/parsing.texi | 4 +++-
src/treesit.c | 6 ++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi
index 524b81a2bb..7164baaa6d 100644
--- a/doc/lispref/parsing.texi
+++ b/doc/lispref/parsing.texi
@@ -992,7 +992,9 @@ The function returns all the captured nodes in a list of
the form
non-@code{nil}, it returns the list of nodes instead. By default the
entire text of @var{node} is searched, but if @var{beg} and @var{end}
are both non-@code{nil}, they specify the region of buffer text where
-this function should match nodes.
+this function should match nodes. Any matching node whose span
+overlaps with the region between @var{beg} and @var{end} are captured,
+it doesn't have to be completely in the region.
@vindex treesit-query-error
@findex treesit-query-validate
diff --git a/src/treesit.c b/src/treesit.c
index e4be065d94..9324b8b100 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -2178,8 +2178,10 @@ either string or sexp form. When using repeatedly, a
compiled query
is much faster than a string or sexp one, so it is recommend to
compile your query if it will be used repeatedly.
-BEG and END, if both non-nil, specify the region of buffer positions
-in which the query is executed.
+BEG and END, if both non-nil, specify the region of buffer positions
+in which the query is executed. Any matching node whose span overlaps
+with the region between BEG and END are captured, it doesn't have to
+be completely in the region.
If NODE-ONLY is non-nil, return a list of nodes.
- feature/tree-sitter updated (9fab83ed7a -> 50e33639fe), Yuan Fu, 2022/11/01
- feature/tree-sitter b49250ada9 2/8: Use treesit-fontify-with-override in tree-sitter functions, Yuan Fu, 2022/11/01
- feature/tree-sitter a3651d3237 4/8: Query on the root node in tree-sitter font-lock, Yuan Fu, 2022/11/01
- feature/tree-sitter 6d5b34d9de 6/8: ; Tree-sitter font-lock debugging: print node type not language, Yuan Fu, 2022/11/01
- feature/tree-sitter ccd2509ed3 7/8: Don't print buffer when printing tree-sitter node and parser, Yuan Fu, 2022/11/01
- feature/tree-sitter f6e92035a7 5/8: Allow user to add/remove tree-sitter font-lock features, Yuan Fu, 2022/11/01
- feature/tree-sitter eeeae5e9ee 1/8: Add an argument OVERRIDE to tree-sitter font-lock functions, Yuan Fu, 2022/11/01
- feature/tree-sitter 50e33639fe 8/8: Fix string fontification for tree-sitter python-mode, Yuan Fu, 2022/11/01
- feature/tree-sitter 4ef50ccd3f 3/8: ; Explain the BEG and END argument in treesit-query-capture better,
Yuan Fu <=