aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorSteven Sojka <Steven.Sojka@tdameritrade.com>2020-11-04 11:03:36 -0600
committerThomas Vigouroux <tomvig38@gmail.com>2020-11-23 08:06:17 +0100
commit1a631026a942b3311adec0bee6d9b0b932c5de31 (patch)
treef74318cb686ccdd5467cd3860280c01eca6cfcf9 /runtime/doc
parentcd691f2b6f605bc7fc13961e275823673d9871ad (diff)
downloadrneovim-1a631026a942b3311adec0bee6d9b0b932c5de31.tar.gz
rneovim-1a631026a942b3311adec0bee6d9b0b932c5de31.tar.bz2
rneovim-1a631026a942b3311adec0bee6d9b0b932c5de31.zip
feat(treesitter): add language tree
Implement the LanguageTree structure to enable language injection. This is done be removing the old Parser metatable and replacing by the new structure, with the same API (almost). Some noticeable differences : - `parser:parse()` now returns a table of trees - There is no incremental parsing for child (injected) languages Co-authored-by: Thomas Vigouroux <tomvig38@gmail.com>
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/treesitter.txt13
1 files changed, 7 insertions, 6 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 58cd535e98..b6a238f158 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -59,15 +59,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): >
+tsparser:set_included_regions({region_list}) *tsparser:set_included_regions()*
+ Changes the regions the parser should consider. This is used for
+ language injection. {region_list} should be of the form (all zero-based): >
{
- {start_node, end_node},
+ {node1, node2},
...
}
<
- NOTE: `start_node` and `end_node` are both inclusive.
+ `node1` and `node2` are both considered part of the same region and
+ will be parsed together with the parser in the same context.
Tree methods *lua-treesitter-tree*
@@ -253,7 +254,7 @@ Here is a list of built-in predicates :
`lua-match?` *ts-predicate-lua-match?*
This will match the same way than |match?| but using lua
regexes.
-
+
`contains?` *ts-predicate-contains?*
Will check if any of the following arguments appears in the
text corresponding to the node : >