aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-09-01 10:52:55 +0200
committerGitHub <noreply@github.com>2020-09-01 10:52:55 +0200
commit04ab26b88591ce5afa427c9a8badb9fcf1b95685 (patch)
tree71ec6f46ca21eaf1bb623f5510020410590e4d3b /runtime
parentc14a9f6fcc0e74294e98913699c8a4a79f1f7321 (diff)
parent18217b987f79afa2f389262d7eb155b1c064f97c (diff)
downloadrneovim-04ab26b88591ce5afa427c9a8badb9fcf1b95685.tar.gz
rneovim-04ab26b88591ce5afa427c9a8badb9fcf1b95685.tar.bz2
rneovim-04ab26b88591ce5afa427c9a8badb9fcf1b95685.zip
Merge pull request #12736 from vigoux/ts-iter-children
treesitter: allow to iterate over node children
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/lua.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 8c306135d0..e692274383 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -622,6 +622,15 @@ Node methods *lua-treesitter-node*
tsnode:parent() *tsnode:parent()*
Get the node's immediate parent.
+tsnode:iter_children() *tsnode:iter_children()*
+ Iterates over all the direct children of {tsnode}, regardless of
+ wether they are named or not.
+ Returns the child node plus the eventual field name corresponding to
+ this child node.
+
+tsnode:field({name}) *tsnode:field()*
+ Returns a table of the nodes corresponding to the {name} field.
+
tsnode:child_count() *tsnode:child_count()*
Get the node's number of children.