Skip to content

Commit

Permalink
fixes #100172
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Sep 14, 2020
1 parent f69faf4 commit b9aa43a
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/vs/workbench/api/common/menusExtensionPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ namespace schema {
};

export const submenusContribution: IJSONSchema = {
description: localize('vscode.extension.contributes.submenus', "(Proposed API) Contributes submenu items to the editor"),
description: localize('vscode.extension.contributes.submenus', "Contributes submenu items to the editor"),
type: 'array',
items: submenu
};
Expand Down Expand Up @@ -585,11 +585,6 @@ submenusExtensionPoint.setHandler(extensions => {
return;
}

if (!extension.description.enableProposedApi) {
collector.error(localize('submenu.proposedAPI.invalid', "Submenus are proposed API and are only available when running out of dev or with the following command line switch: --enable-proposed-api {0}", extension.description.identifier.value));
return;
}

let absoluteIcon: { dark: URI; light?: URI; } | ThemeIcon | undefined;
if (entry.value.icon) {
if (typeof entry.value.icon === 'string') {
Expand Down Expand Up @@ -638,7 +633,6 @@ menusExtensionPoint.setHandler(extensions => {
}

let menu = _apiMenusByKey.get(entry.key);
let isSubmenu = false;

if (!menu) {
const submenu = _submenus.get(entry.key);
Expand All @@ -649,7 +643,6 @@ menusExtensionPoint.setHandler(extensions => {
id: submenu.id,
description: ''
};
isSubmenu = true;
}
}

Expand All @@ -663,11 +656,6 @@ menusExtensionPoint.setHandler(extensions => {
return;
}

if (isSubmenu && !extension.description.enableProposedApi) {
collector.error(localize('proposedAPI.invalid.submenu', "{0} is a submenu identifier and is only available when running out of dev or with the following command line switch: --enable-proposed-api {1}", entry.key, extension.description.identifier.value));
return;
}

for (const menuItem of entry.value) {
let item: IMenuItem | ISubmenuItem;

Expand All @@ -688,13 +676,8 @@ menusExtensionPoint.setHandler(extensions => {

item = { command, alt, group: undefined, order: undefined, when: undefined };
} else {
if (!extension.description.enableProposedApi) {
collector.error(localize('proposedAPI.invalid.submenureference', "Menu item references a submenu which is only available when running out of dev or with the following command line switch: --enable-proposed-api {0}", extension.description.identifier.value));
continue;
}

if (menu.supportsSubmenus === false) {
collector.error(localize('proposedAPI.unsupported.submenureference', "Menu item references a submenu for a menu which doesn't have submenu support."));
collector.error(localize('unsupported.submenureference', "Menu item references a submenu for a menu which doesn't have submenu support."));
continue;
}

Expand Down

0 comments on commit b9aa43a

Please sign in to comment.