aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-06-14 19:14:52 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2020-06-29 22:21:06 +0200
commit558893b1b979d2ec9006ee496c19648edbbf5b1c (patch)
tree1ea35ad57741907c7cb5d23b1d4a358f75802f5e
parent75a1239eb51a805837111ac60e5dbddfadc8cb6f (diff)
downloadrneovim-558893b1b979d2ec9006ee496c19648edbbf5b1c.tar.gz
rneovim-558893b1b979d2ec9006ee496c19648edbbf5b1c.tar.bz2
rneovim-558893b1b979d2ec9006ee496c19648edbbf5b1c.zip
treesitter: add some documentation for parsers
-rw-r--r--runtime/doc/lua.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 5a49d36503..00126f668b 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -512,6 +512,9 @@ retained for the lifetime of a buffer but this is subject to change. A plugin
should keep a reference to the parser object as long as it wants incremental
updates.
+Parser methods *lua-treesitter-parser*
+
+tsparser:parse() *tsparser:parse()*
Whenever you need to access the current syntax tree, parse the buffer: >
tstree = parser:parse()
@@ -528,6 +531,16 @@ shouldn't be done directly in the change callback anyway as they will be very
frequent. Rather a plugin that does any kind of analysis on a tree should use
a timer to throttle too frequent updates.
+tsparser:set_included_ranges(ranges) *tsparser:set_included_ranges()*
+ Changes the ranges the parser should consider. This is used for
+ language injection. `ranges` should be of the form (all zero-based): >
+ {
+ {start_node, end_node},
+ ...
+ }
+<
+ NOTE: `start_node` and `end_node` are both inclusive.
+
Tree methods *lua-treesitter-tree*
tstree:root() *tstree:root()*