偏好设置中移除遥测和在线设置菜单.

This commit is contained in:
wangpenglong 2023-03-08 16:06:18 +08:00 committed by chriswang521
parent 35ff3391cc
commit e62c0acfc3
1 changed files with 44 additions and 44 deletions

View File

@ -54,8 +54,8 @@ const SETTINGS_EDITOR_COMMAND_FOCUS_CONTROL = 'settings.action.focusSettingContr
const SETTINGS_EDITOR_COMMAND_FOCUS_UP = 'settings.action.focusLevelUp'; const SETTINGS_EDITOR_COMMAND_FOCUS_UP = 'settings.action.focusLevelUp';
const SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON = 'settings.switchToJSON'; const SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON = 'settings.switchToJSON';
const SETTINGS_EDITOR_COMMAND_FILTER_ONLINE = 'settings.filterByOnline'; // const SETTINGS_EDITOR_COMMAND_FILTER_ONLINE = 'settings.filterByOnline';
const SETTINGS_EDITOR_COMMAND_FILTER_TELEMETRY = 'settings.filterByTelemetry'; // const SETTINGS_EDITOR_COMMAND_FILTER_TELEMETRY = 'settings.filterByTelemetry';
const SETTINGS_EDITOR_COMMAND_FILTER_UNTRUSTED = 'settings.filterUntrusted'; const SETTINGS_EDITOR_COMMAND_FILTER_UNTRUSTED = 'settings.filterUntrusted';
const SETTINGS_COMMAND_OPEN_SETTINGS = 'workbench.action.openSettings'; const SETTINGS_COMMAND_OPEN_SETTINGS = 'workbench.action.openSettings';
@ -392,49 +392,49 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon
return accessor.get(IPreferencesService).openFolderSettings({ folderUri: resource }); return accessor.get(IPreferencesService).openFolderSettings({ folderUri: resource });
} }
}); });
registerAction2(class extends Action2 { // registerAction2(class extends Action2 {
constructor() { // constructor() {
super({ // super({
id: SETTINGS_EDITOR_COMMAND_FILTER_ONLINE, // id: SETTINGS_EDITOR_COMMAND_FILTER_ONLINE,
title: nls.localize({ key: 'miOpenOnlineSettings', comment: ['&& denotes a mnemonic'] }, "&&Online Services Settings"), // title: nls.localize({ key: 'miOpenOnlineSettings', comment: ['&& denotes a mnemonic'] }, "&&Online Services Settings"),
menu: { // menu: {
id: MenuId.MenubarPreferencesMenu, // id: MenuId.MenubarPreferencesMenu,
group: '1_settings', // group: '1_settings',
order: 2, // order: 2,
} // }
}); // });
} // }
run(accessor: ServicesAccessor) { // run(accessor: ServicesAccessor) {
const editorPane = accessor.get(IEditorService).activeEditorPane; // const editorPane = accessor.get(IEditorService).activeEditorPane;
if (editorPane instanceof SettingsEditor2) { // if (editorPane instanceof SettingsEditor2) {
editorPane.focusSearch(`@tag:usesOnlineServices`); // editorPane.focusSearch(`@tag:usesOnlineServices`);
} else { // } else {
accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:usesOnlineServices' }); // accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:usesOnlineServices' });
} // }
} // }
}); // });
registerAction2(class extends Action2 { // registerAction2(class extends Action2 {
constructor() { // constructor() {
super({ // super({
id: SETTINGS_EDITOR_COMMAND_FILTER_TELEMETRY, // id: SETTINGS_EDITOR_COMMAND_FILTER_TELEMETRY,
title: { value: nls.localize('showTelemtrySettings', "Telemetry Settings"), original: 'Telemetry Settings' }, // title: { value: nls.localize('showTelemtrySettings', "Telemetry Settings"), original: 'Telemetry Settings' },
menu: { // menu: {
id: MenuId.MenubarPreferencesMenu, // id: MenuId.MenubarPreferencesMenu,
group: '1_settings', // group: '1_settings',
order: 3, // order: 3,
} // }
}); // });
} // }
run(accessor: ServicesAccessor) { // run(accessor: ServicesAccessor) {
const editorPane = accessor.get(IEditorService).activeEditorPane; // const editorPane = accessor.get(IEditorService).activeEditorPane;
if (editorPane instanceof SettingsEditor2) { // if (editorPane instanceof SettingsEditor2) {
editorPane.focusSearch('@tag:telemetry'); // editorPane.focusSearch('@tag:telemetry');
} else { // } else {
accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:telemetry' }); // accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:telemetry' });
} // }
} // }
}); // });
registerAction2(class extends Action2 { registerAction2(class extends Action2 {
constructor() { constructor() {