Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3

This commit is contained in:
ADS Merger
2020-03-11 04:19:23 +00:00
parent 16fab722d5
commit 4c3e48773d
880 changed files with 20441 additions and 11232 deletions

View File

@@ -39,8 +39,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { defaultInsertColor, defaultRemoveColor, diffBorder, diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, scrollbarShadow, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground } from 'vs/platform/theme/common/colorRegistry';
import { ITheme, IThemeService, getThemeTypeSelector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { reverseLineChanges } from 'sql/editor/browser/diffEditorHelper'; // {{SQL CARBON EDIT}}
import { IColorTheme, IThemeService, getThemeTypeSelector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IDiffLinesChange, InlineDiffMargin } from 'vs/editor/browser/widget/inlineDiffMargin';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
@@ -49,6 +48,7 @@ import { EditorExtensionsRegistry, IDiffEditorContributionDescription } from 'vs
import { onUnexpectedError } from 'vs/base/common/errors';
import { IEditorProgressService, IProgressRunner } from 'vs/platform/progress/common/progress';
import { ElementSizeObserver } from 'vs/editor/browser/config/elementSizeObserver';
import { reverseLineChanges } from 'sql/editor/browser/diffEditorHelper';
interface IEditorDiffDecorations {
decorations: IModelDeltaDecoration[];
@@ -73,7 +73,7 @@ interface IDiffEditorWidgetStyle {
// {{SQL CARBON EDIT}}
getEditorsDiffDecorations(lineChanges: editorCommon.ILineChange[], ignoreTrimWhitespace: boolean, renderIndicators: boolean, originalWhitespaces: IEditorWhitespace[], modifiedWhitespaces: IEditorWhitespace[], originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor, reverse?: boolean): IEditorsDiffDecorationsWithZones;
setEnableSplitViewResizing(enableSplitViewResizing: boolean): void;
applyColors(theme: ITheme): boolean;
applyColors(theme: IColorTheme): boolean;
layout(): number;
dispose(): void;
}
@@ -283,7 +283,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this._updateDecorationsRunner = this._register(new RunOnceScheduler(() => this._updateDecorations(), 0));
this._containerDomElement = document.createElement('div');
this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getTheme(), this._renderSideBySide);
this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._renderSideBySide);
this._containerDomElement.style.position = 'relative';
this._containerDomElement.style.height = '100%';
this._domElement.appendChild(this._containerDomElement);
@@ -373,11 +373,11 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this._setStrategy(new DiffEditorWidgetInline(this._createDataSource(), this._enableSplitViewResizing));
}
this._register(themeService.onThemeChange(t => {
this._register(themeService.onDidColorThemeChange(t => {
if (this._strategy && this._strategy.applyColors(t)) {
this._updateDecorationsRunner.schedule();
}
this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getTheme(), this._renderSideBySide);
this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._renderSideBySide);
}));
const contributions: IDiffEditorContributionDescription[] = EditorExtensionsRegistry.getDiffEditorContributions();
@@ -436,7 +436,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this._reviewPane.prev();
}
private static _getClassName(theme: ITheme, renderSideBySide: boolean): string {
private static _getClassName(theme: IColorTheme, renderSideBySide: boolean): string {
let result = 'monaco-diff-editor monaco-editor-background ';
if (renderSideBySide) {
result += 'side-by-side ';
@@ -679,7 +679,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this._setStrategy(new DiffEditorWidgetInline(this._createDataSource(), this._enableSplitViewResizing));
}
// Update class name
this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getTheme(), this._renderSideBySide);
this._containerDomElement.className = DiffEditorWidget._getClassName(this._themeService.getColorTheme(), this._renderSideBySide);
}
}
@@ -1178,7 +1178,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
}
this._strategy = newStrategy;
newStrategy.applyColors(this._themeService.getTheme());
newStrategy.applyColors(this._themeService.getColorTheme());
if (this._diffComputationResult) {
this._updateDecorations();
@@ -1302,7 +1302,7 @@ abstract class DiffEditorWidgetStyle extends Disposable implements IDiffEditorWi
this._removeColor = null;
}
public applyColors(theme: ITheme): boolean {
public applyColors(theme: IColorTheme): boolean {
let newInsertColor = (theme.getColor(diffInserted) || defaultInsertColor).transparent(2);
let newRemoveColor = (theme.getColor(diffRemoved) || defaultRemoveColor).transparent(2);
let hasChanges = !newInsertColor.equals(this._insertColor) || !newRemoveColor.equals(this._removeColor);