Replies: 2 comments
-
| 
         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.
                  
                    0 replies
                  
                
            -
| 
         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.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to remove certain items from the context menu, I was wondering if that was possible somehow. I've seen how to add items (through MenuRegistry) but I'm not sure if its possible to hide/remove some.
Beta Was this translation helpful? Give feedback.
All reactions