提交 24179e0b 编写于 作者: S Sandeep Somavarapu

Make Open Keybindings File a primary action

上级 d848101d
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#C5C5C5" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/><polygon fill="#75BEFF" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#656565" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/><polygon fill="#00539C" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/></svg>
\ No newline at end of file
......@@ -374,21 +374,6 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
when: new RawContextKey<string>('workbenchState', '').notEqualsTo('empty')
});
CommandsRegistry.registerCommand(KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS, serviceAccessor => {
const control = serviceAccessor.get(IEditorService).activeControl as IKeybindingsEditor;
if (control) {
control.search('@source:default');
}
});
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command: {
id: KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS,
title: nls.localize('showDefaultKeybindings', "Show Default Keybindings")
},
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR),
group: '1_keyboard_preferences_actions'
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS,
weight: KeybindingWeight.WorkbenchContrib,
......@@ -416,34 +401,52 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
group: 'navigation',
});
CommandsRegistry.registerCommand(KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS, serviceAccessor => {
CommandsRegistry.registerCommand(OpenGlobalKeybindingsFileAction.ID, serviceAccessor => {
serviceAccessor.get(IInstantiationService).createInstance(OpenGlobalKeybindingsFileAction, OpenGlobalKeybindingsFileAction.ID, OpenGlobalKeybindingsFileAction.LABEL).run();
});
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command: {
id: OpenGlobalKeybindingsFileAction.ID,
title: OpenGlobalKeybindingsFileAction.LABEL,
iconLocation: {
light: URI.parse(require.toUrl(`vs/workbench/parts/preferences/browser/media/open-file.svg`)),
dark: URI.parse(require.toUrl(`vs/workbench/parts/preferences/browser/media/open-file-inverse.svg`))
}
},
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR),
group: 'navigation',
});
CommandsRegistry.registerCommand(KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS, serviceAccessor => {
const control = serviceAccessor.get(IEditorService).activeControl as IKeybindingsEditor;
if (control) {
control.search('@source:user');
control.search('@source:default');
}
});
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command: {
id: KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS,
title: nls.localize('showUserKeybindings', "Show User Keybindings")
id: KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS,
title: nls.localize('showDefaultKeybindings', "Show Default Keybindings")
},
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR),
group: '1_keyboard_preferences_actions'
});
CommandsRegistry.registerCommand(OpenGlobalKeybindingsFileAction.ID, serviceAccessor => {
serviceAccessor.get(IInstantiationService).createInstance(OpenGlobalKeybindingsFileAction, OpenGlobalKeybindingsFileAction.ID, OpenGlobalKeybindingsFileAction.LABEL).run();
CommandsRegistry.registerCommand(KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS, serviceAccessor => {
const control = serviceAccessor.get(IEditorService).activeControl as IKeybindingsEditor;
if (control) {
control.search('@source:user');
}
});
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
command: {
id: OpenGlobalKeybindingsFileAction.ID,
title: OpenGlobalKeybindingsFileAction.LABEL,
id: KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS,
title: nls.localize('showUserKeybindings', "Show User Keybindings")
},
when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR),
group: '2_keyboard_preferences_actions'
group: '1_keyboard_preferences_actions'
});
abstract class SettingsCommand extends Command {
protected getPreferencesEditor(accessor: ServicesAccessor): PreferencesEditor | SettingsEditor2 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册