mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 01:25:37 -05:00
Fix schema compare not always showing diff color highlighting (#21413)
* Fix schema compare not always showing diff color highlighting * move helper functions into diffEditorWidget.ts
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ILineChange } from 'vs/editor/common/diff/diffComputer';
|
||||
|
||||
/**
|
||||
* Swaps the original and modified line changes
|
||||
* @param lineChanges The line changes to be reversed
|
||||
*/
|
||||
export function reverseLineChanges(lineChanges: ILineChange[]): ILineChange[] {
|
||||
let reversedLineChanges = lineChanges.map(linechange => {
|
||||
return {
|
||||
modifiedStartLineNumber: linechange.originalStartLineNumber,
|
||||
modifiedEndLineNumber: linechange.originalEndLineNumber,
|
||||
originalStartLineNumber: linechange.modifiedStartLineNumber,
|
||||
originalEndLineNumber: linechange.modifiedEndLineNumber,
|
||||
charChanges: (linechange.charChanges) ?
|
||||
linechange.charChanges.map(charchange => {
|
||||
return {
|
||||
originalStartColumn: charchange.modifiedStartColumn,
|
||||
originalEndColumn: charchange.modifiedEndColumn,
|
||||
modifiedStartColumn: charchange.originalStartColumn,
|
||||
modifiedEndColumn: charchange.originalEndColumn,
|
||||
modifiedStartLineNumber: charchange.originalStartLineNumber,
|
||||
modifiedEndLineNumber: charchange.originalEndLineNumber,
|
||||
originalStartLineNumber: charchange.modifiedStartLineNumber,
|
||||
originalEndLineNumber: charchange.modifiedEndLineNumber,
|
||||
};
|
||||
}) : undefined
|
||||
};
|
||||
});
|
||||
return reversedLineChanges;
|
||||
}
|
||||
Reference in New Issue
Block a user