From 55b165ac15a7528a3c679d928b1edf9d701f850b Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 15 Feb 2025 13:33:38 -0800 Subject: fix(treesitter): `TSNode:field()` returns all children with the given field --- runtime/doc/treesitter.txt | 2 +- runtime/lua/vim/treesitter/_meta/tsnode.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt index b04f13add5..344bd37ddd 100644 --- a/runtime/doc/treesitter.txt +++ b/runtime/doc/treesitter.txt @@ -713,7 +713,7 @@ TSNode:extra() *TSNode:extra()* (`boolean`) TSNode:field({name}) *TSNode:field()* - Returns a table of the nodes corresponding to the {name} field. + Returns a list of all the node's children that have the given field name. Parameters: ~ • {name} (`string`) diff --git a/runtime/lua/vim/treesitter/_meta/tsnode.lua b/runtime/lua/vim/treesitter/_meta/tsnode.lua index 552905c3f0..2f9d7f214a 100644 --- a/runtime/lua/vim/treesitter/_meta/tsnode.lua +++ b/runtime/lua/vim/treesitter/_meta/tsnode.lua @@ -43,7 +43,7 @@ function TSNode:prev_named_sibling() end --- @return fun(): TSNode, string function TSNode:iter_children() end ---- Returns a table of the nodes corresponding to the {name} field. +--- Returns a list of all the node's children that have the given field name. --- @param name string --- @return TSNode[] function TSNode:field(name) end -- cgit