Expose command to open settings page with online services query from gear menu and preferences menu, fixes #75215

This commit is contained in:
Rachel Macfarlane 2019-06-10 15:17:32 -07:00
parent 94b23bc6c4
commit af39a4d4fb
3 changed files with 14 additions and 1 deletions

View file

@ -307,7 +307,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
id: VIEWLET_ID,
title: localize({ key: 'miPreferencesExtensions', comment: ['&& denotes a mnemonic'] }, "&&Extensions")
},
order: 2
order: 3
});
// View menu

View file

@ -741,6 +741,8 @@ CommandsRegistry.registerCommand(SETTINGS_EDITOR_COMMAND_FILTER_ONLINE, serviceA
const control = serviceAccessor.get(IEditorService).activeControl as SettingsEditor2;
if (control instanceof SettingsEditor2) {
control.focusSearch(`@tag:usesOnlineServices`);
} else {
serviceAccessor.get(IPreferencesService).openSettings(undefined, '@tag:usesOnlineServices');
}
});
@ -755,6 +757,15 @@ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
group: '1_settings',
command: {
id: SETTINGS_EDITOR_COMMAND_FILTER_ONLINE,
title: nls.localize({ key: 'miOpenOnlineSettings', comment: ['&& denotes a mnemonic'] }, "&&Online Services Settings")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
group: '2_keybindings',
command: {

View file

@ -232,6 +232,7 @@ export class UpdateContribution extends Disposable implements IGlobalActivity {
private static readonly selectColorThemeId = 'workbench.action.selectTheme';
private static readonly selectIconThemeId = 'workbench.action.selectIconTheme';
private static readonly showExtensionsId = 'workbench.view.extensions';
private static readonly showOnlineSettingsId = 'settings.filterByOnline';
get id() { return 'vs.update'; }
get name() { return nls.localize('manage', "Manage"); }
@ -476,6 +477,7 @@ export class UpdateContribution extends Disposable implements IGlobalActivity {
new CommandAction(UpdateContribution.showCommandsId, nls.localize('commandPalette', "Command Palette..."), this.commandService),
new Separator(),
new CommandAction(UpdateContribution.openSettingsId, nls.localize('settings', "Settings"), this.commandService),
new CommandAction(UpdateContribution.showOnlineSettingsId, nls.localize('onlineServices', "Online Services Settings"), this.commandService),
new CommandAction(UpdateContribution.showExtensionsId, nls.localize('showExtensions', "Extensions"), this.commandService),
new CommandAction(UpdateContribution.openKeybindingsId, nls.localize('keyboardShortcuts', "Keyboard Shortcuts"), this.commandService),
new Separator(),