Function: treesit-node-next-sibling
treesit-node-next-sibling is a function defined in treesit.c.
Signature
(treesit-node-next-sibling NODE &optional NAMED)
Documentation
Return the next sibling of NODE.
Return nil if there is no next sibling. If NAMED is non-nil, look for named siblings only. NAMED defaults to nil. If NODE is nil, return nil.
Other relevant functions are documented in the treesit group.
Shortdoc
;; treesit
(treesit-node-next-sibling node)
e.g. => #<treesit-node (init_declarator) in 5-10>
Source Code
// Defined in /usr/src/emacs/src/treesit.c
{
if (NILP (node)) return Qnil;
treesit_check_node (node);
treesit_initialize ();
TSNode treesit_node = XTS_NODE (node)->node;
TSNode sibling;
if (NILP (named))
sibling = ts_node_next_sibling (treesit_node);
else
sibling = ts_node_next_named_sibling (treesit_node);
if (ts_node_is_null (sibling))
return Qnil;
return make_treesit_node (XTS_NODE (node)->parser, sibling);
}