aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorJongwook Choi <wookayin@gmail.com>2024-02-02 01:51:35 -0500
committerLewis Russell <me@lewisr.dev>2024-02-08 12:42:19 +0000
commitd0e9e36a7841c28f82e5c7ae2bde1fa21319f2ac (patch)
tree097b0a018baa68e8082c6e6491cf05c6453421df /runtime/doc
parent800134ea5ec60338a40280c8536db6a6a4a10249 (diff)
downloadrneovim-d0e9e36a7841c28f82e5c7ae2bde1fa21319f2ac.tar.gz
rneovim-d0e9e36a7841c28f82e5c7ae2bde1fa21319f2ac.tar.bz2
rneovim-d0e9e36a7841c28f82e5c7ae2bde1fa21319f2ac.zip
refactor(treesitter): {start,stop} are optional in Query:iter_* methods
Document that the `start` and `stop` parameters in `Query:iter_captures()` and `Query:iter_matches()` are optional. The tree-sitter lib has been bumped up to 0.20.9, so we also no longer need "Requires treesitter >= 0.20.9".
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/treesitter.txt17
1 files changed, 10 insertions, 7 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 1402753f15..f6ee2ef425 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -1086,8 +1086,10 @@ Query:iter_captures({node}, {source}, {start}, {stop})
• {node} (`TSNode`) under which the search will occur
• {source} (`integer|string`) Source buffer or string to extract text
from
- • {start} (`integer`) Starting line for the search
- • {stop} (`integer`) Stopping line for the search (end-exclusive)
+ • {start} (`integer?`) Starting line for the search. Defaults to
+ `node:start()`.
+ • {stop} (`integer?`) Stopping line for the search (end-exclusive).
+ Defaults to `node:end_()`.
Return: ~
(`fun(end_line: integer?): integer, TSNode, TSMetadata`) capture id,
@@ -1119,13 +1121,14 @@ Query:iter_matches({node}, {source}, {start}, {stop}, {opts})
Parameters: ~
• {node} (`TSNode`) under which the search will occur
• {source} (`integer|string`) Source buffer or string to search
- • {start} (`integer`) Starting line for the search
- • {stop} (`integer`) Stopping line for the search (end-exclusive)
- • {opts} (`table?`) Options:
+ • {start} (`integer?`) Starting line for the search. Defaults to
+ `node:start()`.
+ • {stop} (`integer?`) Stopping line for the search (end-exclusive).
+ Defaults to `node:end_()`.
+ • {opts} (`table?`) Optional keyword arguments:
• max_start_depth (integer) if non-zero, sets the maximum
start depth for each match. This is used to prevent
- traversing too deep into a tree. Requires treesitter >=
- 0.20.9.
+ traversing too deep into a tree.
Return: ~
(`fun(): integer, table<integer,TSNode>, table`) pattern id, match,