diff options
Diffstat (limited to 'runtime/doc/treesitter.txt')
-rw-r--r-- | runtime/doc/treesitter.txt | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index 94690f0b7f..0168b11499 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -1149,21 +1149,24 @@ LanguageTree:parse({self}) *LanguageTree:parse()* Return: ~ TSTree[] -LanguageTree:register_cbs({self}, {cbs}) *LanguageTree:register_cbs()* + *LanguageTree:register_cbs()* +LanguageTree:register_cbs({self}, {cbs}, {recursive}) Registers callbacks for the |LanguageTree|. Parameters: ~ - • {cbs} (table) An |nvim_buf_attach()|-like table argument with the - following handlers: - • `on_bytes` : see |nvim_buf_attach()|, but this will be called after the parsers callback. - • `on_changedtree` : a callback that will be called every time - the tree has syntactical changes. It will only be passed one - argument, which is a table of the ranges (as node ranges) - that changed. - • `on_child_added` : emitted when a child is added to the - tree. - • `on_child_removed` : emitted when a child is removed from - the tree. + • {cbs} (table) An |nvim_buf_attach()|-like table argument with + the following handlers: + • `on_bytes` : see |nvim_buf_attach()|, but this will be called after the parsers callback. + • `on_changedtree` : a callback that will be called + every time the tree has syntactical changes. It will + only be passed one argument, which is a table of the + ranges (as node ranges) that changed. + • `on_child_added` : emitted when a child is added to + the tree. + • `on_child_removed` : emitted when a child is removed + from the tree. + • {recursive?} boolean Apply callbacks recursively for all children. + Any new children will also inherit the callbacks. • {self} LanguageTree:source({self}) *LanguageTree:source()* |