aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-03-17 18:02:40 +0000
committerLewis Russell <me@lewisr.dev>2024-03-17 20:37:15 +0000
commit3b29b39e6deb212456eba691bc79b17edaa8717b (patch)
tree749b52c8824f25298624528a498f277c47d25991 /runtime/doc
parent77a9f3395bd1e7184f4d735c01e50285e30477ab (diff)
downloadrneovim-3b29b39e6deb212456eba691bc79b17edaa8717b.tar.gz
rneovim-3b29b39e6deb212456eba691bc79b17edaa8717b.tar.bz2
rneovim-3b29b39e6deb212456eba691bc79b17edaa8717b.zip
fix(treesitter): revert to using iter_captures in highlighter
Fixes #27895
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/treesitter.txt12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 74dcc5a120..f7d0d7c243 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -1132,10 +1132,10 @@ Query:iter_captures({node}, {source}, {start}, {stop})
i.e., to get syntax highlight matches in the current viewport). When
omitted, the {start} and {stop} row values are used from the given node.
- The iterator returns three values: a numeric id identifying the capture,
- the captured node, and metadata from any directives processing the match.
- The following example shows how to get captures by name: >lua
- for id, node, metadata in query:iter_captures(tree:root(), bufnr, first, last) do
+ The iterator returns four values: a numeric id identifying the capture,
+ the captured node, metadata from any directives processing the match, and
+ the match itself. The following example shows how to get captures by name: >lua
+ for id, node, metadata, match in query:iter_captures(tree:root(), bufnr, first, last) do
local name = query.captures[id] -- name of the capture in the query
-- typically useful info about the node:
local type = node:type() -- type of the captured node
@@ -1154,8 +1154,8 @@ Query:iter_captures({node}, {source}, {start}, {stop})
Defaults to `node:end_()`.
Return: ~
- (`fun(end_line: integer?): integer, TSNode, vim.treesitter.query.TSMetadata`)
- capture id, capture node, metadata
+ (`fun(end_line: integer?): integer, TSNode, vim.treesitter.query.TSMetadata, table<integer, TSNode>`)
+ capture id, capture node, metadata, match
*Query:iter_matches()*
Query:iter_matches({node}, {source}, {start}, {stop}, {opts})