Add support for submenus to simplify the menu structure of the Git extensions '...' menu.
See #9827
I'd particularly like https://github.com/microsoft/vscode/issues/9827#issuecomment-619989638 to be catered for in the new API, so an extension can contribute a submenu whose contents are computed at display-time.
Syntax proposal:
{
"contributes": {
"menus": {
"scm/title": [
{
"command": "git.commit",
"group": "navigation"
},
{
"submenu": "git.stage",
"group": "navigation"
}
],
"git.stage": [
{
"command": "git.stageAll",
"group": "navigation"
},
{
"command": "git.stageUntracked",
"group": "navigation"
}
]
},
"submenus": [
{
"id": "git.stage",
"label": "Stage",
"icon": "$(something)"
}
]
}
}
Syntax proposal:
@joaomoreno Maybe extend the syntax of submenus contribution to support submenus that call the extension at display-time to obtain their contents.
That will definitely not be in there for the first iteration. That should even be generalized for regular menus.
@jrieken Added the icon property in the submenus contribution, in order to make submenus work in toolbars. 馃憤
Re-opening for the finalisation process...
@jrieken I had this one created: https://github.com/microsoft/vscode/issues/103946
I leave it up to you to decide which one to keep. I won't be able to work in finalizing it since I'm out in August so after choosing the issue, pick one option:
I leave it up to you to decide which one to keep.
The newish flow is to have a single item that can be followed throughout the phases of idea, proposal, and finalization. September is good for me
When will submenu apis be stable?
With the next upcoming stable release: September 2020.
Verification
This new API should be usable without the proposed flag!
Is it possible to change the Submenu via Code? (= alter the Package.json?)
I need to expose some menuitems programatically..
Pinging @joaomoreno
Sorry for pinging you - do you know whether this is possible or will be available in the near future?
Most helpful comment
See #9827
I'd particularly like https://github.com/microsoft/vscode/issues/9827#issuecomment-619989638 to be catered for in the new API, so an extension can contribute a submenu whose contents are computed at display-time.