Skip to content

LezerTreeCursor

Unofficial

A cursor for walking through the syntax tree.

Import:

import type { LezerTreeCursor } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export class LezerTreeCursor implements SyntaxNodeRef

Implements: SyntaxNodeRef

Properties

PropertyTypeDescription
fromnumberThe start position of the current node.
namestringThe name of the current node type.
nodeSyntaxNodeThe actual syntax node at the current position.
tonumberThe end position of the current node.
treeLezerTree | nullThe tree that the current node belongs to, if it is a top node.
typeNodeTypeThe type of the current node.

Methods

MethodReturnsDescription
firstChild()booleanMove to the first child of the current node.
lastChild()booleanMove to the last child of the current node.
next(enter?)booleanMove to the next node in tree order.
nextSibling()booleanMove to the next sibling of the current node.
parent()booleanMove to the parent of the current node.
prev(enter?)booleanMove to the previous node in tree order.
prevSibling()booleanMove to the previous sibling of the current node.

Links to this page: