diff options
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/news.txt | 1 | ||||
| -rw-r--r-- | runtime/doc/treesitter.txt | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 71ec84c2f2..07b1b8646a 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -289,6 +289,7 @@ TREESITTER false, which allows it to return anonymous nodes as well as named nodes. • |treesitter-directive-trim!| can trim all whitespace (not just empty lines) from both sides of a node. +• |vim.treesitter.get_captures_at_pos()| now returns the `id` of each capture TUI diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 877d90a3b7..a0860c60a6 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -902,8 +902,8 @@ get_captures_at_pos({bufnr}, {row}, {col}) Returns a list of highlight captures at the given position Each capture is represented by a table containing the capture name as a - string as well as a table of metadata (`priority`, `conceal`, ...; empty - if none are defined). + string, the capture's language, a table of metadata (`priority`, + `conceal`, ...; empty if none are defined), and the id of the capture. Parameters: ~ • {bufnr} (`integer`) Buffer number (0 for current buffer) @@ -911,7 +911,7 @@ get_captures_at_pos({bufnr}, {row}, {col}) • {col} (`integer`) Position column Return: ~ - (`{capture: string, lang: string, metadata: vim.treesitter.query.TSMetadata}[]`) + (`{capture: string, lang: string, metadata: vim.treesitter.query.TSMetadata, id: integer}[]`) get_node({opts}) *vim.treesitter.get_node()* Returns the smallest named node at the given position |