diff --git a/extensions/git/package.json b/extensions/git/package.json index 03013a0f90f..9ff385ce77f 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1693,13 +1693,85 @@ "when": "scmProvider == git" } ], - "scm/sourceControl/title": [ + "scm/repositories/title": [ { "command": "git.reopenClosedRepositories", "group": "navigation@1", "when": "git.closedRepositoryCount > 0" } ], + "scm/repository": [ + { + "command": "git.pull", + "group": "1_header@1", + "when": "scmProvider == git" + }, + { + "command": "git.push", + "group": "1_header@2", + "when": "scmProvider == git" + }, + { + "command": "git.clone", + "group": "1_header@3", + "when": "scmProvider == git" + }, + { + "command": "git.checkout", + "group": "1_header@4", + "when": "scmProvider == git" + }, + { + "command": "git.fetch", + "group": "1_header@5", + "when": "scmProvider == git" + }, + { + "submenu": "git.commit", + "group": "2_main@1", + "when": "scmProvider == git" + }, + { + "submenu": "git.changes", + "group": "2_main@2", + "when": "scmProvider == git" + }, + { + "submenu": "git.pullpush", + "group": "2_main@3", + "when": "scmProvider == git" + }, + { + "submenu": "git.branch", + "group": "2_main@4", + "when": "scmProvider == git" + }, + { + "submenu": "git.remotes", + "group": "2_main@5", + "when": "scmProvider == git" + }, + { + "submenu": "git.stash", + "group": "2_main@6", + "when": "scmProvider == git" + }, + { + "submenu": "git.tags", + "group": "2_main@7", + "when": "scmProvider == git" + }, + { + "submenu": "git.worktrees", + "group": "2_main@8", + "when": "scmProvider == git" + }, + { + "command": "git.showOutput", + "group": "3_footer", + "when": "scmProvider == git" + } + ], "scm/sourceControl": [ { "command": "git.close", diff --git a/src/vs/workbench/contrib/scm/browser/menus.ts b/src/vs/workbench/contrib/scm/browser/menus.ts index 59a953b6dfa..f4732f57be1 100644 --- a/src/vs/workbench/contrib/scm/browser/menus.ts +++ b/src/vs/workbench/contrib/scm/browser/menus.ts @@ -5,7 +5,7 @@ import { IAction } from '../../../../base/common/actions.js'; import { equals } from '../../../../base/common/arrays.js'; -import { Emitter, Event } from '../../../../base/common/event.js'; +import { Emitter } from '../../../../base/common/event.js'; import { DisposableStore, IDisposable, dispose } from '../../../../base/common/lifecycle.js'; import './media/scm.css'; import { localize } from '../../../../nls.js'; @@ -325,7 +325,6 @@ export class SCMMenus implements ISCMMenus, IDisposable { readonly titleMenu: SCMTitleMenu; private readonly disposables = new DisposableStore(); - private readonly repositoryMenuDisposables = new DisposableStore(); private readonly menus = new Map void }>(); constructor( @@ -334,20 +333,6 @@ export class SCMMenus implements ISCMMenus, IDisposable { ) { this.titleMenu = instantiationService.createInstance(SCMTitleMenu); scmService.onDidRemoveRepository(this.onDidRemoveRepository, this, this.disposables); - - // Duplicate the `SCMTitle` menu items to the `SCMSourceControlInline` menu. We do this - // so that menu items can be independently hidden/shown in the "Source Control" and the - // "Source Control Repositories" views. - this.disposables.add(Event.runAndSubscribe(MenuRegistry.onDidChangeMenu, e => { - if (e && !e.has(MenuId.SCMTitle)) { - return; - } - - this.repositoryMenuDisposables.clear(); - for (const menuItem of MenuRegistry.getMenuItems(MenuId.SCMTitle)) { - this.repositoryMenuDisposables.add(MenuRegistry.appendMenuItem(MenuId.SCMSourceControlInline, menuItem)); - } - })); } private onDidRemoveRepository(repository: ISCMRepository): void { diff --git a/src/vs/workbench/services/actions/common/menusExtensionPoint.ts b/src/vs/workbench/services/actions/common/menusExtensionPoint.ts index f74a85a7d0d..812f5ef7abe 100644 --- a/src/vs/workbench/services/actions/common/menusExtensionPoint.ts +++ b/src/vs/workbench/services/actions/common/menusExtensionPoint.ts @@ -149,9 +149,15 @@ const apiMenus: IAPIMenu[] = [ description: localize('menus.scmSourceControl', "The Source Control menu") }, { - key: 'scm/sourceControl/title', + key: 'scm/repositories/title', id: MenuId.SCMSourceControlTitle, - description: localize('menus.scmSourceControlTitle', "The Source Control title menu"), + description: localize('menus.scmSourceControlTitle', "The Source Control Repositories title menu"), + proposed: 'contribSourceControlTitleMenu' + }, + { + key: 'scm/repository', + id: MenuId.SCMSourceControlInline, + description: localize('menus.scmSourceControlInline', "The Source Control repository menu"), proposed: 'contribSourceControlTitleMenu' }, {