TreeSitterHtmlRenderer class final

Converts Tree-sitter highlight events into a persistent HTML byte buffer.

Like upstream HtmlRenderer, instances are reusable: render appends to html, lineOffsets indexes the accumulated lines, and reset clears the output while retaining renderer configuration.

Constructors

TreeSitterHtmlRenderer()

Properties

hashCode int
The hash code for this object.
no setterinherited
html List<int>
Accumulated UTF-8 HTML bytes.
final
lineOffsets List<int>
Byte offsets of rendered line starts.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

lines() Iterable<String>
Returns views of the accumulated HTML split at lineOffsets.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render(Iterable<TreeSitterHighlightEvent> highlighter, List<int> source, TreeSitterHighlightAttributeCallback attributeCallback) → void
Appends a stream of native Tree-sitter highlight events to html.
renderRanges(String source, Iterable<TreeSitterHtmlHighlight> highlights, {String? carriageReturnScope = 'carriage-return'}) List<String>
Renders Flutter-friendly UTF-16 highlight ranges as Tree-sitter HTML.
reset() → void
Clears accumulated output and restores the initial line offset.
setCarriageReturnHighlight(TreeSitterHighlight? highlight) → void
Selects the highlight used for lone carriage returns.
toString() String
A string representation of this object.
inherited

Operators

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