DiffHighlightCache class final

The highlighting and word changes a diff view needs per file, computed the first time a file is asked for.

A file is highlighted again when its grammar changes, as after Highlighter.addLanguage. Create a new cache when the highlighter, theme or language changes. Files are matched by identity.

Constructors

DiffHighlightCache({required Highlighter highlighter, required SyntaxTheme theme, String? language, InlineDiffMode inlineDiffMode = InlineDiffMode.mergedWords})
A cache that highlights with highlighter in theme, in language or the language of each file's path.

Properties

hashCode → int
The hash code for this object.
no setterinherited
highlighter → Highlighter
Provides the grammars.
final
inlineDiffMode → InlineDiffMode
Inline comparison used by all consumers of this cache.
final
language → String?
The language of every file, or null to guess from each path.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
theme → SyntaxTheme
Provides the colors.
final

Methods

highlighted(FileDiff file, {Duration? budget}) → HighlightedDiff
file's highlighting.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
segmentsFor(FileDiff file, DiffLine line) → List<DiffSegment>
line of file as styled segments, with its changed words marked.
tokenize({Duration? budget}) → bool
Continues highlighting the files highlighted left unfinished, in the order they were first asked for, for at most budget. Returns whether every file is finished.
toString() → String
A string representation of this object.
inherited
words(FileDiff file) → WordChanges
file's changed words.

Operators

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