-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Hi, I don't know if it's the best solution, but in my case I changed the MenuRegistry.getMenuItems = function (this, id) {
const result = menuItems.call(this, id);
return result.filter((menuItem: IMenuItem | ISubmenuItem) => {
const commandOrSubmenu = 'command' in menuItem ? menuItem.command : menuItem.submenu;
return !commandOrSubmenu || stringFilter.matches(commandOrSubmenu.id);
});
};This way, I maintain a list of "forbidden" menu items that I don't want to be shown, execute the original command with |
Beta Was this translation helpful? Give feedback.
-
|
Depending on what you are trying to do, menu items do have some condition based on context keys, and those context keys can be updated We've also added a few more context keys for that purpose What do you want to remove? |
Beta Was this translation helpful? Give feedback.


Hi, I don't know if it's the best solution, but in my case I changed the
getMenuItemsfromMenuRegistry, something like this:This way, I maintain a list of "forbidden" menu items that I don't want to be shown, execute the original command with
menuItems..call(...)and then filter the result.