Skip to content

Commit 272fdf6

Browse files
committed
Diff Editor: Disables optimistic diff updates. Fixes microsoft#190748, Fixes microsoft#190232
1 parent 8470c9b commit 272fdf6

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/vs/editor/browser/widget/diffEditorWidget2/diffEditorViewModel.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { RunOnceScheduler } from 'vs/base/common/async';
7+
import { CancellationTokenSource } from 'vs/base/common/cancellation';
78
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
89
import { IObservable, IReader, ISettableObservable, ITransaction, autorunWithStore, derived, observableSignal, observableSignalFromEvent, observableValue, transaction, waitForState } from 'vs/base/common/observable';
9-
import { isDefined } from 'vs/base/common/types';
10+
import { readHotReloadableExport } from 'vs/editor/browser/widget/diffEditorWidget2/utils';
1011
import { ISerializedLineRange, LineRange } from 'vs/editor/common/core/lineRange';
1112
import { Range } from 'vs/editor/common/core/range';
12-
import { IDocumentDiff, IDocumentDiffProvider } from 'vs/editor/common/diff/documentDiffProvider';
13-
import { LineRangeMapping, MovedText, RangeMapping, SimpleLineRangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
1413
import { AdvancedLinesDiffComputer, lineRangeMappingFromRangeMappings } from 'vs/editor/common/diff/advancedLinesDiffComputer';
14+
import { IDocumentDiff, IDocumentDiffProvider } from 'vs/editor/common/diff/documentDiffProvider';
15+
import { LineRangeMapping, MovedText, RangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
1516
import { IDiffEditorModel, IDiffEditorViewModel } from 'vs/editor/common/editorCommon';
1617
import { ITextModel } from 'vs/editor/common/model';
1718
import { TextEditInfo } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/beforeEditPositionMapper';
1819
import { combineTextEditInfos } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/combineTextEditInfos';
1920
import { lengthAdd, lengthDiffNonNegative, lengthGetLineCount, lengthOfRange, lengthToPosition, lengthZero, positionToLength } from 'vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length';
2021
import { DiffEditorOptions } from './diffEditorOptions';
21-
import { readHotReloadableExport } from 'vs/editor/browser/widget/diffEditorWidget2/utils';
22-
import { CancellationTokenSource } from 'vs/base/common/cancellation';
2322

2423
export class DiffEditorViewModel extends Disposable implements IDiffEditorViewModel {
2524
private readonly _isDiffUpToDate = observableValue<boolean>('isDiffUpToDate', false);
@@ -469,6 +468,9 @@ export class UnchangedRegion {
469468
}
470469

471470
function applyOriginalEdits(diff: IDocumentDiff, textEdits: TextEditInfo[], originalTextModel: ITextModel, modifiedTextModel: ITextModel): IDocumentDiff | undefined {
471+
return undefined;
472+
/*
473+
TODO@hediet
472474
if (textEdits.length === 0) {
473475
return diff;
474476
}
@@ -478,7 +480,7 @@ function applyOriginalEdits(diff: IDocumentDiff, textEdits: TextEditInfo[], orig
478480
if (!diff3) {
479481
return undefined;
480482
}
481-
return flip(diff3);
483+
return flip(diff3);*/
482484
}
483485

484486
function flip(diff: IDocumentDiff): IDocumentDiff {
@@ -491,6 +493,9 @@ function flip(diff: IDocumentDiff): IDocumentDiff {
491493
}
492494

493495
function applyModifiedEdits(diff: IDocumentDiff, textEdits: TextEditInfo[], originalTextModel: ITextModel, modifiedTextModel: ITextModel): IDocumentDiff | undefined {
496+
return undefined;
497+
/*
498+
TODO@hediet
494499
if (textEdits.length === 0) {
495500
return diff;
496501
}
@@ -514,7 +519,7 @@ function applyModifiedEdits(diff: IDocumentDiff, textEdits: TextEditInfo[], orig
514519
quitEarly: false,
515520
changes,
516521
moves,
517-
};
522+
};*/
518523
}
519524

520525
function applyEditToLineRange(range: LineRange, textEdits: TextEditInfo[]): LineRange | undefined {

0 commit comments

Comments
 (0)