The start source offset of this node.
The end source offset.
The node's type.
Shorthand for .type.name.
Get a syntax node at the cursor's current position.
Get the tree that represents the current node, if any. Will return null when the node is in a tree buffer.
Move the cursor to the first child that ends after pos.
Move to the last child that starts before pos.
Move the cursor to this node's first child. When this returns false, the node has no child, and the cursor has not been moved.
Iterate over the current node and all its descendants, calling
enter when entering a node and leave, if given, when leaving
one. When enter returns false, any children of that node are
skipped, and leave isn't called for it.
Optionalleave: (node: SyntaxNodeRef) => voidMove the cursor to this node's last child.
Test whether the current node matches a given context—a sequence of direct parent node names. Empty strings in the context array are treated as wildcards.
Move the cursor to the innermost node that covers pos. If
side is -1, it will enter nodes that end at pos. If it is 1,
it will enter nodes that start at pos.
Optionalside: -1 | 0 | 1Move to the next node in a
pre-order
traversal, going from a node to its first child or, if the
current node is empty or enter is false, its next sibling or
the next sibling of the first parent node that has one.
Optionalenter: booleanMove to this node's next sibling, if any.
Move to the node's parent node, if this isn't the top node.
Move to the next node in a last-to-first pre-order traversal. A node is followed by its last child or, if it has none, its previous sibling or the previous sibling of the first parent node that has one.
Optionalenter: booleanMove to this node's previous sibling, if any.
A tree cursor object focuses on a given node in a syntax tree, and allows you to move to adjacent nodes.