aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/treesitter.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/treesitter.txt')
-rw-r--r--runtime/doc/treesitter.txt31
1 files changed, 18 insertions, 13 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 13c0bd024a..f3e697807f 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -1020,13 +1020,6 @@ set({lang}, {query_name}, {text}) *vim.treesitter.query.set()*
==============================================================================
-Lua module: vim.treesitter.highlighter *lua-treesitter-highlighter*
-
-TSHighlighter:destroy() *TSHighlighter:destroy()*
- Removes all internal references to the highlighter.
-
-
-==============================================================================
Lua module: vim.treesitter.languagetree *lua-treesitter-languagetree*
@@ -1053,7 +1046,7 @@ Whenever you need to access the current syntax tree, parse the buffer:
>lua
- local tree = parser:parse()
+ local tree = parser:parse({ start_row, end_row })
<
@@ -1112,7 +1105,7 @@ LanguageTree:included_regions() *LanguageTree:included_regions()*
Gets the set of included regions
Return: ~
- integer[][]
+ Range6[][]
LanguageTree:invalidate({reload}) *LanguageTree:invalidate()*
Invalidates this parser and all its children
@@ -1155,10 +1148,22 @@ LanguageTree:named_node_for_range({range}, {opts})
Return: ~
|TSNode| | nil Found node
-LanguageTree:parse() *LanguageTree:parse()*
- Parses all defined regions using a treesitter parser for the language this
- tree represents. This will run the injection query for this language to
- determine if any child languages should be created.
+LanguageTree:parse({range}) *LanguageTree:parse()*
+ Recursively parse all regions in the language tree using
+ |treesitter-parsers| for the corresponding languages and run injection
+ queries on the parsed trees to determine whether child trees should be
+ created and parsed.
+
+ Any region with empty range (`{}`, typically only the root tree) is always
+ parsed; otherwise (typically injections) only if it intersects {range} (or
+ if {range} is `true`).
+
+ Parameters: ~
+ • {range} boolean|Range|nil: Parse this range in the parser's source.
+ Set to `true` to run a complete parse of the source (Note:
+ Can be slow!) Set to `false|nil` to only parse regions with
+ empty ranges (typically only the root tree without
+ injections).
Return: ~
TSTree[]