diff options
author | Yuan Fu <casouri@gmail.com> | 2022-09-07 11:52:13 -0700 |
---|---|---|
committer | Yuan Fu <casouri@gmail.com> | 2022-09-07 11:52:13 -0700 |
commit | 31ad906bd00a3c624ce024f7caa62e9f0b381b37 (patch) | |
tree | c8af89d87b7612e370975e22cfa2f73308f89ecb /lisp/treesit.el | |
parent | 47a6c23751ba2eb097f0d4d61976eefa19425ba1 (diff) | |
download | emacs-31ad906bd00a3c624ce024f7caa62e9f0b381b37.tar.gz emacs-31ad906bd00a3c624ce024f7caa62e9f0b381b37.tar.bz2 emacs-31ad906bd00a3c624ce024f7caa62e9f0b381b37.zip |
Add manual entry for tree-sitter search functions
* doc/lispref/parsing.texi (Retrieving Node): New subsection
"Searching for node".
* doc/lispref/positions.texi (List Motion): Add entries for
treesit-defun-query, treesit-beginning-of-defun, treesit-end-of-defun.
* lisp/treesit.el (treesit-search-forward, treesit-search-beginning)
(treesit-search-end): Minor docstring fix-up.
Diffstat (limited to 'lisp/treesit.el')
-rw-r--r-- | lisp/treesit.el | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el index b969f185148..9c66f32ec27 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -862,9 +862,6 @@ indentation (target) is in green, current indentation is in red." (defun treesit-search-forward (pos-fn arg query &optional lang up-only) "Search forward for nodes that matches QUERY from current point. -This is a more primitive function, you might want to use -`treesit-search-beginning' or `treesit-search-end' instead. - QUERY has to capture the node to match. LANG specifies the language in which we search for nodes. If LANG is nil, use the first parser in (`treesit-parser-list'). @@ -875,7 +872,7 @@ negative ARG means go backward. POS-FN can be either `treesit-node-start' or `treesit-node-end', or any function that takes a node and returns a position. -If search succeeds, stop at the position returned by POS-FN and +If the search succeeds, stop at the position returned by POS-FN and return the matched node. Return nil if search failed. We search by traversing the parse tree, visiting every node @@ -925,12 +922,12 @@ Stops at the beginning of matched node. QUERY has to capture the node to match. LANG specifies the language in which we search for nodes. If LANG is nil, use the -first parser in (`treesit-parser-list'). +first parser in current buffer's parser list. Move forward/backward ARG times, positive ARG means go forward, negative ARG means go backward. -If search succeeds, return the matched node. Return nil if +If the search succeeds, return the matched node. Return nil if search failed. We search by traversing the parse tree, visiting every node @@ -953,7 +950,7 @@ first parser in (`treesit-parser-list'). Move forward/backward ARG times, positive ARG means go forward, negative ARG means go backward. -If search succeeds, return the matched node. Return nil if +If the search succeeds, return the matched node. Return nil if search failed. We search by traversing the parse tree, visiting every node |