File tree Expand file tree Collapse file tree
src/vs/workbench/api/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ namespace schema {
8181 return false ;
8282 }
8383
84+ export function supportsSubmenus ( menuId : MenuId ) : boolean {
85+ switch ( menuId ) {
86+ case MenuId . EditorContext :
87+ return true ;
88+ }
89+ return false ;
90+ }
91+
8492 export function isMenuItem ( item : IUserFriendlyMenuItem | IUserFriendlySubmenuItem ) : item is IUserFriendlyMenuItem {
8593 return typeof ( item as IUserFriendlyMenuItem ) . command === 'string' ;
8694 }
@@ -626,6 +634,8 @@ menusExtensionPoint.setHandler(extensions => {
626634 return ;
627635 }
628636
637+ const submenuSupport = schema . supportsSubmenus ( id ) ;
638+
629639 for ( const menuItem of entry . value ) {
630640 let item : IMenuItem | ISubmenuItem ;
631641
@@ -651,6 +661,11 @@ menusExtensionPoint.setHandler(extensions => {
651661 continue ;
652662 }
653663
664+ if ( ! submenuSupport ) {
665+ collector . error ( localize ( 'proposedAPI.unsupported.submenureference' , "Menu item references a submenu for a menu which doesn't have submenu support." ) ) ;
666+ continue ;
667+ }
668+
654669 const submenu = _submenus . get ( menuItem . submenu ) ;
655670
656671 if ( ! submenu ) {
You can’t perform that action at this time.
0 commit comments