Tree

actual class Tree : AutoCloseable(source)

A class that represents a syntax tree.

NOTE: If you're targeting Android SDK level < 33, you must use or close the instance to free up resources.

expect class Tree(source)

A class that represents a syntax tree.

actual class Tree(source)

A class that represents a syntax tree.

actual class Tree(source)

A class that represents a syntax tree.

Properties

Link copied to clipboard

The included ranges that were used to parse the syntax tree.

The included ranges that were used to parse the syntax tree.

The included ranges that were used to parse the syntax tree.

The included ranges of the syntax tree.

Link copied to clipboard
actual val language: Language

The language that was used to parse the syntax tree.

expect val language: Language

The language that was used to parse the syntax tree.

actual val language: Language

The language that was used to parse the syntax tree.

actual val language: Language

The language that was used to parse the syntax tree.

Link copied to clipboard
actual val rootNode: Node

The root node of the syntax tree.

expect val rootNode: Node

The root node of the syntax tree.

actual val rootNode: Node

The root node of the syntax tree.

actual val rootNode: Node

The root node of the syntax tree.

Functions

Link copied to clipboard
actual external fun changedRanges(newTree: Tree): List<Range>

Compare an old edited syntax tree to a new syntax tree representing the same document.

expect fun changedRanges(newTree: Tree): List<Range>

Compare an old edited syntax tree to a new syntax tree representing the same document.

actual external fun changedRanges(newTree: Tree): List<Range>

Compare an old edited syntax tree to a new syntax tree representing the same document.

actual fun changedRanges(newTree: Tree): List<Range>

Compare an old edited syntax tree to a new syntax tree representing the same document.

Link copied to clipboard
open override fun close()
Link copied to clipboard
actual fun copy(): Tree

Create a shallow copy of the syntax tree.

expect fun copy(): Tree

Create a shallow copy of the syntax tree.

actual fun copy(): Tree

Create a shallow copy of the syntax tree.

actual fun copy(): Tree

Create a shallow copy of the syntax tree.

Link copied to clipboard
actual external fun edit(edit: InputEdit)

Edit the syntax tree to keep it in sync with source code that has been modified.

expect fun edit(edit: InputEdit)

Edit the syntax tree to keep it in sync with source code that has been modified.

actual external fun edit(edit: InputEdit)

Edit the syntax tree to keep it in sync with source code that has been modified.

actual fun edit(edit: InputEdit)

Edit the syntax tree to keep it in sync with source code that has been modified.

Link copied to clipboard
@JvmName(name = "rootNodeWithOffset")
actual external fun rootNodeWithOffset(bytes: UInt, extent: Point): Node?

Get the root node of the syntax tree, but with its position shifted forward by the given offset.

expect fun rootNodeWithOffset(bytes: UInt, extent: Point): Node?

Get the root node of the syntax tree, but with its position shifted forward by the given offset.

@JvmName(name = "rootNodeWithOffset")
actual external fun rootNodeWithOffset(bytes: UInt, extent: Point): Node?

Get the root node of the syntax tree, but with its position shifted forward by the given offset.

actual fun rootNodeWithOffset(bytes: UInt, extent: Point): Node?

Get the root node of the syntax tree, but with its position shifted forward by the given offset.

Link copied to clipboard
actual fun text(): CharSequence?

Get the source code of the syntax tree, if available.

expect fun text(): CharSequence?

Get the source code of the syntax tree, if available.

actual fun text(): CharSequence?

Get the source code of the syntax tree, if available.

actual fun text(): CharSequence?

Get the source code of the syntax tree, if available.

toString
Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String
Link copied to clipboard
actual fun walk(): TreeCursor

Create a new tree cursor starting from the node of the tree.

expect fun walk(): TreeCursor

Create a new tree cursor starting from the node of the tree.

actual fun walk(): TreeCursor

Create a new tree cursor starting from the node of the tree.

actual fun walk(): TreeCursor

Create a new tree cursor starting from the node of the tree.