Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: No VS Code Version: 1.70.0-insider OS Version: Darwin x64 21.5.0 <details<summaryVS Code version info</summaryVersion: 1.70.0-insider Commit: Date: 2022-07-13T05:21:34.551Z Electron: 18.3.5 Chromium: 100.0.4896.160 16.13.2 V8: 10.0.139.17-electron.0 OS: Darwin x64 21.5.0 </detailsThe Azure Resource Groups extension has a submenus that aren't showing up on Insiders, but show up as expected on VS Code Stable. The issue only reproduces on insiders 1.70.0-insider. Does not repro on stable (1.69.1) I've verified that this bug impacts GitLens submenus as well, but haven't had time to log the issue over there yet. I've made a sample extension as a minimal reproduction. Steps to Reproduce: new window of VS Code Insiders (with a folder/files open if you want to verify that the sample submenu disappears) of the sample extension I made that contributes a submenu to the . "Log (Window)" output channel. If there aren't errors yet, disabling the submenu sample extension, which seems to reload all the extension contributions which causes the error. these errors are shown in the logs, the submenu disappears. I believe it could be caused by Errors from the "Log (Window)" output channel: https://user- You can also easily reproduce this by installing and enabled/disabling various extensions that contribute submenus. Ex: GitLens and Azure Resource Groups.
could this be a consequence of your recent work on menus?
Yes. Menu identifiers need to be unique (while they were using a different identity before). I think for contributed submenus this needs to be relaxed
The error mentions a different menu identifier () but I can understand how this happens. I will push a fix
I'm still able to reproduce this on the latest insiders version. Version: 1.70.0-insider Commit: Date: 2022-07-14T05:17:37.220Z Electron: 18.3.5 Chromium: 100.0.4896.160 16.13.2 V8: 10.0.139.17-electron.0 OS: Darwin x64 21.5.0
According to this still repros
/needsMoreInfo Using latest insiders () Using the sample repos as provided (codespace https://jrieken-alexweininger-vscode-submenu-sample-) Works as expected <img width="954" alt="Screenshot 2022-07-20 at 08 28 13" src="https://user-"Please update your steps and sample so that we can reproduce this
Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our . Please take the time to review these and update the issue. Happy Coding!
I was original able to reproduce this using the sample repos. However, I haven't been able to create a new sample that consistently reproduces the issue. But I can still reproduce it using the Azure extensions. Maybe you can help identify what's going on. The submenu view/title button that disappears in the video does not disappear on stable. At the start of the video I have the following extensions enabled: Azure Account Azure Resource Groups Azure Functions And at this point, the submenu view/title button is shown as expected. Next, I enable the Azure App Service extension, which immediately causes errors to show up in the output window and the submenu view/title button disappears. https://user-
Still investigating this issue, it seems to be related to submenu merging.
Let's assign to August for an investigation. I also asked to provide more info. For example if you build vscode out of source and you revert can you still repro?
Since this looks like a regression - marking as a candidate for recovery release 2.
Created a PR fixing this
awesome, thanks a lot! just came back from vacation, and will review the PR and investigate more in the bug. We quickly glanced at the PR together and it seems to be fixing the right thing. we expect to have a stable release on Wednesday that will have a fix for this issue. Thanks and sorry about the breakage!
Fix is in and in
Can you please verify this with latest insiders and/or 1.70.2 release candidate
Verified with latest insiders. Version: 1.71.0-insider Commit: Date: 2022-08-17T05:20:48.980Z Electron: 19.0.12 Chromium: 102.0.5005.167 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin x64 21.6.0 Sandboxed: Yes

Discussion:
export class MenuId { <del> private static readonly _idPool = new Set<string>(); </del> <ins> private static readonly _instances = new Map<string, MenuId>(); </ins> static readonly CommandPalette = new MenuId('CommandPalette'); static readonly DebugBreakpointsContext = new MenuId('DebugBreakpointsContext');

static readonly NewFile = new MenuId('NewFile'); static readonly MergeToolbar = new MenuId('MergeToolbar'); <ins> /** * Create or reuse a `MenuId` with the given identifier */ static for(identifier: string): MenuId { return MenuId._instances.get(identifier) ?? new MenuId(identifier); } </ins> readonly id: string; <ins> /** * Create a new `MenuId` with the unique identifier. Will throw if a menu * with the identifier already exists, use `MenuId.for(ident)` or a unique * identifier */ </ins> constructor(identifier: string) { <del> if (MenuId._idPool.has(identifier)) { throw new Error(`Duplicate menu identifier ${identifier}`); </del> <ins> if (MenuId._instances.has(identifier)) { throw new TypeError(`MenuId with identifier '${identifier}' already exists. Use MenuId.for(ident) or a unique identifier`); </ins> } <del> MenuId._idPool.add(identifier); </del> <ins> MenuId._instances.set(identifier, this); </ins> this.id = identifier; } }

assert.strictEqual(foundA, true); assert.strictEqual(foundB, true); }); <ins> test('Extension contributed submenus missing with errors in output #155030', function () { const id = generateUuid(); const menu = new MenuId(id); assert.throws(() => new MenuId(id)); assert.ok(menu === MenuId.for(id)); }); </ins> });

} const item: IRegisteredSubmenu = { <del> id: new MenuId(`api:${submenuInfo.id}`), </del> <ins> id: MenuId.for(`api:${submenuInfo.id}`), </ins> label: submenuInfo.label, icon: absoluteIcon };