mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
SCM - Add "Reopen Closed Repositories..." action to the "Source control Repositories" view title bar (#203512)
This commit is contained in:
parent
6c21641885
commit
b26b05031e
|
@ -18,6 +18,7 @@
|
|||
"contribSourceControlHistoryItemGroupMenu",
|
||||
"contribSourceControlHistoryItemMenu",
|
||||
"contribSourceControlInputBoxMenu",
|
||||
"contribSourceControlTitleMenu",
|
||||
"contribViewsWelcome",
|
||||
"diffCommand",
|
||||
"editSessionIdentityProvider",
|
||||
|
@ -94,6 +95,7 @@
|
|||
{
|
||||
"command": "git.reopenClosedRepositories",
|
||||
"title": "%command.reopenClosedRepositories%",
|
||||
"icon": "$(repo)",
|
||||
"category": "Git",
|
||||
"enablement": "!operationInProgress && git.closedRepositoryCount != 0"
|
||||
},
|
||||
|
@ -1448,6 +1450,13 @@
|
|||
"when": "scmProvider == git"
|
||||
}
|
||||
],
|
||||
"scm/sourceControl/title": [
|
||||
{
|
||||
"command": "git.reopenClosedRepositories",
|
||||
"group": "navigation@1",
|
||||
"when": "scmProvider == git && git.closedRepositoryCount > 0"
|
||||
}
|
||||
],
|
||||
"scm/sourceControl": [
|
||||
{
|
||||
"command": "git.close",
|
||||
|
|
|
@ -120,6 +120,7 @@ export class MenuId {
|
|||
static readonly SCMResourceGroupContext = new MenuId('SCMResourceGroupContext');
|
||||
static readonly SCMSourceControl = new MenuId('SCMSourceControl');
|
||||
static readonly SCMSourceControlInline = new MenuId('SCMSourceControlInline');
|
||||
static readonly SCMSourceControlTitle = new MenuId('SCMSourceControlTitle');
|
||||
static readonly SCMTitle = new MenuId('SCMTitle');
|
||||
static readonly SearchContext = new MenuId('SearchContext');
|
||||
static readonly SearchActionMenu = new MenuId('SearchActionContext');
|
||||
|
|
|
@ -57,7 +57,7 @@ export class SCMRepositoriesViewPane extends ViewPane {
|
|||
@IThemeService themeService: IThemeService,
|
||||
@ITelemetryService telemetryService: ITelemetryService
|
||||
) {
|
||||
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
||||
super({ ...options, titleMenuId: MenuId.SCMSourceControlTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
||||
}
|
||||
|
||||
protected override renderBody(container: HTMLElement): void {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { ViewPane, IViewPaneOptions, ViewAction } from 'vs/workbench/browser/par
|
|||
import { append, $, Dimension, asCSSUrl, trackFocus, clearNode, prepend } from 'vs/base/browser/dom';
|
||||
import { IListVirtualDelegate, IIdentityProvider } from 'vs/base/browser/ui/list/list';
|
||||
import { ISCMHistoryItem, ISCMHistoryItemChange, ISCMHistoryProviderCacheEntry, SCMHistoryItemChangeTreeElement, SCMHistoryItemGroupTreeElement, SCMHistoryItemTreeElement, SCMViewSeparatorElement } from 'vs/workbench/contrib/scm/common/history';
|
||||
import { ISCMResourceGroup, ISCMResource, InputValidationType, ISCMRepository, ISCMInput, IInputValidation, ISCMViewService, ISCMViewVisibleRepositoryChangeEvent, ISCMService, SCMInputChangeReason, VIEW_PANE_ID, ISCMActionButton, ISCMActionButtonDescriptor, ISCMRepositorySortKey, REPOSITORIES_VIEW_PANE_ID, ISCMInputValueProviderContext, ISCMProvider } from 'vs/workbench/contrib/scm/common/scm';
|
||||
import { ISCMResourceGroup, ISCMResource, InputValidationType, ISCMRepository, ISCMInput, IInputValidation, ISCMViewService, ISCMViewVisibleRepositoryChangeEvent, ISCMService, SCMInputChangeReason, VIEW_PANE_ID, ISCMActionButton, ISCMActionButtonDescriptor, ISCMRepositorySortKey, ISCMInputValueProviderContext, ISCMProvider } from 'vs/workbench/contrib/scm/common/scm';
|
||||
import { ResourceLabels, IResourceLabel, IFileLabelOptions } from 'vs/workbench/browser/labels';
|
||||
import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
@ -1639,8 +1639,7 @@ abstract class RepositorySortAction extends ViewAction<SCMViewPane> {
|
|||
group: '1_sort'
|
||||
},
|
||||
{
|
||||
id: MenuId.ViewTitle,
|
||||
when: ContextKeyExpr.equals('view', REPOSITORIES_VIEW_PANE_ID),
|
||||
id: MenuId.SCMSourceControlTitle,
|
||||
group: '1_sort',
|
||||
},
|
||||
]
|
||||
|
|
|
@ -124,6 +124,12 @@ const apiMenus: IAPIMenu[] = [
|
|||
id: MenuId.SCMSourceControl,
|
||||
description: localize('menus.scmSourceControl', "The Source Control menu")
|
||||
},
|
||||
{
|
||||
key: 'scm/sourceControl/title',
|
||||
id: MenuId.SCMSourceControlTitle,
|
||||
description: localize('menus.scmSourceControlTitle', "The Source Control title menu"),
|
||||
proposed: 'contribSourceControlTitleMenu'
|
||||
},
|
||||
{
|
||||
key: 'scm/resourceState/context',
|
||||
id: MenuId.SCMResourceContext,
|
||||
|
|
|
@ -36,6 +36,7 @@ export const allApiProposals = Object.freeze({
|
|||
contribSourceControlHistoryItemGroupMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemGroupMenu.d.ts',
|
||||
contribSourceControlHistoryItemMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts',
|
||||
contribSourceControlInputBoxMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts',
|
||||
contribSourceControlTitleMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts',
|
||||
contribStatusBarItems: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts',
|
||||
contribViewsRemote: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts',
|
||||
contribViewsWelcome: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts',
|
||||
|
|
7
src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts
vendored
Normal file
7
src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// empty placeholder declaration for the `scm/sourceControl/title`-menu contribution point
|
||||
// https://github.com/microsoft/vscode/issues/203511
|
Loading…
Reference in a new issue