applyBatch method

void applyBatch(
  1. TreeSitterEditBatch batch, {
  2. required int currentRevision,
})

Implementation

void applyBatch(TreeSitterEditBatch batch, {required int currentRevision}) {
  if (batch.baseRevision != currentRevision) {
    throw StateError(
      'Expected edit base revision $currentRevision, got '
      '${batch.baseRevision}',
    );
  }
  for (final edit in batch.edits) {
    applyEdit(edit);
  }
}