src/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits.ts/BulkCellEdits/apply
class BulkCellEdits:	async apply(): Promise<void> {

		const editsByNotebook = groupBy(this._edits, (a, b) => compare(a.resource.toString(), b.resource.toString()));

		for (let group of editsByNotebook) {
			if (this._token.isCancellationRequested) {
				break;
			}
			const [first] = group;
			const ref = await this._notebookModelService.resolve(first.resource);

			// check state
			if (typeof first.versionId === 'number' && ref.object.notebook.versionId !== first.versionId) {
				ref.dispose();
				throw new Error(`Notebook '${first.resource}' has changed in the meantime`);
			}

			// apply edits
			const edits = group.map(entry => entry.cellEdit);
			ref.object.notebook.applyEdits(edits, true, undefined, () => undefined, this._undoRedoGroup);
			ref.dispose();

			this._progress.report(undefined);
		}
	}