TreeReuser class

AST subtree reuse utility

Refers to tree-sitter's tree reuse strategy: After an edit occurs, the top-level child nodes of the old AST are classified into three categories based on TextEdit:

  1. Prefix nodes: sourceRange is entirely before the edit start -> retained directly
  2. Dirty nodes: sourceRange overlaps with the edit region -> must be re-parsed
  3. Suffix nodes: sourceRange is entirely after the edit end -> reused after offset shift

Constructors

TreeReuser()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

partition(List<LatexNode> oldChildren, TextEdit edit) ReusePartition
Partitions the top-level child nodes of the old AST
shiftNodes(List<LatexNode> nodes, int delta) List<LatexNode>
Shifts the sourceRange of suffix nodes by the delta offset