Skip to content

SyntaxNode

Unofficial

Represents a node in the syntax tree.

Import:

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

Signature:

export interface SyntaxNode

Properties

PropertyTypeDescription
firstChildnull | SyntaxNodeThe first child node.
fromnumberThe start position of this node.
lastChildnull | SyntaxNodeThe last child node.
namestringThe name of the node type.
nextSiblingnull | SyntaxNodeThe next sibling node.
parentnull | SyntaxNodeThe parent node.
prevSiblingnull | SyntaxNodeThe previous sibling node.
tonumberThe end position of this node.
treeLezerTree | nullThe tree that this node belongs to, if it is a top node.
typeNodeTypeThe type of this node.

Methods

MethodReturnsDescription
cursor(mode?)LezerTreeCursorCreate a tree cursor starting at this node.
resolve(pos, side?)SyntaxNodeResolve the node at the given position.

Links to this page: