TreeSitterNode class final
Constructors
-
TreeSitterNode({required String kind, required int startByte, required int endByte, required TreeSitterUtf16Offset startOffset, required TreeSitterUtf16Offset endOffset, List<
TreeSitterNode> children = const [], bool isNamed = true, bool isMissing = false, bool isExtra = false, bool isError = false, bool isNull = false, int symbolId = 0, int? grammarSymbolId, String? grammarKind, TreeSitterLanguageTable? language, int parseState = 0, int paddingBytes = 0, bool hasChanges = false, List<String> fieldNames = const [], Set<String> supertypeKinds = const {}, Set<String> properties = const {}, Object? querySiblingGroup, Object? nodeIdentity, TreeSitterPoint? startPoint, TreeSitterPoint? endPoint}) -
const
-
TreeSitterNode.fromRaw(TreeSitterRawHandle<
TreeSitterNode> raw) -
Reconstructs a node value transferred through intoRaw.
factory
Properties
- byteRange → ({int end, int start})
-
no setter
- childCount → int
-
no setter
-
children
→ List<
TreeSitterNode> -
final
- debugString → String
-
Rust
Debugformatting for a node handle.no setter - descendantCount → int
-
Number of visible nodes in this subtree, including this node.
no setter
- endByte → int
-
no setter
- endOffset → TreeSitterUtf16Offset
-
no setter
- endPoint → TreeSitterPoint
-
no setter
-
fieldNames
→ List<
String> -
final
- grammarId → int
-
Alias-independent grammar symbol id.
no setter
- grammarName → String
-
Alias-independent grammar symbol name.
no setter
- hasChanges → bool
-
no setter
- hasError → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → int
-
Stable native-subtree identity. Reused subtrees retain this value across
incrementally produced trees, matching
Node::id.no setter - isError → bool
-
final
- isExtra → bool
-
final
- isMissing → bool
-
final
- isNamed → bool
-
final
- isNull → bool
-
final
- kind → String
-
final
- kindId → int
-
no setter
- language → TreeSitterLanguageTable?
-
Generated language table that produced this node.
no setter
- namedChildCount → int
-
no setter
-
namedChildren
→ Iterable<
TreeSitterNode> -
no setter
- nextNamedSibling → TreeSitterNode?
-
no setter
- nextParseState → int
-
Parse state reached after accepting this node's grammar symbol.
no setter
- nextSibling → TreeSitterNode?
-
no setter
- paddingBytes → int
-
final
- parent → TreeSitterNode?
-
no setter
- parseState → int
-
final
- previousNamedSibling → TreeSitterNode?
-
no setter
- previousSibling → TreeSitterNode?
-
no setter
-
properties
→ Set<
String> -
Query properties used by
#is?and#is-not?. Generated syntax trees leave this empty until a locals/property pass annotates them.final - range → TreeSitterRange
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startByte → int
-
no setter
- startOffset → TreeSitterUtf16Offset
-
no setter
- startPoint → TreeSitterPoint
-
no setter
-
supertypeKinds
→ Set<
String> -
Hidden grammar supertypes traversed between the nearest visible parent
and this node. Tree-sitter selectors such as
(expression/identifier)constrain the identifier through this contextual parse-tree metadata.final - symbolId → int
-
final
Methods
-
child(
int index) → TreeSitterNode? -
childByFieldId(
int fieldId) → TreeSitterNode? -
childByFieldName(
String name) → TreeSitterNode? -
childrenByFieldId(
int fieldId) → Iterable< TreeSitterNode> -
childrenByFieldName(
String name) → Iterable< TreeSitterNode> -
childWithDescendant(
TreeSitterNode descendant) → TreeSitterNode? -
descendantForByteRange(
int rangeStart, int rangeEnd) → TreeSitterNode -
descendantForPointRange(
TreeSitterPoint rangeStart, TreeSitterPoint rangeEnd) → TreeSitterNode -
edit(
TreeSitterInputEdit edit) → void - Applies Tree-sitter's native node endpoint transform to this node handle.
-
fieldNameForChild(
int index) → String? -
fieldNameForNamedChild(
int index) → String? -
firstChildForByte(
int byteOffset) → TreeSitterNode? -
firstNamedChildForByte(
int byteOffset) → TreeSitterNode? -
formattedSExpression(
int width) → String -
Rust
Node's alternate Display formatting. -
hasField(
String name) → bool -
intoRaw(
) → TreeSitterRawHandle< TreeSitterNode> - Returns the by-value raw node counterpart.
-
namedChild(
int index) → TreeSitterNode? -
namedDescendantForByteRange(
int rangeStart, int rangeEnd) → TreeSitterNode -
namedDescendantForPointRange(
TreeSitterPoint rangeStart, TreeSitterPoint rangeEnd) → TreeSitterNode -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sameNodeAs(
TreeSitterNode other) → bool -
C
ts_node_eq, which also requires both handles to belong to one tree. -
toSExpression(
) → String - Tree-sitter's parenthesized node representation.
-
toString(
) → String -
A string representation of this object.
override
-
utf16Text(
List< int> source) → List<int> -
utf8Text(
List< int> source) → String -
walk(
) → Iterable< TreeSitterNode> -
walkCursor(
) → TreeSitterTreeCursor
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- nullNode → const TreeSitterNode