mirror of https://git.tuxpa.in/a/code-server.git
Remove non-working menu items
This commit is contained in:
parent
5a1eb858a9
commit
278c59b920
|
@ -1,16 +1,33 @@
|
||||||
import { logger } from "@coder/logger";
|
|
||||||
import { IDisposable } from "vs/base/common/lifecycle";
|
import { IDisposable } from "vs/base/common/lifecycle";
|
||||||
import * as actions from "vs/platform/actions/common/actions";
|
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 { 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.
|
// Intercept appending menu items so we can skip items that won't work.
|
||||||
const originalAppend = actions.MenuRegistry.appendMenuItem.bind(actions.MenuRegistry);
|
const originalAppend = actions.MenuRegistry.appendMenuItem.bind(actions.MenuRegistry);
|
||||||
actions.MenuRegistry.appendMenuItem = (id: actions.MenuId, item: actions.IMenuItem | actions.ISubmenuItem): IDisposable => {
|
actions.MenuRegistry.appendMenuItem = (id: actions.MenuId, item: actions.IMenuItem | actions.ISubmenuItem): IDisposable => {
|
||||||
if (actions.isIMenuItem(item)) {
|
if (actions.isIMenuItem(item)) {
|
||||||
switch (item.command.id) {
|
if (toSkip.indexOf(item.command.id) !== -1) {
|
||||||
case ToggleDevToolsAction.ID: // There appears to be no way to toggle this programmatically.
|
// Skip instantiation
|
||||||
logger.debug(`Skipping unsupported menu item ${item.command.id}`);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dispose: (): void => undefined,
|
dispose: (): void => undefined,
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,6 +4,14 @@ import { IProductConfiguration } from "vs/platform/product/node/product";
|
||||||
class Product implements IProductConfiguration {
|
class Product implements IProductConfiguration {
|
||||||
public nameShort = "code-server";
|
public nameShort = "code-server";
|
||||||
public nameLong = "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;
|
private _dataFolderName: string | undefined;
|
||||||
public get dataFolderName(): string {
|
public get dataFolderName(): string {
|
||||||
|
|
Loading…
Reference in New Issue