diff --git a/src/vs/editor/common/diff/diffComputer.ts b/src/vs/editor/common/diff/diffComputer.ts index f9c02b3ee116074b160800e90cba6b33240b51c5..a1b88e19a4b09c14c8a800056a2c640246edb29d 100644 --- a/src/vs/editor/common/diff/diffComputer.ts +++ b/src/vs/editor/common/diff/diffComputer.ts @@ -34,24 +34,6 @@ class MarkerSequence implements ISequence { this.endMarkers = endMarkers; } - public equals(other: any): boolean { - if (!(other instanceof MarkerSequence)) { - return false; - } - const otherMarkerSequence = other; - if (this.getLength() !== otherMarkerSequence.getLength()) { - return false; - } - for (let i = 0, len = this.getLength(); i < len; i++) { - const myElement = this.getElementHash(i); - const otherElement = otherMarkerSequence.getElementHash(i); - if (myElement !== otherElement) { - return false; - } - } - return true; - } - public getLength(): number { return this.startMarkers.length; } @@ -321,7 +303,6 @@ class LineChange implements ILineChange { export interface IDiffComputerOpts { shouldPostProcessCharChanges: boolean; shouldIgnoreTrimWhitespace: boolean; - shouldConsiderTrimWhitespaceInEmptyCase: boolean; shouldMakePrettyDiff: boolean; } @@ -347,11 +328,6 @@ export class DiffComputer { this.modifiedLines = modifiedLines; this.original = new LineMarkerSequence(originalLines); this.modified = new LineMarkerSequence(modifiedLines); - - if (opts.shouldConsiderTrimWhitespaceInEmptyCase && this.shouldIgnoreTrimWhitespace && this.original.equals(this.modified)) { - // Diff would be empty with `shouldIgnoreTrimWhitespace` - this.shouldIgnoreTrimWhitespace = false; - } } public computeDiff(): ILineChange[] { diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts index 169df1f0de1ac1f2d6a7089d4d756831822519a0..155f97c34cf364866b0f36a25a50dc65c8bb3fb4 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts @@ -313,7 +313,6 @@ export abstract class BaseEditorSimpleWorker { let diffComputer = new DiffComputer(originalLines, modifiedLines, { shouldPostProcessCharChanges: true, shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldConsiderTrimWhitespaceInEmptyCase: true, shouldMakePrettyDiff: true }); return TPromise.as(diffComputer.computeDiff()); @@ -331,7 +330,6 @@ export abstract class BaseEditorSimpleWorker { let diffComputer = new DiffComputer(originalLines, modifiedLines, { shouldPostProcessCharChanges: false, shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldConsiderTrimWhitespaceInEmptyCase: false, shouldMakePrettyDiff: true }); return TPromise.as(diffComputer.computeDiff()); diff --git a/src/vs/editor/test/common/diff/diffComputer.test.ts b/src/vs/editor/test/common/diff/diffComputer.test.ts index 54ef2f3a86ed3a764ea924d71a475c4e8042697d..0d521de7eb852aae1710382a09f1f2b99864e452 100644 --- a/src/vs/editor/test/common/diff/diffComputer.test.ts +++ b/src/vs/editor/test/common/diff/diffComputer.test.ts @@ -55,7 +55,6 @@ function assertDiff(originalLines: string[], modifiedLines: string[], expectedCh var diffComputer = new DiffComputer(originalLines, modifiedLines, { shouldPostProcessCharChanges: shouldPostProcessCharChanges || false, shouldIgnoreTrimWhitespace: shouldIgnoreTrimWhitespace || false, - shouldConsiderTrimWhitespaceInEmptyCase: true, shouldMakePrettyDiff: true }); var changes = diffComputer.computeDiff();