Skip to content

SyntaxNode

Unofficial

Represents a node in the syntax tree.

Import:

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

Signature:

export interface SyntaxNode

Properties

Property Type Description
firstChild null | SyntaxNode The first child node.
from number The start position of this node.
lastChild null | SyntaxNode The last child node.
name string The name of the node type.
nextSibling null | SyntaxNode The next sibling node.
parent null | SyntaxNode The parent node.
prevSibling null | SyntaxNode The previous sibling node.
to number The end position of this node.
tree LezerTree | null The tree that this node belongs to, if it is a top node.
type NodeType The type of this node.

Methods

Method Returns Description
cursor(mode?) LezerTreeCursor Create a tree cursor starting at this node.
resolve(pos, side?) SyntaxNode Resolve the node at the given position.

Links to this page: