Answered by
castrob
Oct 28, 2025
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 |
1 reply
Answer selected by
wfortin
|
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? |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


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.