CommandHandlerRegistrationContext.shouldAddCommandToSubmenu?
CommandHandlerRegistrationContext › shouldAddCommandToSubmenu?
Overrides the handler's ownshouldAddCommandToSubmenu, or undefined to leave it alone.A menu surface that already wraps every contributed item in a plugin-titled parent entry — such as
NotebookNavigatorMenuEventRegistrarComponent — sets this to false, because a handler declaring a section submenu of its own would make Menu.sort() nest a second plugin-titled entry inside the first. Only AbstractFileCommandHandler reads it: the surfaces that need it bridge file and folder menus, never the editor menu.