|
1 |
| -import { logger } from "@coder/logger"; |
2 | 1 | import { IDisposable } from "vs/base/common/lifecycle";
|
3 | 2 | import * as actions from "vs/platform/actions/common/actions";
|
| 3 | +import { CloseWorkspaceAction } from "vs/workbench/browser/actions/workspaceActions"; |
| 4 | +import { OpenProcessExplorer } from "vs/workbench/contrib/issue/electron-browser/issueActions"; |
4 | 5 | import { ToggleDevToolsAction } from "vs/workbench/electron-browser/actions/developerActions";
|
| 6 | +import { OpenPrivacyStatementUrlAction, OpenRequestFeatureUrlAction, OpenTwitterUrlAction } from "vs/workbench/electron-browser/actions/helpActions"; |
| 7 | +import { CloseCurrentWindowAction, NewWindowAction, ShowAboutDialogAction } from "vs/workbench/electron-browser/actions/windowActions"; |
| 8 | + |
| 9 | +const toSkip = [ |
| 10 | + ToggleDevToolsAction.ID, |
| 11 | + OpenTwitterUrlAction.ID, |
| 12 | + OpenPrivacyStatementUrlAction.ID, |
| 13 | + ShowAboutDialogAction.ID, |
| 14 | + OpenProcessExplorer.ID, |
| 15 | + OpenRequestFeatureUrlAction.ID, |
| 16 | + NewWindowAction.ID, |
| 17 | + CloseCurrentWindowAction.ID, |
| 18 | + CloseWorkspaceAction.ID, |
| 19 | + |
| 20 | + // Unfortunately referenced as a string |
| 21 | + "update.showCurrentReleaseNotes", |
| 22 | + "workbench.action.openIssueReporter", |
| 23 | +]; |
5 | 24 |
|
6 | 25 | // Intercept appending menu items so we can skip items that won't work.
|
7 | 26 | const originalAppend = actions.MenuRegistry.appendMenuItem.bind(actions.MenuRegistry);
|
8 | 27 | actions.MenuRegistry.appendMenuItem = (id: actions.MenuId, item: actions.IMenuItem | actions.ISubmenuItem): IDisposable => {
|
9 | 28 | if (actions.isIMenuItem(item)) {
|
10 |
| - switch (item.command.id) { |
11 |
| - case ToggleDevToolsAction.ID: // There appears to be no way to toggle this programmatically. |
12 |
| - logger.debug(`Skipping unsupported menu item ${item.command.id}`); |
13 |
| - |
14 |
| - return { |
15 |
| - dispose: (): void => undefined, |
16 |
| - }; |
| 29 | + if (toSkip.indexOf(item.command.id) !== -1) { |
| 30 | + // Skip instantiation |
| 31 | + return { |
| 32 | + dispose: (): void => undefined, |
| 33 | + }; |
17 | 34 | }
|
18 | 35 | }
|
19 | 36 |
|
|
0 commit comments