@codingame/monaco-vscode-scm-service-override 37.2.0 → 37.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common.d.ts +2 -0
- package/common.js +25 -0
- package/index.d.ts +2 -2
- package/index.js +1 -24
- package/package.json +10 -2
- package/session.d.ts +2 -0
- package/session.js +2 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +9 -9
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiff.contribution.js +14 -14
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffDecorator.js +5 -5
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffModel.js +11 -11
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffWidget.js +24 -18
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +71 -71
- package/vscode/src/vs/workbench/contrib/scm/browser/scmAccessibilityHelp.js +25 -25
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.js +41 -41
- package/vscode/src/vs/workbench/contrib/scm/browser/scmInput.js +9 -9
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +12 -12
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.js +8 -6
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +39 -39
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.js +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js +12 -12
|
@@ -68,7 +68,7 @@ import { SCMInputWidget } from './scmInput.js';
|
|
|
68
68
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
69
69
|
|
|
70
70
|
var ActionButtonRenderer_1, InputRenderer_1, ResourceGroupRenderer_1, ResourceRenderer_1;
|
|
71
|
-
registerCss(scm);
|
|
71
|
+
registerCss(scm, 1);
|
|
72
72
|
function processResourceFilterData(uri, filterData) {
|
|
73
73
|
if (!filterData) {
|
|
74
74
|
return [undefined, undefined];
|
|
@@ -181,7 +181,7 @@ class SCMTreeDragAndDrop {
|
|
|
181
181
|
const items = SCMTreeDragAndDrop.getResourcesFromDragAndDropData(data);
|
|
182
182
|
if (originalEvent.dataTransfer && items?.length) {
|
|
183
183
|
this.instantiationService.invokeFunction(accessor => fillEditorsDragData(accessor, items, originalEvent));
|
|
184
|
-
const fileResources =
|
|
184
|
+
const fileResources = items.filter(s => s.scheme === Schemas.file).map(r => r.fsPath);
|
|
185
185
|
if (fileResources.length) {
|
|
186
186
|
originalEvent.dataTransfer.setData(CodeDataTransfers.FILES, JSON.stringify(fileResources));
|
|
187
187
|
}
|
|
@@ -400,7 +400,7 @@ class RepositoryPaneActionRunner extends ActionRunner {
|
|
|
400
400
|
const selection = this.getSelectedResources().filter(r => isSCMResourceGroup(r) === isContextResourceGroup);
|
|
401
401
|
const contextIsSelected = ( selection.some(s => s === context));
|
|
402
402
|
const actualContext = contextIsSelected ? selection : [context];
|
|
403
|
-
const args =
|
|
403
|
+
const args = actualContext.map(e => ResourceTree.isResourceNode(e) ? ResourceTree.collect(e) : [e]).flat();
|
|
404
404
|
await action.run(...args);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
@@ -533,7 +533,7 @@ let ResourceRenderer = class ResourceRenderer {
|
|
|
533
533
|
renderCompressedElements(node, index, template) {
|
|
534
534
|
const compressed = node.element;
|
|
535
535
|
const folder = compressed.elements[compressed.elements.length - 1];
|
|
536
|
-
const label =
|
|
536
|
+
const label = compressed.elements.map(e => e.name);
|
|
537
537
|
const fileKind = FileKind.FOLDER;
|
|
538
538
|
const matches = createMatches(node.filterData);
|
|
539
539
|
template.fileLabel.setResource({
|
|
@@ -739,7 +739,7 @@ let SCMTreeKeyboardNavigationLabelProvider = class SCMTreeKeyboardNavigationLabe
|
|
|
739
739
|
}
|
|
740
740
|
getCompressedNodeKeyboardNavigationLabel(elements) {
|
|
741
741
|
const folders = elements;
|
|
742
|
-
return
|
|
742
|
+
return folders.map(e => e.name).join("/");
|
|
743
743
|
}
|
|
744
744
|
};
|
|
745
745
|
SCMTreeKeyboardNavigationLabelProvider = ( __decorate([( __param(1, ILabelService))], SCMTreeKeyboardNavigationLabelProvider));
|
|
@@ -785,7 +785,7 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
785
785
|
this.labelService = labelService;
|
|
786
786
|
}
|
|
787
787
|
getWidgetAriaLabel() {
|
|
788
|
-
return localize(
|
|
788
|
+
return localize(17964, "Source Control Management");
|
|
789
789
|
}
|
|
790
790
|
getAriaLabel(element) {
|
|
791
791
|
if (ResourceTree.isResourceNode(element)) {
|
|
@@ -798,15 +798,15 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
798
798
|
} else if (isSCMInput(element)) {
|
|
799
799
|
const verbosity = this.configurationService.getValue(AccessibilityVerbositySettingId.SourceControl) === true;
|
|
800
800
|
if (!verbosity || !this.accessibilityService.isScreenReaderOptimized()) {
|
|
801
|
-
return localize(
|
|
801
|
+
return localize(17965, "Source Control Input");
|
|
802
802
|
}
|
|
803
803
|
const kbLabel = this.keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getLabel();
|
|
804
804
|
return kbLabel ? ( localize(
|
|
805
|
-
|
|
805
|
+
17966,
|
|
806
806
|
"Source Control Input, Use {0} to open Source Control Accessibility Help.",
|
|
807
807
|
kbLabel
|
|
808
808
|
)) : ( localize(
|
|
809
|
-
|
|
809
|
+
17967,
|
|
810
810
|
"Source Control Input, Run the Open Accessibility Help command for more information."
|
|
811
811
|
));
|
|
812
812
|
} else if (isSCMActionButton(element)) {
|
|
@@ -841,33 +841,33 @@ const Menus = {
|
|
|
841
841
|
ViewSort: ( new MenuId("SCMViewSort")),
|
|
842
842
|
Repositories: ( new MenuId("SCMRepositories"))};
|
|
843
843
|
const ContextKeys = {
|
|
844
|
-
SCMViewMode:
|
|
845
|
-
SCMViewSortKey:
|
|
846
|
-
SCMViewAreAllRepositoriesCollapsed:
|
|
847
|
-
SCMViewIsAnyRepositoryCollapsible:
|
|
848
|
-
SCMProvider:
|
|
849
|
-
SCMProviderRootUri:
|
|
850
|
-
SCMProviderHasRootUri:
|
|
851
|
-
SCMHistoryItemCount:
|
|
852
|
-
SCMHistoryViewMode:
|
|
853
|
-
SCMCurrentHistoryItemRefHasRemote:
|
|
854
|
-
SCMCurrentHistoryItemRefHasBase:
|
|
855
|
-
SCMCurrentHistoryItemRefInFilter:
|
|
856
|
-
RepositoryCount:
|
|
857
|
-
RepositoryVisibilityCount:
|
|
844
|
+
SCMViewMode: new RawContextKey("scmViewMode", ViewMode.List),
|
|
845
|
+
SCMViewSortKey: new RawContextKey("scmViewSortKey", ViewSortKey.Path),
|
|
846
|
+
SCMViewAreAllRepositoriesCollapsed: new RawContextKey("scmViewAreAllRepositoriesCollapsed", false),
|
|
847
|
+
SCMViewIsAnyRepositoryCollapsible: new RawContextKey("scmViewIsAnyRepositoryCollapsible", false),
|
|
848
|
+
SCMProvider: new RawContextKey("scmProvider", undefined),
|
|
849
|
+
SCMProviderRootUri: new RawContextKey("scmProviderRootUri", undefined),
|
|
850
|
+
SCMProviderHasRootUri: new RawContextKey("scmProviderHasRootUri", undefined),
|
|
851
|
+
SCMHistoryItemCount: new RawContextKey("scmHistoryItemCount", 0),
|
|
852
|
+
SCMHistoryViewMode: new RawContextKey("scmHistoryViewMode", ViewMode.List),
|
|
853
|
+
SCMCurrentHistoryItemRefHasRemote: new RawContextKey("scmCurrentHistoryItemRefHasRemote", false),
|
|
854
|
+
SCMCurrentHistoryItemRefHasBase: new RawContextKey("scmCurrentHistoryItemRefHasBase", false),
|
|
855
|
+
SCMCurrentHistoryItemRefInFilter: new RawContextKey("scmCurrentHistoryItemRefInFilter", false),
|
|
856
|
+
RepositoryCount: new RawContextKey("scmRepositoryCount", 0),
|
|
857
|
+
RepositoryVisibilityCount: new RawContextKey("scmRepositoryVisibleCount", 0),
|
|
858
858
|
RepositoryVisibility(repository) {
|
|
859
|
-
return
|
|
859
|
+
return new RawContextKey(`scmRepositoryVisible:${repository.provider.id}`, false);
|
|
860
860
|
}
|
|
861
861
|
};
|
|
862
862
|
MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
|
|
863
|
-
title: ( localize(
|
|
863
|
+
title: ( localize(17968, "View & Sort")),
|
|
864
864
|
submenu: Menus.ViewSort,
|
|
865
865
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("view", VIEW_PANE_ID)), ( ContextKeys.RepositoryCount.notEqualsTo(0)))),
|
|
866
866
|
group: "0_view&sort",
|
|
867
867
|
order: 1
|
|
868
868
|
});
|
|
869
869
|
MenuRegistry.appendMenuItem(Menus.ViewSort, {
|
|
870
|
-
title: ( localize(
|
|
870
|
+
title: ( localize(17969, "Repositories")),
|
|
871
871
|
submenu: Menus.Repositories,
|
|
872
872
|
when: ContextKeyExpr.greater(ContextKeys.RepositoryCount.key, 1),
|
|
873
873
|
group: "0_repositories"
|
|
@@ -959,7 +959,7 @@ class SetListViewModeAction extends ViewAction {
|
|
|
959
959
|
constructor(id = "workbench.scm.action.setListViewMode", menu = {}) {
|
|
960
960
|
super({
|
|
961
961
|
id,
|
|
962
|
-
title: ( localize(
|
|
962
|
+
title: ( localize(17970, "View as List")),
|
|
963
963
|
viewId: VIEW_PANE_ID,
|
|
964
964
|
f1: false,
|
|
965
965
|
icon: Codicon.listTree,
|
|
@@ -990,7 +990,7 @@ class SetTreeViewModeAction extends ViewAction {
|
|
|
990
990
|
constructor(id = "workbench.scm.action.setTreeViewMode", menu = {}) {
|
|
991
991
|
super({
|
|
992
992
|
id,
|
|
993
|
-
title: ( localize(
|
|
993
|
+
title: ( localize(17971, "View as Tree")),
|
|
994
994
|
viewId: VIEW_PANE_ID,
|
|
995
995
|
f1: false,
|
|
996
996
|
icon: Codicon.listFlat,
|
|
@@ -1044,17 +1044,17 @@ class RepositorySortAction extends Action2 {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
class RepositorySortByDiscoveryTimeAction extends RepositorySortAction {
|
|
1046
1046
|
constructor() {
|
|
1047
|
-
super(ISCMRepositorySortKey.DiscoveryTime, ( localize(
|
|
1047
|
+
super(ISCMRepositorySortKey.DiscoveryTime, ( localize(17972, "Sort by Discovery Time")));
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
1050
|
class RepositorySortByNameAction extends RepositorySortAction {
|
|
1051
1051
|
constructor() {
|
|
1052
|
-
super(ISCMRepositorySortKey.Name, ( localize(
|
|
1052
|
+
super(ISCMRepositorySortKey.Name, ( localize(17973, "Sort by Name")));
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
1055
|
class RepositorySortByPathAction extends RepositorySortAction {
|
|
1056
1056
|
constructor() {
|
|
1057
|
-
super(ISCMRepositorySortKey.Path, ( localize(
|
|
1057
|
+
super(ISCMRepositorySortKey.Path, ( localize(17974, "Sort by Path")));
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
1060
|
registerAction2(RepositorySortByDiscoveryTimeAction);
|
|
@@ -1087,12 +1087,12 @@ class RepositorySelectionModeAction extends Action2 {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
class RepositorySingleSelectionModeAction extends RepositorySelectionModeAction {
|
|
1089
1089
|
constructor() {
|
|
1090
|
-
super(ISCMRepositorySelectionMode.Single, ( localize(
|
|
1090
|
+
super(ISCMRepositorySelectionMode.Single, ( localize(17975, "Select Single Repository")), 1);
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
1093
|
class RepositoryMultiSelectionModeAction extends RepositorySelectionModeAction {
|
|
1094
1094
|
constructor() {
|
|
1095
|
-
super(ISCMRepositorySelectionMode.Multiple, ( localize(
|
|
1095
|
+
super(ISCMRepositorySelectionMode.Multiple, ( localize(17976, "Select Multiple Repositories")), 2);
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
1098
|
registerAction2(RepositorySingleSelectionModeAction);
|
|
@@ -1119,17 +1119,17 @@ class SetSortKeyAction extends ViewAction {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
class SetSortByNameAction extends SetSortKeyAction {
|
|
1121
1121
|
constructor() {
|
|
1122
|
-
super(ViewSortKey.Name, ( localize(
|
|
1122
|
+
super(ViewSortKey.Name, ( localize(17977, "Sort Changes by Name")));
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
class SetSortByPathAction extends SetSortKeyAction {
|
|
1126
1126
|
constructor() {
|
|
1127
|
-
super(ViewSortKey.Path, ( localize(
|
|
1127
|
+
super(ViewSortKey.Path, ( localize(17978, "Sort Changes by Path")));
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
1130
|
class SetSortByStatusAction extends SetSortKeyAction {
|
|
1131
1131
|
constructor() {
|
|
1132
|
-
super(ViewSortKey.Status, ( localize(
|
|
1132
|
+
super(ViewSortKey.Status, ( localize(17979, "Sort Changes by Status")));
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
1135
|
registerAction2(SetSortByNameAction);
|
|
@@ -1139,7 +1139,7 @@ class CollapseAllRepositoriesAction extends ViewAction {
|
|
|
1139
1139
|
constructor() {
|
|
1140
1140
|
super({
|
|
1141
1141
|
id: `workbench.scm.action.collapseAllRepositories`,
|
|
1142
|
-
title: ( localize(
|
|
1142
|
+
title: ( localize(17980, "Collapse All Repositories")),
|
|
1143
1143
|
viewId: VIEW_PANE_ID,
|
|
1144
1144
|
f1: false,
|
|
1145
1145
|
icon: Codicon.collapseAll,
|
|
@@ -1158,7 +1158,7 @@ class ExpandAllRepositoriesAction extends ViewAction {
|
|
|
1158
1158
|
constructor() {
|
|
1159
1159
|
super({
|
|
1160
1160
|
id: `workbench.scm.action.expandAllRepositories`,
|
|
1161
|
-
title: ( localize(
|
|
1161
|
+
title: ( localize(17981, "Expand All Repositories")),
|
|
1162
1162
|
viewId: VIEW_PANE_ID,
|
|
1163
1163
|
f1: false,
|
|
1164
1164
|
icon: Codicon.expandAll,
|
|
@@ -1179,7 +1179,7 @@ class CollapseAllAction extends ViewAction {
|
|
|
1179
1179
|
constructor() {
|
|
1180
1180
|
super({
|
|
1181
1181
|
id: `workbench.scm.action.collapseAll`,
|
|
1182
|
-
title: ( localize(
|
|
1182
|
+
title: ( localize(17982, "Collapse All")),
|
|
1183
1183
|
viewId: VIEW_PANE_ID,
|
|
1184
1184
|
f1: false,
|
|
1185
1185
|
icon: Codicon.collapseAll,
|
|
@@ -16,7 +16,7 @@ import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/w
|
|
|
16
16
|
import { ViewPaneContainer } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
17
17
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
18
18
|
|
|
19
|
-
registerCss(scm);
|
|
19
|
+
registerCss(scm, 1);
|
|
20
20
|
let SCMViewPaneContainer = class SCMViewPaneContainer extends ViewPaneContainer {
|
|
21
21
|
constructor(
|
|
22
22
|
layoutService,
|
|
@@ -45,8 +45,8 @@ function getRepositoryName(workspaceContextService, repository) {
|
|
|
45
45
|
return folder?.uri.toString() === ( repository.provider.rootUri.toString()) ? folder.name : basename(repository.provider.rootUri);
|
|
46
46
|
}
|
|
47
47
|
const RepositoryContextKeys = {
|
|
48
|
-
RepositorySortKey:
|
|
49
|
-
RepositorySelectionMode:
|
|
48
|
+
RepositorySortKey: new RawContextKey("scmRepositorySortKey", ISCMRepositorySortKey.DiscoveryTime),
|
|
49
|
+
RepositorySelectionMode: new RawContextKey("scmRepositorySelectionMode", ISCMRepositorySelectionMode.Single)
|
|
50
50
|
};
|
|
51
51
|
let RepositoryPicker = class RepositoryPicker {
|
|
52
52
|
constructor(
|
|
@@ -60,7 +60,7 @@ let RepositoryPicker = class RepositoryPicker {
|
|
|
60
60
|
this._quickInputService = _quickInputService;
|
|
61
61
|
this._scmViewService = _scmViewService;
|
|
62
62
|
this._autoQuickPickItem = {
|
|
63
|
-
label: ( localize(
|
|
63
|
+
label: ( localize(17983, "Auto")),
|
|
64
64
|
description: this._autoQuickItemDescription,
|
|
65
65
|
repository: "auto"
|
|
66
66
|
};
|
|
@@ -72,7 +72,7 @@ let RepositoryPicker = class RepositoryPicker {
|
|
|
72
72
|
const activeRepository = this._scmViewService.activeRepository.get();
|
|
73
73
|
const repository = activeRepository?.repository;
|
|
74
74
|
const pinned = activeRepository?.pinned === true;
|
|
75
|
-
picks.push(...
|
|
75
|
+
picks.push(...this._scmViewService.repositories.map(r => {
|
|
76
76
|
const icon = getSCMRepositoryIcon(activeRepository, r);
|
|
77
77
|
return {
|
|
78
78
|
label: r.provider.name,
|
|
@@ -80,7 +80,7 @@ let RepositoryPicker = class RepositoryPicker {
|
|
|
80
80
|
iconClass: ThemeIcon.asClassName(icon),
|
|
81
81
|
repository: r
|
|
82
82
|
};
|
|
83
|
-
}))
|
|
83
|
+
}));
|
|
84
84
|
const activeItem = pinned ? picks.find(p => p.type !== "separator" && p.repository === repository) : this._autoQuickPickItem;
|
|
85
85
|
return this._quickInputService.pick(picks, {
|
|
86
86
|
placeHolder: this._placeHolder,
|
|
@@ -91,13 +91,13 @@ let RepositoryPicker = class RepositoryPicker {
|
|
|
91
91
|
RepositoryPicker = ( __decorate([( __param(2, IQuickInputService)), ( __param(3, ISCMViewService))], RepositoryPicker));
|
|
92
92
|
let SCMViewService = class SCMViewService {
|
|
93
93
|
get repositories() {
|
|
94
|
-
return
|
|
94
|
+
return this._repositories.filter(r => r.repository.provider.isHidden !== true).map(r => r.repository);
|
|
95
95
|
}
|
|
96
96
|
get visibleRepositories() {
|
|
97
97
|
if (this._repositoriesSortKey === ISCMRepositorySortKey.DiscoveryTime) {
|
|
98
|
-
return
|
|
98
|
+
return this._repositories.filter(r => r.repository.provider.isHidden !== true && r.selectionIndex !== -1).sort((r1, r2) => r1.selectionIndex - r2.selectionIndex).map(r => r.repository);
|
|
99
99
|
}
|
|
100
|
-
return
|
|
100
|
+
return this._repositories.filter(r => r.repository.provider.isHidden !== true && r.selectionIndex !== -1).map(r => r.repository);
|
|
101
101
|
}
|
|
102
102
|
set visibleRepositories(visibleRepositories) {
|
|
103
103
|
const set = ( new Set(visibleRepositories));
|
|
@@ -350,7 +350,7 @@ let SCMViewService = class SCMViewService {
|
|
|
350
350
|
}
|
|
351
351
|
this._onDidChangeRepositories.fire({
|
|
352
352
|
added,
|
|
353
|
-
removed:
|
|
353
|
+
removed: removed.map(r => r.repository)
|
|
354
354
|
});
|
|
355
355
|
if (removed.length === 1 && removed[0].focused && this.visibleRepositories.length > 0) {
|
|
356
356
|
this.focus(this.visibleRepositories[0]);
|
|
@@ -433,7 +433,7 @@ let SCMViewService = class SCMViewService {
|
|
|
433
433
|
return nameComparison;
|
|
434
434
|
}
|
|
435
435
|
getMaxSelectionIndex() {
|
|
436
|
-
return this._repositories.length === 0 ? -1 : Math.max(...
|
|
436
|
+
return this._repositories.length === 0 ? -1 : Math.max(...this._repositories.map(r => r.selectionIndex));
|
|
437
437
|
}
|
|
438
438
|
getViewSortOrder() {
|
|
439
439
|
const sortOder = this.configurationService.getValue("scm.repositories.sortOrder");
|
|
@@ -456,8 +456,8 @@ let SCMViewService = class SCMViewService {
|
|
|
456
456
|
if (!this.didFinishLoadingRepositories.get()) {
|
|
457
457
|
return;
|
|
458
458
|
}
|
|
459
|
-
const all =
|
|
460
|
-
const visible =
|
|
459
|
+
const all = this.repositories.map(r => getProviderStorageKey(r.provider));
|
|
460
|
+
const visible = this.visibleRepositories.map(r => all.indexOf(getProviderStorageKey(r.provider)));
|
|
461
461
|
this.previousState = {
|
|
462
462
|
all,
|
|
463
463
|
visible,
|