mirror of
https://git.tuxpa.in/a/code-server.git
synced 2024-12-27 04:35:25 +00:00
Remove non-working menu items
This commit is contained in:
parent
5a1eb858a9
commit
278c59b920
@ -1,19 +1,36 @@
|
||||
import { logger } from "@coder/logger";
|
||||
import { IDisposable } from "vs/base/common/lifecycle";
|
||||
import * as actions from "vs/platform/actions/common/actions";
|
||||
import { CloseWorkspaceAction } from "vs/workbench/browser/actions/workspaceActions";
|
||||
import { OpenProcessExplorer } from "vs/workbench/contrib/issue/electron-browser/issueActions";
|
||||
import { ToggleDevToolsAction } from "vs/workbench/electron-browser/actions/developerActions";
|
||||
import { OpenPrivacyStatementUrlAction, OpenRequestFeatureUrlAction, OpenTwitterUrlAction } from "vs/workbench/electron-browser/actions/helpActions";
|
||||
import { CloseCurrentWindowAction, NewWindowAction, ShowAboutDialogAction } from "vs/workbench/electron-browser/actions/windowActions";
|
||||
|
||||
const toSkip = [
|
||||
ToggleDevToolsAction.ID,
|
||||
OpenTwitterUrlAction.ID,
|
||||
OpenPrivacyStatementUrlAction.ID,
|
||||
ShowAboutDialogAction.ID,
|
||||
OpenProcessExplorer.ID,
|
||||
OpenRequestFeatureUrlAction.ID,
|
||||
NewWindowAction.ID,
|
||||
CloseCurrentWindowAction.ID,
|
||||
CloseWorkspaceAction.ID,
|
||||
|
||||
// Unfortunately referenced as a string
|
||||
"update.showCurrentReleaseNotes",
|
||||
"workbench.action.openIssueReporter",
|
||||
];
|
||||
|
||||
// Intercept appending menu items so we can skip items that won't work.
|
||||
const originalAppend = actions.MenuRegistry.appendMenuItem.bind(actions.MenuRegistry);
|
||||
actions.MenuRegistry.appendMenuItem = (id: actions.MenuId, item: actions.IMenuItem | actions.ISubmenuItem): IDisposable => {
|
||||
if (actions.isIMenuItem(item)) {
|
||||
switch (item.command.id) {
|
||||
case ToggleDevToolsAction.ID: // There appears to be no way to toggle this programmatically.
|
||||
logger.debug(`Skipping unsupported menu item ${item.command.id}`);
|
||||
|
||||
return {
|
||||
dispose: (): void => undefined,
|
||||
};
|
||||
if (toSkip.indexOf(item.command.id) !== -1) {
|
||||
// Skip instantiation
|
||||
return {
|
||||
dispose: (): void => undefined,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,14 @@ import { IProductConfiguration } from "vs/platform/product/node/product";
|
||||
class Product implements IProductConfiguration {
|
||||
public nameShort = "code-server";
|
||||
public nameLong = "code-server";
|
||||
public documentationUrl = "https://code.visualstudio.com/docs";
|
||||
public keyboardShortcutsUrlMac = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf";
|
||||
public keyboardShortcutsUrlLinux = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf";
|
||||
public keyboardShortcutsUrlWin = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf";
|
||||
public introductoryVideosUrl = "https://code.visualstudio.com/docs/getstarted/introvideos";
|
||||
public tipsAndTricksUrl = "https://code.visualstudio.com/docs/getstarted/tips-and-tricks";
|
||||
public twitterUrl = "https://twitter.com/code";
|
||||
public licenseUrl = "https://github.com/codercom/code-server/blob/master/LICENSE";
|
||||
|
||||
private _dataFolderName: string | undefined;
|
||||
public get dataFolderName(): string {
|
||||
|
Loading…
Reference in New Issue
Block a user