TreeSitterTree class final

Constructors

TreeSitterTree({required TreeSitterNode rootNode, required String source, Uint8List? sourceBytes, List<TreeSitterUtf16Range> changedRanges = const [], int reusedNodeCount = 0, GeneratedTreeSitterTree? generatedTree, Map<String, int> phaseTimingsMicros = const {}, List<TreeSitterRange> includedRanges = const [], GeneratedTreeSitterTree? comparisonGeneratedTree, TreeSitterInputEncoding inputEncoding = TreeSitterInputEncoding.utf8, TreeSitterDecodedInputMap? decodedInputMap})
TreeSitterTree.fromRaw(TreeSitterRawHandle<TreeSitterTree> raw)
Reconstructs ownership of a tree transferred through intoRaw.
factory

Properties

changedRanges List<TreeSitterUtf16Range>
final
debugString String
no setter
generatedTree GeneratedTreeSitterTree?
final
hashCode int
The hash code for this object.
no setterinherited
includedRanges List<TreeSitterRange>
no setter
isDisposed bool
no setter
language TreeSitterLanguageTable?
no setter
lexedBytes int
no setter
parseActionCount int
no setter
phaseTimingsMicros Map<String, int>
final
reuseCursorVisitCount int
no setter
reusedBytes int
no setter
reusedNodeCount int
final
reuseRejections Map<String, int>
no setter
rootNode TreeSitterNode
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source String
final
sourceBytes Uint8List
Exact parser input bytes. Unlike source, this preserves malformed UTF-8 and is therefore authoritative for byte-ranged text providers.
final

Methods

changedRangesComparedTo(TreeSitterTree other) List<TreeSitterRange>
Compares this edited tree with other using Tree-sitter's structural changed-range algorithm. As upstream requires, call edit first so this tree's coordinates describe the same document as other.
copy() TreeSitterTree
dispose() → void
Releases this tree handle, matching ts_tree_delete.
edit(TreeSitterInputEdit edit) → void
Applies native Tree-sitter's endpoint transform to included ranges.
intoRaw() TreeSitterRawHandle<TreeSitterTree>
Moves this tree into a single-consumption raw handle.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rootNodeWithOffset(int byteOffset, TreeSitterPoint pointOffset, {int? utf16Offset}) TreeSitterNode
toDotGraph() String
toString() String
A string representation of this object.
inherited
walkCursor() TreeSitterTreeCursor
writeDotGraph(StringSink output) → void
Writes a Graphviz representation of the retained concrete syntax tree.

Operators

operator ==(Object other) bool
The equality operator.
inherited