aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-06-30 00:02:46 +0200
committerGitHub <noreply@github.com>2020-06-30 00:02:46 +0200
commit1920ba4b5597a872973de0a5d558cbbf23063fb6 (patch)
treed3c2cda699808a08493c6ce7883533b5186de46d /runtime/doc/lua.txt
parentfd545d46fa9d9472159485ebc03e1f39417ee9c0 (diff)
parent69816f5e134f0e965352367b5928835794da1698 (diff)
downloadrneovim-1920ba4b5597a872973de0a5d558cbbf23063fb6.tar.gz
rneovim-1920ba4b5597a872973de0a5d558cbbf23063fb6.tar.bz2
rneovim-1920ba4b5597a872973de0a5d558cbbf23063fb6.zip
Merge pull request #12491 from vigoux/treesitter-set-ranges
[RDY] Treesitter set ranges
Diffstat (limited to 'runtime/doc/lua.txt')
-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()*