diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index 356d6134b5864..c62a3ac55d30b 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -633,7 +633,8 @@ export class VSCodeMenu { private setViewMenu(viewMenu: Electron.Menu): void { const explorer = this.createMenuItem(nls.localize({ key: 'miViewExplorer', comment: ['&& denotes a mnemonic'] }, "&&Explorer"), 'workbench.view.explorer'); const search = this.createMenuItem(nls.localize({ key: 'miViewSearch', comment: ['&& denotes a mnemonic'] }, "&&Search"), 'workbench.view.search'); - const scm = this.createMenuItem(nls.localize({ key: 'miViewSCM', comment: ['&& denotes a mnemonic'] }, "S&&CM"), 'workbench.view.scm'); + const git = this.createMenuItem(nls.localize({ key: 'miViewGit', comment: ['&& denotes a mnemonic'] }, "&&Git"), 'workbench.view.git'); + // const scm = this.createMenuItem(nls.localize({ key: 'miViewSCM', comment: ['&& denotes a mnemonic'] }, "S&&CM"), 'workbench.view.scm'); const debug = this.createMenuItem(nls.localize({ key: 'miViewDebug', comment: ['&& denotes a mnemonic'] }, "&&Debug"), 'workbench.view.debug'); const extensions = this.createMenuItem(nls.localize({ key: 'miViewExtensions', comment: ['&& denotes a mnemonic'] }, "E&&xtensions"), 'workbench.view.extensions'); const output = this.createMenuItem(nls.localize({ key: 'miToggleOutput', comment: ['&& denotes a mnemonic'] }, "&&Output"), 'workbench.action.output.toggleOutput'); @@ -701,7 +702,8 @@ export class VSCodeMenu { __separator__(), explorer, search, - scm, + git, + // scm, debug, extensions, additionalViewlets, diff --git a/src/vs/workbench/parts/git/electron-browser/git.contribution.ts b/src/vs/workbench/parts/git/electron-browser/git.contribution.ts index f85747bf6684c..93c3bdb17f32c 100644 --- a/src/vs/workbench/parts/git/electron-browser/git.contribution.ts +++ b/src/vs/workbench/parts/git/electron-browser/git.contribution.ts @@ -13,8 +13,25 @@ import { Registry } from 'vs/platform/platform'; import { CloneAction } from './gitActions'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actionRegistry'; import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; +import { ToggleViewletAction } from 'vs/workbench/browser/viewlet'; +import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; +import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -if (!SCMPreview.enabled) { +// TODO@joao: remove +class OpenScmViewletAction extends ToggleViewletAction { + + static ID = 'workbench.view.git'; // fake redirect + static LABEL = localize('toggleSCMViewlet', "Show SCM"); + + constructor(id: string, label: string, @IViewletService viewletService: IViewletService, @IWorkbenchEditorService editorService: IWorkbenchEditorService) { + super(id, label, 'workbench.view.scm', viewletService, editorService); + } +} + +if (SCMPreview.enabled) { + Registry.as(WorkbenchActionExtensions.WorkbenchActions) + .registerWorkbenchAction(new SyncActionDescriptor(OpenScmViewletAction, OpenScmViewletAction.ID, OpenScmViewletAction.LABEL), 'View: Show SCM', 'View'); +} else { registerContributions(); // Register Service