mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 09:10:30 -04:00
Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3
This commit is contained in:
@@ -23,14 +23,14 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { IKeybindingService, IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { DefineKeybindingWidget, KeybindingsSearchWidget, KeybindingsSearchOptions } from 'vs/workbench/contrib/preferences/browser/keybindingWidgets';
|
||||
import {
|
||||
IKeybindingsEditor, CONTEXT_KEYBINDING_FOCUS, CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_COPY,
|
||||
IKeybindingsEditorPane, CONTEXT_KEYBINDING_FOCUS, CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_COPY,
|
||||
KEYBINDINGS_EDITOR_COMMAND_RESET, KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, KEYBINDINGS_EDITOR_COMMAND_DEFINE, KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR,
|
||||
KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS, KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE, KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, KEYBINDINGS_EDITOR_COMMAND_DEFINE_WHEN
|
||||
} from 'vs/workbench/contrib/preferences/common/preferences';
|
||||
import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IKeybindingEditingService } from 'vs/workbench/services/keybinding/common/keybindingEditing';
|
||||
import { IListVirtualDelegate, IListRenderer, IListContextMenuEvent, IListEvent } from 'vs/base/browser/ui/list/list';
|
||||
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { IContextKeyService, IContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode, ResolvedKeybinding } from 'vs/base/common/keyCodes';
|
||||
@@ -55,7 +55,7 @@ interface ColumnItem {
|
||||
width: number;
|
||||
}
|
||||
|
||||
export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor {
|
||||
export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditorPane {
|
||||
|
||||
static readonly ID: string = 'workbench.editor.keybindings';
|
||||
|
||||
@@ -463,7 +463,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
||||
}
|
||||
})) as WorkbenchList<IListEntry>;
|
||||
this._register(this.keybindingsList.onContextMenu(e => this.onContextMenu(e)));
|
||||
this._register(this.keybindingsList.onFocusChange(e => this.onFocusChange(e)));
|
||||
this._register(this.keybindingsList.onDidChangeFocus(e => this.onFocusChange(e)));
|
||||
this._register(this.keybindingsList.onDidFocus(() => {
|
||||
DOM.addClass(this.keybindingsList.getHTMLElement(), 'focused');
|
||||
}));
|
||||
@@ -551,7 +551,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
||||
this.unAssignedKeybindingItemToRevealAndFocus = null;
|
||||
} else if (currentSelectedIndex !== -1 && currentSelectedIndex < this.listEntries.length) {
|
||||
this.selectEntry(currentSelectedIndex, preserveFocus);
|
||||
} else if (this.editorService.activeControl === this && !preserveFocus) {
|
||||
} else if (this.editorService.activeEditorPane === this && !preserveFocus) {
|
||||
this.focus();
|
||||
}
|
||||
}
|
||||
@@ -854,7 +854,7 @@ abstract class Column extends Disposable {
|
||||
abstract readonly element: HTMLElement;
|
||||
abstract render(keybindingItemEntry: IKeybindingItemEntry): void;
|
||||
|
||||
constructor(protected keybindingsEditor: IKeybindingsEditor) {
|
||||
constructor(protected keybindingsEditor: IKeybindingsEditorPane) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -867,7 +867,7 @@ class ActionsColumn extends Column {
|
||||
|
||||
constructor(
|
||||
parent: HTMLElement,
|
||||
keybindingsEditor: IKeybindingsEditor,
|
||||
keybindingsEditor: IKeybindingsEditorPane,
|
||||
@IKeybindingService private keybindingsService: IKeybindingService
|
||||
) {
|
||||
super(keybindingsEditor);
|
||||
@@ -921,7 +921,7 @@ class CommandColumn extends Column {
|
||||
|
||||
constructor(
|
||||
parent: HTMLElement,
|
||||
keybindingsEditor: IKeybindingsEditor,
|
||||
keybindingsEditor: IKeybindingsEditorPane,
|
||||
) {
|
||||
super(keybindingsEditor);
|
||||
this.element = this.commandColumn = DOM.append(parent, $('.column.command', { id: 'command_' + ++Column.COUNTER }));
|
||||
@@ -953,7 +953,7 @@ class CommandColumn extends Column {
|
||||
}
|
||||
|
||||
private getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string {
|
||||
return localize('commandAriaLabel', "Command is {0}.", keybindingItemEntry.keybindingItem.commandLabel ? keybindingItemEntry.keybindingItem.commandLabel : keybindingItemEntry.keybindingItem.command);
|
||||
return keybindingItemEntry.keybindingItem.commandLabel ? keybindingItemEntry.keybindingItem.commandLabel : keybindingItemEntry.keybindingItem.command;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -964,7 +964,7 @@ class KeybindingColumn extends Column {
|
||||
|
||||
constructor(
|
||||
parent: HTMLElement,
|
||||
keybindingsEditor: IKeybindingsEditor,
|
||||
keybindingsEditor: IKeybindingsEditorPane,
|
||||
) {
|
||||
super(keybindingsEditor);
|
||||
|
||||
@@ -992,7 +992,7 @@ class SourceColumn extends Column {
|
||||
|
||||
constructor(
|
||||
parent: HTMLElement,
|
||||
keybindingsEditor: IKeybindingsEditor,
|
||||
keybindingsEditor: IKeybindingsEditorPane,
|
||||
) {
|
||||
super(keybindingsEditor);
|
||||
this.element = this.sourceColumn = DOM.append(parent, $('.column.source', { id: 'source_' + ++Column.COUNTER }));
|
||||
@@ -1024,7 +1024,7 @@ class WhenColumn extends Column {
|
||||
|
||||
constructor(
|
||||
parent: HTMLElement,
|
||||
keybindingsEditor: IKeybindingsEditor,
|
||||
keybindingsEditor: IKeybindingsEditorPane,
|
||||
@IContextViewService private readonly contextViewService: IContextViewService,
|
||||
@IThemeService private readonly themeService: IThemeService
|
||||
) {
|
||||
@@ -1123,7 +1123,7 @@ class WhenColumn extends Column {
|
||||
}
|
||||
}
|
||||
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
const listHighlightForegroundColor = theme.getColor(listHighlightForeground);
|
||||
if (listHighlightForegroundColor) {
|
||||
collector.addRule(`.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row > .column .highlight { color: ${listHighlightForegroundColor}; }`);
|
||||
|
||||
@@ -21,7 +21,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { IEditor } from 'vs/workbench/common/editor';
|
||||
import { IEditorPane } from 'vs/workbench/common/editor';
|
||||
|
||||
export class KeyboardLayoutPickerContribution extends Disposable implements IWorkbenchContribution {
|
||||
private readonly pickerElement = this._register(new MutableDisposable<IStatusbarEntryAccessor>());
|
||||
@@ -156,7 +156,7 @@ export class KeyboardLayoutPickerAction extends Action {
|
||||
|
||||
await this.fileService.resolve(file).then(undefined, (error) => {
|
||||
return this.fileService.createFile(file, VSBuffer.fromString(KeyboardLayoutPickerAction.DEFAULT_CONTENT));
|
||||
}).then((stat): Promise<IEditor | undefined> | undefined => {
|
||||
}).then((stat): Promise<IEditorPane | undefined> | undefined => {
|
||||
if (!stat) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IsMacNativeContext, RemoteNameContext, WorkbenchStateContext } from 'vs/workbench/browser/contextkeys';
|
||||
import { RemoteNameContext, WorkbenchStateContext } from 'vs/workbench/browser/contextkeys';
|
||||
import { IsMacNativeContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { EditorDescriptor, Extensions as EditorExtensions, IEditorRegistry } from 'vs/workbench/browser/editor';
|
||||
import { Extensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
@@ -31,7 +32,7 @@ import { KeybindingsEditor } from 'vs/workbench/contrib/preferences/browser/keyb
|
||||
import { ConfigureLanguageBasedSettingsAction, OpenDefaultKeybindingsFileAction, OpenFolderSettingsAction, OpenGlobalKeybindingsAction, OpenGlobalKeybindingsFileAction, OpenGlobalSettingsAction, OpenRawDefaultSettingsAction, OpenRemoteSettingsAction, OpenSettings2Action, OpenSettingsJsonAction, OpenWorkspaceSettingsAction, OPEN_FOLDER_SETTINGS_COMMAND, OPEN_FOLDER_SETTINGS_LABEL } from 'vs/workbench/contrib/preferences/browser/preferencesActions';
|
||||
import { PreferencesEditor } from 'vs/workbench/contrib/preferences/browser/preferencesEditor';
|
||||
import { SettingsEditor2 } from 'vs/workbench/contrib/preferences/browser/settingsEditor2';
|
||||
import { CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, CONTEXT_KEYBINDING_FOCUS, CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_JSON_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, IKeybindingsEditor, KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, KEYBINDINGS_EDITOR_COMMAND_COPY, KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, KEYBINDINGS_EDITOR_COMMAND_DEFINE, KEYBINDINGS_EDITOR_COMMAND_DEFINE_WHEN, KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS, KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_RESET, KEYBINDINGS_EDITOR_COMMAND_SEARCH, KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR, KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE, KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS, KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS, MODIFIED_SETTING_TAG, SETTINGS_COMMAND_OPEN_SETTINGS, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING, SETTINGS_EDITOR_COMMAND_FILTER_MODIFIED, SETTINGS_EDITOR_COMMAND_FILTER_ONLINE, SETTINGS_EDITOR_COMMAND_FOCUS_FILE, SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST, SETTINGS_EDITOR_COMMAND_SEARCH, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU, SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON } from 'vs/workbench/contrib/preferences/common/preferences';
|
||||
import { CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, CONTEXT_KEYBINDING_FOCUS, CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_JSON_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, KEYBINDINGS_EDITOR_COMMAND_COPY, KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, KEYBINDINGS_EDITOR_COMMAND_DEFINE, KEYBINDINGS_EDITOR_COMMAND_DEFINE_WHEN, KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS, KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_RESET, KEYBINDINGS_EDITOR_COMMAND_SEARCH, KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR, KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE, KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS, KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS, MODIFIED_SETTING_TAG, SETTINGS_COMMAND_OPEN_SETTINGS, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING, SETTINGS_EDITOR_COMMAND_FILTER_MODIFIED, SETTINGS_EDITOR_COMMAND_FILTER_ONLINE, SETTINGS_EDITOR_COMMAND_FOCUS_FILE, SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST, SETTINGS_EDITOR_COMMAND_SEARCH, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU, SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON } from 'vs/workbench/contrib/preferences/common/preferences';
|
||||
import { PreferencesContribution } from 'vs/workbench/contrib/preferences/common/preferencesContribution';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
@@ -243,9 +244,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDING_FOCUS),
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_K),
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control && control instanceof KeybindingsEditor) {
|
||||
control.defineKeybinding(control.activeKeybindingEntry!);
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.defineKeybinding(editorPane.activeKeybindingEntry!);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -256,9 +257,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDING_FOCUS),
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_E),
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control && control instanceof KeybindingsEditor && control.activeKeybindingEntry!.keybindingItem.keybinding) {
|
||||
control.defineWhenExpression(control.activeKeybindingEntry!);
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor && editorPane.activeKeybindingEntry!.keybindingItem.keybinding) {
|
||||
editorPane.defineWhenExpression(editorPane.activeKeybindingEntry!);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -272,9 +273,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.Backspace)
|
||||
},
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control && control instanceof KeybindingsEditor) {
|
||||
control.removeKeybinding(control.activeKeybindingEntry!);
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.removeKeybinding(editorPane.activeKeybindingEntry!);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -285,9 +286,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDING_FOCUS),
|
||||
primary: 0,
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control && control instanceof KeybindingsEditor) {
|
||||
control.resetKeybinding(control.activeKeybindingEntry!);
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.resetKeybinding(editorPane.activeKeybindingEntry!);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -298,9 +299,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR),
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control && control instanceof KeybindingsEditor) {
|
||||
control.focusSearch();
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.focusSearch();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -312,9 +313,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
primary: KeyMod.Alt | KeyCode.KEY_K,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_K },
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control && control instanceof KeybindingsEditor) {
|
||||
control.recordSearchKeys();
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.recordSearchKeys();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -326,9 +327,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
primary: KeyMod.Alt | KeyCode.KEY_P,
|
||||
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_P },
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control && control instanceof KeybindingsEditor) {
|
||||
control.toggleSortByPrecedence();
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.toggleSortByPrecedence();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -339,9 +340,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDING_FOCUS),
|
||||
primary: 0,
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control) {
|
||||
control.showSimilarKeybindings(control.activeKeybindingEntry!);
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.showSimilarKeybindings(editorPane.activeKeybindingEntry!);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -352,9 +353,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDING_FOCUS),
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_C,
|
||||
handler: async (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control) {
|
||||
await control.copyKeybinding(control.activeKeybindingEntry!);
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
await editorPane.copyKeybinding(editorPane.activeKeybindingEntry!);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -365,9 +366,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDING_FOCUS),
|
||||
primary: 0,
|
||||
handler: async (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control) {
|
||||
await control.copyKeybindingCommand(control.activeKeybindingEntry!);
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
await editorPane.copyKeybindingCommand(editorPane.activeKeybindingEntry!);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -378,9 +379,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS),
|
||||
primary: KeyCode.DownArrow,
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control) {
|
||||
control.focusKeybindings();
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.focusKeybindings();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -525,9 +526,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS),
|
||||
primary: KeyCode.Escape,
|
||||
handler: (accessor, args: any) => {
|
||||
const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control) {
|
||||
control.clearSearchResults();
|
||||
const editorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.clearSearchResults();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -546,9 +547,9 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand(KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS, serviceAccessor => {
|
||||
const control = serviceAccessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control) {
|
||||
control.search('@source:default');
|
||||
const editorPane = serviceAccessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.search('@source:default');
|
||||
}
|
||||
});
|
||||
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
@@ -561,9 +562,9 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand(KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS, serviceAccessor => {
|
||||
const control = serviceAccessor.get(IEditorService).activeControl as IKeybindingsEditor;
|
||||
if (control) {
|
||||
control.search('@source:user');
|
||||
const editorPane = serviceAccessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof KeybindingsEditor) {
|
||||
editorPane.search('@source:user');
|
||||
}
|
||||
});
|
||||
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
@@ -576,9 +577,9 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
});
|
||||
|
||||
function getPreferencesEditor(accessor: ServicesAccessor): PreferencesEditor | SettingsEditor2 | null {
|
||||
const activeControl = accessor.get(IEditorService).activeControl;
|
||||
if (activeControl instanceof PreferencesEditor || activeControl instanceof SettingsEditor2) {
|
||||
return activeControl;
|
||||
const activeEditorPane = accessor.get(IEditorService).activeEditorPane;
|
||||
if (activeEditorPane instanceof PreferencesEditor || activeEditorPane instanceof SettingsEditor2) {
|
||||
return activeEditorPane;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -787,25 +788,25 @@ registerAction2(class extends Action2 {
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand(SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON, serviceAccessor => {
|
||||
const control = serviceAccessor.get(IEditorService).activeControl as SettingsEditor2;
|
||||
if (control instanceof SettingsEditor2) {
|
||||
return control.switchToSettingsFile();
|
||||
const editorPane = serviceAccessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof SettingsEditor2) {
|
||||
return editorPane.switchToSettingsFile();
|
||||
}
|
||||
|
||||
return Promise.resolve(null);
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand(SETTINGS_EDITOR_COMMAND_FILTER_MODIFIED, serviceAccessor => {
|
||||
const control = serviceAccessor.get(IEditorService).activeControl as SettingsEditor2;
|
||||
if (control instanceof SettingsEditor2) {
|
||||
control.focusSearch(`@${MODIFIED_SETTING_TAG}`);
|
||||
const editorPane = serviceAccessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof SettingsEditor2) {
|
||||
editorPane.focusSearch(`@${MODIFIED_SETTING_TAG}`);
|
||||
}
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand(SETTINGS_EDITOR_COMMAND_FILTER_ONLINE, serviceAccessor => {
|
||||
const control = serviceAccessor.get(IEditorService).activeControl as SettingsEditor2;
|
||||
if (control instanceof SettingsEditor2) {
|
||||
control.focusSearch(`@tag:usesOnlineServices`);
|
||||
const editorPane = serviceAccessor.get(IEditorService).activeEditorPane;
|
||||
if (editorPane instanceof SettingsEditor2) {
|
||||
editorPane.focusSearch(`@tag:usesOnlineServices`);
|
||||
} else {
|
||||
serviceAccessor.get(IPreferencesService).openSettings(false, '@tag:usesOnlineServices');
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ export class ConfigureLanguageBasedSettingsAction extends Action {
|
||||
if (pick) {
|
||||
const modeId = this.modeService.getModeIdForLanguageName(pick.label.toLowerCase());
|
||||
if (typeof modeId === 'string') {
|
||||
return this.preferencesService.configureSettingsForLanguage(modeId);
|
||||
return this.preferencesService.openGlobalSettings(true, { editSetting: `[${modeId}]` });
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
|
||||
@@ -249,10 +249,10 @@ export class PreferencesEditor extends BaseEditor {
|
||||
|
||||
private switchSettings(target: SettingsTarget): void {
|
||||
// Focus the editor if this editor is not active editor
|
||||
if (this.editorService.activeControl !== this) {
|
||||
if (this.editorService.activeEditorPane !== this) {
|
||||
this.focus();
|
||||
}
|
||||
const promise: Promise<boolean> = this.input && this.input.isDirty() ? this.editorService.save({ editor: this.input, groupId: this.group!.id }) : Promise.resolve(true);
|
||||
const promise = this.input && this.input.isDirty() ? this.editorService.save({ editor: this.input, groupId: this.group!.id }) : Promise.resolve(true);
|
||||
promise.then(() => {
|
||||
if (target === ConfigurationTarget.USER_LOCAL) {
|
||||
this.preferencesService.switchSettings(ConfigurationTarget.USER_LOCAL, this.preferencesService.userSettingsResource, true);
|
||||
|
||||
@@ -28,7 +28,7 @@ import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { activeContrastBorder, badgeBackground, badgeForeground, contrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler';
|
||||
import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { ICssStyleCollector, IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { PANEL_ACTIVE_TITLE_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND, PANEL_INACTIVE_TITLE_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
@@ -642,7 +642,7 @@ export class SearchWidget extends Widget {
|
||||
this.countElement.style.borderStyle = border ? 'solid' : '';
|
||||
this.countElement.style.borderColor = border;
|
||||
|
||||
const color = this.themeService.getTheme().getColor(badgeForeground);
|
||||
const color = this.themeService.getColorTheme().getColor(badgeForeground);
|
||||
this.countElement.style.color = color ? color.toString() : '';
|
||||
}));
|
||||
}
|
||||
@@ -803,7 +803,7 @@ export class EditPreferenceWidget<T> extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
|
||||
collector.addRule(`
|
||||
.settings-tabs-widget > .monaco-action-bar .action-item .action-label:focus,
|
||||
|
||||
@@ -33,7 +33,7 @@ import { badgeBackground, badgeForeground, contrastBorder, editorForeground } fr
|
||||
import { attachStylerCallback } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { IEditor, IEditorMemento } from 'vs/workbench/common/editor';
|
||||
import { IEditorPane, IEditorMemento } 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}}
|
||||
@@ -501,15 +501,14 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
}
|
||||
}
|
||||
|
||||
switchToSettingsFile(): Promise<IEditor | undefined> {
|
||||
const query = parseQuery(this.searchWidget.getValue());
|
||||
return this.openSettingsFile(query.query);
|
||||
switchToSettingsFile(): Promise<IEditorPane | undefined> {
|
||||
const query = parseQuery(this.searchWidget.getValue()).query;
|
||||
return this.openSettingsFile({ query });
|
||||
}
|
||||
|
||||
private async openSettingsFile(query?: string): Promise<IEditor | undefined> {
|
||||
private async openSettingsFile(options?: ISettingsEditorOptions): Promise<IEditorPane | undefined> {
|
||||
const currentSettingsTarget = this.settingsTargetsWidget.settingsTarget;
|
||||
|
||||
const options: ISettingsEditorOptions = { query };
|
||||
if (currentSettingsTarget === ConfigurationTarget.USER_LOCAL) {
|
||||
return this.preferencesService.openGlobalSettings(true, options);
|
||||
} else if (currentSettingsTarget === ConfigurationTarget.USER_REMOTE) {
|
||||
@@ -668,7 +667,7 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
this.settingRenderers = this.instantiationService.createInstance(SettingTreeRenderers);
|
||||
this._register(this.settingRenderers.onDidChangeSetting(e => this.onDidChangeSetting(e.key, e.value, e.type)));
|
||||
this._register(this.settingRenderers.onDidOpenSettings(settingKey => {
|
||||
this.openSettingsFile(settingKey);
|
||||
this.openSettingsFile({ editSetting: settingKey });
|
||||
}));
|
||||
this._register(this.settingRenderers.onDidClickSettingLink(settingName => this.onDidClickSetting(settingName)));
|
||||
this._register(this.settingRenderers.onDidFocusSetting(element => {
|
||||
|
||||
@@ -165,6 +165,11 @@ export const tocData: ITOCEntry = {
|
||||
label: localize('problems', "Problems"),
|
||||
settings: ['problems.*']
|
||||
},
|
||||
{
|
||||
id: 'features/output',
|
||||
label: localize('output', "Output"),
|
||||
settings: ['output.*']
|
||||
},
|
||||
{
|
||||
id: 'features/comments',
|
||||
label: localize('comments', "Comments"),
|
||||
|
||||
@@ -41,7 +41,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { editorBackground, errorForeground, focusBorder, foreground, inputValidationErrorBackground, inputValidationErrorBorder, inputValidationErrorForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler, attachStyler } from 'vs/platform/theme/common/styler';
|
||||
import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { ICssStyleCollector, IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { getIgnoredSettings } from 'vs/platform/userDataSync/common/settingsMerge';
|
||||
import { ITOCEntry } from 'vs/workbench/contrib/preferences/browser/settingsLayout';
|
||||
import { ISettingsEditorViewState, settingKeyToDisplayFormat, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeNewExtensionsElement, SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels';
|
||||
@@ -1508,7 +1508,7 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
|
||||
});
|
||||
|
||||
this.disposables.clear();
|
||||
this.disposables.add(registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
this.disposables.add(registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
const activeBorderColor = theme.getColor(focusBorder);
|
||||
if (activeBorderColor) {
|
||||
// TODO@rob - why isn't this applied when added to the stylesheet from tocTree.ts? Seems like a chromium glitch.
|
||||
|
||||
@@ -18,7 +18,7 @@ import { localize } from 'vs/nls';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { foreground, inputBackground, inputBorder, inputForeground, listActiveSelectionBackground, listActiveSelectionForeground, listHoverBackground, listHoverForeground, listInactiveSelectionBackground, listInactiveSelectionForeground, registerColor, selectBackground, selectBorder, selectForeground, textLinkForeground, textPreformatForeground, editorWidgetBorder, textLinkActiveForeground, simpleCheckboxBackground, simpleCheckboxForeground, simpleCheckboxBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { attachButtonStyler, attachInputBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { ICssStyleCollector, IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { disposableTimeout } from 'vs/base/common/async';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
|
||||
@@ -51,7 +51,7 @@ export const settingsNumberInputBackground = registerColor('settings.numberInput
|
||||
export const settingsNumberInputForeground = registerColor('settings.numberInputForeground', { dark: inputForeground, light: inputForeground, hc: inputForeground }, localize('numberInputBoxForeground', "Settings editor number input box foreground."));
|
||||
export const settingsNumberInputBorder = registerColor('settings.numberInputBorder', { dark: inputBorder, light: inputBorder, hc: inputBorder }, localize('numberInputBoxBorder', "Settings editor number input box border."));
|
||||
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
const checkboxBackgroundColor = theme.getColor(settingsCheckboxBackground);
|
||||
if (checkboxBackgroundColor) {
|
||||
collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-bool .setting-value-checkbox { background-color: ${checkboxBackgroundColor} !important; }`);
|
||||
|
||||
Reference in New Issue
Block a user