mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 01:00:29 -04:00
Merge from vscode 1ec43773e37997841c5af42b33ddb180e9735bf2
This commit is contained in:
@@ -142,16 +142,6 @@
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.vs .monaco-editor .settings-header-widget .title-container {
|
||||
color: #6f6f6f;
|
||||
}
|
||||
.vs-dark .monaco-editor .settings-header-widget .title-container {
|
||||
color: #bbbbbb;
|
||||
}
|
||||
.hc-black .monaco-editor .settings-header-widget .title-container {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.monaco-editor .settings-header-widget .title-container .title {
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
@@ -175,22 +165,12 @@
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.vs .monaco-editor .settings-group-title-widget .title-container {
|
||||
color: #6f6f6f;
|
||||
}
|
||||
|
||||
.monaco-editor .settings-group-title-widget .title-container .title {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-editor .settings-group-title-widget .title-container {
|
||||
color: #bbbbbb;
|
||||
}
|
||||
.hc-black .monaco-editor .settings-group-title-widget .title-container {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.monaco-editor.vs-dark .settings-group-title-widget .title-container.focused,
|
||||
.monaco-editor.vs .settings-group-title-widget .title-container.focused {
|
||||
outline: none !important;
|
||||
|
||||
@@ -64,6 +64,10 @@
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-header > .settings-header-controls .settings-target-container {
|
||||
flex: auto;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-header > .settings-header-controls .settings-tabs-widget .action-label {
|
||||
opacity: 0.9;
|
||||
}
|
||||
@@ -314,8 +318,19 @@
|
||||
}
|
||||
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-title .setting-item-overrides {
|
||||
opacity: 0.5;
|
||||
opacity: 0.9;
|
||||
font-style: italic;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-title .setting-item-ignored {
|
||||
opacity: 0.9;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-title .setting-item-ignored .codicon {
|
||||
vertical-align: text-top;
|
||||
padding-left: 1px;
|
||||
}
|
||||
|
||||
.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-title .setting-item-overrides a.modified-scope {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,233 +4,18 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import * as nls from 'vs/nls';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { PICK_WORKSPACE_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/workspaceCommands';
|
||||
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
|
||||
|
||||
export class OpenRawDefaultSettingsAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openRawDefaultSettings';
|
||||
static readonly LABEL = nls.localize('openRawDefaultSettings', "Open Default Settings (JSON)");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openRawDefaultSettings();
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenSettings2Action extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openSettings2';
|
||||
static readonly LABEL = nls.localize('openSettings2', "Open Settings (UI)");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openSettings(false, undefined);
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenSettingsJsonAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openSettingsJson';
|
||||
static readonly LABEL = nls.localize('openSettingsJson', "Open Settings (JSON)");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openSettings(true, undefined);
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenGlobalSettingsAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openGlobalSettings';
|
||||
static readonly LABEL = nls.localize('openGlobalSettings', "Open User Settings");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService,
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openGlobalSettings();
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenRemoteSettingsAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openRemoteSettings';
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService,
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openRemoteSettings();
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenGlobalKeybindingsAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openGlobalKeybindings';
|
||||
static readonly LABEL = nls.localize('openGlobalKeybindings', "Open Keyboard Shortcuts");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openGlobalKeybindingSettings(false);
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenGlobalKeybindingsFileAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openGlobalKeybindingsFile';
|
||||
static readonly LABEL = nls.localize('openGlobalKeybindingsFile', "Open Keyboard Shortcuts (JSON)");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openGlobalKeybindingSettings(true);
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenDefaultKeybindingsFileAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openDefaultKeybindingsFile';
|
||||
static readonly LABEL = nls.localize('openDefaultKeybindingsFile', "Open Default Keyboard Shortcuts (JSON)");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openDefaultKeybindingsFile();
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenWorkspaceSettingsAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openWorkspaceSettings';
|
||||
static readonly LABEL = nls.localize('openWorkspaceSettings', "Open Workspace Settings");
|
||||
|
||||
private readonly disposables = new DisposableStore();
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService,
|
||||
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
|
||||
) {
|
||||
super(id, label);
|
||||
this.update();
|
||||
this.disposables.add(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
this.enabled = this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY;
|
||||
}
|
||||
|
||||
run(event?: any): Promise<any> {
|
||||
return this.preferencesService.openWorkspaceSettings();
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.disposables.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export const OPEN_FOLDER_SETTINGS_COMMAND = '_workbench.action.openFolderSettings';
|
||||
export const OPEN_FOLDER_SETTINGS_LABEL = nls.localize('openFolderSettings', "Open Folder Settings");
|
||||
export class OpenFolderSettingsAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.openFolderSettings';
|
||||
static readonly LABEL = OPEN_FOLDER_SETTINGS_LABEL;
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
|
||||
@IPreferencesService private readonly preferencesService: IPreferencesService,
|
||||
@ICommandService private readonly commandService: ICommandService,
|
||||
) {
|
||||
super(id, label);
|
||||
this.update();
|
||||
this._register(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
this._register(this.workspaceContextService.onDidChangeWorkspaceFolders(() => this.update(), this));
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
this.enabled = this.workspaceContextService.getWorkbenchState() === WorkbenchState.WORKSPACE && this.workspaceContextService.getWorkspace().folders.length > 0;
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
return this.commandService.executeCommand<IWorkspaceFolder>(PICK_WORKSPACE_FOLDER_COMMAND_ID)
|
||||
.then(workspaceFolder => {
|
||||
if (workspaceFolder) {
|
||||
return this.preferencesService.openFolderSettings(workspaceFolder.uri);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class ConfigureLanguageBasedSettingsAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.configureLanguageBasedSettings';
|
||||
static readonly LABEL = nls.localize('configureLanguageBasedSettings', "Configure Language Specific Settings...");
|
||||
static readonly LABEL = { value: nls.localize('configureLanguageBasedSettings', "Configure Language Specific Settings..."), original: 'Configure Language Specific Settings...' };
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
|
||||
@@ -6,34 +6,41 @@
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { Button } from 'vs/base/browser/ui/button/button';
|
||||
import { ITreeElement } from 'vs/base/browser/ui/tree/tree';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import { Delayer, ThrottledDelayer, timeout } from 'vs/base/common/async';
|
||||
import { Delayer, ThrottledDelayer, timeout, IntervalTimer } from 'vs/base/common/async';
|
||||
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import * as collections from 'vs/base/common/collections';
|
||||
import { getErrorMessage, isPromiseCanceledError } from 'vs/base/common/errors';
|
||||
import { Iterator } from 'vs/base/common/iterator';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { isArray, withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import 'vs/css!./media/settingsEditor2';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { ConfigurationTarget, IConfigurationOverrides, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IEditorModel } from 'vs/platform/editor/common/editor';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { badgeBackground, badgeForeground, contrastBorder, editorForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { attachStylerCallback } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
|
||||
import { getUserDataSyncStore, IUserDataSyncService, SyncStatus, IUserDataSyncEnablementService } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { IEditorPane, IEditorMemento } from 'vs/workbench/common/editor';
|
||||
import { IEditorMemento, IEditorPane } from 'vs/workbench/common/editor';
|
||||
import { attachSuggestEnabledInputBoxStyler, SuggestEnabledInput } from 'vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput';
|
||||
import { SettingsTarget, SettingsTargetsWidget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets';
|
||||
// {{SQL CARBON EDIT}}
|
||||
@@ -49,8 +56,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor
|
||||
import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEditorOptions, SettingsEditorOptions, SettingValueType } from 'vs/workbench/services/preferences/common/preferences';
|
||||
import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput';
|
||||
import { Settings2EditorModel } from 'vs/workbench/services/preferences/common/preferencesModels';
|
||||
import { IEditorModel } from 'vs/platform/editor/common/editor';
|
||||
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
|
||||
import { fromNow } from 'vs/base/common/date';
|
||||
|
||||
function createGroupIterator(group: SettingsTreeGroupElement): Iterator<ITreeElement<SettingsTreeGroupChild>> {
|
||||
const groupsIt = Iterator.fromArray(group.children);
|
||||
@@ -164,6 +170,7 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
@IEditorGroupsService protected editorGroupService: IEditorGroupsService,
|
||||
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
||||
@IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
) {
|
||||
super(SettingsEditor2.ID, telemetryService, themeService, storageService);
|
||||
this.delayedFilterLogging = new Delayer<void>(1000);
|
||||
@@ -462,6 +469,10 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
this.settingsTargetsWidget.settingsTarget = ConfigurationTarget.USER_LOCAL;
|
||||
this.settingsTargetsWidget.onDidTargetChange(target => this.onDidSettingsTargetChange(target));
|
||||
|
||||
if (syncAllowed(this.productService, this.configurationService)) {
|
||||
this._register(this.instantiationService.createInstance(SyncControls, headerControlsContainer));
|
||||
}
|
||||
|
||||
this.controlsElement = DOM.append(searchContainer, DOM.$('.settings-clear-widget'));
|
||||
|
||||
const actionBar = this._register(new ActionBar(this.controlsElement, {
|
||||
@@ -1379,7 +1390,80 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
}
|
||||
}
|
||||
|
||||
class SyncControls extends Disposable {
|
||||
private readonly lastSyncedLabel!: HTMLElement;
|
||||
private readonly turnOnSyncButton!: Button;
|
||||
|
||||
constructor(
|
||||
container: HTMLElement,
|
||||
@ICommandService private readonly commandService: ICommandService,
|
||||
@IUserDataSyncService private readonly userDataSyncService: IUserDataSyncService,
|
||||
@IUserDataSyncEnablementService private readonly userDataSyncEnablementService: IUserDataSyncEnablementService
|
||||
) {
|
||||
super();
|
||||
|
||||
const headerRightControlsContainer = DOM.append(container, $('.settings-right-controls'));
|
||||
const turnOnSyncButtonContainer = DOM.append(headerRightControlsContainer, $('.turn-on-sync'));
|
||||
this.turnOnSyncButton = this._register(new Button(turnOnSyncButtonContainer, { title: true }));
|
||||
this.lastSyncedLabel = DOM.append(headerRightControlsContainer, $('.last-synced-label'));
|
||||
DOM.hide(this.lastSyncedLabel);
|
||||
|
||||
this.turnOnSyncButton.enabled = true;
|
||||
this.turnOnSyncButton.label = localize('turnOnSyncButton', "Turn on Preferences Sync");
|
||||
DOM.hide(this.turnOnSyncButton.element);
|
||||
|
||||
this._register(this.turnOnSyncButton.onDidClick(async () => {
|
||||
await this.commandService.executeCommand('workbench.userData.actions.syncStart');
|
||||
}));
|
||||
|
||||
this.updateLastSyncedTime();
|
||||
this._register(this.userDataSyncService.onDidChangeLastSyncTime(() => {
|
||||
this.updateLastSyncedTime();
|
||||
}));
|
||||
|
||||
const updateLastSyncedTimer = this._register(new IntervalTimer());
|
||||
updateLastSyncedTimer.cancelAndSet(() => this.updateLastSyncedTime(), 60 * 1000);
|
||||
|
||||
this.update();
|
||||
this._register(this.userDataSyncService.onDidChangeStatus(() => {
|
||||
this.update();
|
||||
}));
|
||||
|
||||
this._register(this.userDataSyncEnablementService.onDidChangeEnablement(() => {
|
||||
this.update();
|
||||
}));
|
||||
}
|
||||
|
||||
private updateLastSyncedTime(): void {
|
||||
const last = this.userDataSyncService.lastSyncTime;
|
||||
if (typeof last === 'number') {
|
||||
const d = fromNow(last, true);
|
||||
this.lastSyncedLabel.textContent = localize('lastSyncedLabel', "Last synced: {0}", d);
|
||||
} else {
|
||||
this.lastSyncedLabel.textContent = '';
|
||||
}
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
if (this.userDataSyncService.status === SyncStatus.Uninitialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.userDataSyncEnablementService.isEnabled()) {
|
||||
DOM.show(this.lastSyncedLabel);
|
||||
DOM.hide(this.turnOnSyncButton.element);
|
||||
} else {
|
||||
DOM.hide(this.lastSyncedLabel);
|
||||
DOM.show(this.turnOnSyncButton.element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ISettingsEditor2State {
|
||||
searchQuery: string;
|
||||
target: SettingsTarget;
|
||||
}
|
||||
|
||||
function syncAllowed(productService: IProductService, configService: IConfigurationService): boolean {
|
||||
return !!getUserDataSyncStore(productService, configService);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import { SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { ISetting, ISettingsGroup, SettingValueType } from 'vs/workbench/services/preferences/common/preferences';
|
||||
import { IUserDataSyncEnablementService, getDefaultIgnoredSettings } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { CodiconLabel } from 'vs/base/browser/ui/codiconLabel/codiconLabel';
|
||||
|
||||
const $ = DOM.$;
|
||||
|
||||
@@ -204,6 +205,7 @@ interface ISettingItemTemplate<T = any> extends IDisposableTemplate {
|
||||
controlElement: HTMLElement;
|
||||
deprecationWarningElement: HTMLElement;
|
||||
otherOverridesElement: HTMLElement;
|
||||
syncIgnoredElement: HTMLElement;
|
||||
toolbar: ToolBar;
|
||||
elementDisposables: IDisposable[];
|
||||
}
|
||||
@@ -300,6 +302,10 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
|
||||
private readonly _onDidFocusSetting = this._register(new Emitter<SettingsTreeSettingElement>());
|
||||
readonly onDidFocusSetting: Event<SettingsTreeSettingElement> = this._onDidFocusSetting.event;
|
||||
|
||||
private ignoredSettings: string[];
|
||||
private readonly _onDidChangeIgnoredSettings = this._register(new Emitter<void>());
|
||||
readonly onDidChangeIgnoredSettings: Event<void> = this._onDidChangeIgnoredSettings.event;
|
||||
|
||||
// Put common injections back here
|
||||
constructor(
|
||||
private readonly settingActions: IAction[],
|
||||
@@ -311,8 +317,17 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
|
||||
@ICommandService protected readonly _commandService: ICommandService,
|
||||
@IContextMenuService protected readonly _contextMenuService: IContextMenuService,
|
||||
@IKeybindingService protected readonly _keybindingService: IKeybindingService,
|
||||
@IConfigurationService protected readonly _configService: IConfigurationService,
|
||||
) {
|
||||
super();
|
||||
|
||||
this.ignoredSettings = getIgnoredSettings(getDefaultIgnoredSettings(), this._configService);
|
||||
this._register(this._configService.onDidChangeConfiguration(e => {
|
||||
if (e.affectedKeys.includes('sync.ignoredSettings')) {
|
||||
this.ignoredSettings = getIgnoredSettings(getDefaultIgnoredSettings(), this._configService);
|
||||
this._onDidChangeIgnoredSettings.fire();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
renderTemplate(container: HTMLElement): any {
|
||||
@@ -323,6 +338,14 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
|
||||
throw new Error('to override');
|
||||
}
|
||||
|
||||
protected createSyncIgnoredElement(container: HTMLElement): HTMLElement {
|
||||
const syncIgnoredElement = DOM.append(container, $('span.setting-item-ignored'));
|
||||
const syncIgnoredLabel = new CodiconLabel(syncIgnoredElement);
|
||||
syncIgnoredLabel.text = `($(eye-closed) ${localize('extensionSyncIgnoredLabel', 'Sync: Ignored')})`;
|
||||
|
||||
return syncIgnoredElement;
|
||||
}
|
||||
|
||||
protected renderCommonTemplate(tree: any, _container: HTMLElement, typeClass: string): ISettingItemTemplate {
|
||||
DOM.addClass(_container, 'setting-item');
|
||||
DOM.addClass(_container, 'setting-item-' + typeClass);
|
||||
@@ -333,6 +356,8 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
|
||||
const categoryElement = DOM.append(labelCategoryContainer, $('span.setting-item-category'));
|
||||
const labelElement = DOM.append(labelCategoryContainer, $('span.setting-item-label'));
|
||||
const otherOverridesElement = DOM.append(titleElement, $('span.setting-item-overrides'));
|
||||
const syncIgnoredElement = this.createSyncIgnoredElement(titleElement);
|
||||
|
||||
const descriptionElement = DOM.append(container, $('.setting-item-description'));
|
||||
const modifiedIndicatorElement = DOM.append(container, $('.setting-item-modified-indicator'));
|
||||
modifiedIndicatorElement.title = localize('modified', "Modified");
|
||||
@@ -358,6 +383,7 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
|
||||
controlElement,
|
||||
deprecationWarningElement,
|
||||
otherOverridesElement,
|
||||
syncIgnoredElement,
|
||||
toolbar
|
||||
};
|
||||
|
||||
@@ -447,8 +473,10 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
|
||||
template.descriptionElement.id = baseId + '_setting_description';
|
||||
|
||||
template.otherOverridesElement.innerHTML = '';
|
||||
|
||||
template.otherOverridesElement.style.display = 'none';
|
||||
if (element.overriddenScopeList.length) {
|
||||
template.otherOverridesElement.style.display = 'inline';
|
||||
|
||||
const otherOverridesLabel = element.isConfigured ?
|
||||
localize('alsoConfiguredIn', "Also modified in") :
|
||||
localize('configuredIn', "Modified in");
|
||||
@@ -482,6 +510,14 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
|
||||
DOM.toggleClass(template.containerElement, 'is-deprecated', !!deprecationText);
|
||||
|
||||
this.renderValue(element, <ISettingItemTemplate>template, onChange);
|
||||
|
||||
const update = () => {
|
||||
template.syncIgnoredElement.style.display = this.ignoredSettings.includes(element.setting.key) ? 'inline' : 'none';
|
||||
};
|
||||
update();
|
||||
template.elementDisposables.push(this.onDidChangeIgnoredSettings(() => {
|
||||
update();
|
||||
}));
|
||||
}
|
||||
|
||||
private renderDescriptionMarkdown(element: SettingsTreeSettingElement, text: string, disposeables: DisposableStore): HTMLElement {
|
||||
@@ -1085,6 +1121,7 @@ export class SettingBoolRenderer extends AbstractSettingRenderer implements ITre
|
||||
const categoryElement = DOM.append(titleElement, $('span.setting-item-category'));
|
||||
const labelElement = DOM.append(titleElement, $('span.setting-item-label'));
|
||||
const otherOverridesElement = DOM.append(titleElement, $('span.setting-item-overrides'));
|
||||
const syncIgnoredElement = this.createSyncIgnoredElement(titleElement);
|
||||
|
||||
const descriptionAndValueElement = DOM.append(container, $('.setting-item-value-description'));
|
||||
const controlElement = DOM.append(descriptionAndValueElement, $('.setting-item-bool-control'));
|
||||
@@ -1138,6 +1175,7 @@ export class SettingBoolRenderer extends AbstractSettingRenderer implements ITre
|
||||
descriptionElement,
|
||||
deprecationWarningElement,
|
||||
otherOverridesElement,
|
||||
syncIgnoredElement,
|
||||
toolbar
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user