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 LezerTreeProperties
| Property | Type | Description | |
|---|---|---|---|
| children | readonly (LezerTree | LezerTreeBuffer)[] | The child trees and buffers of this node. | |
| empty | LezerTree | An empty tree. | |
| length | number | The total length of the content covered by this tree. | |
| positions | readonly number[] | The start positions of the children. | |
| type | NodeType | The type of the top node. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| cursor(mode?) | LezerTreeCursor | Create a cursor over this tree. | |
| cursorAt(pos, side?, mode?) | LezerTreeCursor | Create a cursor positioned at the given position. | |
| prop(prop) | T | undefined | Get the value of a prop for the top node type. | |
| resolve(pos, side?) | SyntaxNode | Resolve the node at the given position. | |
| resolveInner(pos, side?) | SyntaxNode | Resolve the innermost node at the given position. |
Links to this page: