@codingame/monaco-vscode-scm-service-override 7.1.0 → 7.1.1
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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +62 -95
- package/vscode/src/vs/workbench/contrib/scm/browser/media/scm.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +16 -5
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +112 -164
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +54 -24
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +3 -7
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +598 -380
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.js +2 -3
- package/vscode/src/vs/workbench/contrib/scm/browser/workingSet.js +39 -43
|
@@ -18,7 +18,7 @@ import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/comma
|
|
|
18
18
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
19
19
|
import { MenuItemAction, MenuId, MenuRegistry, Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
20
20
|
import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
|
|
21
|
-
import { ActionRunner, Action, Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
21
|
+
import { ActionRunner, Action, toAction, Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
22
22
|
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
23
23
|
import { registerThemingParticipant } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
24
24
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
@@ -35,11 +35,10 @@ import { comparePaths, compareFileNames } from 'vscode/vscode/vs/base/common/com
|
|
|
35
35
|
import { createMatches } from 'vscode/vscode/vs/base/common/filters';
|
|
36
36
|
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
37
37
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
38
|
-
import {
|
|
38
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
39
39
|
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
40
40
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
41
41
|
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
42
|
-
import { PANEL_BACKGROUND, SIDE_BAR_BACKGROUND } from 'vscode/vscode/vs/workbench/common/theme';
|
|
43
42
|
import { CodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
44
43
|
import { getSimpleEditorOptions } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
45
44
|
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
@@ -98,28 +97,32 @@ import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
|
98
97
|
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
99
98
|
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
100
99
|
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
101
|
-
import { WorkbenchToolBar
|
|
100
|
+
import { WorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
|
|
102
101
|
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
103
102
|
import { DropdownWithPrimaryActionViewItem } from 'vscode/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem';
|
|
104
103
|
import { clamp, rot } from 'vscode/vscode/vs/base/common/numbers';
|
|
105
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
106
104
|
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
105
|
+
import { WorkbenchHoverDelegate } from 'vscode/vscode/vs/platform/hover/browser/hover';
|
|
107
106
|
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
108
107
|
import { OpenScmGroupAction } from 'vscode/vscode/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver';
|
|
109
108
|
import { HoverController } from 'vscode/vscode/vs/editor/contrib/hover/browser/hoverController';
|
|
110
|
-
import 'vscode/vscode/vs/base/common/arrays';
|
|
109
|
+
import { equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
111
110
|
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
112
111
|
import { autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
113
112
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
114
|
-
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
115
|
-
import { renderSCMHistoryItemGraph, toISCMHistoryItemViewModelArray } from './scmHistory.js';
|
|
113
|
+
import { getDefaultHoverDelegate, createInstantHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
114
|
+
import { renderSCMHistoryItemGraph, historyItemGroupLocal, historyItemGroupRemote, historyItemGroupBase, historyItemGroupHoverLabelForeground, toISCMHistoryItemViewModelArray } from './scmHistory.js';
|
|
115
|
+
import { PlaceholderTextContribution } from 'vscode/vscode/vs/editor/contrib/placeholderText/browser/placeholderTextContribution';
|
|
116
|
+
import { HoverPosition } from 'vscode/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
117
|
+
import { Position } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
118
|
+
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
119
|
+
import { fromNow } from 'vscode/vscode/vs/base/common/date';
|
|
116
120
|
|
|
117
121
|
var ActionButtonRenderer_1, InputRenderer_1, ResourceGroupRenderer_1, ResourceRenderer_1, HistoryItemGroupRenderer_1, HistoryItemRenderer_1, HistoryItem2Renderer_1, HistoryItemChangeRenderer_1, SeparatorRenderer_1, SCMInputWidget_1;
|
|
118
|
-
const
|
|
119
|
-
registerColor('scm.
|
|
120
|
-
registerColor('scm.
|
|
121
|
-
registerColor('scm.
|
|
122
|
-
registerColor('scm.historyItemSelectedStatisticsBorder', ( (transparent(listActiveSelectionForeground, 0.2))), ( localizeWithPath(_moduleId, 3, "History item selected statistics border color.")));
|
|
122
|
+
const historyItemAdditionsForeground = registerColor('scm.historyItemAdditionsForeground', 'gitDecoration.addedResourceForeground', ( localize(6360, "History item additions foreground color.")));
|
|
123
|
+
const historyItemDeletionsForeground = registerColor('scm.historyItemDeletionsForeground', 'gitDecoration.deletedResourceForeground', ( localize(6361, "History item deletions foreground color.")));
|
|
124
|
+
registerColor('scm.historyItemStatisticsBorder', ( (transparent(foreground, 0.2))), ( localize(6362, "History item statistics border color.")));
|
|
125
|
+
registerColor('scm.historyItemSelectedStatisticsBorder', ( (transparent(listActiveSelectionForeground, 0.2))), ( localize(6363, "History item selected statistics border color.")));
|
|
123
126
|
function processResourceFilterData(uri, filterData) {
|
|
124
127
|
if (!filterData) {
|
|
125
128
|
return [undefined, undefined];
|
|
@@ -664,6 +667,68 @@ class HistoryItemActionRunner extends ActionRunner {
|
|
|
664
667
|
await action.run(...args);
|
|
665
668
|
}
|
|
666
669
|
}
|
|
670
|
+
class HistoryItemActionRunner2 extends ActionRunner {
|
|
671
|
+
constructor(getSelectedHistoryItems) {
|
|
672
|
+
super();
|
|
673
|
+
this.getSelectedHistoryItems = getSelectedHistoryItems;
|
|
674
|
+
}
|
|
675
|
+
async runAction(action, context) {
|
|
676
|
+
if (!(action instanceof MenuItemAction)) {
|
|
677
|
+
return super.runAction(action, context);
|
|
678
|
+
}
|
|
679
|
+
const args = [];
|
|
680
|
+
args.push(context.repository.provider);
|
|
681
|
+
const selection = this.getSelectedHistoryItems();
|
|
682
|
+
const contextIsSelected = ( (selection.some(s => s === context)));
|
|
683
|
+
if (contextIsSelected && selection.length > 1) {
|
|
684
|
+
args.push(...( (selection.map(h => ({
|
|
685
|
+
id: h.historyItemViewModel.historyItem.id,
|
|
686
|
+
parentIds: h.historyItemViewModel.historyItem.parentIds,
|
|
687
|
+
message: h.historyItemViewModel.historyItem.message,
|
|
688
|
+
author: h.historyItemViewModel.historyItem.author,
|
|
689
|
+
icon: h.historyItemViewModel.historyItem.icon,
|
|
690
|
+
timestamp: h.historyItemViewModel.historyItem.timestamp,
|
|
691
|
+
statistics: h.historyItemViewModel.historyItem.statistics,
|
|
692
|
+
})))));
|
|
693
|
+
}
|
|
694
|
+
else {
|
|
695
|
+
args.push({
|
|
696
|
+
id: context.historyItemViewModel.historyItem.id,
|
|
697
|
+
parentIds: context.historyItemViewModel.historyItem.parentIds,
|
|
698
|
+
message: context.historyItemViewModel.historyItem.message,
|
|
699
|
+
author: context.historyItemViewModel.historyItem.author,
|
|
700
|
+
icon: context.historyItemViewModel.historyItem.icon,
|
|
701
|
+
timestamp: context.historyItemViewModel.historyItem.timestamp,
|
|
702
|
+
statistics: context.historyItemViewModel.historyItem.statistics,
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
await action.run(...args);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
let HistoryItemHoverDelegate = class HistoryItemHoverDelegate extends WorkbenchHoverDelegate {
|
|
709
|
+
constructor(viewContainerLocation, sideBarPosition, configurationService, hoverService) {
|
|
710
|
+
super('element', true, () => this.getHoverOptions(), configurationService, hoverService);
|
|
711
|
+
this.viewContainerLocation = viewContainerLocation;
|
|
712
|
+
this.sideBarPosition = sideBarPosition;
|
|
713
|
+
}
|
|
714
|
+
getHoverOptions() {
|
|
715
|
+
let hoverPosition;
|
|
716
|
+
if (this.viewContainerLocation === ViewContainerLocation.Sidebar) {
|
|
717
|
+
hoverPosition = this.sideBarPosition === Position.LEFT ? HoverPosition.RIGHT : HoverPosition.LEFT;
|
|
718
|
+
}
|
|
719
|
+
else if (this.viewContainerLocation === ViewContainerLocation.AuxiliaryBar) {
|
|
720
|
+
hoverPosition = this.sideBarPosition === Position.LEFT ? HoverPosition.LEFT : HoverPosition.RIGHT;
|
|
721
|
+
}
|
|
722
|
+
else {
|
|
723
|
+
hoverPosition = HoverPosition.RIGHT;
|
|
724
|
+
}
|
|
725
|
+
return { additionalClasses: ['history-item-hover'], position: { hoverPosition, forcePosition: true } };
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
HistoryItemHoverDelegate = ( (__decorate([
|
|
729
|
+
( (__param(2, IConfigurationService))),
|
|
730
|
+
( (__param(3, IHoverService)))
|
|
731
|
+
], HistoryItemHoverDelegate)));
|
|
667
732
|
let HistoryItemRenderer = class HistoryItemRenderer {
|
|
668
733
|
static { HistoryItemRenderer_1 = this; }
|
|
669
734
|
static { this.TEMPLATE_ID = 'history-item'; }
|
|
@@ -744,18 +809,12 @@ let HistoryItemRenderer = class HistoryItemRenderer {
|
|
|
744
809
|
if (historyItem.statistics) {
|
|
745
810
|
const statsAriaLabel = [
|
|
746
811
|
historyItem.statistics.files === 1 ?
|
|
747
|
-
(
|
|
748
|
-
(
|
|
749
|
-
historyItem.statistics.insertions === 1 ? (
|
|
750
|
-
historyItem.statistics.insertions > 1 ? (
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
"{0} insertions{1}",
|
|
754
|
-
historyItem.statistics.insertions,
|
|
755
|
-
'(+)'
|
|
756
|
-
)) : '',
|
|
757
|
-
historyItem.statistics.deletions === 1 ? ( localizeWithPath(_moduleId, 8, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
|
|
758
|
-
historyItem.statistics.deletions > 1 ? ( localizeWithPath(_moduleId, 9, "{0} deletions{1}", historyItem.statistics.deletions, '(-)')) : ''
|
|
812
|
+
( localize(6364, "{0} file changed", historyItem.statistics.files)) :
|
|
813
|
+
( localize(6365, "{0} files changed", historyItem.statistics.files)),
|
|
814
|
+
historyItem.statistics.insertions === 1 ? ( localize(6366, "{0} insertion{1}", historyItem.statistics.insertions, '(+)')) :
|
|
815
|
+
historyItem.statistics.insertions > 1 ? ( localize(6367, "{0} insertions{1}", historyItem.statistics.insertions, '(+)')) : '',
|
|
816
|
+
historyItem.statistics.deletions === 1 ? ( localize(6368, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
|
|
817
|
+
historyItem.statistics.deletions > 1 ? ( localize(6369, "{0} deletions{1}", historyItem.statistics.deletions, '(-)')) : ''
|
|
759
818
|
];
|
|
760
819
|
const statsTitle = statsAriaLabel.filter(l => l !== '').join(', ');
|
|
761
820
|
templateData.statsContainer.setAttribute('aria-label', statsTitle);
|
|
@@ -783,8 +842,10 @@ let HistoryItem2Renderer = class HistoryItem2Renderer {
|
|
|
783
842
|
static { HistoryItem2Renderer_1 = this; }
|
|
784
843
|
static { this.TEMPLATE_ID = 'history-item-2'; }
|
|
785
844
|
get templateId() { return HistoryItem2Renderer_1.TEMPLATE_ID; }
|
|
786
|
-
constructor(hoverService) {
|
|
845
|
+
constructor(hoverDelegate, hoverService, themeService) {
|
|
846
|
+
this.hoverDelegate = hoverDelegate;
|
|
787
847
|
this.hoverService = hoverService;
|
|
848
|
+
this.themeService = themeService;
|
|
788
849
|
}
|
|
789
850
|
renderTemplate(container) {
|
|
790
851
|
container.parentElement.parentElement.querySelector('.monaco-tl-twistie').classList.add('force-no-twistie');
|
|
@@ -796,23 +857,27 @@ let HistoryItem2Renderer = class HistoryItem2Renderer {
|
|
|
796
857
|
)));
|
|
797
858
|
const labelContainer = append(element, $('.label-container'));
|
|
798
859
|
element.appendChild(labelContainer);
|
|
799
|
-
return { graphContainer, label: iconLabel, labelContainer, elementDisposables: ( (new DisposableStore())), disposables: ( (new DisposableStore())) };
|
|
860
|
+
return { element, graphContainer, label: iconLabel, labelContainer, elementDisposables: ( (new DisposableStore())), disposables: ( (new DisposableStore())) };
|
|
800
861
|
}
|
|
801
862
|
renderElement(node, index, templateData, height) {
|
|
802
863
|
const historyItemViewModel = node.element.historyItemViewModel;
|
|
803
864
|
const historyItem = historyItemViewModel.historyItem;
|
|
865
|
+
const historyItemHover = this.hoverService.setupManagedHover(this.hoverDelegate, templateData.element, this.getTooltip(node.element));
|
|
866
|
+
templateData.elementDisposables.add(historyItemHover);
|
|
804
867
|
templateData.graphContainer.textContent = '';
|
|
805
868
|
templateData.graphContainer.appendChild(renderSCMHistoryItemGraph(historyItemViewModel));
|
|
806
|
-
const title = this.getTooltip(historyItemViewModel);
|
|
807
869
|
const [matches, descriptionMatches] = this.processMatches(historyItemViewModel, node.filterData);
|
|
808
|
-
templateData.label.setLabel(historyItem.message,
|
|
870
|
+
templateData.label.setLabel(historyItem.message, historyItem.author, { matches, descriptionMatches });
|
|
809
871
|
templateData.labelContainer.textContent = '';
|
|
810
872
|
if (historyItem.labels) {
|
|
873
|
+
const instantHoverDelegate = createInstantHoverDelegate();
|
|
874
|
+
templateData.elementDisposables.add(instantHoverDelegate);
|
|
811
875
|
for (const label of historyItem.labels) {
|
|
812
876
|
if (label.icon && ThemeIcon.isThemeIcon(label.icon)) {
|
|
813
877
|
const icon = append(templateData.labelContainer, $('div.label'));
|
|
814
878
|
icon.classList.add(...ThemeIcon.asClassNameArray(label.icon));
|
|
815
|
-
|
|
879
|
+
const hover = this.hoverService.setupManagedHover(instantHoverDelegate, icon, label.title);
|
|
880
|
+
templateData.elementDisposables.add(hover);
|
|
816
881
|
}
|
|
817
882
|
}
|
|
818
883
|
}
|
|
@@ -820,17 +885,53 @@ let HistoryItem2Renderer = class HistoryItem2Renderer {
|
|
|
820
885
|
renderCompressedElements(node, index, templateData, height) {
|
|
821
886
|
throw ( (new Error('Should never happen since node is incompressible')));
|
|
822
887
|
}
|
|
823
|
-
getTooltip(
|
|
824
|
-
const
|
|
888
|
+
getTooltip(element) {
|
|
889
|
+
const colorTheme = this.themeService.getColorTheme();
|
|
890
|
+
const historyItem = element.historyItemViewModel.historyItem;
|
|
891
|
+
const currentHistoryItemGroup = element.repository.provider.historyProvider.get()?.currentHistoryItemGroup?.get();
|
|
825
892
|
const markdown = ( (new MarkdownString('', { isTrusted: true, supportThemeIcons: true })));
|
|
826
893
|
if (historyItem.author) {
|
|
827
|
-
markdown.appendMarkdown(`$(account) **${historyItem.author}
|
|
894
|
+
markdown.appendMarkdown(`$(account) **${historyItem.author}**`);
|
|
895
|
+
if (historyItem.timestamp) {
|
|
896
|
+
const dateFormatter = new Intl.DateTimeFormat(language, { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' });
|
|
897
|
+
markdown.appendMarkdown(`, $(history) ${fromNow(historyItem.timestamp, true, true)} (${dateFormatter.format(historyItem.timestamp)})`);
|
|
898
|
+
}
|
|
899
|
+
markdown.appendMarkdown('\n\n');
|
|
828
900
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
markdown.appendMarkdown(
|
|
901
|
+
markdown.appendMarkdown(`${historyItem.message}\n\n`);
|
|
902
|
+
if (historyItem.statistics) {
|
|
903
|
+
markdown.appendMarkdown(`---\n\n`);
|
|
904
|
+
markdown.appendMarkdown(`<span>${historyItem.statistics.files === 1 ?
|
|
905
|
+
( localize(6369, "{0} file changed", historyItem.statistics.files)) :
|
|
906
|
+
( localize(6369, "{0} files changed", historyItem.statistics.files))}</span>`);
|
|
907
|
+
if (historyItem.statistics.insertions) {
|
|
908
|
+
const historyItemAdditionsForegroundColor = colorTheme.getColor(historyItemAdditionsForeground);
|
|
909
|
+
markdown.appendMarkdown(`, <span style="color:${historyItemAdditionsForegroundColor};">${historyItem.statistics.insertions === 1 ?
|
|
910
|
+
( localize(6369, "{0} insertion{1}", historyItem.statistics.insertions, '(+)')) :
|
|
911
|
+
( localize(6369, "{0} insertions{1}", historyItem.statistics.insertions, '(+)'))}</span>`);
|
|
912
|
+
}
|
|
913
|
+
if (historyItem.statistics.deletions) {
|
|
914
|
+
const historyItemDeletionsForegroundColor = colorTheme.getColor(historyItemDeletionsForeground);
|
|
915
|
+
markdown.appendMarkdown(`, <span style="color:${historyItemDeletionsForegroundColor};">${historyItem.statistics.deletions === 1 ?
|
|
916
|
+
( localize(6369, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
|
|
917
|
+
( localize(6369, "{0} deletions{1}", historyItem.statistics.deletions, '(-)'))}</span>`);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
if (historyItem.labels) {
|
|
921
|
+
const historyItemGroupLocalColor = colorTheme.getColor(historyItemGroupLocal);
|
|
922
|
+
const historyItemGroupRemoteColor = colorTheme.getColor(historyItemGroupRemote);
|
|
923
|
+
const historyItemGroupBaseColor = colorTheme.getColor(historyItemGroupBase);
|
|
924
|
+
const historyItemGroupHoverLabelForegroundColor = colorTheme.getColor(historyItemGroupHoverLabelForeground);
|
|
925
|
+
markdown.appendMarkdown(`\n\n---\n\n`);
|
|
926
|
+
markdown.appendMarkdown(( (historyItem.labels.map(label => {
|
|
927
|
+
const historyItemGroupHoverLabelBackgroundColor = label.title === currentHistoryItemGroup?.name ? historyItemGroupLocalColor :
|
|
928
|
+
label.title === currentHistoryItemGroup?.remote?.name ? historyItemGroupRemoteColor :
|
|
929
|
+
label.title === currentHistoryItemGroup?.base?.name ? historyItemGroupBaseColor :
|
|
930
|
+
undefined;
|
|
931
|
+
const historyItemGroupHoverLabelIconId = ThemeIcon.isThemeIcon(label.icon) ? label.icon.id : '';
|
|
932
|
+
return `<span style="color:${historyItemGroupHoverLabelForegroundColor};background-color:${historyItemGroupHoverLabelBackgroundColor};border-radius:2px;"> $(${historyItemGroupHoverLabelIconId}) ${label.title} </span>`;
|
|
933
|
+
}))).join(' '));
|
|
832
934
|
}
|
|
833
|
-
markdown.appendMarkdown(historyItem.message);
|
|
834
935
|
return { markdown, markdownNotSupportedFallback: historyItem.message };
|
|
835
936
|
}
|
|
836
937
|
processMatches(historyItemViewModel, filterData) {
|
|
@@ -850,7 +951,8 @@ let HistoryItem2Renderer = class HistoryItem2Renderer {
|
|
|
850
951
|
}
|
|
851
952
|
};
|
|
852
953
|
HistoryItem2Renderer = HistoryItem2Renderer_1 = ( (__decorate([
|
|
853
|
-
( (__param(
|
|
954
|
+
( (__param(1, IHoverService))),
|
|
955
|
+
( (__param(2, IThemeService)))
|
|
854
956
|
], HistoryItem2Renderer)));
|
|
855
957
|
let HistoryItemChangeRenderer = class HistoryItemChangeRenderer {
|
|
856
958
|
static { HistoryItemChangeRenderer_1 = this; }
|
|
@@ -908,11 +1010,11 @@ let SeparatorRenderer = class SeparatorRenderer {
|
|
|
908
1010
|
static { SeparatorRenderer_1 = this; }
|
|
909
1011
|
static { this.TEMPLATE_ID = 'separator'; }
|
|
910
1012
|
get templateId() { return SeparatorRenderer_1.TEMPLATE_ID; }
|
|
911
|
-
constructor(contextKeyService, contextMenuService, keybindingService,
|
|
1013
|
+
constructor(getFilterActions, contextKeyService, contextMenuService, keybindingService, commandService, menuService, telemetryService) {
|
|
1014
|
+
this.getFilterActions = getFilterActions;
|
|
912
1015
|
this.contextKeyService = contextKeyService;
|
|
913
1016
|
this.contextMenuService = contextMenuService;
|
|
914
1017
|
this.keybindingService = keybindingService;
|
|
915
|
-
this.configurationService = configurationService;
|
|
916
1018
|
this.commandService = commandService;
|
|
917
1019
|
this.menuService = menuService;
|
|
918
1020
|
this.telemetryService = telemetryService;
|
|
@@ -920,42 +1022,54 @@ let SeparatorRenderer = class SeparatorRenderer {
|
|
|
920
1022
|
renderTemplate(container) {
|
|
921
1023
|
container.parentElement.parentElement.querySelector('.monaco-tl-twistie').classList.add('force-no-twistie');
|
|
922
1024
|
container.parentElement.parentElement.classList.add('cursor-default', 'force-no-hover');
|
|
923
|
-
const
|
|
1025
|
+
const templateDisposables = ( (new DisposableStore()));
|
|
924
1026
|
const element = append(container, $('.separator-container'));
|
|
925
1027
|
const label = ( (new IconLabel(element, { supportIcons: true, })));
|
|
926
1028
|
append(element, $('.separator'));
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
disposables.add(toolBar);
|
|
941
|
-
}
|
|
942
|
-
return { label, disposables };
|
|
1029
|
+
templateDisposables.add(label);
|
|
1030
|
+
const toolBar = ( (new WorkbenchToolBar(
|
|
1031
|
+
append(element, $('.actions')),
|
|
1032
|
+
undefined,
|
|
1033
|
+
this.menuService,
|
|
1034
|
+
this.contextKeyService,
|
|
1035
|
+
this.contextMenuService,
|
|
1036
|
+
this.keybindingService,
|
|
1037
|
+
this.commandService,
|
|
1038
|
+
this.telemetryService
|
|
1039
|
+
)));
|
|
1040
|
+
templateDisposables.add(toolBar);
|
|
1041
|
+
return { label, toolBar, elementDisposables: ( (new DisposableStore())), templateDisposables };
|
|
943
1042
|
}
|
|
944
1043
|
renderElement(element, index, templateData, height) {
|
|
1044
|
+
const provider = element.element.repository.provider;
|
|
1045
|
+
const historyProvider = provider.historyProvider.get();
|
|
1046
|
+
const currentHistoryItemGroup = historyProvider?.currentHistoryItemGroup.get();
|
|
945
1047
|
templateData.label.setLabel(element.element.label, undefined, { title: element.element.ariaLabel });
|
|
1048
|
+
const contextKeyService = this.contextKeyService.createOverlay([
|
|
1049
|
+
['scmHistoryItemGroupHasRemote', !!currentHistoryItemGroup?.remote],
|
|
1050
|
+
]);
|
|
1051
|
+
const menu = this.menuService.createMenu(MenuId.SCMChangesSeparator, contextKeyService);
|
|
1052
|
+
templateData.elementDisposables.add(connectPrimaryMenu(menu, (primary, secondary) => {
|
|
1053
|
+
secondary.push(...this.getFilterActions(element.element.repository));
|
|
1054
|
+
templateData.toolBar.setActions(primary, secondary, [MenuId.SCMChangesSeparator]);
|
|
1055
|
+
}));
|
|
1056
|
+
templateData.toolBar.context = provider;
|
|
946
1057
|
}
|
|
947
1058
|
renderCompressedElements(node, index, templateData, height) {
|
|
948
1059
|
throw ( (new Error('Should never happen since node is incompressible')));
|
|
949
1060
|
}
|
|
1061
|
+
disposeElement(node, index, templateData, height) {
|
|
1062
|
+
templateData.elementDisposables.clear();
|
|
1063
|
+
}
|
|
950
1064
|
disposeTemplate(templateData) {
|
|
951
|
-
templateData.
|
|
1065
|
+
templateData.elementDisposables.dispose();
|
|
1066
|
+
templateData.templateDisposables.dispose();
|
|
952
1067
|
}
|
|
953
1068
|
};
|
|
954
1069
|
SeparatorRenderer = SeparatorRenderer_1 = ( (__decorate([
|
|
955
|
-
( (__param(
|
|
956
|
-
( (__param(
|
|
957
|
-
( (__param(
|
|
958
|
-
( (__param(3, IConfigurationService))),
|
|
1070
|
+
( (__param(1, IContextKeyService))),
|
|
1071
|
+
( (__param(2, IContextMenuService))),
|
|
1072
|
+
( (__param(3, IKeybindingService))),
|
|
959
1073
|
( (__param(4, ICommandService))),
|
|
960
1074
|
( (__param(5, IMenuService))),
|
|
961
1075
|
( (__param(6, ITelemetryService)))
|
|
@@ -1227,7 +1341,7 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
1227
1341
|
this.labelService = labelService;
|
|
1228
1342
|
}
|
|
1229
1343
|
getWidgetAriaLabel() {
|
|
1230
|
-
return (
|
|
1344
|
+
return ( localize(6370, "Source Control Management"));
|
|
1231
1345
|
}
|
|
1232
1346
|
getAriaLabel(element) {
|
|
1233
1347
|
if (ResourceTree.isResourceNode(element)) {
|
|
@@ -1237,7 +1351,7 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
1237
1351
|
return `${element.provider.name} ${element.provider.label}`;
|
|
1238
1352
|
}
|
|
1239
1353
|
else if (isSCMInput(element)) {
|
|
1240
|
-
return (
|
|
1354
|
+
return ( localize(6371, "Source Control Input"));
|
|
1241
1355
|
}
|
|
1242
1356
|
else if (isSCMActionButton(element)) {
|
|
1243
1357
|
return element.button?.command.title ?? '';
|
|
@@ -1316,7 +1430,7 @@ const ContextKeys = {
|
|
|
1316
1430
|
}
|
|
1317
1431
|
};
|
|
1318
1432
|
MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
|
|
1319
|
-
title: (
|
|
1433
|
+
title: ( localize(6372, "View & Sort")),
|
|
1320
1434
|
submenu: Menus.ViewSort,
|
|
1321
1435
|
when: ( (ContextKeyExpr.and(
|
|
1322
1436
|
(ContextKeyExpr.equals('view', VIEW_PANE_ID)),
|
|
@@ -1326,18 +1440,18 @@ MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
|
|
|
1326
1440
|
order: 1
|
|
1327
1441
|
});
|
|
1328
1442
|
MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
|
|
1329
|
-
title: (
|
|
1443
|
+
title: ( localize(6373, "Incoming & Outgoing")),
|
|
1330
1444
|
submenu: Menus.ChangesSettings,
|
|
1331
1445
|
when: ( (ContextKeyExpr.and(
|
|
1332
1446
|
(ContextKeyExpr.equals('view', VIEW_PANE_ID)),
|
|
1333
1447
|
(ContextKeys.RepositoryCount.notEqualsTo(0)),
|
|
1334
|
-
(( (ContextKeyExpr.equals('config.scm.
|
|
1448
|
+
(( (ContextKeyExpr.equals('config.scm.showHistoryGraph', true))).negate())
|
|
1335
1449
|
))),
|
|
1336
1450
|
group: '0_view&sort',
|
|
1337
1451
|
order: 2
|
|
1338
1452
|
});
|
|
1339
1453
|
MenuRegistry.appendMenuItem(Menus.ViewSort, {
|
|
1340
|
-
title: (
|
|
1454
|
+
title: ( localize(6374, "Repositories")),
|
|
1341
1455
|
submenu: Menus.Repositories,
|
|
1342
1456
|
when: ContextKeyExpr.greater(ContextKeys.RepositoryCount.key, 1),
|
|
1343
1457
|
group: '0_repositories'
|
|
@@ -1358,22 +1472,24 @@ class SCMChangesSettingAction extends Action2 {
|
|
|
1358
1472
|
}
|
|
1359
1473
|
}
|
|
1360
1474
|
MenuRegistry.appendMenuItem(MenuId.SCMChangesSeparator, {
|
|
1361
|
-
title: (
|
|
1475
|
+
title: ( localize(6375, "Show Incoming Changes")),
|
|
1362
1476
|
submenu: MenuId.SCMIncomingChangesSetting,
|
|
1363
1477
|
group: '1_incoming&outgoing',
|
|
1364
|
-
order: 1
|
|
1478
|
+
order: 1,
|
|
1479
|
+
when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
|
|
1365
1480
|
});
|
|
1366
1481
|
MenuRegistry.appendMenuItem(Menus.ChangesSettings, {
|
|
1367
|
-
title: (
|
|
1482
|
+
title: ( localize(6375, "Show Incoming Changes")),
|
|
1368
1483
|
submenu: MenuId.SCMIncomingChangesSetting,
|
|
1369
1484
|
group: '1_incoming&outgoing',
|
|
1370
|
-
order: 1
|
|
1485
|
+
order: 1,
|
|
1486
|
+
when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
|
|
1371
1487
|
});
|
|
1372
1488
|
registerAction2(class extends SCMChangesSettingAction {
|
|
1373
1489
|
constructor() {
|
|
1374
1490
|
super('scm.showIncomingChanges', 'always', {
|
|
1375
1491
|
id: 'workbench.scm.action.showIncomingChanges.always',
|
|
1376
|
-
title: (
|
|
1492
|
+
title: ( localize(6376, "Always")),
|
|
1377
1493
|
menu: { id: MenuId.SCMIncomingChangesSetting },
|
|
1378
1494
|
});
|
|
1379
1495
|
}
|
|
@@ -1382,7 +1498,7 @@ registerAction2(class extends SCMChangesSettingAction {
|
|
|
1382
1498
|
constructor() {
|
|
1383
1499
|
super('scm.showIncomingChanges', 'auto', {
|
|
1384
1500
|
id: 'workbench.scm.action.showIncomingChanges.auto',
|
|
1385
|
-
title: (
|
|
1501
|
+
title: ( localize(6377, "Auto")),
|
|
1386
1502
|
menu: {
|
|
1387
1503
|
id: MenuId.SCMIncomingChangesSetting,
|
|
1388
1504
|
}
|
|
@@ -1393,7 +1509,7 @@ registerAction2(class extends SCMChangesSettingAction {
|
|
|
1393
1509
|
constructor() {
|
|
1394
1510
|
super('scm.showIncomingChanges', 'never', {
|
|
1395
1511
|
id: 'workbench.scm.action.showIncomingChanges.never',
|
|
1396
|
-
title: (
|
|
1512
|
+
title: ( localize(6378, "Never")),
|
|
1397
1513
|
menu: {
|
|
1398
1514
|
id: MenuId.SCMIncomingChangesSetting,
|
|
1399
1515
|
}
|
|
@@ -1401,22 +1517,24 @@ registerAction2(class extends SCMChangesSettingAction {
|
|
|
1401
1517
|
}
|
|
1402
1518
|
});
|
|
1403
1519
|
MenuRegistry.appendMenuItem(MenuId.SCMChangesSeparator, {
|
|
1404
|
-
title: (
|
|
1520
|
+
title: ( localize(6379, "Show Outgoing Changes")),
|
|
1405
1521
|
submenu: MenuId.SCMOutgoingChangesSetting,
|
|
1406
1522
|
group: '1_incoming&outgoing',
|
|
1407
|
-
order: 2
|
|
1523
|
+
order: 2,
|
|
1524
|
+
when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
|
|
1408
1525
|
});
|
|
1409
1526
|
MenuRegistry.appendMenuItem(Menus.ChangesSettings, {
|
|
1410
|
-
title: (
|
|
1527
|
+
title: ( localize(6379, "Show Outgoing Changes")),
|
|
1411
1528
|
submenu: MenuId.SCMOutgoingChangesSetting,
|
|
1412
1529
|
group: '1_incoming&outgoing',
|
|
1413
|
-
order: 2
|
|
1530
|
+
order: 2,
|
|
1531
|
+
when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
|
|
1414
1532
|
});
|
|
1415
1533
|
registerAction2(class extends SCMChangesSettingAction {
|
|
1416
1534
|
constructor() {
|
|
1417
1535
|
super('scm.showOutgoingChanges', 'always', {
|
|
1418
1536
|
id: 'workbench.scm.action.showOutgoingChanges.always',
|
|
1419
|
-
title: (
|
|
1537
|
+
title: ( localize(6379, "Always")),
|
|
1420
1538
|
menu: {
|
|
1421
1539
|
id: MenuId.SCMOutgoingChangesSetting,
|
|
1422
1540
|
}
|
|
@@ -1427,7 +1545,7 @@ registerAction2(class extends SCMChangesSettingAction {
|
|
|
1427
1545
|
constructor() {
|
|
1428
1546
|
super('scm.showOutgoingChanges', 'auto', {
|
|
1429
1547
|
id: 'workbench.scm.action.showOutgoingChanges.auto',
|
|
1430
|
-
title: (
|
|
1548
|
+
title: ( localize(6379, "Auto")),
|
|
1431
1549
|
menu: {
|
|
1432
1550
|
id: MenuId.SCMOutgoingChangesSetting,
|
|
1433
1551
|
}
|
|
@@ -1438,7 +1556,7 @@ registerAction2(class extends SCMChangesSettingAction {
|
|
|
1438
1556
|
constructor() {
|
|
1439
1557
|
super('scm.showOutgoingChanges', 'never', {
|
|
1440
1558
|
id: 'workbench.scm.action.showOutgoingChanges.never',
|
|
1441
|
-
title: (
|
|
1559
|
+
title: ( localize(6379, "Never")),
|
|
1442
1560
|
menu: {
|
|
1443
1561
|
id: MenuId.SCMOutgoingChangesSetting,
|
|
1444
1562
|
}
|
|
@@ -1449,12 +1567,20 @@ registerAction2(class extends Action2 {
|
|
|
1449
1567
|
constructor() {
|
|
1450
1568
|
super({
|
|
1451
1569
|
id: 'workbench.scm.action.scm.showChangesSummary',
|
|
1452
|
-
title: (
|
|
1570
|
+
title: ( localize(6380, "Show Changes Summary")),
|
|
1453
1571
|
f1: false,
|
|
1454
1572
|
toggled: ( (ContextKeyExpr.equals('config.scm.showChangesSummary', true))),
|
|
1455
1573
|
menu: [
|
|
1456
|
-
{
|
|
1457
|
-
|
|
1574
|
+
{
|
|
1575
|
+
id: MenuId.SCMChangesSeparator,
|
|
1576
|
+
order: 3,
|
|
1577
|
+
when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
id: Menus.ChangesSettings,
|
|
1581
|
+
order: 3,
|
|
1582
|
+
when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
|
|
1583
|
+
},
|
|
1458
1584
|
]
|
|
1459
1585
|
});
|
|
1460
1586
|
}
|
|
@@ -1464,6 +1590,58 @@ registerAction2(class extends Action2 {
|
|
|
1464
1590
|
configurationService.updateValue('scm.showChangesSummary', !configValue);
|
|
1465
1591
|
}
|
|
1466
1592
|
});
|
|
1593
|
+
registerAction2(class extends Action2 {
|
|
1594
|
+
constructor() {
|
|
1595
|
+
super({
|
|
1596
|
+
id: 'workbench.scm.action.scm.viewChanges',
|
|
1597
|
+
title: ( localize(6381, "View Changes")),
|
|
1598
|
+
f1: false,
|
|
1599
|
+
menu: [
|
|
1600
|
+
{
|
|
1601
|
+
id: MenuId.SCMChangesContext,
|
|
1602
|
+
group: '0_view',
|
|
1603
|
+
when: ( (ContextKeyExpr.equals('config.multiDiffEditor.experimental.enabled', true)))
|
|
1604
|
+
}
|
|
1605
|
+
]
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
async run(accessor, provider, ...historyItems) {
|
|
1609
|
+
const commandService = accessor.get(ICommandService);
|
|
1610
|
+
if (!provider || historyItems.length === 0) {
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
const historyItem = historyItems[0];
|
|
1614
|
+
const historyItemLast = historyItems[historyItems.length - 1];
|
|
1615
|
+
const historyProvider = provider.historyProvider.get();
|
|
1616
|
+
if (historyItems.length > 1) {
|
|
1617
|
+
const ancestor = await historyProvider?.resolveHistoryItemGroupCommonAncestor2([historyItem.id, historyItemLast.id]);
|
|
1618
|
+
if (!ancestor || (ancestor !== historyItem.id && ancestor !== historyItemLast.id)) {
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
const historyItemParentId = historyItemLast.parentIds.length > 0 ? historyItemLast.parentIds[0] : undefined;
|
|
1623
|
+
const historyItemChanges = await historyProvider?.provideHistoryItemChanges(historyItem.id, historyItemParentId);
|
|
1624
|
+
if (!historyItemChanges?.length) {
|
|
1625
|
+
return;
|
|
1626
|
+
}
|
|
1627
|
+
const title = historyItems.length === 1 ?
|
|
1628
|
+
`${historyItems[0].id.substring(0, 8)} - ${historyItems[0].message}` :
|
|
1629
|
+
( localize(
|
|
1630
|
+
6382,
|
|
1631
|
+
"All Changes ({0} ↔ {1})",
|
|
1632
|
+
historyItem.id.substring(0, 8),
|
|
1633
|
+
historyItemLast.id.substring(0, 8)
|
|
1634
|
+
));
|
|
1635
|
+
const rootUri = provider.rootUri;
|
|
1636
|
+
const multiDiffSourceUri = rootUri ?
|
|
1637
|
+
rootUri.with({ scheme: 'scm-history-item', path: `${rootUri.path}/${historyItem.id}..${historyItemParentId}` }) :
|
|
1638
|
+
( (URI.from(
|
|
1639
|
+
{ scheme: 'scm-history-item', path: `${provider.label}/${historyItem.id}..${historyItemParentId}` },
|
|
1640
|
+
true
|
|
1641
|
+
)));
|
|
1642
|
+
commandService.executeCommand('_workbench.openMultiDiffEditor', { title, multiDiffSourceUri, resources: historyItemChanges });
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1467
1645
|
class RepositoryVisibilityAction extends Action2 {
|
|
1468
1646
|
constructor(repository) {
|
|
1469
1647
|
super({
|
|
@@ -1552,7 +1730,7 @@ class SetListViewModeAction extends ViewAction {
|
|
|
1552
1730
|
constructor(id = 'workbench.scm.action.setListViewMode', menu = {}) {
|
|
1553
1731
|
super({
|
|
1554
1732
|
id,
|
|
1555
|
-
title: (
|
|
1733
|
+
title: ( localize(6383, "View as List")),
|
|
1556
1734
|
viewId: VIEW_PANE_ID,
|
|
1557
1735
|
f1: false,
|
|
1558
1736
|
icon: Codicon.listTree,
|
|
@@ -1582,7 +1760,7 @@ class SetTreeViewModeAction extends ViewAction {
|
|
|
1582
1760
|
constructor(id = 'workbench.scm.action.setTreeViewMode', menu = {}) {
|
|
1583
1761
|
super({
|
|
1584
1762
|
id,
|
|
1585
|
-
title: (
|
|
1763
|
+
title: ( localize(6384, "View as Tree")),
|
|
1586
1764
|
viewId: VIEW_PANE_ID,
|
|
1587
1765
|
f1: false,
|
|
1588
1766
|
icon: Codicon.listFlat,
|
|
@@ -1639,17 +1817,17 @@ class RepositorySortAction extends ViewAction {
|
|
|
1639
1817
|
}
|
|
1640
1818
|
class RepositorySortByDiscoveryTimeAction extends RepositorySortAction {
|
|
1641
1819
|
constructor() {
|
|
1642
|
-
super(ISCMRepositorySortKey.DiscoveryTime, (
|
|
1820
|
+
super(ISCMRepositorySortKey.DiscoveryTime, ( localize(6385, "Sort by Discovery Time")));
|
|
1643
1821
|
}
|
|
1644
1822
|
}
|
|
1645
1823
|
class RepositorySortByNameAction extends RepositorySortAction {
|
|
1646
1824
|
constructor() {
|
|
1647
|
-
super(ISCMRepositorySortKey.Name, (
|
|
1825
|
+
super(ISCMRepositorySortKey.Name, ( localize(6386, "Sort by Name")));
|
|
1648
1826
|
}
|
|
1649
1827
|
}
|
|
1650
1828
|
class RepositorySortByPathAction extends RepositorySortAction {
|
|
1651
1829
|
constructor() {
|
|
1652
|
-
super(ISCMRepositorySortKey.Path, (
|
|
1830
|
+
super(ISCMRepositorySortKey.Path, ( localize(6387, "Sort by Path")));
|
|
1653
1831
|
}
|
|
1654
1832
|
}
|
|
1655
1833
|
registerAction2(RepositorySortByDiscoveryTimeAction);
|
|
@@ -1674,17 +1852,17 @@ class SetSortKeyAction extends ViewAction {
|
|
|
1674
1852
|
}
|
|
1675
1853
|
class SetSortByNameAction extends SetSortKeyAction {
|
|
1676
1854
|
constructor() {
|
|
1677
|
-
super(ViewSortKey.Name, (
|
|
1855
|
+
super(ViewSortKey.Name, ( localize(6388, "Sort Changes by Name")));
|
|
1678
1856
|
}
|
|
1679
1857
|
}
|
|
1680
1858
|
class SetSortByPathAction extends SetSortKeyAction {
|
|
1681
1859
|
constructor() {
|
|
1682
|
-
super(ViewSortKey.Path, (
|
|
1860
|
+
super(ViewSortKey.Path, ( localize(6389, "Sort Changes by Path")));
|
|
1683
1861
|
}
|
|
1684
1862
|
}
|
|
1685
1863
|
class SetSortByStatusAction extends SetSortKeyAction {
|
|
1686
1864
|
constructor() {
|
|
1687
|
-
super(ViewSortKey.Status, (
|
|
1865
|
+
super(ViewSortKey.Status, ( localize(6390, "Sort Changes by Status")));
|
|
1688
1866
|
}
|
|
1689
1867
|
}
|
|
1690
1868
|
registerAction2(SetSortByNameAction);
|
|
@@ -1694,7 +1872,7 @@ class CollapseAllRepositoriesAction extends ViewAction {
|
|
|
1694
1872
|
constructor() {
|
|
1695
1873
|
super({
|
|
1696
1874
|
id: `workbench.scm.action.collapseAllRepositories`,
|
|
1697
|
-
title: (
|
|
1875
|
+
title: ( localize(6391, "Collapse All Repositories")),
|
|
1698
1876
|
viewId: VIEW_PANE_ID,
|
|
1699
1877
|
f1: false,
|
|
1700
1878
|
icon: Codicon.collapseAll,
|
|
@@ -1717,7 +1895,7 @@ class ExpandAllRepositoriesAction extends ViewAction {
|
|
|
1717
1895
|
constructor() {
|
|
1718
1896
|
super({
|
|
1719
1897
|
id: `workbench.scm.action.expandAllRepositories`,
|
|
1720
|
-
title: (
|
|
1898
|
+
title: ( localize(6392, "Expand All Repositories")),
|
|
1721
1899
|
viewId: VIEW_PANE_ID,
|
|
1722
1900
|
f1: false,
|
|
1723
1901
|
icon: Codicon.expandAll,
|
|
@@ -1795,22 +1973,22 @@ let SCMInputWidgetToolbar = class SCMInputWidgetToolbar extends WorkbenchToolBar
|
|
|
1795
1973
|
this._dropdownActions = [];
|
|
1796
1974
|
this._onDidChange = ( (new Emitter()));
|
|
1797
1975
|
this.onDidChange = this._onDidChange.event;
|
|
1798
|
-
this.
|
|
1799
|
-
this._dropdownAction = ( (new Action('scmInputMoreActions', (
|
|
1976
|
+
this._disposables = this._register(( (new MutableDisposable())));
|
|
1977
|
+
this._dropdownAction = ( (new Action('scmInputMoreActions', ( localize(6393, "More Actions...")), 'codicon-chevron-down')));
|
|
1800
1978
|
this._cancelAction = ( (new MenuItemAction({
|
|
1801
1979
|
id: SCMInputWidgetCommandId.CancelAction,
|
|
1802
|
-
title: (
|
|
1980
|
+
title: ( localize(6394, "Cancel")),
|
|
1803
1981
|
icon: Codicon.debugStop,
|
|
1804
1982
|
}, undefined, undefined, undefined, undefined, contextKeyService, commandService)));
|
|
1805
1983
|
}
|
|
1806
1984
|
setInput(input) {
|
|
1807
|
-
this.
|
|
1985
|
+
this._disposables.value = ( (new DisposableStore()));
|
|
1808
1986
|
const contextKeyService = this.contextKeyService.createOverlay([
|
|
1809
1987
|
['scmProvider', input.repository.provider.contextValue],
|
|
1810
1988
|
['scmProviderRootUri', input.repository.provider.rootUri?.toString()],
|
|
1811
1989
|
['scmProviderHasRootUri', !!input.repository.provider.rootUri]
|
|
1812
1990
|
]);
|
|
1813
|
-
const menu = this.
|
|
1991
|
+
const menu = this._disposables.value.add(this.menuService.createMenu(MenuId.SCMInputBox, contextKeyService, { emitEventsForSubmenuChanges: true }));
|
|
1814
1992
|
const isEnabled = () => {
|
|
1815
1993
|
return (
|
|
1816
1994
|
(input.repository.provider.groups.some(g => g.resources.length > 0))
|
|
@@ -1835,17 +2013,17 @@ let SCMInputWidgetToolbar = class SCMInputWidgetToolbar extends WorkbenchToolBar
|
|
|
1835
2013
|
super.setActions(primaryAction ? [primaryAction] : [], []);
|
|
1836
2014
|
this._onDidChange.fire();
|
|
1837
2015
|
};
|
|
1838
|
-
this.
|
|
1839
|
-
this.
|
|
1840
|
-
this.
|
|
2016
|
+
this._disposables.value.add(menu.onDidChange(() => updateToolbar()));
|
|
2017
|
+
this._disposables.value.add(input.repository.provider.onDidChangeResources(() => updateToolbar()));
|
|
2018
|
+
this._disposables.value.add(this.storageService.onDidChangeValue(StorageScope.PROFILE, SCMInputWidgetStorageKey.LastActionId, this._disposables.value)(() => updateToolbar()));
|
|
1841
2019
|
this.actionRunner = ( (new SCMInputWidgetActionRunner(input, this.storageService)));
|
|
1842
|
-
this.
|
|
2020
|
+
this._disposables.value.add(this.actionRunner.onWillRun(e => {
|
|
1843
2021
|
if (this.actionRunner.runningActions.size === 0) {
|
|
1844
2022
|
super.setActions([this._cancelAction], []);
|
|
1845
2023
|
this._onDidChange.fire();
|
|
1846
2024
|
}
|
|
1847
2025
|
}));
|
|
1848
|
-
this.
|
|
2026
|
+
this._disposables.value.add(this.actionRunner.onDidRun(e => {
|
|
1849
2027
|
if (this.actionRunner.runningActions.size === 0) {
|
|
1850
2028
|
updateToolbar();
|
|
1851
2029
|
}
|
|
@@ -2001,19 +2179,15 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2001
2179
|
this.repositoryDisposables.add(input.onDidChangeFocus(() => this.focus()));
|
|
2002
2180
|
this.repositoryDisposables.add(input.onDidChangeValidationMessage((e) => this.setValidation(e, { focus: true, timeout: true })));
|
|
2003
2181
|
this.repositoryDisposables.add(input.onDidChangeValidateInput((e) => triggerValidation()));
|
|
2004
|
-
const updatePlaceholderVisibility = () => this.placeholderTextContainer.classList.toggle('hidden', textModel.getValueLength() > 0);
|
|
2005
2182
|
this.repositoryDisposables.add(textModel.onDidChangeContent(() => {
|
|
2006
2183
|
input.setValue(textModel.getValue(), true);
|
|
2007
|
-
updatePlaceholderVisibility();
|
|
2008
2184
|
triggerValidation();
|
|
2009
2185
|
}));
|
|
2010
|
-
updatePlaceholderVisibility();
|
|
2011
2186
|
const updatePlaceholderText = () => {
|
|
2012
2187
|
const binding = this.keybindingService.lookupKeybinding('scm.acceptInput');
|
|
2013
2188
|
const label = binding ? binding.getLabel() : (isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter');
|
|
2014
2189
|
const placeholderText = format(input.placeholder, label);
|
|
2015
|
-
this.inputEditor.updateOptions({
|
|
2016
|
-
this.placeholderTextContainer.textContent = placeholderText;
|
|
2190
|
+
this.inputEditor.updateOptions({ placeholder: placeholderText });
|
|
2017
2191
|
};
|
|
2018
2192
|
this.repositoryDisposables.add(input.onDidChangePlaceholder(updatePlaceholderText));
|
|
2019
2193
|
this.repositoryDisposables.add(this.keybindingService.onDidUpdateKeybindings(updatePlaceholderText));
|
|
@@ -2077,38 +2251,37 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2077
2251
|
this.shouldFocusAfterLayout = false;
|
|
2078
2252
|
this.element = append(container, $('.scm-editor'));
|
|
2079
2253
|
this.editorContainer = append(this.element, $('.scm-editor-container'));
|
|
2080
|
-
this.placeholderTextContainer = append(this.editorContainer, $('.scm-editor-placeholder'));
|
|
2081
2254
|
this.toolbarContainer = append(this.element, $('.scm-editor-toolbar'));
|
|
2082
2255
|
this.contextKeyService = contextKeyService.createScoped(this.element);
|
|
2083
2256
|
this.repositoryIdContextKey = this.contextKeyService.createKey('scmRepository', undefined);
|
|
2084
2257
|
this.inputEditorOptions = ( (new SCMInputWidgetEditorOptions(overflowWidgetsDomNode, this.configurationService)));
|
|
2085
2258
|
this.disposables.add(this.inputEditorOptions.onDidChange(this.onDidChangeEditorOptions, this));
|
|
2086
2259
|
this.disposables.add(this.inputEditorOptions);
|
|
2087
|
-
const editorConstructionOptions = this.inputEditorOptions.getEditorConstructionOptions();
|
|
2088
|
-
this.setPlaceholderFontStyles(editorConstructionOptions.fontFamily, editorConstructionOptions.fontSize, editorConstructionOptions.lineHeight);
|
|
2089
2260
|
const codeEditorWidgetOptions = {
|
|
2090
|
-
isSimpleWidget: true,
|
|
2091
2261
|
contributions: EditorExtensionsRegistry.getSomeEditorContributions([
|
|
2262
|
+
CodeActionController.ID,
|
|
2092
2263
|
ColorDetector.ID,
|
|
2093
2264
|
ContextMenuController.ID,
|
|
2094
|
-
DragAndDropController.ID,
|
|
2095
2265
|
CopyPasteController.ID,
|
|
2266
|
+
DragAndDropController.ID,
|
|
2096
2267
|
DropIntoEditorController.ID,
|
|
2268
|
+
EditorDictation.ID,
|
|
2269
|
+
FormatOnType.ID,
|
|
2270
|
+
HoverController.ID,
|
|
2271
|
+
InlineCompletionsController.ID,
|
|
2097
2272
|
LinkDetector.ID,
|
|
2098
2273
|
MenuPreventer.ID,
|
|
2099
2274
|
MessageController.ID,
|
|
2100
|
-
|
|
2275
|
+
PlaceholderTextContribution.ID,
|
|
2101
2276
|
SelectionClipboardContributionID,
|
|
2102
2277
|
SnippetController2.ID,
|
|
2103
|
-
SuggestController.ID
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
FormatOnType.ID,
|
|
2107
|
-
EditorDictation.ID,
|
|
2108
|
-
])
|
|
2278
|
+
SuggestController.ID
|
|
2279
|
+
]),
|
|
2280
|
+
isSimpleWidget: true
|
|
2109
2281
|
};
|
|
2110
2282
|
const services = ( (new ServiceCollection([IContextKeyService, this.contextKeyService])));
|
|
2111
2283
|
const instantiationService2 = instantiationService.createChild(services, this.disposables);
|
|
2284
|
+
const editorConstructionOptions = this.inputEditorOptions.getEditorConstructionOptions();
|
|
2112
2285
|
this.inputEditor = instantiationService2.createInstance(CodeEditorWidget, this.editorContainer, editorConstructionOptions, codeEditorWidgetOptions);
|
|
2113
2286
|
this.disposables.add(this.inputEditor);
|
|
2114
2287
|
this.disposables.add(this.inputEditor.onDidFocusEditorText(() => {
|
|
@@ -2180,7 +2353,6 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2180
2353
|
}
|
|
2181
2354
|
this.lastLayoutWasTrash = false;
|
|
2182
2355
|
this.inputEditor.layout(dimension);
|
|
2183
|
-
this.placeholderTextContainer.style.width = `${dimension.width}px`;
|
|
2184
2356
|
this.renderValidation();
|
|
2185
2357
|
const showInputActionButton = this.configurationService.getValue('scm.showInputActionButton') === true;
|
|
2186
2358
|
this.toolbarContainer.classList.toggle('hidden', !showInputActionButton || this.toolbar?.isEmpty() === true);
|
|
@@ -2202,9 +2374,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2202
2374
|
return this.inputEditor.hasTextFocus();
|
|
2203
2375
|
}
|
|
2204
2376
|
onDidChangeEditorOptions() {
|
|
2205
|
-
|
|
2206
|
-
this.inputEditor.updateOptions(editorOptions);
|
|
2207
|
-
this.setPlaceholderFontStyles(editorOptions.fontFamily, editorOptions.fontSize, editorOptions.lineHeight);
|
|
2377
|
+
this.inputEditor.updateOptions(this.inputEditorOptions.getEditorOptions());
|
|
2208
2378
|
}
|
|
2209
2379
|
renderValidation() {
|
|
2210
2380
|
this.clearValidation();
|
|
@@ -2257,7 +2427,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2257
2427
|
}
|
|
2258
2428
|
const actionsContainer = append(validationContainer, $('.scm-editor-validation-actions'));
|
|
2259
2429
|
const actionbar = ( (new ActionBar(actionsContainer)));
|
|
2260
|
-
const action = ( (new Action('scmInputWidget.validationMessage.close', (
|
|
2430
|
+
const action = ( (new Action('scmInputWidget.validationMessage.close', ( localize(6395, "Close")), ThemeIcon.asClassName(Codicon.close), true, () => {
|
|
2261
2431
|
this.contextViewService.hideContextView();
|
|
2262
2432
|
this.element.style.borderBottomLeftRadius = '2px';
|
|
2263
2433
|
this.element.style.borderBottomRightRadius = '2px';
|
|
@@ -2284,11 +2454,6 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2284
2454
|
26 :
|
|
2285
2455
|
39 ;
|
|
2286
2456
|
}
|
|
2287
|
-
setPlaceholderFontStyles(fontFamily, fontSize, lineHeight) {
|
|
2288
|
-
this.placeholderTextContainer.style.fontFamily = fontFamily;
|
|
2289
|
-
this.placeholderTextContainer.style.fontSize = `${fontSize}px`;
|
|
2290
|
-
this.placeholderTextContainer.style.lineHeight = `${lineHeight}px`;
|
|
2291
|
-
}
|
|
2292
2457
|
clearValidation() {
|
|
2293
2458
|
this.validationContextView?.close();
|
|
2294
2459
|
this.validationContextView = undefined;
|
|
@@ -2340,16 +2505,16 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2340
2505
|
this.storageService.store(`scm.viewSortKey`, sortKey, StorageScope.WORKSPACE, StorageTarget.USER);
|
|
2341
2506
|
}
|
|
2342
2507
|
}
|
|
2343
|
-
constructor(options, commandService, editorService,
|
|
2508
|
+
constructor(options, commandService, editorService, menuService, scmService, scmViewService, storageService, uriIdentityService, layoutService, keybindingService, themeService, contextMenuService, instantiationService, viewDescriptorService, configurationService, contextKeyService, openerService, telemetryService, hoverService) {
|
|
2344
2509
|
super({ ...options, titleMenuId: MenuId.SCMTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
|
|
2345
2510
|
this.commandService = commandService;
|
|
2346
2511
|
this.editorService = editorService;
|
|
2347
|
-
this.logService = logService;
|
|
2348
2512
|
this.menuService = menuService;
|
|
2349
2513
|
this.scmService = scmService;
|
|
2350
2514
|
this.scmViewService = scmViewService;
|
|
2351
2515
|
this.storageService = storageService;
|
|
2352
2516
|
this.uriIdentityService = uriIdentityService;
|
|
2517
|
+
this.layoutService = layoutService;
|
|
2353
2518
|
this._onDidChangeViewMode = ( (new Emitter()));
|
|
2354
2519
|
this.onDidChangeViewMode = this._onDidChangeViewMode.event;
|
|
2355
2520
|
this._onDidChangeViewSortKey = ( (new Emitter()));
|
|
@@ -2433,10 +2598,13 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2433
2598
|
Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.inputMinLineCount') ||
|
|
2434
2599
|
e.affectsConfiguration('scm.inputMaxLineCount') ||
|
|
2435
2600
|
e.affectsConfiguration('scm.showActionButton') ||
|
|
2436
|
-
e.affectsConfiguration('scm.showChangesSummary') ||
|
|
2437
2601
|
e.affectsConfiguration('scm.showIncomingChanges') ||
|
|
2438
2602
|
e.affectsConfiguration('scm.showOutgoingChanges') ||
|
|
2439
|
-
e.affectsConfiguration('scm.
|
|
2603
|
+
e.affectsConfiguration('scm.showHistoryGraph'), this.visibilityDisposables)(() => this.updateChildren(), this, this.visibilityDisposables);
|
|
2604
|
+
Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.showChangesSummary'), this.visibilityDisposables)(() => {
|
|
2605
|
+
this.historyProviderDataSource.clearCache();
|
|
2606
|
+
this.updateChildren();
|
|
2607
|
+
}, this, this.visibilityDisposables);
|
|
2440
2608
|
this.editorService.onDidActiveEditorChange(this.onDidActiveEditorChange, this, this.visibilityDisposables);
|
|
2441
2609
|
this.scmViewService.onDidChangeVisibleRepositories(this.onDidChangeVisibleRepositories, this, this.visibilityDisposables);
|
|
2442
2610
|
this.onDidChangeVisibleRepositories({ added: this.scmViewService.visibleRepositories, removed: Iterable.empty() });
|
|
@@ -2478,7 +2646,11 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2478
2646
|
const historyItemActionRunner = ( (new HistoryItemActionRunner()));
|
|
2479
2647
|
historyItemActionRunner.onWillRun(() => this.tree.domFocus(), this, this.disposables);
|
|
2480
2648
|
this.disposables.add(historyItemActionRunner);
|
|
2481
|
-
const
|
|
2649
|
+
const historyItemHoverDelegate = this.instantiationService.createInstance(HistoryItemHoverDelegate, this.viewDescriptorService.getViewLocationById(this.id), this.layoutService.getSideBarPosition());
|
|
2650
|
+
this.disposables.add(historyItemHoverDelegate);
|
|
2651
|
+
this.historyProviderDataSource = this.instantiationService.createInstance(SCMTreeHistoryProviderDataSource, () => this.viewMode);
|
|
2652
|
+
this.disposables.add(this.historyProviderDataSource);
|
|
2653
|
+
const treeDataSource = this.instantiationService.createInstance(SCMTreeDataSource, () => this.viewMode, this.historyProviderDataSource);
|
|
2482
2654
|
this.disposables.add(treeDataSource);
|
|
2483
2655
|
this.tree = this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'SCM Tree Repo', container, ( (new ListDelegate(this.inputRenderer))), ( (new SCMTreeCompressionDelegate())), [
|
|
2484
2656
|
this.inputRenderer,
|
|
@@ -2488,9 +2660,9 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2488
2660
|
this.instantiationService.createInstance(ResourceRenderer, () => this.viewMode, this.listLabels, getActionViewItemProvider(this.instantiationService), resourceActionRunner),
|
|
2489
2661
|
this.instantiationService.createInstance(HistoryItemGroupRenderer, historyItemGroupActionRunner),
|
|
2490
2662
|
this.instantiationService.createInstance(HistoryItemRenderer, historyItemActionRunner, getActionViewItemProvider(this.instantiationService)),
|
|
2491
|
-
this.instantiationService.createInstance(HistoryItem2Renderer),
|
|
2663
|
+
this.instantiationService.createInstance(HistoryItem2Renderer, historyItemHoverDelegate),
|
|
2492
2664
|
this.instantiationService.createInstance(HistoryItemChangeRenderer, () => this.viewMode, this.listLabels),
|
|
2493
|
-
this.instantiationService.createInstance(SeparatorRenderer)
|
|
2665
|
+
this.instantiationService.createInstance(SeparatorRenderer, (repository) => this.getHistoryItemGroupFilterActions(repository)),
|
|
2494
2666
|
], treeDataSource, {
|
|
2495
2667
|
horizontalScrolling: false,
|
|
2496
2668
|
setRowLineHeight: false,
|
|
@@ -2500,9 +2672,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2500
2672
|
identityProvider: ( (new SCMResourceIdentityProvider())),
|
|
2501
2673
|
sorter: ( (new SCMTreeSorter(() => this.viewMode, () => this.viewSortKey))),
|
|
2502
2674
|
keyboardNavigationLabelProvider: this.instantiationService.createInstance(SCMTreeKeyboardNavigationLabelProvider, () => this.viewMode),
|
|
2503
|
-
overrideStyles:
|
|
2504
|
-
listBackground: this.viewDescriptorService.getViewLocationById(this.id) === ViewContainerLocation.Panel ? PANEL_BACKGROUND : SIDE_BAR_BACKGROUND
|
|
2505
|
-
},
|
|
2675
|
+
overrideStyles: this.getLocationBasedColors().listOverrideStyles,
|
|
2506
2676
|
collapseByDefault: (e) => {
|
|
2507
2677
|
if (isSCMRepository(e) || isSCMResourceGroup(e) || isSCMResourceNode(e) || isSCMHistoryItemChangeNode(e)) {
|
|
2508
2678
|
return false;
|
|
@@ -2607,14 +2777,17 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2607
2777
|
else if (isSCMHistoryItemViewModelTreeElement(e.element)) {
|
|
2608
2778
|
const historyItem = e.element.historyItemViewModel.historyItem;
|
|
2609
2779
|
const historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : undefined;
|
|
2610
|
-
const historyProvider = e.element.repository.provider.historyProvider;
|
|
2780
|
+
const historyProvider = e.element.repository.provider.historyProvider.get();
|
|
2611
2781
|
const historyItemChanges = await historyProvider?.provideHistoryItemChanges(historyItem.id, historyItemParentId);
|
|
2612
2782
|
if (historyItemChanges) {
|
|
2613
2783
|
const title = `${historyItem.id.substring(0, 8)} - ${historyItem.message}`;
|
|
2614
2784
|
const rootUri = e.element.repository.provider.rootUri;
|
|
2615
2785
|
const multiDiffSourceUri = rootUri ?
|
|
2616
|
-
rootUri.with({ scheme: 'scm-history-item', path: `${rootUri.path}/${historyItem.id}` }) :
|
|
2617
|
-
|
|
2786
|
+
rootUri.with({ scheme: 'scm-history-item', path: `${rootUri.path}/${historyItem.id}..${historyItemParentId}` }) :
|
|
2787
|
+
( (URI.from(
|
|
2788
|
+
{ scheme: 'scm-history-item', path: `${e.element.repository.provider.label}/${historyItem.id}..${historyItemParentId}` },
|
|
2789
|
+
true
|
|
2790
|
+
)));
|
|
2618
2791
|
await this.commandService.executeCommand('_workbench.openMultiDiffEditor', { title, multiDiffSourceUri, resources: historyItemChanges });
|
|
2619
2792
|
}
|
|
2620
2793
|
this.scmViewService.focus(e.element.repository);
|
|
@@ -2676,16 +2849,11 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2676
2849
|
repositoryDisposables.add(repository.provider.onDidChange(() => this.updateChildren(repository)));
|
|
2677
2850
|
repositoryDisposables.add(repository.input.onDidChangeVisibility(() => this.updateChildren(repository)));
|
|
2678
2851
|
repositoryDisposables.add(repository.provider.onDidChangeResourceGroups(() => this.updateChildren(repository)));
|
|
2679
|
-
repositoryDisposables.add(
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
repositoryDisposables.add(repository.provider.historyProvider.onDidChangeCurrentHistoryItemGroup(() => {
|
|
2685
|
-
this.updateChildren(repository);
|
|
2686
|
-
this.logService.debug('SCMViewPane:onDidChangeCurrentHistoryItemGroup - update children');
|
|
2687
|
-
}));
|
|
2688
|
-
this.logService.debug('SCMViewPane:onDidChangeVisibleRepositories - onDidChangeCurrentHistoryItemGroup listener added');
|
|
2852
|
+
repositoryDisposables.add(autorun(reader => {
|
|
2853
|
+
repository.provider.historyProvider.read(reader)?.currentHistoryItemGroup.read(reader);
|
|
2854
|
+
this.historyProviderDataSource.deleteCacheEntry(repository);
|
|
2855
|
+
this.historyProviderDataSource.deleteHistoryItemGroupFilter(repository);
|
|
2856
|
+
this.updateChildren(repository);
|
|
2689
2857
|
}));
|
|
2690
2858
|
const resourceGroupDisposables = repositoryDisposables.add(( (new DisposableMap())));
|
|
2691
2859
|
const onDidChangeResourceGroups = () => {
|
|
@@ -2708,6 +2876,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2708
2876
|
this.items.set(repository, repositoryDisposables);
|
|
2709
2877
|
}
|
|
2710
2878
|
for (const repository of removed) {
|
|
2879
|
+
this.historyProviderDataSource.deleteCacheEntry(repository);
|
|
2711
2880
|
this.items.deleteAndDispose(repository);
|
|
2712
2881
|
}
|
|
2713
2882
|
this.updateChildren();
|
|
@@ -2715,15 +2884,13 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2715
2884
|
}
|
|
2716
2885
|
onListContextMenu(e) {
|
|
2717
2886
|
if (!e.element) {
|
|
2718
|
-
const menu = this.menuService.
|
|
2887
|
+
const menu = this.menuService.getMenuActions(Menus.ViewSort, this.contextKeyService);
|
|
2719
2888
|
const actions = [];
|
|
2720
|
-
createAndFillInContextMenuActions(menu,
|
|
2889
|
+
createAndFillInContextMenuActions(menu, actions);
|
|
2721
2890
|
return this.contextMenuService.showContextMenu({
|
|
2722
2891
|
getAnchor: () => e.anchor,
|
|
2723
2892
|
getActions: () => actions,
|
|
2724
|
-
onHide: () => {
|
|
2725
|
-
menu.dispose();
|
|
2726
|
-
}
|
|
2893
|
+
onHide: () => { }
|
|
2727
2894
|
});
|
|
2728
2895
|
}
|
|
2729
2896
|
const element = e.element;
|
|
@@ -2776,6 +2943,14 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2776
2943
|
actions = collectContextMenuActions(menu);
|
|
2777
2944
|
}
|
|
2778
2945
|
}
|
|
2946
|
+
else if (isSCMHistoryItemViewModelTreeElement(element)) {
|
|
2947
|
+
const menus = this.scmViewService.menus.getRepositoryMenus(element.repository.provider);
|
|
2948
|
+
const menu = menus.historyProviderMenu?.getHistoryItemMenu2(element);
|
|
2949
|
+
if (menu) {
|
|
2950
|
+
actionRunner = ( (new HistoryItemActionRunner2(() => this.getSelectedHistoryItems())));
|
|
2951
|
+
actions = collectContextMenuActions(menu);
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2779
2954
|
actionRunner.onWillRun(() => this.tree.domFocus());
|
|
2780
2955
|
this.contextMenuService.showContextMenu({
|
|
2781
2956
|
getAnchor: () => e.anchor,
|
|
@@ -2793,6 +2968,10 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2793
2968
|
return this.tree.getSelection()
|
|
2794
2969
|
.filter(r => !!r && !isSCMResourceGroup(r));
|
|
2795
2970
|
}
|
|
2971
|
+
getSelectedHistoryItems() {
|
|
2972
|
+
return this.tree.getSelection()
|
|
2973
|
+
.filter(r => !!r && isSCMHistoryItemViewModelTreeElement(r));
|
|
2974
|
+
}
|
|
2796
2975
|
getViewMode() {
|
|
2797
2976
|
let mode = this.configurationService.getValue('scm.defaultViewMode') === 'list' ? ViewMode.List : ViewMode.Tree;
|
|
2798
2977
|
const storageMode = this.storageService.get(`scm.viewMode`, StorageScope.WORKSPACE);
|
|
@@ -2968,6 +3147,32 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2968
3147
|
this.tree.domFocus();
|
|
2969
3148
|
}
|
|
2970
3149
|
}
|
|
3150
|
+
getHistoryItemGroupFilterActions(repository) {
|
|
3151
|
+
const currentHistoryItemGroup = repository.provider.historyProvider.get()?.currentHistoryItemGroup?.get();
|
|
3152
|
+
if (!currentHistoryItemGroup) {
|
|
3153
|
+
return [];
|
|
3154
|
+
}
|
|
3155
|
+
const toHistoryItemGroupFilterAction = (historyItemGroupId, historyItemGroupName) => {
|
|
3156
|
+
return toAction({
|
|
3157
|
+
id: `workbench.scm.action.toggleHistoryItemGroupVisibility.${repository.id}.${historyItemGroupId}`,
|
|
3158
|
+
label: historyItemGroupName,
|
|
3159
|
+
checked: !( (this.historyProviderDataSource.getHistoryItemGroupFilter(repository).has(historyItemGroupId))),
|
|
3160
|
+
run: () => {
|
|
3161
|
+
this.historyProviderDataSource.toggleHistoryItemGroupFilter(repository, historyItemGroupId);
|
|
3162
|
+
this.historyProviderDataSource.deleteCacheEntry(repository);
|
|
3163
|
+
this.updateChildren(repository);
|
|
3164
|
+
}
|
|
3165
|
+
});
|
|
3166
|
+
};
|
|
3167
|
+
const actions = [];
|
|
3168
|
+
if (currentHistoryItemGroup.remote) {
|
|
3169
|
+
actions.push(toHistoryItemGroupFilterAction(currentHistoryItemGroup.remote.id, currentHistoryItemGroup.remote.name));
|
|
3170
|
+
}
|
|
3171
|
+
if (currentHistoryItemGroup.base) {
|
|
3172
|
+
actions.push(toHistoryItemGroupFilterAction(currentHistoryItemGroup.base.id, currentHistoryItemGroup.base.name));
|
|
3173
|
+
}
|
|
3174
|
+
return actions;
|
|
3175
|
+
}
|
|
2971
3176
|
shouldShowWelcome() {
|
|
2972
3177
|
return this.scmService.repositoryCount === 0;
|
|
2973
3178
|
}
|
|
@@ -3007,12 +3212,12 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
3007
3212
|
SCMViewPane = ( (__decorate([
|
|
3008
3213
|
( (__param(1, ICommandService))),
|
|
3009
3214
|
( (__param(2, IEditorService))),
|
|
3010
|
-
( (__param(3,
|
|
3011
|
-
( (__param(4,
|
|
3012
|
-
( (__param(5,
|
|
3013
|
-
( (__param(6,
|
|
3014
|
-
( (__param(7,
|
|
3015
|
-
( (__param(8,
|
|
3215
|
+
( (__param(3, IMenuService))),
|
|
3216
|
+
( (__param(4, ISCMService))),
|
|
3217
|
+
( (__param(5, ISCMViewService))),
|
|
3218
|
+
( (__param(6, IStorageService))),
|
|
3219
|
+
( (__param(7, IUriIdentityService))),
|
|
3220
|
+
( (__param(8, IWorkbenchLayoutService))),
|
|
3016
3221
|
( (__param(9, IKeybindingService))),
|
|
3017
3222
|
( (__param(10, IThemeService))),
|
|
3018
3223
|
( (__param(11, IContextMenuService))),
|
|
@@ -3024,150 +3229,31 @@ SCMViewPane = ( (__decorate([
|
|
|
3024
3229
|
( (__param(17, ITelemetryService))),
|
|
3025
3230
|
( (__param(18, IHoverService)))
|
|
3026
3231
|
], SCMViewPane)));
|
|
3027
|
-
let
|
|
3028
|
-
constructor(viewMode, configurationService,
|
|
3232
|
+
let SCMTreeHistoryProviderDataSource = class SCMTreeHistoryProviderDataSource extends Disposable {
|
|
3233
|
+
constructor(viewMode, configurationService, uriIdentityService) {
|
|
3234
|
+
super();
|
|
3029
3235
|
this.viewMode = viewMode;
|
|
3030
3236
|
this.configurationService = configurationService;
|
|
3031
|
-
this.logService = logService;
|
|
3032
|
-
this.scmViewService = scmViewService;
|
|
3033
3237
|
this.uriIdentityService = uriIdentityService;
|
|
3034
|
-
this.
|
|
3035
|
-
this.
|
|
3036
|
-
this.disposables = ( (new DisposableStore()));
|
|
3037
|
-
const onDidChangeConfiguration = Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.showChangesSummary'), this.disposables);
|
|
3038
|
-
this.disposables.add(onDidChangeConfiguration(() => this.historyProviderCache.clear()));
|
|
3039
|
-
this.scmViewService.onDidChangeVisibleRepositories(this.onDidChangeVisibleRepositories, this, this.disposables);
|
|
3040
|
-
this.onDidChangeVisibleRepositories({ added: this.scmViewService.visibleRepositories, removed: Iterable.empty() });
|
|
3238
|
+
this._cache = ( (new Map()));
|
|
3239
|
+
this._historyItemGroupFilter = ( (new Map()));
|
|
3041
3240
|
}
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
return this.scmViewService.visibleRepositories.length !== 0;
|
|
3045
|
-
}
|
|
3046
|
-
else if (isSCMRepository(inputOrElement)) {
|
|
3047
|
-
return true;
|
|
3048
|
-
}
|
|
3049
|
-
else if (isSCMInput(inputOrElement)) {
|
|
3050
|
-
return false;
|
|
3051
|
-
}
|
|
3052
|
-
else if (isSCMActionButton(inputOrElement)) {
|
|
3053
|
-
return false;
|
|
3054
|
-
}
|
|
3055
|
-
else if (isSCMResourceGroup(inputOrElement)) {
|
|
3056
|
-
return true;
|
|
3057
|
-
}
|
|
3058
|
-
else if (isSCMResource(inputOrElement)) {
|
|
3059
|
-
return false;
|
|
3060
|
-
}
|
|
3061
|
-
else if (ResourceTree.isResourceNode(inputOrElement)) {
|
|
3062
|
-
return inputOrElement.childrenCount > 0;
|
|
3063
|
-
}
|
|
3064
|
-
else if (isSCMHistoryItemGroupTreeElement(inputOrElement)) {
|
|
3065
|
-
return true;
|
|
3066
|
-
}
|
|
3067
|
-
else if (isSCMHistoryItemTreeElement(inputOrElement)) {
|
|
3068
|
-
return true;
|
|
3069
|
-
}
|
|
3070
|
-
else if (isSCMHistoryItemViewModelTreeElement(inputOrElement)) {
|
|
3071
|
-
return false;
|
|
3072
|
-
}
|
|
3073
|
-
else if (isSCMHistoryItemChangeTreeElement(inputOrElement)) {
|
|
3074
|
-
return false;
|
|
3075
|
-
}
|
|
3076
|
-
else if (isSCMViewSeparator(inputOrElement)) {
|
|
3077
|
-
return false;
|
|
3078
|
-
}
|
|
3079
|
-
else {
|
|
3080
|
-
throw ( (new Error('hasChildren not implemented.')));
|
|
3081
|
-
}
|
|
3241
|
+
clearCache() {
|
|
3242
|
+
this._cache.clear();
|
|
3082
3243
|
}
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
const repositoryCount = this.scmViewService.visibleRepositories.length;
|
|
3086
|
-
if (isSCMViewService(inputOrElement) && (repositoryCount > 1 || alwaysShowRepositories)) {
|
|
3087
|
-
return this.scmViewService.visibleRepositories;
|
|
3088
|
-
}
|
|
3089
|
-
else if ((isSCMViewService(inputOrElement) && repositoryCount === 1 && !alwaysShowRepositories) || isSCMRepository(inputOrElement)) {
|
|
3090
|
-
const children = [];
|
|
3091
|
-
inputOrElement = isSCMRepository(inputOrElement) ? inputOrElement : this.scmViewService.visibleRepositories[0];
|
|
3092
|
-
const actionButton = inputOrElement.provider.actionButton;
|
|
3093
|
-
const resourceGroups = inputOrElement.provider.groups;
|
|
3094
|
-
if (inputOrElement.input.visible) {
|
|
3095
|
-
children.push(inputOrElement.input);
|
|
3096
|
-
}
|
|
3097
|
-
if (showActionButton && actionButton) {
|
|
3098
|
-
children.push({
|
|
3099
|
-
type: 'actionButton',
|
|
3100
|
-
repository: inputOrElement,
|
|
3101
|
-
button: actionButton
|
|
3102
|
-
});
|
|
3103
|
-
}
|
|
3104
|
-
const hasSomeChanges = ( (resourceGroups.some(group => group.resources.length > 0)));
|
|
3105
|
-
if (hasSomeChanges || (repositoryCount === 1 && (!showActionButton || !actionButton))) {
|
|
3106
|
-
children.push(...resourceGroups);
|
|
3107
|
-
}
|
|
3108
|
-
const historyItemGroups = await this.getHistoryItemGroups(inputOrElement);
|
|
3109
|
-
if (historyItemGroups.length > 0) {
|
|
3110
|
-
let label = ( localizeWithPath(_moduleId, 34, "Incoming/Outgoing"));
|
|
3111
|
-
let ariaLabel = ( localizeWithPath(_moduleId, 35, "Incoming and outgoing changes"));
|
|
3112
|
-
const incomingHistoryItems = historyItemGroups.find(g => g.direction === 'incoming');
|
|
3113
|
-
const outgoingHistoryItems = historyItemGroups.find(g => g.direction === 'outgoing');
|
|
3114
|
-
if (incomingHistoryItems && !outgoingHistoryItems) {
|
|
3115
|
-
label = ( localizeWithPath(_moduleId, 36, "Incoming"));
|
|
3116
|
-
ariaLabel = ( localizeWithPath(_moduleId, 37, "Incoming changes"));
|
|
3117
|
-
}
|
|
3118
|
-
else if (!incomingHistoryItems && outgoingHistoryItems) {
|
|
3119
|
-
label = ( localizeWithPath(_moduleId, 38, "Outgoing"));
|
|
3120
|
-
ariaLabel = ( localizeWithPath(_moduleId, 39, "Outgoing changes"));
|
|
3121
|
-
}
|
|
3122
|
-
children.push({ label, ariaLabel, repository: inputOrElement, type: 'separator' });
|
|
3123
|
-
}
|
|
3124
|
-
children.push(...historyItemGroups);
|
|
3125
|
-
const historyItems = await this.getHistoryItems2(inputOrElement);
|
|
3126
|
-
if (historyItems.length > 0) {
|
|
3127
|
-
const label = ( localizeWithPath(_moduleId, 34, "Incoming/Outgoing"));
|
|
3128
|
-
const ariaLabel = ( localizeWithPath(_moduleId, 35, "Incoming and outgoing changes"));
|
|
3129
|
-
children.push({ label, ariaLabel, repository: inputOrElement, type: 'separator' });
|
|
3130
|
-
}
|
|
3131
|
-
children.push(...historyItems);
|
|
3132
|
-
return children;
|
|
3133
|
-
}
|
|
3134
|
-
else if (isSCMResourceGroup(inputOrElement)) {
|
|
3135
|
-
if (this.viewMode() === ViewMode.List) {
|
|
3136
|
-
return inputOrElement.resources;
|
|
3137
|
-
}
|
|
3138
|
-
else if (this.viewMode() === ViewMode.Tree) {
|
|
3139
|
-
const children = [];
|
|
3140
|
-
for (const node of inputOrElement.resourceTree.root.children) {
|
|
3141
|
-
children.push(node.element && node.childrenCount === 0 ? node.element : node);
|
|
3142
|
-
}
|
|
3143
|
-
return children;
|
|
3144
|
-
}
|
|
3145
|
-
}
|
|
3146
|
-
else if (isSCMResourceNode(inputOrElement) || isSCMHistoryItemChangeNode(inputOrElement)) {
|
|
3147
|
-
const children = [];
|
|
3148
|
-
for (const node of inputOrElement.children) {
|
|
3149
|
-
children.push(node.element && node.childrenCount === 0 ? node.element : node);
|
|
3150
|
-
}
|
|
3151
|
-
return children;
|
|
3152
|
-
}
|
|
3153
|
-
else if (isSCMHistoryItemGroupTreeElement(inputOrElement)) {
|
|
3154
|
-
return this.getHistoryItems(inputOrElement);
|
|
3155
|
-
}
|
|
3156
|
-
else if (isSCMHistoryItemTreeElement(inputOrElement)) {
|
|
3157
|
-
return this.getHistoryItemChanges(inputOrElement);
|
|
3158
|
-
}
|
|
3159
|
-
return [];
|
|
3244
|
+
deleteCacheEntry(repository) {
|
|
3245
|
+
this._cache.delete(repository);
|
|
3160
3246
|
}
|
|
3161
3247
|
async getHistoryItemGroups(element) {
|
|
3162
|
-
const { showIncomingChanges, showOutgoingChanges, showHistoryGraph } = this.
|
|
3248
|
+
const { showIncomingChanges, showOutgoingChanges, showHistoryGraph } = this._getConfiguration();
|
|
3163
3249
|
const scmProvider = element.provider;
|
|
3164
|
-
const historyProvider = scmProvider.historyProvider;
|
|
3165
|
-
const currentHistoryItemGroup = historyProvider?.currentHistoryItemGroup;
|
|
3250
|
+
const historyProvider = scmProvider.historyProvider.get();
|
|
3251
|
+
const currentHistoryItemGroup = historyProvider?.currentHistoryItemGroup.get();
|
|
3166
3252
|
if (!historyProvider || !currentHistoryItemGroup || (showIncomingChanges === 'never' && showOutgoingChanges === 'never') || showHistoryGraph) {
|
|
3167
3253
|
return [];
|
|
3168
3254
|
}
|
|
3169
3255
|
const children = [];
|
|
3170
|
-
const historyProviderCacheEntry = this.
|
|
3256
|
+
const historyProviderCacheEntry = this._getCacheEntry(element);
|
|
3171
3257
|
let incomingHistoryItemGroup = historyProviderCacheEntry?.incomingHistoryItemGroup;
|
|
3172
3258
|
let outgoingHistoryItemGroup = historyProviderCacheEntry?.outgoingHistoryItemGroup;
|
|
3173
3259
|
if (!incomingHistoryItemGroup && !outgoingHistoryItemGroup) {
|
|
@@ -3178,12 +3264,7 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3178
3264
|
incomingHistoryItemGroup = currentHistoryItemGroup.remote ? {
|
|
3179
3265
|
id: currentHistoryItemGroup.remote.id,
|
|
3180
3266
|
label: currentHistoryItemGroup.remote.name,
|
|
3181
|
-
ariaLabel: (
|
|
3182
|
-
_moduleId,
|
|
3183
|
-
40,
|
|
3184
|
-
"Incoming changes from {0}",
|
|
3185
|
-
currentHistoryItemGroup.remote.name
|
|
3186
|
-
)),
|
|
3267
|
+
ariaLabel: ( localize(6396, "Incoming changes from {0}", currentHistoryItemGroup.remote.name)),
|
|
3187
3268
|
icon: Codicon.arrowCircleDown,
|
|
3188
3269
|
direction: 'incoming',
|
|
3189
3270
|
ancestor: ancestor.id,
|
|
@@ -3194,7 +3275,7 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3194
3275
|
outgoingHistoryItemGroup = {
|
|
3195
3276
|
id: currentHistoryItemGroup.id,
|
|
3196
3277
|
label: currentHistoryItemGroup.name,
|
|
3197
|
-
ariaLabel: (
|
|
3278
|
+
ariaLabel: ( localize(6397, "Outgoing changes to {0}", currentHistoryItemGroup.name)),
|
|
3198
3279
|
icon: Codicon.arrowCircleUp,
|
|
3199
3280
|
direction: 'outgoing',
|
|
3200
3281
|
ancestor: ancestor.id,
|
|
@@ -3202,8 +3283,7 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3202
3283
|
repository: element,
|
|
3203
3284
|
type: 'historyItemGroup'
|
|
3204
3285
|
};
|
|
3205
|
-
this.
|
|
3206
|
-
...historyProviderCacheEntry,
|
|
3286
|
+
this._updateCacheEntry(element, {
|
|
3207
3287
|
incomingHistoryItemGroup,
|
|
3208
3288
|
outgoingHistoryItemGroup
|
|
3209
3289
|
});
|
|
@@ -3220,23 +3300,35 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3220
3300
|
}
|
|
3221
3301
|
return children;
|
|
3222
3302
|
}
|
|
3303
|
+
getHistoryItemGroupFilter(element) {
|
|
3304
|
+
return this._historyItemGroupFilter.get(element) ?? ( (new Set()));
|
|
3305
|
+
}
|
|
3306
|
+
deleteHistoryItemGroupFilter(repository) {
|
|
3307
|
+
this._historyItemGroupFilter.delete(repository);
|
|
3308
|
+
}
|
|
3309
|
+
toggleHistoryItemGroupFilter(element, historyItemGroupId) {
|
|
3310
|
+
const filters = this.getHistoryItemGroupFilter(element);
|
|
3311
|
+
if (!filters.delete(historyItemGroupId)) {
|
|
3312
|
+
filters.add(historyItemGroupId);
|
|
3313
|
+
}
|
|
3314
|
+
this._historyItemGroupFilter.set(element, filters);
|
|
3315
|
+
}
|
|
3223
3316
|
async getHistoryItems(element) {
|
|
3224
3317
|
const repository = element.repository;
|
|
3225
|
-
const historyProvider = repository.provider.historyProvider;
|
|
3318
|
+
const historyProvider = repository.provider.historyProvider.get();
|
|
3226
3319
|
if (!historyProvider) {
|
|
3227
3320
|
return [];
|
|
3228
3321
|
}
|
|
3229
|
-
const historyProviderCacheEntry = this.
|
|
3322
|
+
const historyProviderCacheEntry = this._getCacheEntry(repository);
|
|
3230
3323
|
const historyItemsMap = historyProviderCacheEntry.historyItems;
|
|
3231
3324
|
let historyItemsElement = historyProviderCacheEntry.historyItems.get(element.id);
|
|
3232
3325
|
if (!historyItemsElement) {
|
|
3233
3326
|
const historyItems = (await historyProvider.provideHistoryItems(element.id, { limit: { id: element.ancestor } })) ?? [];
|
|
3234
|
-
const { showChangesSummary } = this.
|
|
3327
|
+
const { showChangesSummary } = this._getConfiguration();
|
|
3235
3328
|
const allChanges = showChangesSummary && historyItems.length >= 2 ?
|
|
3236
3329
|
await historyProvider.provideHistoryItemSummary(historyItems[0].id, element.ancestor) : undefined;
|
|
3237
3330
|
historyItemsElement = [allChanges, historyItems];
|
|
3238
|
-
this.
|
|
3239
|
-
...historyProviderCacheEntry,
|
|
3331
|
+
this._updateCacheEntry(repository, {
|
|
3240
3332
|
historyItems: historyItemsMap.set(element.id, historyItemsElement)
|
|
3241
3333
|
});
|
|
3242
3334
|
}
|
|
@@ -3245,7 +3337,7 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3245
3337
|
children.push({
|
|
3246
3338
|
...historyItemsElement[0],
|
|
3247
3339
|
icon: historyItemsElement[0].icon ?? Codicon.files,
|
|
3248
|
-
message: (
|
|
3340
|
+
message: ( localize(6398, "All Changes")),
|
|
3249
3341
|
historyItemGroup: element,
|
|
3250
3342
|
type: 'allChanges'
|
|
3251
3343
|
});
|
|
@@ -3259,13 +3351,13 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3259
3351
|
return children;
|
|
3260
3352
|
}
|
|
3261
3353
|
async getHistoryItems2(element) {
|
|
3262
|
-
const { showHistoryGraph } = this.
|
|
3263
|
-
const historyProvider = element.provider.historyProvider;
|
|
3264
|
-
const currentHistoryItemGroup = historyProvider?.currentHistoryItemGroup;
|
|
3265
|
-
if (!currentHistoryItemGroup || !showHistoryGraph) {
|
|
3354
|
+
const { showHistoryGraph } = this._getConfiguration();
|
|
3355
|
+
const historyProvider = element.provider.historyProvider.get();
|
|
3356
|
+
const currentHistoryItemGroup = historyProvider?.currentHistoryItemGroup.get();
|
|
3357
|
+
if (!historyProvider || !currentHistoryItemGroup || !showHistoryGraph) {
|
|
3266
3358
|
return [];
|
|
3267
3359
|
}
|
|
3268
|
-
const historyProviderCacheEntry = this.
|
|
3360
|
+
const historyProviderCacheEntry = this._getCacheEntry(element);
|
|
3269
3361
|
let historyItemsElement = historyProviderCacheEntry.historyItems2.get(element.id);
|
|
3270
3362
|
const historyItemsMap = historyProviderCacheEntry.historyItems2;
|
|
3271
3363
|
if (!historyItemsElement) {
|
|
@@ -3274,24 +3366,39 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3274
3366
|
...(currentHistoryItemGroup.remote ? [currentHistoryItemGroup.remote.id] : []),
|
|
3275
3367
|
...(currentHistoryItemGroup.base ? [currentHistoryItemGroup.base.id] : []),
|
|
3276
3368
|
];
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3369
|
+
const ancestor = await historyProvider.resolveHistoryItemGroupCommonAncestor2(historyItemGroupIds);
|
|
3370
|
+
if (!ancestor) {
|
|
3371
|
+
return [];
|
|
3372
|
+
}
|
|
3373
|
+
const filters = this.getHistoryItemGroupFilter(element);
|
|
3374
|
+
historyItemsElement = (await historyProvider.provideHistoryItems2({
|
|
3375
|
+
historyItemGroupIds: historyItemGroupIds.filter(id => !( (filters.has(id)))),
|
|
3376
|
+
limit: { id: ancestor }
|
|
3377
|
+
})) ?? [];
|
|
3378
|
+
this._updateCacheEntry(element, {
|
|
3280
3379
|
historyItems2: historyItemsMap.set(element.id, historyItemsElement)
|
|
3281
3380
|
});
|
|
3282
3381
|
}
|
|
3283
|
-
if (historyItemsElement.length === 1
|
|
3284
|
-
|
|
3285
|
-
|
|
3382
|
+
if (historyItemsElement.length === 1) {
|
|
3383
|
+
const currentHistoryItemGroupLabels = [
|
|
3384
|
+
currentHistoryItemGroup.name,
|
|
3385
|
+
...(currentHistoryItemGroup.remote ? [currentHistoryItemGroup.remote.name] : []),
|
|
3386
|
+
...(currentHistoryItemGroup.base ? [currentHistoryItemGroup.base.name] : []),
|
|
3387
|
+
];
|
|
3388
|
+
const labels = ( ((historyItemsElement[0].labels ?? [])
|
|
3389
|
+
.map(l => l.title)));
|
|
3390
|
+
if (equals(currentHistoryItemGroupLabels.sort(), labels.sort())) {
|
|
3391
|
+
return [];
|
|
3392
|
+
}
|
|
3286
3393
|
}
|
|
3287
3394
|
const colorMap = ( (new Map([
|
|
3288
|
-
[currentHistoryItemGroup.name,
|
|
3395
|
+
[currentHistoryItemGroup.name, historyItemGroupLocal]
|
|
3289
3396
|
])));
|
|
3290
3397
|
if (currentHistoryItemGroup.remote) {
|
|
3291
|
-
colorMap.set(currentHistoryItemGroup.remote.name,
|
|
3398
|
+
colorMap.set(currentHistoryItemGroup.remote.name, historyItemGroupRemote);
|
|
3292
3399
|
}
|
|
3293
3400
|
if (currentHistoryItemGroup.base) {
|
|
3294
|
-
colorMap.set(currentHistoryItemGroup.base.name,
|
|
3401
|
+
colorMap.set(currentHistoryItemGroup.base.name, historyItemGroupBase);
|
|
3295
3402
|
}
|
|
3296
3403
|
return (
|
|
3297
3404
|
(toISCMHistoryItemViewModelArray(historyItemsElement, colorMap)
|
|
@@ -3304,19 +3411,18 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3304
3411
|
}
|
|
3305
3412
|
async getHistoryItemChanges(element) {
|
|
3306
3413
|
const repository = element.historyItemGroup.repository;
|
|
3307
|
-
const historyProvider = repository.provider.historyProvider;
|
|
3414
|
+
const historyProvider = repository.provider.historyProvider.get();
|
|
3308
3415
|
if (!historyProvider) {
|
|
3309
3416
|
return [];
|
|
3310
3417
|
}
|
|
3311
|
-
const historyProviderCacheEntry = this.
|
|
3418
|
+
const historyProviderCacheEntry = this._getCacheEntry(repository);
|
|
3312
3419
|
const historyItemChangesMap = historyProviderCacheEntry.historyItemChanges;
|
|
3313
3420
|
const historyItemParentId = element.parentIds.length > 0 ? element.parentIds[0] : undefined;
|
|
3314
3421
|
let historyItemChanges = historyItemChangesMap.get(`${element.id}/${historyItemParentId}`);
|
|
3315
3422
|
if (!historyItemChanges) {
|
|
3316
3423
|
const historyItemParentId = element.parentIds.length > 0 ? element.parentIds[0] : undefined;
|
|
3317
3424
|
historyItemChanges = (await historyProvider.provideHistoryItemChanges(element.id, historyItemParentId)) ?? [];
|
|
3318
|
-
this.
|
|
3319
|
-
...historyProviderCacheEntry,
|
|
3425
|
+
this._updateCacheEntry(repository, {
|
|
3320
3426
|
historyItemChanges: historyItemChangesMap.set(`${element.id}/${historyItemParentId}`, historyItemChanges)
|
|
3321
3427
|
});
|
|
3322
3428
|
}
|
|
@@ -3347,6 +3453,126 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3347
3453
|
}
|
|
3348
3454
|
return children;
|
|
3349
3455
|
}
|
|
3456
|
+
_getCacheEntry(repository) {
|
|
3457
|
+
let entry = this._cache.get(repository);
|
|
3458
|
+
if (!entry) {
|
|
3459
|
+
entry = {
|
|
3460
|
+
incomingHistoryItemGroup: undefined,
|
|
3461
|
+
outgoingHistoryItemGroup: undefined,
|
|
3462
|
+
historyItems: ( (new Map())),
|
|
3463
|
+
historyItems2: ( (new Map())),
|
|
3464
|
+
historyItemChanges: ( (new Map()))
|
|
3465
|
+
};
|
|
3466
|
+
this._cache.set(repository, entry);
|
|
3467
|
+
}
|
|
3468
|
+
return entry;
|
|
3469
|
+
}
|
|
3470
|
+
_updateCacheEntry(repository, entry) {
|
|
3471
|
+
this._cache.set(repository, {
|
|
3472
|
+
...this._getCacheEntry(repository),
|
|
3473
|
+
...entry
|
|
3474
|
+
});
|
|
3475
|
+
}
|
|
3476
|
+
_getConfiguration() {
|
|
3477
|
+
return {
|
|
3478
|
+
showChangesSummary: this.configurationService.getValue('scm.showChangesSummary'),
|
|
3479
|
+
showIncomingChanges: this.configurationService.getValue('scm.showIncomingChanges'),
|
|
3480
|
+
showOutgoingChanges: this.configurationService.getValue('scm.showOutgoingChanges'),
|
|
3481
|
+
showHistoryGraph: this.configurationService.getValue('scm.showHistoryGraph')
|
|
3482
|
+
};
|
|
3483
|
+
}
|
|
3484
|
+
};
|
|
3485
|
+
SCMTreeHistoryProviderDataSource = ( (__decorate([
|
|
3486
|
+
( (__param(1, IConfigurationService))),
|
|
3487
|
+
( (__param(2, IUriIdentityService)))
|
|
3488
|
+
], SCMTreeHistoryProviderDataSource)));
|
|
3489
|
+
let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
|
|
3490
|
+
constructor(viewMode, historyProviderDataSource, configurationService, scmViewService) {
|
|
3491
|
+
super();
|
|
3492
|
+
this.viewMode = viewMode;
|
|
3493
|
+
this.historyProviderDataSource = historyProviderDataSource;
|
|
3494
|
+
this.configurationService = configurationService;
|
|
3495
|
+
this.scmViewService = scmViewService;
|
|
3496
|
+
}
|
|
3497
|
+
async getChildren(inputOrElement) {
|
|
3498
|
+
const repositoryCount = this.scmViewService.visibleRepositories.length;
|
|
3499
|
+
const showActionButton = this.configurationService.getValue('scm.showActionButton') === true;
|
|
3500
|
+
const alwaysShowRepositories = this.configurationService.getValue('scm.alwaysShowRepositories') === true;
|
|
3501
|
+
if (isSCMViewService(inputOrElement) && (repositoryCount > 1 || alwaysShowRepositories)) {
|
|
3502
|
+
return this.scmViewService.visibleRepositories;
|
|
3503
|
+
}
|
|
3504
|
+
else if ((isSCMViewService(inputOrElement) && repositoryCount === 1 && !alwaysShowRepositories) || isSCMRepository(inputOrElement)) {
|
|
3505
|
+
const children = [];
|
|
3506
|
+
inputOrElement = isSCMRepository(inputOrElement) ? inputOrElement : this.scmViewService.visibleRepositories[0];
|
|
3507
|
+
const actionButton = inputOrElement.provider.actionButton;
|
|
3508
|
+
const resourceGroups = inputOrElement.provider.groups;
|
|
3509
|
+
if (inputOrElement.input.visible) {
|
|
3510
|
+
children.push(inputOrElement.input);
|
|
3511
|
+
}
|
|
3512
|
+
if (showActionButton && actionButton) {
|
|
3513
|
+
children.push({
|
|
3514
|
+
type: 'actionButton',
|
|
3515
|
+
repository: inputOrElement,
|
|
3516
|
+
button: actionButton
|
|
3517
|
+
});
|
|
3518
|
+
}
|
|
3519
|
+
const hasSomeChanges = ( (resourceGroups.some(group => group.resources.length > 0)));
|
|
3520
|
+
if (hasSomeChanges || (repositoryCount === 1 && (!showActionButton || !actionButton))) {
|
|
3521
|
+
children.push(...resourceGroups);
|
|
3522
|
+
}
|
|
3523
|
+
const historyItemGroups = await this.historyProviderDataSource.getHistoryItemGroups(inputOrElement);
|
|
3524
|
+
if (historyItemGroups.length > 0) {
|
|
3525
|
+
let label = ( localize(6399, "Incoming/Outgoing"));
|
|
3526
|
+
let ariaLabel = ( localize(6400, "Incoming and outgoing changes"));
|
|
3527
|
+
const incomingHistoryItems = historyItemGroups.find(g => g.direction === 'incoming');
|
|
3528
|
+
const outgoingHistoryItems = historyItemGroups.find(g => g.direction === 'outgoing');
|
|
3529
|
+
if (incomingHistoryItems && !outgoingHistoryItems) {
|
|
3530
|
+
label = ( localize(6401, "Incoming"));
|
|
3531
|
+
ariaLabel = ( localize(6402, "Incoming changes"));
|
|
3532
|
+
}
|
|
3533
|
+
else if (!incomingHistoryItems && outgoingHistoryItems) {
|
|
3534
|
+
label = ( localize(6403, "Outgoing"));
|
|
3535
|
+
ariaLabel = ( localize(6404, "Outgoing changes"));
|
|
3536
|
+
}
|
|
3537
|
+
children.push({ label, ariaLabel, repository: inputOrElement, type: 'separator' });
|
|
3538
|
+
}
|
|
3539
|
+
children.push(...historyItemGroups);
|
|
3540
|
+
const historyItems = await this.historyProviderDataSource.getHistoryItems2(inputOrElement);
|
|
3541
|
+
if (historyItems.length > 0) {
|
|
3542
|
+
const label = ( localize(6404, "Incoming/Outgoing"));
|
|
3543
|
+
const ariaLabel = ( localize(6404, "Incoming and outgoing changes"));
|
|
3544
|
+
children.push({ label, ariaLabel, repository: inputOrElement, type: 'separator' });
|
|
3545
|
+
}
|
|
3546
|
+
children.push(...historyItems);
|
|
3547
|
+
return children;
|
|
3548
|
+
}
|
|
3549
|
+
else if (isSCMResourceGroup(inputOrElement)) {
|
|
3550
|
+
if (this.viewMode() === ViewMode.List) {
|
|
3551
|
+
return inputOrElement.resources;
|
|
3552
|
+
}
|
|
3553
|
+
else if (this.viewMode() === ViewMode.Tree) {
|
|
3554
|
+
const children = [];
|
|
3555
|
+
for (const node of inputOrElement.resourceTree.root.children) {
|
|
3556
|
+
children.push(node.element && node.childrenCount === 0 ? node.element : node);
|
|
3557
|
+
}
|
|
3558
|
+
return children;
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
else if (isSCMResourceNode(inputOrElement) || isSCMHistoryItemChangeNode(inputOrElement)) {
|
|
3562
|
+
const children = [];
|
|
3563
|
+
for (const node of inputOrElement.children) {
|
|
3564
|
+
children.push(node.element && node.childrenCount === 0 ? node.element : node);
|
|
3565
|
+
}
|
|
3566
|
+
return children;
|
|
3567
|
+
}
|
|
3568
|
+
else if (isSCMHistoryItemGroupTreeElement(inputOrElement)) {
|
|
3569
|
+
return this.historyProviderDataSource.getHistoryItems(inputOrElement);
|
|
3570
|
+
}
|
|
3571
|
+
else if (isSCMHistoryItemTreeElement(inputOrElement)) {
|
|
3572
|
+
return this.historyProviderDataSource.getHistoryItemChanges(inputOrElement);
|
|
3573
|
+
}
|
|
3574
|
+
return [];
|
|
3575
|
+
}
|
|
3350
3576
|
getParent(element) {
|
|
3351
3577
|
if (isSCMResourceNode(element)) {
|
|
3352
3578
|
if (element.parent === element.context.resourceTree.root) {
|
|
@@ -3387,56 +3613,51 @@ let SCMTreeDataSource = class SCMTreeDataSource {
|
|
|
3387
3613
|
throw ( (new Error('Unexpected call to getParent')));
|
|
3388
3614
|
}
|
|
3389
3615
|
}
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
showActionButton: this.configurationService.getValue('scm.showActionButton'),
|
|
3394
|
-
showChangesSummary: this.configurationService.getValue('scm.showChangesSummary'),
|
|
3395
|
-
showIncomingChanges: this.configurationService.getValue('scm.showIncomingChanges'),
|
|
3396
|
-
showOutgoingChanges: this.configurationService.getValue('scm.showOutgoingChanges'),
|
|
3397
|
-
showHistoryGraph: this.configurationService.getValue('scm.experimental.showHistoryGraph')
|
|
3398
|
-
};
|
|
3399
|
-
}
|
|
3400
|
-
onDidChangeVisibleRepositories({ added, removed }) {
|
|
3401
|
-
for (const repository of added) {
|
|
3402
|
-
const repositoryDisposables = ( (new DisposableStore()));
|
|
3403
|
-
repositoryDisposables.add(Event.runAndSubscribe(repository.provider.onDidChangeHistoryProvider, () => {
|
|
3404
|
-
if (!repository.provider.historyProvider) {
|
|
3405
|
-
this.logService.debug('SCMTreeDataSource:onDidChangeVisibleRepositories - no history provider present');
|
|
3406
|
-
return;
|
|
3407
|
-
}
|
|
3408
|
-
repositoryDisposables.add(repository.provider.historyProvider.onDidChangeCurrentHistoryItemGroup(() => {
|
|
3409
|
-
this.historyProviderCache.delete(repository);
|
|
3410
|
-
this.logService.debug('SCMTreeDataSource:onDidChangeCurrentHistoryItemGroup - cache cleared');
|
|
3411
|
-
}));
|
|
3412
|
-
this.logService.debug('SCMTreeDataSource:onDidChangeVisibleRepositories - onDidChangeCurrentHistoryItemGroup listener added');
|
|
3413
|
-
}));
|
|
3414
|
-
this.repositoryDisposables.set(repository, repositoryDisposables);
|
|
3616
|
+
hasChildren(inputOrElement) {
|
|
3617
|
+
if (isSCMViewService(inputOrElement)) {
|
|
3618
|
+
return this.scmViewService.visibleRepositories.length !== 0;
|
|
3415
3619
|
}
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3620
|
+
else if (isSCMRepository(inputOrElement)) {
|
|
3621
|
+
return true;
|
|
3622
|
+
}
|
|
3623
|
+
else if (isSCMInput(inputOrElement)) {
|
|
3624
|
+
return false;
|
|
3625
|
+
}
|
|
3626
|
+
else if (isSCMActionButton(inputOrElement)) {
|
|
3627
|
+
return false;
|
|
3628
|
+
}
|
|
3629
|
+
else if (isSCMResourceGroup(inputOrElement)) {
|
|
3630
|
+
return true;
|
|
3631
|
+
}
|
|
3632
|
+
else if (isSCMResource(inputOrElement)) {
|
|
3633
|
+
return false;
|
|
3634
|
+
}
|
|
3635
|
+
else if (ResourceTree.isResourceNode(inputOrElement)) {
|
|
3636
|
+
return inputOrElement.childrenCount > 0;
|
|
3637
|
+
}
|
|
3638
|
+
else if (isSCMHistoryItemGroupTreeElement(inputOrElement)) {
|
|
3639
|
+
return true;
|
|
3640
|
+
}
|
|
3641
|
+
else if (isSCMHistoryItemTreeElement(inputOrElement)) {
|
|
3642
|
+
return true;
|
|
3643
|
+
}
|
|
3644
|
+
else if (isSCMHistoryItemViewModelTreeElement(inputOrElement)) {
|
|
3645
|
+
return false;
|
|
3646
|
+
}
|
|
3647
|
+
else if (isSCMHistoryItemChangeTreeElement(inputOrElement)) {
|
|
3648
|
+
return false;
|
|
3649
|
+
}
|
|
3650
|
+
else if (isSCMViewSeparator(inputOrElement)) {
|
|
3651
|
+
return false;
|
|
3652
|
+
}
|
|
3653
|
+
else {
|
|
3654
|
+
throw ( (new Error('hasChildren not implemented.')));
|
|
3419
3655
|
}
|
|
3420
|
-
}
|
|
3421
|
-
getHistoryProviderCacheEntry(repository) {
|
|
3422
|
-
return this.historyProviderCache.get(repository) ?? {
|
|
3423
|
-
incomingHistoryItemGroup: undefined,
|
|
3424
|
-
outgoingHistoryItemGroup: undefined,
|
|
3425
|
-
historyItems: ( (new Map())),
|
|
3426
|
-
historyItems2: ( (new Map())),
|
|
3427
|
-
historyItemChanges: ( (new Map()))
|
|
3428
|
-
};
|
|
3429
|
-
}
|
|
3430
|
-
dispose() {
|
|
3431
|
-
this.repositoryDisposables.dispose();
|
|
3432
|
-
this.disposables.dispose();
|
|
3433
3656
|
}
|
|
3434
3657
|
};
|
|
3435
3658
|
SCMTreeDataSource = ( (__decorate([
|
|
3436
|
-
( (__param(
|
|
3437
|
-
( (__param(
|
|
3438
|
-
( (__param(3, ISCMViewService))),
|
|
3439
|
-
( (__param(4, IUriIdentityService)))
|
|
3659
|
+
( (__param(2, IConfigurationService))),
|
|
3660
|
+
( (__param(3, ISCMViewService)))
|
|
3440
3661
|
], SCMTreeDataSource)));
|
|
3441
3662
|
class SCMActionButton {
|
|
3442
3663
|
constructor(container, contextMenuService, commandService, notificationService) {
|
|
@@ -3517,16 +3738,13 @@ registerThemingParticipant((theme, collector) => {
|
|
|
3517
3738
|
if (selectionBackgroundColor) {
|
|
3518
3739
|
const inputBackgroundColor = theme.getColor(inputBackground);
|
|
3519
3740
|
if (inputBackgroundColor) {
|
|
3741
|
+
collector.addRule(`.scm-view .scm-editor-container .monaco-editor-background { background-color: ${inputBackgroundColor}; } `);
|
|
3520
3742
|
collector.addRule(`.scm-view .scm-editor-container .monaco-editor .selected-text { background-color: ${( (inputBackgroundColor.transparent(0.4)))}; }`);
|
|
3521
3743
|
}
|
|
3522
3744
|
const inputForegroundColor = theme.getColor(inputForeground);
|
|
3523
3745
|
if (inputForegroundColor) {
|
|
3524
3746
|
collector.addRule(`.scm-view .scm-editor-container .monaco-editor .view-line span.inline-selected-text { color: ${inputForegroundColor}; }`);
|
|
3525
3747
|
}
|
|
3526
|
-
const backgroundColor = theme.getColor(inputBackground);
|
|
3527
|
-
if (backgroundColor) {
|
|
3528
|
-
collector.addRule(`.scm-view .scm-editor-container .monaco-editor-background { background-color: ${backgroundColor}; } `);
|
|
3529
|
-
}
|
|
3530
3748
|
collector.addRule(`.scm-view .scm-editor-container .monaco-editor .focused .selected-text { background-color: ${selectionBackgroundColor}; }`);
|
|
3531
3749
|
}
|
|
3532
3750
|
else {
|