tokenize method

bool tokenize({
  1. Duration? budget,
})

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.

Implementation

bool tokenize({Duration? budget}) {
  final clock = Stopwatch()..start();
  for (final (_, highlighted) in _highlights.values) {
    if (highlighted.isComplete) continue;
    final left = HighlightedDiff._left(budget, clock);
    if (!highlighted.tokenize(budget: left)) return false;
  }
  return true;
}