Skip to content

LezerTree

Unofficial

A parse tree representing the syntactic structure of a document.

Import:

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

Signature:

export class LezerTree

Properties

PropertyTypeDescription
childrenreadonly (LezerTree | LezerTreeBuffer)[]The child trees and buffers of this node.
emptyLezerTreeAn empty tree.
lengthnumberThe total length of the content covered by this tree.
positionsreadonly number[]The start positions of the children.
typeNodeTypeThe type of the top node.

Methods

MethodReturnsDescription
cursor(mode?)LezerTreeCursorCreate a cursor over this tree.
cursorAt(pos, side?, mode?)LezerTreeCursorCreate a cursor positioned at the given position.
prop(prop)T | undefinedGet the value of a prop for the top node type.
resolve(pos, side?)SyntaxNodeResolve the node at the given position.
resolveInner(pos, side?)SyntaxNodeResolve the innermost node at the given position.

Links to this page: