LezerTreeCursor
Unofficial
A cursor for walking through the syntax tree.
Import:
import type { LezerTreeCursor } from '@obsidian-typings/obsidian-public-latest';Signature:
export class LezerTreeCursor implements SyntaxNodeRefImplements: SyntaxNodeRef
Properties
| Property | Type | Description | |
|---|---|---|---|
| from | number | The start position of the current node. | |
| name | string | The name of the current node type. | |
| node | SyntaxNode | The actual syntax node at the current position. | |
| to | number | The end position of the current node. | |
| tree | LezerTree | null | The tree that the current node belongs to, if it is a top node. | |
| type | NodeType | The type of the current node. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| firstChild() | boolean | Move to the first child of the current node. | |
| lastChild() | boolean | Move to the last child of the current node. | |
| next(enter?) | boolean | Move to the next node in tree order. | |
| nextSibling() | boolean | Move to the next sibling of the current node. | |
| parent() | boolean | Move to the parent of the current node. | |
| prev(enter?) | boolean | Move to the previous node in tree order. | |
| prevSibling() | boolean | Move to the previous sibling of the current node. |
Links to this page: