src/vs/editor/browser/widget/diffEditorWidget.ts/DiffEditorWidget/_beginUpdateDecorations
class DiffEditorWidget:	private _beginUpdateDecorations(): void {
		if (this._beginUpdateDecorationsTimeout !== -1) {
			// Cancel any pending requests in case this method is called directly
			window.clearTimeout(this._beginUpdateDecorationsTimeout);
			this._beginUpdateDecorationsTimeout = -1;
		}
		const currentOriginalModel = this._originalEditor.getModel();
		const currentModifiedModel = this._modifiedEditor.getModel();
		if (!currentOriginalModel || !currentModifiedModel) {
			return;
		}

		// Prevent old diff requests to come if a new request has been initiated
		// The best method would be to call cancel on the Promise, but this is not
		// yet supported, so using tokens for now.
		this._diffComputationToken++;
		const currentToken = this._diffComputationToken;

		const diffLimit = this._options.maxFileSize * 1024 * 1024; // MB
		const canSyncModelForDiff = (model: ITextModel): boolean => {
			const bufferTextLength = model.getValueLength();
			return (diffLimit === 0 || bufferTextLength <= diffLimit);
		};

		if (!canSyncModelForDiff(currentOriginalModel) || !canSyncModelForDiff(currentModifiedModel)) {
			if (
				!DiffEditorWidget._equals(currentOriginalModel.uri, this._lastOriginalWarning)
				|| !DiffEditorWidget._equals(currentModifiedModel.uri, this._lastModifiedWarning)
			) {
				this._lastOriginalWarning = currentOriginalModel.uri;
				this._lastModifiedWarning = currentModifiedModel.uri;
				this._notificationService.warn(nls.localize("diff.tooLarge", "Cannot compare files because one file is too large."));
			}
			return;
		}

		this._setState(editorBrowser.DiffEditorState.ComputingDiff);
		this._documentDiffProvider.computeDiff(currentOriginalModel, currentModifiedModel, {
			ignoreTrimWhitespace: this._options.ignoreTrimWhitespace,
			maxComputationTimeMs: this._options.maxComputationTime,
		}).then(result => {
			if (currentToken === this._diffComputationToken
				&& currentOriginalModel === this._originalEditor.getModel()
				&& currentModifiedModel === this._modifiedEditor.getModel()
			) {
				this._setState(editorBrowser.DiffEditorState.DiffComputed);
				this._diffComputationResult = {
					identical: result.identical,
					quitEarly: result.quitEarly,
					changes: result.changes.map(m => {
						// TODO don't do this translation, but use the diff result directly
						let originalStartLineNumber: number;
						let originalEndLineNumber: number;
						let modifiedStartLineNumber: number;
						let modifiedEndLineNumber: number;
						let innerChanges = m.innerChanges;

						if (m.originalRange.isEmpty) {
							// Insertion
							originalStartLineNumber = m.originalRange.startLineNumber - 1;
							originalEndLineNumber = 0;
							innerChanges = undefined;
						} else {
							originalStartLineNumber = m.originalRange.startLineNumber;
							originalEndLineNumber = m.originalRange.endLineNumberExclusive - 1;
						}

						if (m.modifiedRange.isEmpty) {
							// Deletion
							modifiedStartLineNumber = m.modifiedRange.startLineNumber - 1;
							modifiedEndLineNumber = 0;
							innerChanges = undefined;
						} else {
							modifiedStartLineNumber = m.modifiedRange.startLineNumber;
							modifiedEndLineNumber = m.modifiedRange.endLineNumberExclusive - 1;
						}

						return {
							originalStartLineNumber,
							originalEndLineNumber,
							modifiedStartLineNumber,
							modifiedEndLineNumber,
							charChanges: innerChanges?.map(m => ({
								originalStartLineNumber: m.originalRange.startLineNumber,
								originalStartColumn: m.originalRange.startColumn,
								originalEndLineNumber: m.originalRange.endLineNumber,
								originalEndColumn: m.originalRange.endColumn,
								modifiedStartLineNumber: m.modifiedRange.startLineNumber,
								modifiedStartColumn: m.modifiedRange.startColumn,
								modifiedEndLineNumber: m.modifiedRange.endLineNumber,
								modifiedEndColumn: m.modifiedRange.endColumn,
							}))
						};
					})
				};
				this._updateDecorationsRunner.schedule();
				this._onDidUpdateDiff.fire();
			}
		}, (error) => {
			if (currentToken === this._diffComputationToken
				&& currentOriginalModel === this._originalEditor.getModel()
				&& currentModifiedModel === this._modifiedEditor.getModel()
			) {
				this._setState(editorBrowser.DiffEditorState.DiffComputed);
				this._diffComputationResult = null;
				this._updateDecorationsRunner.schedule();
			}
		});
	}