@codingame/monaco-vscode-scm-service-override 9.0.2 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +24 -37
- package/vscode/src/vs/workbench/contrib/scm/browser/media/scm.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +2 -77
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +172 -123
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.js +914 -501
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +4 -5
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.js +4 -3
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +106 -916
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.js +12 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js +45 -17
- package/vscode/src/vs/workbench/contrib/scm/browser/workingSet.js +19 -16
- package/vscode/src/vs/workbench/contrib/scm/common/scmService.js +9 -10
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +0 -222
- package/vscode/src/vs/workbench/contrib/scm/browser/util.js +0 -133
|
@@ -4,8 +4,8 @@ import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
|
4
4
|
import { basename, dirname } from 'vscode/vscode/vs/base/common/resources';
|
|
5
5
|
import { Disposable, DisposableStore, toDisposable, combinedDisposable, MutableDisposable, dispose, DisposableMap } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
6
|
import { ViewAction, ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
7
|
-
import { append, $, asCSSUrl,
|
|
8
|
-
import { VIEW_PANE_ID,
|
|
7
|
+
import { append, $, asCSSUrl, Dimension, trackFocus, isPointerEvent, isActiveElement, clearNode } from 'vscode/vscode/vs/base/browser/dom';
|
|
8
|
+
import { VIEW_PANE_ID, SCMInputChangeReason } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm';
|
|
9
9
|
import { ISCMViewService, ISCMService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
10
10
|
import { ResourceLabels } from 'vscode/vscode/vs/workbench/browser/labels';
|
|
11
11
|
import { CountBadge } from 'vscode/vscode/vs/base/browser/ui/countBadge/countBadge';
|
|
@@ -16,26 +16,22 @@ import { RawContextKey, ContextKeyExpr } from 'vscode/vscode/vs/platform/context
|
|
|
16
16
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
17
17
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
18
18
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
19
|
-
import { MenuItemAction, MenuId, MenuRegistry,
|
|
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,
|
|
21
|
+
import { ActionRunner, Action, Separator } from 'vscode/vscode/vs/base/common/actions';
|
|
22
22
|
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
23
23
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
24
|
-
import { isSCMResource, connectPrimaryMenuToInlineActionBar,
|
|
24
|
+
import { isSCMResource, connectPrimaryMenuToInlineActionBar, isSCMInput, isSCMActionButton, isSCMRepository, isSCMResourceGroup, isSCMResourceNode, getActionViewItemProvider, collectContextMenuActions, isSCMViewService } from 'vscode/vscode/vs/workbench/contrib/scm/browser/util';
|
|
25
25
|
import { WorkbenchCompressibleAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
26
|
-
import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
27
26
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
28
27
|
import { disposableTimeout, ThrottledDelayer, Sequencer, Throttler } from 'vscode/vscode/vs/base/common/async';
|
|
29
28
|
import { ResourceTree } from 'vscode/vscode/vs/base/common/resourceTree';
|
|
30
29
|
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
31
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
32
30
|
import { FileKind } from 'vscode/vscode/vs/platform/files/common/files';
|
|
33
|
-
import {
|
|
31
|
+
import { compareFileNames, comparePaths } from 'vscode/vscode/vs/base/common/comparers';
|
|
34
32
|
import { createMatches } from 'vscode/vscode/vs/base/common/filters';
|
|
35
|
-
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
36
33
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
37
34
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
38
|
-
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
39
35
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
40
36
|
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
41
37
|
import { CodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
@@ -46,7 +42,7 @@ import { MenuPreventer } from 'vscode/vscode/vs/workbench/contrib/codeEditor/bro
|
|
|
46
42
|
import { SelectionClipboardContributionID } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/selectionClipboard';
|
|
47
43
|
import { EditorDictation } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation';
|
|
48
44
|
import { ContextMenuController } from 'vscode/vscode/vs/editor/contrib/contextmenu/browser/contextmenu';
|
|
49
|
-
import {
|
|
45
|
+
import { isMacintosh } from 'vscode/vscode/vs/base/common/platform';
|
|
50
46
|
import { compare, format } from 'vscode/vscode/vs/base/common/strings';
|
|
51
47
|
import { SuggestController } from 'vscode/vscode/vs/editor/contrib/suggest/browser/suggestController';
|
|
52
48
|
import { SnippetController2 } from 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetController2';
|
|
@@ -56,11 +52,9 @@ import { LinkDetector } from 'vscode/vscode/vs/editor/contrib/links/browser/link
|
|
|
56
52
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
|
|
57
53
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
58
54
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
59
|
-
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
60
55
|
import { DEFAULT_FONT_FAMILY } from 'vscode/vscode/vs/base/browser/fonts';
|
|
61
56
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
62
57
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
63
|
-
import { AnchorAlignment } from 'vscode/vscode/vs/base/browser/ui/contextview/contextview';
|
|
64
58
|
import { RepositoryRenderer, RepositoryActionRunner } from './scmRepositoryRenderer.js';
|
|
65
59
|
import { ColorScheme } from 'vscode/vscode/vs/platform/theme/common/theme';
|
|
66
60
|
import { API_OPEN_EDITOR_COMMAND_ID, API_OPEN_DIFF_EDITOR_COMMAND_ID } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
@@ -80,50 +74,25 @@ import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
|
80
74
|
import { fillEditorsDragData } from 'vscode/vscode/vs/workbench/browser/dnd';
|
|
81
75
|
import { CodeDataTransfers } from 'vscode/vscode/vs/platform/dnd/browser/dnd';
|
|
82
76
|
import { FormatOnType } from 'vscode/vscode/vs/editor/contrib/format/browser/formatActions';
|
|
83
|
-
import { EditorOptions
|
|
77
|
+
import { EditorOptions } from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
84
78
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
85
79
|
import { EditOperation } from 'vscode/vscode/vs/editor/common/core/editOperation';
|
|
86
|
-
import { stripIcons } from 'vscode/vscode/vs/base/common/iconLabels';
|
|
87
|
-
import { IconLabel } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabel';
|
|
88
|
-
import { registerColor, transparent } from 'vscode/vscode/vs/platform/theme/common/colorUtils';
|
|
89
|
-
import { foreground } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
|
|
90
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
|
|
91
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
|
|
92
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
|
|
93
|
-
import { listActiveSelectionForeground } from 'vscode/vscode/vs/platform/theme/common/colors/listColors';
|
|
94
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/menuColors';
|
|
95
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
96
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
97
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
98
|
-
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
99
80
|
import { WorkbenchToolBar } from 'vscode/vscode/vs/platform/actions/browser/toolbar';
|
|
100
81
|
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
101
82
|
import { DropdownWithPrimaryActionViewItem } from 'vscode/vscode/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem';
|
|
102
83
|
import { clamp, rot } from 'vscode/vscode/vs/base/common/numbers';
|
|
103
|
-
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
104
|
-
import { WorkbenchHoverDelegate } from 'vscode/vscode/vs/platform/hover/browser/hover';
|
|
105
84
|
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
106
85
|
import { OpenScmGroupAction } from 'vscode/vscode/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver';
|
|
107
|
-
import { ContentHoverController } from 'vscode/vscode/vs/editor/contrib/hover/browser/
|
|
108
|
-
import {
|
|
86
|
+
import { ContentHoverController } from 'vscode/vscode/vs/editor/contrib/hover/browser/contentHoverController';
|
|
87
|
+
import { GlyphHoverController } from 'vscode/vscode/vs/editor/contrib/hover/browser/glyphHoverController';
|
|
109
88
|
import 'vscode/vscode/vs/base/common/arrays';
|
|
110
|
-
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
111
89
|
import { autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
|
|
90
|
+
import 'vscode/vscode/vs/base/common/observableInternal/derived';
|
|
112
91
|
import 'vscode/vscode/vs/base/common/observableInternal/utils';
|
|
113
|
-
import { getDefaultHoverDelegate, createInstantHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
114
|
-
import { renderSCMHistoryItemGraph, historyItemGroupLocal, historyItemGroupRemote, historyItemGroupBase, historyItemGroupHoverLabelForeground } from './scmHistory.js';
|
|
115
92
|
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';
|
|
120
93
|
import { observableConfigValue } from 'vscode/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
121
94
|
|
|
122
|
-
var ActionButtonRenderer_1, InputRenderer_1, ResourceGroupRenderer_1, ResourceRenderer_1,
|
|
123
|
-
const historyItemAdditionsForeground = registerColor('scm.historyItemAdditionsForeground', 'gitDecoration.addedResourceForeground', ( localize(6435, "History item additions foreground color.")));
|
|
124
|
-
const historyItemDeletionsForeground = registerColor('scm.historyItemDeletionsForeground', 'gitDecoration.deletedResourceForeground', ( localize(6436, "History item deletions foreground color.")));
|
|
125
|
-
registerColor('scm.historyItemStatisticsBorder', ( (transparent(foreground, 0.2))), ( localize(6437, "History item statistics border color.")));
|
|
126
|
-
registerColor('scm.historyItemSelectedStatisticsBorder', ( (transparent(listActiveSelectionForeground, 0.2))), ( localize(6438, "History item selected statistics border color.")));
|
|
95
|
+
var ActionButtonRenderer_1, InputRenderer_1, ResourceGroupRenderer_1, ResourceRenderer_1, SCMInputWidget_1;
|
|
127
96
|
function processResourceFilterData(uri, filterData) {
|
|
128
97
|
if (!filterData) {
|
|
129
98
|
return [undefined, undefined];
|
|
@@ -446,7 +415,7 @@ let ResourceRenderer = class ResourceRenderer {
|
|
|
446
415
|
const uri = ResourceTree.isResourceNode(resourceOrFolder) ? resourceOrFolder.uri : resourceOrFolder.sourceUri;
|
|
447
416
|
const fileKind = ResourceTree.isResourceNode(resourceOrFolder) ? FileKind.FOLDER : FileKind.FILE;
|
|
448
417
|
const tooltip = !ResourceTree.isResourceNode(resourceOrFolder) && resourceOrFolder.decorations.tooltip || '';
|
|
449
|
-
const hidePath = this.viewMode() ===
|
|
418
|
+
const hidePath = this.viewMode() === "tree" ;
|
|
450
419
|
let matches;
|
|
451
420
|
let descriptionMatches;
|
|
452
421
|
let strikethrough;
|
|
@@ -563,518 +532,6 @@ ResourceRenderer = ResourceRenderer_1 = ( (__decorate([
|
|
|
563
532
|
( (__param(5, ISCMViewService))),
|
|
564
533
|
( (__param(6, IThemeService)))
|
|
565
534
|
], ResourceRenderer)));
|
|
566
|
-
class HistoryItemGroupActionRunner extends ActionRunner {
|
|
567
|
-
runAction(action, context) {
|
|
568
|
-
if (!(action instanceof MenuItemAction)) {
|
|
569
|
-
return super.runAction(action, context);
|
|
570
|
-
}
|
|
571
|
-
return action.run(context.repository.provider, context.id);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
let HistoryItemGroupRenderer = class HistoryItemGroupRenderer {
|
|
575
|
-
static { HistoryItemGroupRenderer_1 = this; }
|
|
576
|
-
static { this.TEMPLATE_ID = 'history-item-group'; }
|
|
577
|
-
get templateId() { return HistoryItemGroupRenderer_1.TEMPLATE_ID; }
|
|
578
|
-
constructor(actionRunner, contextKeyService, contextMenuService, keybindingService, commandService, menuService, scmViewService, telemetryService) {
|
|
579
|
-
this.actionRunner = actionRunner;
|
|
580
|
-
this.contextKeyService = contextKeyService;
|
|
581
|
-
this.contextMenuService = contextMenuService;
|
|
582
|
-
this.keybindingService = keybindingService;
|
|
583
|
-
this.commandService = commandService;
|
|
584
|
-
this.menuService = menuService;
|
|
585
|
-
this.scmViewService = scmViewService;
|
|
586
|
-
this.telemetryService = telemetryService;
|
|
587
|
-
}
|
|
588
|
-
renderTemplate(container) {
|
|
589
|
-
container.parentElement.parentElement.querySelector('.monaco-tl-twistie').classList.add('force-twistie');
|
|
590
|
-
const element = append(container, $('.history-item-group'));
|
|
591
|
-
const label = ( (new IconLabel(element, { supportIcons: true })));
|
|
592
|
-
const iconContainer = prepend(label.element, $('.icon-container'));
|
|
593
|
-
const templateDisposables = ( (new DisposableStore()));
|
|
594
|
-
const toolBar = ( (new WorkbenchToolBar(
|
|
595
|
-
append(element, $('.actions')),
|
|
596
|
-
{ actionRunner: this.actionRunner, menuOptions: { shouldForwardArgs: true } },
|
|
597
|
-
this.menuService,
|
|
598
|
-
this.contextKeyService,
|
|
599
|
-
this.contextMenuService,
|
|
600
|
-
this.keybindingService,
|
|
601
|
-
this.commandService,
|
|
602
|
-
this.telemetryService
|
|
603
|
-
)));
|
|
604
|
-
templateDisposables.add(toolBar);
|
|
605
|
-
const countContainer = append(element, $('.count'));
|
|
606
|
-
const count = ( (new CountBadge(countContainer, {}, defaultCountBadgeStyles)));
|
|
607
|
-
return { iconContainer, label, toolBar, count, elementDisposables: ( (new DisposableStore())), templateDisposables };
|
|
608
|
-
}
|
|
609
|
-
renderElement(node, index, templateData, height) {
|
|
610
|
-
const historyItemGroup = node.element;
|
|
611
|
-
templateData.iconContainer.className = 'icon-container';
|
|
612
|
-
if (historyItemGroup.icon && ThemeIcon.isThemeIcon(historyItemGroup.icon)) {
|
|
613
|
-
templateData.iconContainer.classList.add(...ThemeIcon.asClassNameArray(historyItemGroup.icon));
|
|
614
|
-
}
|
|
615
|
-
templateData.label.setLabel(historyItemGroup.label, historyItemGroup.description, { title: historyItemGroup.ariaLabel });
|
|
616
|
-
templateData.count.setCount(historyItemGroup.count ?? 0);
|
|
617
|
-
const repositoryMenus = this.scmViewService.menus.getRepositoryMenus(historyItemGroup.repository.provider);
|
|
618
|
-
const historyProviderMenu = repositoryMenus.historyProviderMenu;
|
|
619
|
-
if (historyProviderMenu) {
|
|
620
|
-
const menu = historyProviderMenu.getHistoryItemGroupMenu(historyItemGroup);
|
|
621
|
-
const resetMenuId = historyItemGroup.direction === 'incoming' ? MenuId.SCMIncomingChanges : MenuId.SCMOutgoingChanges;
|
|
622
|
-
templateData.elementDisposables.add(connectPrimaryMenu(menu, (primary, secondary) => {
|
|
623
|
-
templateData.toolBar.setActions(primary, secondary, [resetMenuId]);
|
|
624
|
-
}));
|
|
625
|
-
templateData.toolBar.context = historyItemGroup;
|
|
626
|
-
}
|
|
627
|
-
else {
|
|
628
|
-
templateData.toolBar.setActions([], []);
|
|
629
|
-
templateData.toolBar.context = undefined;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
633
|
-
throw ( (new Error('Should never happen since node is incompressible')));
|
|
634
|
-
}
|
|
635
|
-
disposeElement(node, index, templateData, height) {
|
|
636
|
-
templateData.elementDisposables.clear();
|
|
637
|
-
}
|
|
638
|
-
disposeTemplate(templateData) {
|
|
639
|
-
templateData.elementDisposables.dispose();
|
|
640
|
-
templateData.templateDisposables.dispose();
|
|
641
|
-
}
|
|
642
|
-
};
|
|
643
|
-
HistoryItemGroupRenderer = HistoryItemGroupRenderer_1 = ( (__decorate([
|
|
644
|
-
( (__param(1, IContextKeyService))),
|
|
645
|
-
( (__param(2, IContextMenuService))),
|
|
646
|
-
( (__param(3, IKeybindingService))),
|
|
647
|
-
( (__param(4, ICommandService))),
|
|
648
|
-
( (__param(5, IMenuService))),
|
|
649
|
-
( (__param(6, ISCMViewService))),
|
|
650
|
-
( (__param(7, ITelemetryService)))
|
|
651
|
-
], HistoryItemGroupRenderer)));
|
|
652
|
-
class HistoryItemActionRunner extends ActionRunner {
|
|
653
|
-
async runAction(action, context) {
|
|
654
|
-
if (!(action instanceof MenuItemAction)) {
|
|
655
|
-
return super.runAction(action, context);
|
|
656
|
-
}
|
|
657
|
-
const args = [];
|
|
658
|
-
args.push(context.historyItemGroup.repository.provider);
|
|
659
|
-
args.push({
|
|
660
|
-
id: context.id,
|
|
661
|
-
parentIds: context.parentIds,
|
|
662
|
-
message: context.message,
|
|
663
|
-
author: context.author,
|
|
664
|
-
icon: context.icon,
|
|
665
|
-
timestamp: context.timestamp,
|
|
666
|
-
statistics: context.statistics,
|
|
667
|
-
});
|
|
668
|
-
await action.run(...args);
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
class HistoryItemActionRunner2 extends ActionRunner {
|
|
672
|
-
constructor(getSelectedHistoryItems) {
|
|
673
|
-
super();
|
|
674
|
-
this.getSelectedHistoryItems = getSelectedHistoryItems;
|
|
675
|
-
}
|
|
676
|
-
async runAction(action, context) {
|
|
677
|
-
if (!(action instanceof MenuItemAction)) {
|
|
678
|
-
return super.runAction(action, context);
|
|
679
|
-
}
|
|
680
|
-
const args = [];
|
|
681
|
-
args.push(context.repository.provider);
|
|
682
|
-
const selection = this.getSelectedHistoryItems();
|
|
683
|
-
const contextIsSelected = ( (selection.some(s => s === context)));
|
|
684
|
-
if (contextIsSelected && selection.length > 1) {
|
|
685
|
-
args.push(...( (selection.map(h => ({
|
|
686
|
-
id: h.historyItemViewModel.historyItem.id,
|
|
687
|
-
parentIds: h.historyItemViewModel.historyItem.parentIds,
|
|
688
|
-
message: h.historyItemViewModel.historyItem.message,
|
|
689
|
-
author: h.historyItemViewModel.historyItem.author,
|
|
690
|
-
icon: h.historyItemViewModel.historyItem.icon,
|
|
691
|
-
timestamp: h.historyItemViewModel.historyItem.timestamp,
|
|
692
|
-
statistics: h.historyItemViewModel.historyItem.statistics,
|
|
693
|
-
})))));
|
|
694
|
-
}
|
|
695
|
-
else {
|
|
696
|
-
args.push({
|
|
697
|
-
id: context.historyItemViewModel.historyItem.id,
|
|
698
|
-
parentIds: context.historyItemViewModel.historyItem.parentIds,
|
|
699
|
-
message: context.historyItemViewModel.historyItem.message,
|
|
700
|
-
author: context.historyItemViewModel.historyItem.author,
|
|
701
|
-
icon: context.historyItemViewModel.historyItem.icon,
|
|
702
|
-
timestamp: context.historyItemViewModel.historyItem.timestamp,
|
|
703
|
-
statistics: context.historyItemViewModel.historyItem.statistics,
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
await action.run(...args);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
let HistoryItemHoverDelegate = class HistoryItemHoverDelegate extends WorkbenchHoverDelegate {
|
|
710
|
-
constructor(viewContainerLocation, sideBarPosition, configurationService, hoverService) {
|
|
711
|
-
super('element', true, () => this.getHoverOptions(), configurationService, hoverService);
|
|
712
|
-
this.viewContainerLocation = viewContainerLocation;
|
|
713
|
-
this.sideBarPosition = sideBarPosition;
|
|
714
|
-
}
|
|
715
|
-
getHoverOptions() {
|
|
716
|
-
let hoverPosition;
|
|
717
|
-
if (this.viewContainerLocation === ViewContainerLocation.Sidebar) {
|
|
718
|
-
hoverPosition = this.sideBarPosition === Position.LEFT ? HoverPosition.RIGHT : HoverPosition.LEFT;
|
|
719
|
-
}
|
|
720
|
-
else if (this.viewContainerLocation === ViewContainerLocation.AuxiliaryBar) {
|
|
721
|
-
hoverPosition = this.sideBarPosition === Position.LEFT ? HoverPosition.LEFT : HoverPosition.RIGHT;
|
|
722
|
-
}
|
|
723
|
-
else {
|
|
724
|
-
hoverPosition = HoverPosition.RIGHT;
|
|
725
|
-
}
|
|
726
|
-
return { additionalClasses: ['history-item-hover'], position: { hoverPosition, forcePosition: true } };
|
|
727
|
-
}
|
|
728
|
-
};
|
|
729
|
-
HistoryItemHoverDelegate = ( (__decorate([
|
|
730
|
-
( (__param(2, IConfigurationService))),
|
|
731
|
-
( (__param(3, IHoverService)))
|
|
732
|
-
], HistoryItemHoverDelegate)));
|
|
733
|
-
let HistoryItemRenderer = class HistoryItemRenderer {
|
|
734
|
-
static { HistoryItemRenderer_1 = this; }
|
|
735
|
-
static { this.TEMPLATE_ID = 'history-item'; }
|
|
736
|
-
get templateId() { return HistoryItemRenderer_1.TEMPLATE_ID; }
|
|
737
|
-
constructor(actionRunner, actionViewItemProvider, hoverService, scmViewService) {
|
|
738
|
-
this.actionRunner = actionRunner;
|
|
739
|
-
this.actionViewItemProvider = actionViewItemProvider;
|
|
740
|
-
this.hoverService = hoverService;
|
|
741
|
-
this.scmViewService = scmViewService;
|
|
742
|
-
}
|
|
743
|
-
renderTemplate(container) {
|
|
744
|
-
container.parentElement.parentElement.querySelector('.monaco-tl-twistie').classList.add('force-twistie');
|
|
745
|
-
const element = append(container, $('.history-item'));
|
|
746
|
-
const iconLabel = ( (new IconLabel(
|
|
747
|
-
element,
|
|
748
|
-
{ supportIcons: true, supportHighlights: true, supportDescriptionHighlights: true }
|
|
749
|
-
)));
|
|
750
|
-
const iconContainer = prepend(iconLabel.element, $('.icon-container'));
|
|
751
|
-
const disposables = ( (new DisposableStore()));
|
|
752
|
-
const actionsContainer = append(element, $('.actions'));
|
|
753
|
-
const actionBar = ( (new ActionBar(
|
|
754
|
-
actionsContainer,
|
|
755
|
-
{ actionRunner: this.actionRunner, actionViewItemProvider: this.actionViewItemProvider }
|
|
756
|
-
)));
|
|
757
|
-
disposables.add(actionBar);
|
|
758
|
-
const statsContainer = append(element, $('.stats-container'));
|
|
759
|
-
const filesLabel = append(statsContainer, $('.files-label'));
|
|
760
|
-
const insertionsLabel = append(statsContainer, $('.insertions-label'));
|
|
761
|
-
const deletionsLabel = append(statsContainer, $('.deletions-label'));
|
|
762
|
-
const statsCustomHover = this.hoverService.setupManagedHover(getDefaultHoverDelegate('element'), statsContainer, '');
|
|
763
|
-
disposables.add(statsCustomHover);
|
|
764
|
-
return { iconContainer, label: iconLabel, actionBar, statsContainer, statsCustomHover, filesLabel, insertionsLabel, deletionsLabel, elementDisposables: ( (new DisposableStore())), disposables };
|
|
765
|
-
}
|
|
766
|
-
renderElement(node, index, templateData, height) {
|
|
767
|
-
const historyItem = node.element;
|
|
768
|
-
templateData.iconContainer.className = 'icon-container';
|
|
769
|
-
if (historyItem.icon && ThemeIcon.isThemeIcon(historyItem.icon)) {
|
|
770
|
-
templateData.iconContainer.classList.add(...ThemeIcon.asClassNameArray(historyItem.icon));
|
|
771
|
-
}
|
|
772
|
-
const title = this.getTooltip(historyItem);
|
|
773
|
-
const [matches, descriptionMatches] = this.processMatches(historyItem, node.filterData);
|
|
774
|
-
templateData.label.setLabel(historyItem.message, historyItem.author, { matches, descriptionMatches, title });
|
|
775
|
-
templateData.actionBar.clear();
|
|
776
|
-
templateData.actionBar.context = historyItem;
|
|
777
|
-
const menus = this.scmViewService.menus.getRepositoryMenus(historyItem.historyItemGroup.repository.provider);
|
|
778
|
-
if (menus.historyProviderMenu) {
|
|
779
|
-
const historyItemMenu = menus.historyProviderMenu.getHistoryItemMenu(historyItem);
|
|
780
|
-
templateData.elementDisposables.add(connectPrimaryMenuToInlineActionBar(historyItemMenu, templateData.actionBar));
|
|
781
|
-
}
|
|
782
|
-
this.renderStatistics(node, index, templateData, height);
|
|
783
|
-
}
|
|
784
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
785
|
-
throw ( (new Error('Should never happen since node is incompressible')));
|
|
786
|
-
}
|
|
787
|
-
getTooltip(historyItem) {
|
|
788
|
-
const markdown = ( (new MarkdownString('', { isTrusted: true, supportThemeIcons: true })));
|
|
789
|
-
if (historyItem.author) {
|
|
790
|
-
markdown.appendMarkdown(`$(account) **${historyItem.author}**\n\n`);
|
|
791
|
-
}
|
|
792
|
-
if (historyItem.timestamp) {
|
|
793
|
-
const dateFormatter = new Intl.DateTimeFormat(language, { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' });
|
|
794
|
-
markdown.appendMarkdown(`$(history) ${dateFormatter.format(historyItem.timestamp)}\n\n`);
|
|
795
|
-
}
|
|
796
|
-
markdown.appendMarkdown(historyItem.message);
|
|
797
|
-
return { markdown, markdownNotSupportedFallback: historyItem.message };
|
|
798
|
-
}
|
|
799
|
-
processMatches(historyItem, filterData) {
|
|
800
|
-
if (!filterData) {
|
|
801
|
-
return [undefined, undefined];
|
|
802
|
-
}
|
|
803
|
-
return [
|
|
804
|
-
historyItem.message === filterData.label ? createMatches(filterData.score) : undefined,
|
|
805
|
-
historyItem.author === filterData.label ? createMatches(filterData.score) : undefined
|
|
806
|
-
];
|
|
807
|
-
}
|
|
808
|
-
renderStatistics(node, index, templateData, height) {
|
|
809
|
-
const historyItem = node.element;
|
|
810
|
-
if (historyItem.statistics) {
|
|
811
|
-
const statsAriaLabel = [
|
|
812
|
-
historyItem.statistics.files === 1 ?
|
|
813
|
-
( localize(6439, "{0} file changed", historyItem.statistics.files)) :
|
|
814
|
-
( localize(6440, "{0} files changed", historyItem.statistics.files)),
|
|
815
|
-
historyItem.statistics.insertions === 1 ? ( localize(6441, "{0} insertion{1}", historyItem.statistics.insertions, '(+)')) :
|
|
816
|
-
historyItem.statistics.insertions > 1 ? ( localize(6442, "{0} insertions{1}", historyItem.statistics.insertions, '(+)')) : '',
|
|
817
|
-
historyItem.statistics.deletions === 1 ? ( localize(6443, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
|
|
818
|
-
historyItem.statistics.deletions > 1 ? ( localize(6444, "{0} deletions{1}", historyItem.statistics.deletions, '(-)')) : ''
|
|
819
|
-
];
|
|
820
|
-
const statsTitle = statsAriaLabel.filter(l => l !== '').join(', ');
|
|
821
|
-
templateData.statsContainer.setAttribute('aria-label', statsTitle);
|
|
822
|
-
templateData.statsCustomHover.update(statsTitle);
|
|
823
|
-
templateData.filesLabel.textContent = ( (historyItem.statistics.files.toString()));
|
|
824
|
-
templateData.insertionsLabel.textContent = historyItem.statistics.insertions > 0 ? `+${historyItem.statistics.insertions}` : '';
|
|
825
|
-
templateData.insertionsLabel.classList.toggle('hidden', historyItem.statistics.insertions === 0);
|
|
826
|
-
templateData.deletionsLabel.textContent = historyItem.statistics.deletions > 0 ? `-${historyItem.statistics.deletions}` : '';
|
|
827
|
-
templateData.deletionsLabel.classList.toggle('hidden', historyItem.statistics.deletions === 0);
|
|
828
|
-
}
|
|
829
|
-
templateData.statsContainer.classList.toggle('hidden', historyItem.statistics === undefined);
|
|
830
|
-
}
|
|
831
|
-
disposeElement(element, index, templateData, height) {
|
|
832
|
-
templateData.elementDisposables.clear();
|
|
833
|
-
}
|
|
834
|
-
disposeTemplate(templateData) {
|
|
835
|
-
templateData.disposables.dispose();
|
|
836
|
-
}
|
|
837
|
-
};
|
|
838
|
-
HistoryItemRenderer = HistoryItemRenderer_1 = ( (__decorate([
|
|
839
|
-
( (__param(2, IHoverService))),
|
|
840
|
-
( (__param(3, ISCMViewService)))
|
|
841
|
-
], HistoryItemRenderer)));
|
|
842
|
-
let HistoryItem2Renderer = class HistoryItem2Renderer {
|
|
843
|
-
static { HistoryItem2Renderer_1 = this; }
|
|
844
|
-
static { this.TEMPLATE_ID = 'history-item-2'; }
|
|
845
|
-
get templateId() { return HistoryItem2Renderer_1.TEMPLATE_ID; }
|
|
846
|
-
constructor(hoverDelegate, hoverService, themeService) {
|
|
847
|
-
this.hoverDelegate = hoverDelegate;
|
|
848
|
-
this.hoverService = hoverService;
|
|
849
|
-
this.themeService = themeService;
|
|
850
|
-
}
|
|
851
|
-
renderTemplate(container) {
|
|
852
|
-
container.parentElement.parentElement.querySelector('.monaco-tl-twistie').classList.add('force-no-twistie');
|
|
853
|
-
const element = append(container, $('.history-item'));
|
|
854
|
-
const graphContainer = append(element, $('.graph-container'));
|
|
855
|
-
const iconLabel = ( (new IconLabel(
|
|
856
|
-
element,
|
|
857
|
-
{ supportIcons: true, supportHighlights: true, supportDescriptionHighlights: true }
|
|
858
|
-
)));
|
|
859
|
-
const labelContainer = append(element, $('.label-container'));
|
|
860
|
-
element.appendChild(labelContainer);
|
|
861
|
-
return { element, graphContainer, label: iconLabel, labelContainer, elementDisposables: ( (new DisposableStore())), disposables: ( (new DisposableStore())) };
|
|
862
|
-
}
|
|
863
|
-
renderElement(node, index, templateData, height) {
|
|
864
|
-
const historyItemViewModel = node.element.historyItemViewModel;
|
|
865
|
-
const historyItem = historyItemViewModel.historyItem;
|
|
866
|
-
const historyItemHover = this.hoverService.setupManagedHover(this.hoverDelegate, templateData.element, this.getTooltip(node.element));
|
|
867
|
-
templateData.elementDisposables.add(historyItemHover);
|
|
868
|
-
templateData.graphContainer.textContent = '';
|
|
869
|
-
templateData.graphContainer.appendChild(renderSCMHistoryItemGraph(historyItemViewModel));
|
|
870
|
-
const [matches, descriptionMatches] = this.processMatches(historyItemViewModel, node.filterData);
|
|
871
|
-
templateData.label.setLabel(historyItem.message, historyItem.author, { matches, descriptionMatches });
|
|
872
|
-
templateData.labelContainer.textContent = '';
|
|
873
|
-
if (historyItem.labels) {
|
|
874
|
-
const instantHoverDelegate = createInstantHoverDelegate();
|
|
875
|
-
templateData.elementDisposables.add(instantHoverDelegate);
|
|
876
|
-
for (const label of historyItem.labels) {
|
|
877
|
-
if (label.icon && ThemeIcon.isThemeIcon(label.icon)) {
|
|
878
|
-
const icon = append(templateData.labelContainer, $('div.label'));
|
|
879
|
-
icon.classList.add(...ThemeIcon.asClassNameArray(label.icon));
|
|
880
|
-
const hover = this.hoverService.setupManagedHover(instantHoverDelegate, icon, label.title);
|
|
881
|
-
templateData.elementDisposables.add(hover);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
887
|
-
throw ( (new Error('Should never happen since node is incompressible')));
|
|
888
|
-
}
|
|
889
|
-
getTooltip(element) {
|
|
890
|
-
const colorTheme = this.themeService.getColorTheme();
|
|
891
|
-
const historyItem = element.historyItemViewModel.historyItem;
|
|
892
|
-
const currentHistoryItemGroup = element.repository.provider.historyProvider.get()?.currentHistoryItemGroup?.get();
|
|
893
|
-
const markdown = ( (new MarkdownString('', { isTrusted: true, supportThemeIcons: true })));
|
|
894
|
-
if (historyItem.author) {
|
|
895
|
-
markdown.appendMarkdown(`$(account) **${historyItem.author}**`);
|
|
896
|
-
if (historyItem.timestamp) {
|
|
897
|
-
const dateFormatter = new Intl.DateTimeFormat(language, { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' });
|
|
898
|
-
markdown.appendMarkdown(`, $(history) ${fromNow(historyItem.timestamp, true, true)} (${dateFormatter.format(historyItem.timestamp)})`);
|
|
899
|
-
}
|
|
900
|
-
markdown.appendMarkdown('\n\n');
|
|
901
|
-
}
|
|
902
|
-
markdown.appendMarkdown(`${historyItem.message}\n\n`);
|
|
903
|
-
if (historyItem.statistics) {
|
|
904
|
-
markdown.appendMarkdown(`---\n\n`);
|
|
905
|
-
markdown.appendMarkdown(`<span>${historyItem.statistics.files === 1 ?
|
|
906
|
-
( localize(6439, "{0} file changed", historyItem.statistics.files)) :
|
|
907
|
-
( localize(6440, "{0} files changed", historyItem.statistics.files))}</span>`);
|
|
908
|
-
if (historyItem.statistics.insertions) {
|
|
909
|
-
const historyItemAdditionsForegroundColor = colorTheme.getColor(historyItemAdditionsForeground);
|
|
910
|
-
markdown.appendMarkdown(`, <span style="color:${historyItemAdditionsForegroundColor};">${historyItem.statistics.insertions === 1 ?
|
|
911
|
-
( localize(6441, "{0} insertion{1}", historyItem.statistics.insertions, '(+)')) :
|
|
912
|
-
( localize(6442, "{0} insertions{1}", historyItem.statistics.insertions, '(+)'))}</span>`);
|
|
913
|
-
}
|
|
914
|
-
if (historyItem.statistics.deletions) {
|
|
915
|
-
const historyItemDeletionsForegroundColor = colorTheme.getColor(historyItemDeletionsForeground);
|
|
916
|
-
markdown.appendMarkdown(`, <span style="color:${historyItemDeletionsForegroundColor};">${historyItem.statistics.deletions === 1 ?
|
|
917
|
-
( localize(6443, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
|
|
918
|
-
( localize(6444, "{0} deletions{1}", historyItem.statistics.deletions, '(-)'))}</span>`);
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
if (historyItem.labels) {
|
|
922
|
-
const historyItemGroupLocalColor = colorTheme.getColor(historyItemGroupLocal);
|
|
923
|
-
const historyItemGroupRemoteColor = colorTheme.getColor(historyItemGroupRemote);
|
|
924
|
-
const historyItemGroupBaseColor = colorTheme.getColor(historyItemGroupBase);
|
|
925
|
-
const historyItemGroupHoverLabelForegroundColor = colorTheme.getColor(historyItemGroupHoverLabelForeground);
|
|
926
|
-
markdown.appendMarkdown(`\n\n---\n\n`);
|
|
927
|
-
markdown.appendMarkdown(( (historyItem.labels.map(label => {
|
|
928
|
-
const historyItemGroupHoverLabelBackgroundColor = label.title === currentHistoryItemGroup?.name ? historyItemGroupLocalColor :
|
|
929
|
-
label.title === currentHistoryItemGroup?.remote?.name ? historyItemGroupRemoteColor :
|
|
930
|
-
label.title === currentHistoryItemGroup?.base?.name ? historyItemGroupBaseColor :
|
|
931
|
-
undefined;
|
|
932
|
-
const historyItemGroupHoverLabelIconId = ThemeIcon.isThemeIcon(label.icon) ? label.icon.id : '';
|
|
933
|
-
return `<span style="color:${historyItemGroupHoverLabelForegroundColor};background-color:${historyItemGroupHoverLabelBackgroundColor};border-radius:2px;"> $(${historyItemGroupHoverLabelIconId}) ${label.title} </span>`;
|
|
934
|
-
}))).join(' '));
|
|
935
|
-
}
|
|
936
|
-
return { markdown, markdownNotSupportedFallback: historyItem.message };
|
|
937
|
-
}
|
|
938
|
-
processMatches(historyItemViewModel, filterData) {
|
|
939
|
-
if (!filterData) {
|
|
940
|
-
return [undefined, undefined];
|
|
941
|
-
}
|
|
942
|
-
return [
|
|
943
|
-
historyItemViewModel.historyItem.message === filterData.label ? createMatches(filterData.score) : undefined,
|
|
944
|
-
historyItemViewModel.historyItem.author === filterData.label ? createMatches(filterData.score) : undefined
|
|
945
|
-
];
|
|
946
|
-
}
|
|
947
|
-
disposeElement(element, index, templateData, height) {
|
|
948
|
-
templateData.elementDisposables.clear();
|
|
949
|
-
}
|
|
950
|
-
disposeTemplate(templateData) {
|
|
951
|
-
templateData.disposables.dispose();
|
|
952
|
-
}
|
|
953
|
-
};
|
|
954
|
-
HistoryItem2Renderer = HistoryItem2Renderer_1 = ( (__decorate([
|
|
955
|
-
( (__param(1, IHoverService))),
|
|
956
|
-
( (__param(2, IThemeService)))
|
|
957
|
-
], HistoryItem2Renderer)));
|
|
958
|
-
let HistoryItemChangeRenderer = class HistoryItemChangeRenderer {
|
|
959
|
-
static { HistoryItemChangeRenderer_1 = this; }
|
|
960
|
-
static { this.TEMPLATE_ID = 'historyItemChange'; }
|
|
961
|
-
get templateId() { return HistoryItemChangeRenderer_1.TEMPLATE_ID; }
|
|
962
|
-
constructor(viewMode, labels, labelService) {
|
|
963
|
-
this.viewMode = viewMode;
|
|
964
|
-
this.labels = labels;
|
|
965
|
-
this.labelService = labelService;
|
|
966
|
-
}
|
|
967
|
-
renderTemplate(container) {
|
|
968
|
-
const element = append(container, $('.change'));
|
|
969
|
-
const name = append(element, $('.name'));
|
|
970
|
-
const fileLabel = this.labels.create(name, { supportDescriptionHighlights: true, supportHighlights: true });
|
|
971
|
-
const decorationIcon = append(element, $('.decoration-icon'));
|
|
972
|
-
return { element, name, fileLabel, decorationIcon, disposables: ( (new DisposableStore())) };
|
|
973
|
-
}
|
|
974
|
-
renderElement(node, index, templateData, height) {
|
|
975
|
-
const historyItemChangeOrFolder = node.element;
|
|
976
|
-
const uri = ResourceTree.isResourceNode(historyItemChangeOrFolder) ? historyItemChangeOrFolder.element?.uri ?? historyItemChangeOrFolder.uri : historyItemChangeOrFolder.uri;
|
|
977
|
-
const fileKind = ResourceTree.isResourceNode(historyItemChangeOrFolder) ? FileKind.FOLDER : FileKind.FILE;
|
|
978
|
-
const hidePath = this.viewMode() === ViewMode.Tree;
|
|
979
|
-
let matches;
|
|
980
|
-
let descriptionMatches;
|
|
981
|
-
if (ResourceTree.isResourceNode(historyItemChangeOrFolder)) {
|
|
982
|
-
if (!historyItemChangeOrFolder.element) {
|
|
983
|
-
matches = createMatches(node.filterData);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
else {
|
|
987
|
-
[matches, descriptionMatches] = processResourceFilterData(uri, node.filterData);
|
|
988
|
-
}
|
|
989
|
-
templateData.fileLabel.setFile(uri, { fileDecorations: { colors: false, badges: true }, fileKind, hidePath, matches, descriptionMatches });
|
|
990
|
-
}
|
|
991
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
992
|
-
const compressed = node.element;
|
|
993
|
-
const folder = compressed.elements[compressed.elements.length - 1];
|
|
994
|
-
const label = ( (compressed.elements.map(e => e.name)));
|
|
995
|
-
const matches = createMatches(node.filterData);
|
|
996
|
-
templateData.fileLabel.setResource({ resource: folder.uri, name: label }, {
|
|
997
|
-
fileDecorations: { colors: false, badges: true },
|
|
998
|
-
fileKind: FileKind.FOLDER,
|
|
999
|
-
matches,
|
|
1000
|
-
separator: this.labelService.getSeparator(folder.uri.scheme)
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
disposeTemplate(templateData) {
|
|
1004
|
-
templateData.disposables.dispose();
|
|
1005
|
-
}
|
|
1006
|
-
};
|
|
1007
|
-
HistoryItemChangeRenderer = HistoryItemChangeRenderer_1 = ( (__decorate([
|
|
1008
|
-
( (__param(2, ILabelService)))
|
|
1009
|
-
], HistoryItemChangeRenderer)));
|
|
1010
|
-
let SeparatorRenderer = class SeparatorRenderer {
|
|
1011
|
-
static { SeparatorRenderer_1 = this; }
|
|
1012
|
-
static { this.TEMPLATE_ID = 'separator'; }
|
|
1013
|
-
get templateId() { return SeparatorRenderer_1.TEMPLATE_ID; }
|
|
1014
|
-
constructor(getFilterActions, contextKeyService, contextMenuService, keybindingService, commandService, menuService, telemetryService) {
|
|
1015
|
-
this.getFilterActions = getFilterActions;
|
|
1016
|
-
this.contextKeyService = contextKeyService;
|
|
1017
|
-
this.contextMenuService = contextMenuService;
|
|
1018
|
-
this.keybindingService = keybindingService;
|
|
1019
|
-
this.commandService = commandService;
|
|
1020
|
-
this.menuService = menuService;
|
|
1021
|
-
this.telemetryService = telemetryService;
|
|
1022
|
-
}
|
|
1023
|
-
renderTemplate(container) {
|
|
1024
|
-
container.parentElement.parentElement.querySelector('.monaco-tl-twistie').classList.add('force-no-twistie');
|
|
1025
|
-
container.parentElement.parentElement.classList.add('cursor-default', 'force-no-hover');
|
|
1026
|
-
const templateDisposables = ( (new DisposableStore()));
|
|
1027
|
-
const element = append(container, $('.separator-container'));
|
|
1028
|
-
const label = ( (new IconLabel(element, { supportIcons: true, })));
|
|
1029
|
-
append(element, $('.separator'));
|
|
1030
|
-
templateDisposables.add(label);
|
|
1031
|
-
const toolBar = ( (new WorkbenchToolBar(
|
|
1032
|
-
append(element, $('.actions')),
|
|
1033
|
-
undefined,
|
|
1034
|
-
this.menuService,
|
|
1035
|
-
this.contextKeyService,
|
|
1036
|
-
this.contextMenuService,
|
|
1037
|
-
this.keybindingService,
|
|
1038
|
-
this.commandService,
|
|
1039
|
-
this.telemetryService
|
|
1040
|
-
)));
|
|
1041
|
-
templateDisposables.add(toolBar);
|
|
1042
|
-
return { label, toolBar, elementDisposables: ( (new DisposableStore())), templateDisposables };
|
|
1043
|
-
}
|
|
1044
|
-
renderElement(element, index, templateData, height) {
|
|
1045
|
-
const provider = element.element.repository.provider;
|
|
1046
|
-
const historyProvider = provider.historyProvider.get();
|
|
1047
|
-
const currentHistoryItemGroup = historyProvider?.currentHistoryItemGroup.get();
|
|
1048
|
-
templateData.label.setLabel(element.element.label, undefined, { title: element.element.ariaLabel });
|
|
1049
|
-
const contextKeyService = this.contextKeyService.createOverlay([
|
|
1050
|
-
['scmHistoryItemGroupHasRemote', !!currentHistoryItemGroup?.remote],
|
|
1051
|
-
]);
|
|
1052
|
-
const menu = this.menuService.createMenu(MenuId.SCMChangesSeparator, contextKeyService);
|
|
1053
|
-
templateData.elementDisposables.add(connectPrimaryMenu(menu, (primary, secondary) => {
|
|
1054
|
-
secondary.splice(0, 0, ...this.getFilterActions(element.element.repository), ( (new Separator())));
|
|
1055
|
-
templateData.toolBar.setActions(primary, secondary, [MenuId.SCMChangesSeparator]);
|
|
1056
|
-
}));
|
|
1057
|
-
templateData.toolBar.context = provider;
|
|
1058
|
-
}
|
|
1059
|
-
renderCompressedElements(node, index, templateData, height) {
|
|
1060
|
-
throw ( (new Error('Should never happen since node is incompressible')));
|
|
1061
|
-
}
|
|
1062
|
-
disposeElement(node, index, templateData, height) {
|
|
1063
|
-
templateData.elementDisposables.clear();
|
|
1064
|
-
}
|
|
1065
|
-
disposeTemplate(templateData) {
|
|
1066
|
-
templateData.elementDisposables.dispose();
|
|
1067
|
-
templateData.templateDisposables.dispose();
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
SeparatorRenderer = SeparatorRenderer_1 = ( (__decorate([
|
|
1071
|
-
( (__param(1, IContextKeyService))),
|
|
1072
|
-
( (__param(2, IContextMenuService))),
|
|
1073
|
-
( (__param(3, IKeybindingService))),
|
|
1074
|
-
( (__param(4, ICommandService))),
|
|
1075
|
-
( (__param(5, IMenuService))),
|
|
1076
|
-
( (__param(6, ITelemetryService)))
|
|
1077
|
-
], SeparatorRenderer)));
|
|
1078
535
|
class ListDelegate {
|
|
1079
536
|
constructor(inputRenderer) {
|
|
1080
537
|
this.inputRenderer = inputRenderer;
|
|
@@ -1106,21 +563,6 @@ class ListDelegate {
|
|
|
1106
563
|
else if (isSCMResource(element) || isSCMResourceNode(element)) {
|
|
1107
564
|
return ResourceRenderer.TEMPLATE_ID;
|
|
1108
565
|
}
|
|
1109
|
-
else if (isSCMHistoryItemGroupTreeElement(element)) {
|
|
1110
|
-
return HistoryItemGroupRenderer.TEMPLATE_ID;
|
|
1111
|
-
}
|
|
1112
|
-
else if (isSCMHistoryItemTreeElement(element)) {
|
|
1113
|
-
return HistoryItemRenderer.TEMPLATE_ID;
|
|
1114
|
-
}
|
|
1115
|
-
else if (isSCMHistoryItemViewModelTreeElement(element)) {
|
|
1116
|
-
return HistoryItem2Renderer.TEMPLATE_ID;
|
|
1117
|
-
}
|
|
1118
|
-
else if (isSCMHistoryItemChangeTreeElement(element) || isSCMHistoryItemChangeNode(element)) {
|
|
1119
|
-
return HistoryItemChangeRenderer.TEMPLATE_ID;
|
|
1120
|
-
}
|
|
1121
|
-
else if (isSCMViewSeparator(element)) {
|
|
1122
|
-
return SeparatorRenderer.TEMPLATE_ID;
|
|
1123
|
-
}
|
|
1124
566
|
else {
|
|
1125
567
|
throw ( (new Error('Unknown element')));
|
|
1126
568
|
}
|
|
@@ -1171,42 +613,13 @@ class SCMTreeSorter {
|
|
|
1171
613
|
if (isSCMResourceGroup(one)) {
|
|
1172
614
|
return isSCMResourceGroup(other) ? 0 : -1;
|
|
1173
615
|
}
|
|
1174
|
-
if (
|
|
1175
|
-
|
|
1176
|
-
}
|
|
1177
|
-
if (isSCMHistoryItemGroupTreeElement(one)) {
|
|
1178
|
-
return isSCMHistoryItemGroupTreeElement(other) ? 0 : 1;
|
|
1179
|
-
}
|
|
1180
|
-
if (isSCMHistoryItemTreeElement(one)) {
|
|
1181
|
-
if (!isSCMHistoryItemTreeElement(other)) {
|
|
1182
|
-
throw ( (new Error('Invalid comparison')));
|
|
1183
|
-
}
|
|
1184
|
-
return 0;
|
|
1185
|
-
}
|
|
1186
|
-
if (isSCMHistoryItemViewModelTreeElement(one)) {
|
|
1187
|
-
return isSCMHistoryItemViewModelTreeElement(other) ? 0 : 1;
|
|
1188
|
-
}
|
|
1189
|
-
if (isSCMHistoryItemChangeTreeElement(one) || isSCMHistoryItemChangeNode(one)) {
|
|
1190
|
-
if (this.viewMode() === ViewMode.List) {
|
|
1191
|
-
if (!isSCMHistoryItemChangeTreeElement(other)) {
|
|
1192
|
-
throw ( (new Error('Invalid comparison')));
|
|
1193
|
-
}
|
|
1194
|
-
return comparePaths(one.uri.fsPath, other.uri.fsPath);
|
|
1195
|
-
}
|
|
1196
|
-
if (!isSCMHistoryItemChangeTreeElement(other) && !isSCMHistoryItemChangeNode(other)) {
|
|
1197
|
-
throw ( (new Error('Invalid comparison')));
|
|
1198
|
-
}
|
|
1199
|
-
const oneName = isSCMHistoryItemChangeNode(one) ? one.name : basename(one.uri);
|
|
1200
|
-
const otherName = isSCMHistoryItemChangeNode(other) ? other.name : basename(other.uri);
|
|
1201
|
-
return compareFileNames(oneName, otherName);
|
|
1202
|
-
}
|
|
1203
|
-
if (this.viewMode() === ViewMode.List) {
|
|
1204
|
-
if (this.viewSortKey() === ViewSortKey.Name) {
|
|
616
|
+
if (this.viewMode() === "list" ) {
|
|
617
|
+
if (this.viewSortKey() === "name" ) {
|
|
1205
618
|
const oneName = basename(one.sourceUri);
|
|
1206
619
|
const otherName = basename(other.sourceUri);
|
|
1207
620
|
return compareFileNames(oneName, otherName);
|
|
1208
621
|
}
|
|
1209
|
-
if (this.viewSortKey() ===
|
|
622
|
+
if (this.viewSortKey() === "status" ) {
|
|
1210
623
|
const oneTooltip = one.decorations.tooltip ?? '';
|
|
1211
624
|
const otherTooltip = other.decorations.tooltip ?? '';
|
|
1212
625
|
if (oneTooltip !== otherTooltip) {
|
|
@@ -1242,25 +655,14 @@ let SCMTreeKeyboardNavigationLabelProvider = class SCMTreeKeyboardNavigationLabe
|
|
|
1242
655
|
else if (isSCMResourceGroup(element)) {
|
|
1243
656
|
return element.label;
|
|
1244
657
|
}
|
|
1245
|
-
else if (isSCMHistoryItemGroupTreeElement(element)) {
|
|
1246
|
-
return element.label;
|
|
1247
|
-
}
|
|
1248
|
-
else if (isSCMHistoryItemTreeElement(element)) {
|
|
1249
|
-
return [element.message, element.author];
|
|
1250
|
-
}
|
|
1251
|
-
else if (isSCMHistoryItemViewModelTreeElement(element)) {
|
|
1252
|
-
return [element.historyItemViewModel.historyItem.message, element.historyItemViewModel.historyItem.author];
|
|
1253
|
-
}
|
|
1254
|
-
else if (isSCMViewSeparator(element)) {
|
|
1255
|
-
return element.label;
|
|
1256
|
-
}
|
|
1257
658
|
else {
|
|
1258
|
-
if (this.viewMode() ===
|
|
1259
|
-
const
|
|
1260
|
-
|
|
659
|
+
if (this.viewMode() === "list" ) {
|
|
660
|
+
const fileName = basename(element.sourceUri);
|
|
661
|
+
const filePath = this.labelService.getUriLabel(element.sourceUri, { relative: true });
|
|
662
|
+
return [fileName, filePath];
|
|
1261
663
|
}
|
|
1262
664
|
else {
|
|
1263
|
-
return basename(
|
|
665
|
+
return basename(element.sourceUri);
|
|
1264
666
|
}
|
|
1265
667
|
}
|
|
1266
668
|
}
|
|
@@ -1298,36 +700,6 @@ function getSCMResourceId(element) {
|
|
|
1298
700
|
const group = element.context;
|
|
1299
701
|
return `folder:${group.provider.id}/${group.id}/$FOLDER/${( (element.uri.toString()))}`;
|
|
1300
702
|
}
|
|
1301
|
-
else if (isSCMHistoryItemGroupTreeElement(element)) {
|
|
1302
|
-
const provider = element.repository.provider;
|
|
1303
|
-
return `historyItemGroup:${provider.id}/${element.id}`;
|
|
1304
|
-
}
|
|
1305
|
-
else if (isSCMHistoryItemTreeElement(element)) {
|
|
1306
|
-
const historyItemGroup = element.historyItemGroup;
|
|
1307
|
-
const provider = historyItemGroup.repository.provider;
|
|
1308
|
-
return `historyItem:${provider.id}/${historyItemGroup.id}/${element.id}/${element.parentIds.join(',')}`;
|
|
1309
|
-
}
|
|
1310
|
-
else if (isSCMHistoryItemViewModelTreeElement(element)) {
|
|
1311
|
-
const provider = element.repository.provider;
|
|
1312
|
-
const historyItem = element.historyItemViewModel.historyItem;
|
|
1313
|
-
return `historyItem2:${provider.id}/${historyItem.id}/${historyItem.parentIds.join(',')}`;
|
|
1314
|
-
}
|
|
1315
|
-
else if (isSCMHistoryItemChangeTreeElement(element)) {
|
|
1316
|
-
const historyItem = element.historyItem;
|
|
1317
|
-
const historyItemGroup = historyItem.historyItemGroup;
|
|
1318
|
-
const provider = historyItemGroup.repository.provider;
|
|
1319
|
-
return `historyItemChange:${provider.id}/${historyItemGroup.id}/${historyItem.id}/${( (element.uri.toString()))}`;
|
|
1320
|
-
}
|
|
1321
|
-
else if (isSCMHistoryItemChangeNode(element)) {
|
|
1322
|
-
const historyItem = element.context;
|
|
1323
|
-
const historyItemGroup = historyItem.historyItemGroup;
|
|
1324
|
-
const provider = historyItemGroup.repository.provider;
|
|
1325
|
-
return `folder:${provider.id}/${historyItemGroup.id}/${historyItem.id}/$FOLDER/${( (element.uri.toString()))}`;
|
|
1326
|
-
}
|
|
1327
|
-
else if (isSCMViewSeparator(element)) {
|
|
1328
|
-
const provider = element.repository.provider;
|
|
1329
|
-
return `separator:${provider.id}`;
|
|
1330
|
-
}
|
|
1331
703
|
else {
|
|
1332
704
|
throw ( (new Error('Invalid tree element')));
|
|
1333
705
|
}
|
|
@@ -1342,7 +714,7 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
1342
714
|
this.labelService = labelService;
|
|
1343
715
|
}
|
|
1344
716
|
getWidgetAriaLabel() {
|
|
1345
|
-
return ( localize(
|
|
717
|
+
return ( localize(6602, "Source Control Management"));
|
|
1346
718
|
}
|
|
1347
719
|
getAriaLabel(element) {
|
|
1348
720
|
if (ResourceTree.isResourceNode(element)) {
|
|
@@ -1352,7 +724,7 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
1352
724
|
return `${element.provider.name} ${element.provider.label}`;
|
|
1353
725
|
}
|
|
1354
726
|
else if (isSCMInput(element)) {
|
|
1355
|
-
return ( localize(
|
|
727
|
+
return ( localize(6603, "Source Control Input"));
|
|
1356
728
|
}
|
|
1357
729
|
else if (isSCMActionButton(element)) {
|
|
1358
730
|
return element.button?.command.title ?? '';
|
|
@@ -1360,27 +732,6 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
1360
732
|
else if (isSCMResourceGroup(element)) {
|
|
1361
733
|
return element.label;
|
|
1362
734
|
}
|
|
1363
|
-
else if (isSCMHistoryItemGroupTreeElement(element)) {
|
|
1364
|
-
return element.ariaLabel ?? `${element.label.trim()}${element.description ? `, ${element.description}` : ''}`;
|
|
1365
|
-
}
|
|
1366
|
-
else if (isSCMHistoryItemTreeElement(element)) {
|
|
1367
|
-
return `${stripIcons(element.message).trim()}${element.author ? `, ${element.author}` : ''}`;
|
|
1368
|
-
}
|
|
1369
|
-
else if (isSCMHistoryItemViewModelTreeElement(element)) {
|
|
1370
|
-
const historyItem = element.historyItemViewModel.historyItem;
|
|
1371
|
-
return `${stripIcons(historyItem.message).trim()}${historyItem.author ? `, ${historyItem.author}` : ''}`;
|
|
1372
|
-
}
|
|
1373
|
-
else if (isSCMHistoryItemChangeTreeElement(element)) {
|
|
1374
|
-
const result = [basename(element.uri)];
|
|
1375
|
-
const path = this.labelService.getUriLabel(dirname(element.uri), { relative: true, noPrefix: true });
|
|
1376
|
-
if (path) {
|
|
1377
|
-
result.push(path);
|
|
1378
|
-
}
|
|
1379
|
-
return result.join(', ');
|
|
1380
|
-
}
|
|
1381
|
-
else if (isSCMViewSeparator(element)) {
|
|
1382
|
-
return element.ariaLabel ?? element.label;
|
|
1383
|
-
}
|
|
1384
735
|
else {
|
|
1385
736
|
const result = [];
|
|
1386
737
|
result.push(basename(element.sourceUri));
|
|
@@ -1398,30 +749,20 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
|
|
|
1398
749
|
SCMAccessibilityProvider = ( (__decorate([
|
|
1399
750
|
( (__param(0, ILabelService)))
|
|
1400
751
|
], SCMAccessibilityProvider)));
|
|
1401
|
-
var ViewMode;
|
|
1402
|
-
( ((function(ViewMode) {
|
|
1403
|
-
ViewMode["List"] = "list";
|
|
1404
|
-
ViewMode["Tree"] = "tree";
|
|
1405
|
-
})(ViewMode || (ViewMode = {}))));
|
|
1406
|
-
var ViewSortKey;
|
|
1407
|
-
( ((function(ViewSortKey) {
|
|
1408
|
-
ViewSortKey["Path"] = "path";
|
|
1409
|
-
ViewSortKey["Name"] = "name";
|
|
1410
|
-
ViewSortKey["Status"] = "status";
|
|
1411
|
-
})(ViewSortKey || (ViewSortKey = {}))));
|
|
1412
752
|
const Menus = {
|
|
1413
753
|
ViewSort: ( (new MenuId('SCMViewSort'))),
|
|
1414
754
|
Repositories: ( (new MenuId('SCMRepositories'))),
|
|
1415
755
|
ChangesSettings: ( (new MenuId('SCMChangesSettings'))),
|
|
1416
756
|
};
|
|
1417
757
|
const ContextKeys = {
|
|
1418
|
-
SCMViewMode: ( (new RawContextKey('scmViewMode',
|
|
1419
|
-
SCMViewSortKey: ( (new RawContextKey('scmViewSortKey',
|
|
758
|
+
SCMViewMode: ( (new RawContextKey('scmViewMode', "list" ))),
|
|
759
|
+
SCMViewSortKey: ( (new RawContextKey('scmViewSortKey', "path" ))),
|
|
1420
760
|
SCMViewAreAllRepositoriesCollapsed: ( (new RawContextKey('scmViewAreAllRepositoriesCollapsed', false))),
|
|
1421
761
|
SCMViewIsAnyRepositoryCollapsible: ( (new RawContextKey('scmViewIsAnyRepositoryCollapsible', false))),
|
|
1422
762
|
SCMProvider: ( (new RawContextKey('scmProvider', undefined))),
|
|
1423
763
|
SCMProviderRootUri: ( (new RawContextKey('scmProviderRootUri', undefined))),
|
|
1424
764
|
SCMProviderHasRootUri: ( (new RawContextKey('scmProviderHasRootUri', undefined))),
|
|
765
|
+
SCMHistoryItemCount: ( (new RawContextKey('scmHistoryItemCount', 0))),
|
|
1425
766
|
RepositoryCount: ( (new RawContextKey('scmRepositoryCount', 0))),
|
|
1426
767
|
RepositoryVisibilityCount: ( (new RawContextKey('scmRepositoryVisibleCount', 0))),
|
|
1427
768
|
RepositoryVisibility(repository) {
|
|
@@ -1431,7 +772,7 @@ const ContextKeys = {
|
|
|
1431
772
|
}
|
|
1432
773
|
};
|
|
1433
774
|
MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
|
|
1434
|
-
title: ( localize(
|
|
775
|
+
title: ( localize(6604, "View & Sort")),
|
|
1435
776
|
submenu: Menus.ViewSort,
|
|
1436
777
|
when: ( (ContextKeyExpr.and(
|
|
1437
778
|
(ContextKeyExpr.equals('view', VIEW_PANE_ID)),
|
|
@@ -1441,62 +782,11 @@ MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
|
|
|
1441
782
|
order: 1
|
|
1442
783
|
});
|
|
1443
784
|
MenuRegistry.appendMenuItem(Menus.ViewSort, {
|
|
1444
|
-
title: ( localize(
|
|
785
|
+
title: ( localize(6605, "Repositories")),
|
|
1445
786
|
submenu: Menus.Repositories,
|
|
1446
787
|
when: ContextKeyExpr.greater(ContextKeys.RepositoryCount.key, 1),
|
|
1447
788
|
group: '0_repositories'
|
|
1448
789
|
});
|
|
1449
|
-
registerAction2(class extends Action2 {
|
|
1450
|
-
constructor() {
|
|
1451
|
-
super({
|
|
1452
|
-
id: 'workbench.scm.action.scm.viewChanges',
|
|
1453
|
-
title: ( localize(6449, "View Changes")),
|
|
1454
|
-
f1: false,
|
|
1455
|
-
menu: [
|
|
1456
|
-
{
|
|
1457
|
-
id: MenuId.SCMChangesContext,
|
|
1458
|
-
group: '0_view',
|
|
1459
|
-
when: ( (ContextKeyExpr.equals('config.multiDiffEditor.experimental.enabled', true)))
|
|
1460
|
-
}
|
|
1461
|
-
]
|
|
1462
|
-
});
|
|
1463
|
-
}
|
|
1464
|
-
async run(accessor, provider, ...historyItems) {
|
|
1465
|
-
const commandService = accessor.get(ICommandService);
|
|
1466
|
-
if (!provider || historyItems.length === 0) {
|
|
1467
|
-
return;
|
|
1468
|
-
}
|
|
1469
|
-
const historyItem = historyItems[0];
|
|
1470
|
-
const historyItemLast = historyItems[historyItems.length - 1];
|
|
1471
|
-
const historyProvider = provider.historyProvider.get();
|
|
1472
|
-
if (historyItems.length > 1) {
|
|
1473
|
-
const ancestor = await historyProvider?.resolveHistoryItemGroupCommonAncestor2([historyItem.id, historyItemLast.id]);
|
|
1474
|
-
if (!ancestor || (ancestor !== historyItem.id && ancestor !== historyItemLast.id)) {
|
|
1475
|
-
return;
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
const historyItemParentId = historyItemLast.parentIds.length > 0 ? historyItemLast.parentIds[0] : undefined;
|
|
1479
|
-
const historyItemChanges = await historyProvider?.provideHistoryItemChanges(historyItem.id, historyItemParentId);
|
|
1480
|
-
if (!historyItemChanges?.length) {
|
|
1481
|
-
return;
|
|
1482
|
-
}
|
|
1483
|
-
const title = historyItems.length === 1 ?
|
|
1484
|
-
`${historyItems[0].id.substring(0, 8)} - ${historyItems[0].message}` :
|
|
1485
|
-
( localize(
|
|
1486
|
-
6450,
|
|
1487
|
-
"All Changes ({0} ↔ {1})",
|
|
1488
|
-
historyItemLast.id.substring(0, 8),
|
|
1489
|
-
historyItem.id.substring(0, 8)
|
|
1490
|
-
));
|
|
1491
|
-
const rootUri = provider.rootUri;
|
|
1492
|
-
const path = rootUri ? rootUri.path : provider.label;
|
|
1493
|
-
const multiDiffSourceUri = ( (URI.from(
|
|
1494
|
-
{ scheme: 'scm-history-item', path: `${path}/${historyItemParentId}..${historyItem.id}` },
|
|
1495
|
-
true
|
|
1496
|
-
)));
|
|
1497
|
-
commandService.executeCommand('_workbench.openMultiDiffEditor', { title, multiDiffSourceUri, resources: historyItemChanges });
|
|
1498
|
-
}
|
|
1499
|
-
});
|
|
1500
790
|
class RepositoryVisibilityAction extends Action2 {
|
|
1501
791
|
constructor(repository) {
|
|
1502
792
|
super({
|
|
@@ -1585,16 +875,16 @@ class SetListViewModeAction extends ViewAction {
|
|
|
1585
875
|
constructor(id = 'workbench.scm.action.setListViewMode', menu = {}) {
|
|
1586
876
|
super({
|
|
1587
877
|
id,
|
|
1588
|
-
title: ( localize(
|
|
878
|
+
title: ( localize(6606, "View as List")),
|
|
1589
879
|
viewId: VIEW_PANE_ID,
|
|
1590
880
|
f1: false,
|
|
1591
881
|
icon: Codicon.listTree,
|
|
1592
|
-
toggled: ( (ContextKeys.SCMViewMode.isEqualTo(
|
|
882
|
+
toggled: ( (ContextKeys.SCMViewMode.isEqualTo("list" ))),
|
|
1593
883
|
menu: { id: Menus.ViewSort, group: '1_viewmode', ...menu }
|
|
1594
884
|
});
|
|
1595
885
|
}
|
|
1596
886
|
async runInView(_, view) {
|
|
1597
|
-
view.viewMode =
|
|
887
|
+
view.viewMode = "list" ;
|
|
1598
888
|
}
|
|
1599
889
|
}
|
|
1600
890
|
class SetListViewModeNavigationAction extends SetListViewModeAction {
|
|
@@ -1604,7 +894,7 @@ class SetListViewModeNavigationAction extends SetListViewModeAction {
|
|
|
1604
894
|
when: ( (ContextKeyExpr.and(
|
|
1605
895
|
(ContextKeyExpr.equals('view', VIEW_PANE_ID)),
|
|
1606
896
|
(ContextKeys.RepositoryCount.notEqualsTo(0)),
|
|
1607
|
-
(ContextKeys.SCMViewMode.isEqualTo(
|
|
897
|
+
(ContextKeys.SCMViewMode.isEqualTo("tree" ))
|
|
1608
898
|
))),
|
|
1609
899
|
group: 'navigation',
|
|
1610
900
|
order: -1000
|
|
@@ -1615,16 +905,16 @@ class SetTreeViewModeAction extends ViewAction {
|
|
|
1615
905
|
constructor(id = 'workbench.scm.action.setTreeViewMode', menu = {}) {
|
|
1616
906
|
super({
|
|
1617
907
|
id,
|
|
1618
|
-
title: ( localize(
|
|
908
|
+
title: ( localize(6607, "View as Tree")),
|
|
1619
909
|
viewId: VIEW_PANE_ID,
|
|
1620
910
|
f1: false,
|
|
1621
911
|
icon: Codicon.listFlat,
|
|
1622
|
-
toggled: ( (ContextKeys.SCMViewMode.isEqualTo(
|
|
912
|
+
toggled: ( (ContextKeys.SCMViewMode.isEqualTo("tree" ))),
|
|
1623
913
|
menu: { id: Menus.ViewSort, group: '1_viewmode', ...menu }
|
|
1624
914
|
});
|
|
1625
915
|
}
|
|
1626
916
|
async runInView(_, view) {
|
|
1627
|
-
view.viewMode =
|
|
917
|
+
view.viewMode = "tree" ;
|
|
1628
918
|
}
|
|
1629
919
|
}
|
|
1630
920
|
class SetTreeViewModeNavigationAction extends SetTreeViewModeAction {
|
|
@@ -1634,7 +924,7 @@ class SetTreeViewModeNavigationAction extends SetTreeViewModeAction {
|
|
|
1634
924
|
when: ( (ContextKeyExpr.and(
|
|
1635
925
|
(ContextKeyExpr.equals('view', VIEW_PANE_ID)),
|
|
1636
926
|
(ContextKeys.RepositoryCount.notEqualsTo(0)),
|
|
1637
|
-
(ContextKeys.SCMViewMode.isEqualTo(
|
|
927
|
+
(ContextKeys.SCMViewMode.isEqualTo("list" ))
|
|
1638
928
|
))),
|
|
1639
929
|
group: 'navigation',
|
|
1640
930
|
order: -1000
|
|
@@ -1672,17 +962,17 @@ class RepositorySortAction extends ViewAction {
|
|
|
1672
962
|
}
|
|
1673
963
|
class RepositorySortByDiscoveryTimeAction extends RepositorySortAction {
|
|
1674
964
|
constructor() {
|
|
1675
|
-
super(
|
|
965
|
+
super("discoveryTime" , ( localize(6608, "Sort by Discovery Time")));
|
|
1676
966
|
}
|
|
1677
967
|
}
|
|
1678
968
|
class RepositorySortByNameAction extends RepositorySortAction {
|
|
1679
969
|
constructor() {
|
|
1680
|
-
super(
|
|
970
|
+
super("name" , ( localize(6609, "Sort by Name")));
|
|
1681
971
|
}
|
|
1682
972
|
}
|
|
1683
973
|
class RepositorySortByPathAction extends RepositorySortAction {
|
|
1684
974
|
constructor() {
|
|
1685
|
-
super(
|
|
975
|
+
super("path" , ( localize(6610, "Sort by Path")));
|
|
1686
976
|
}
|
|
1687
977
|
}
|
|
1688
978
|
registerAction2(RepositorySortByDiscoveryTimeAction);
|
|
@@ -1696,7 +986,7 @@ class SetSortKeyAction extends ViewAction {
|
|
|
1696
986
|
viewId: VIEW_PANE_ID,
|
|
1697
987
|
f1: false,
|
|
1698
988
|
toggled: ( (ContextKeys.SCMViewSortKey.isEqualTo(sortKey))),
|
|
1699
|
-
precondition: ( (ContextKeys.SCMViewMode.isEqualTo(
|
|
989
|
+
precondition: ( (ContextKeys.SCMViewMode.isEqualTo("list" ))),
|
|
1700
990
|
menu: { id: Menus.ViewSort, group: '2_sort' }
|
|
1701
991
|
});
|
|
1702
992
|
this.sortKey = sortKey;
|
|
@@ -1707,17 +997,17 @@ class SetSortKeyAction extends ViewAction {
|
|
|
1707
997
|
}
|
|
1708
998
|
class SetSortByNameAction extends SetSortKeyAction {
|
|
1709
999
|
constructor() {
|
|
1710
|
-
super(
|
|
1000
|
+
super("name" , ( localize(6611, "Sort Changes by Name")));
|
|
1711
1001
|
}
|
|
1712
1002
|
}
|
|
1713
1003
|
class SetSortByPathAction extends SetSortKeyAction {
|
|
1714
1004
|
constructor() {
|
|
1715
|
-
super(
|
|
1005
|
+
super("path" , ( localize(6612, "Sort Changes by Path")));
|
|
1716
1006
|
}
|
|
1717
1007
|
}
|
|
1718
1008
|
class SetSortByStatusAction extends SetSortKeyAction {
|
|
1719
1009
|
constructor() {
|
|
1720
|
-
super(
|
|
1010
|
+
super("status" , ( localize(6613, "Sort Changes by Status")));
|
|
1721
1011
|
}
|
|
1722
1012
|
}
|
|
1723
1013
|
registerAction2(SetSortByNameAction);
|
|
@@ -1727,7 +1017,7 @@ class CollapseAllRepositoriesAction extends ViewAction {
|
|
|
1727
1017
|
constructor() {
|
|
1728
1018
|
super({
|
|
1729
1019
|
id: `workbench.scm.action.collapseAllRepositories`,
|
|
1730
|
-
title: ( localize(
|
|
1020
|
+
title: ( localize(6614, "Collapse All Repositories")),
|
|
1731
1021
|
viewId: VIEW_PANE_ID,
|
|
1732
1022
|
f1: false,
|
|
1733
1023
|
icon: Codicon.collapseAll,
|
|
@@ -1750,7 +1040,7 @@ class ExpandAllRepositoriesAction extends ViewAction {
|
|
|
1750
1040
|
constructor() {
|
|
1751
1041
|
super({
|
|
1752
1042
|
id: `workbench.scm.action.expandAllRepositories`,
|
|
1753
|
-
title: ( localize(
|
|
1043
|
+
title: ( localize(6615, "Expand All Repositories")),
|
|
1754
1044
|
viewId: VIEW_PANE_ID,
|
|
1755
1045
|
f1: false,
|
|
1756
1046
|
icon: Codicon.expandAll,
|
|
@@ -1771,14 +1061,6 @@ class ExpandAllRepositoriesAction extends ViewAction {
|
|
|
1771
1061
|
}
|
|
1772
1062
|
registerAction2(CollapseAllRepositoriesAction);
|
|
1773
1063
|
registerAction2(ExpandAllRepositoriesAction);
|
|
1774
|
-
var SCMInputWidgetCommandId;
|
|
1775
|
-
( ((function(SCMInputWidgetCommandId) {
|
|
1776
|
-
SCMInputWidgetCommandId["CancelAction"] = "scm.input.cancelAction";
|
|
1777
|
-
})(SCMInputWidgetCommandId || (SCMInputWidgetCommandId = {}))));
|
|
1778
|
-
var SCMInputWidgetStorageKey;
|
|
1779
|
-
( ((function(SCMInputWidgetStorageKey) {
|
|
1780
|
-
SCMInputWidgetStorageKey["LastActionId"] = "scm.input.lastActionId";
|
|
1781
|
-
})(SCMInputWidgetStorageKey || (SCMInputWidgetStorageKey = {}))));
|
|
1782
1064
|
let SCMInputWidgetActionRunner = class SCMInputWidgetActionRunner extends ActionRunner {
|
|
1783
1065
|
get runningActions() { return this._runningActions; }
|
|
1784
1066
|
constructor(input, storageService) {
|
|
@@ -1791,7 +1073,7 @@ let SCMInputWidgetActionRunner = class SCMInputWidgetActionRunner extends Action
|
|
|
1791
1073
|
try {
|
|
1792
1074
|
if (this.runningActions.size !== 0) {
|
|
1793
1075
|
this._cts?.cancel();
|
|
1794
|
-
if (action.id ===
|
|
1076
|
+
if (action.id === "scm.input.cancelAction" ) {
|
|
1795
1077
|
return;
|
|
1796
1078
|
}
|
|
1797
1079
|
}
|
|
@@ -1809,7 +1091,7 @@ let SCMInputWidgetActionRunner = class SCMInputWidgetActionRunner extends Action
|
|
|
1809
1091
|
finally {
|
|
1810
1092
|
this._runningActions.delete(action);
|
|
1811
1093
|
if (this._runningActions.size === 0) {
|
|
1812
|
-
this.storageService.store(
|
|
1094
|
+
this.storageService.store("scm.input.lastActionId" , action.id, 0 , 0 );
|
|
1813
1095
|
}
|
|
1814
1096
|
}
|
|
1815
1097
|
}
|
|
@@ -1829,10 +1111,10 @@ let SCMInputWidgetToolbar = class SCMInputWidgetToolbar extends WorkbenchToolBar
|
|
|
1829
1111
|
this._onDidChange = ( (new Emitter()));
|
|
1830
1112
|
this.onDidChange = this._onDidChange.event;
|
|
1831
1113
|
this._disposables = this._register(( (new MutableDisposable())));
|
|
1832
|
-
this._dropdownAction = ( (new Action('scmInputMoreActions', ( localize(
|
|
1114
|
+
this._dropdownAction = ( (new Action('scmInputMoreActions', ( localize(6616, "More Actions...")), 'codicon-chevron-down')));
|
|
1833
1115
|
this._cancelAction = ( (new MenuItemAction({
|
|
1834
|
-
id:
|
|
1835
|
-
title: ( localize(
|
|
1116
|
+
id: "scm.input.cancelAction" ,
|
|
1117
|
+
title: ( localize(6617, "Cancel")),
|
|
1836
1118
|
icon: Codicon.debugStop,
|
|
1837
1119
|
}, undefined, undefined, undefined, undefined, contextKeyService, commandService)));
|
|
1838
1120
|
}
|
|
@@ -1861,7 +1143,7 @@ let SCMInputWidgetToolbar = class SCMInputWidgetToolbar extends WorkbenchToolBar
|
|
|
1861
1143
|
primaryAction = actions[0];
|
|
1862
1144
|
}
|
|
1863
1145
|
else if (actions.length > 1) {
|
|
1864
|
-
const lastActionId = this.storageService.get(
|
|
1146
|
+
const lastActionId = this.storageService.get("scm.input.lastActionId" , 0 , '');
|
|
1865
1147
|
primaryAction = actions.find(a => a.id === lastActionId) ?? actions[0];
|
|
1866
1148
|
}
|
|
1867
1149
|
this._dropdownActions = actions.length === 1 ? [] : actions;
|
|
@@ -1870,7 +1152,7 @@ let SCMInputWidgetToolbar = class SCMInputWidgetToolbar extends WorkbenchToolBar
|
|
|
1870
1152
|
};
|
|
1871
1153
|
this._disposables.value.add(menu.onDidChange(() => updateToolbar()));
|
|
1872
1154
|
this._disposables.value.add(input.repository.provider.onDidChangeResources(() => updateToolbar()));
|
|
1873
|
-
this._disposables.value.add(this.storageService.onDidChangeValue(
|
|
1155
|
+
this._disposables.value.add(this.storageService.onDidChangeValue(0 , "scm.input.lastActionId" , this._disposables.value)(() => updateToolbar()));
|
|
1874
1156
|
this.actionRunner = ( (new SCMInputWidgetActionRunner(input, this.storageService)));
|
|
1875
1157
|
this._disposables.value.add(this.actionRunner.onWillRun(e => {
|
|
1876
1158
|
if (this.actionRunner.runningActions.size === 0) {
|
|
@@ -1979,9 +1261,9 @@ class SCMInputWidgetEditorOptions {
|
|
|
1979
1261
|
let SCMInputWidget = class SCMInputWidget {
|
|
1980
1262
|
static { SCMInputWidget_1 = this; }
|
|
1981
1263
|
static { this.ValidationTimeouts = {
|
|
1982
|
-
[
|
|
1983
|
-
[
|
|
1984
|
-
[
|
|
1264
|
+
[2 ]: 5000,
|
|
1265
|
+
[1 ]: 8000,
|
|
1266
|
+
[0 ]: 10000
|
|
1985
1267
|
}; }
|
|
1986
1268
|
get input() {
|
|
1987
1269
|
return this.model?.input;
|
|
@@ -2002,7 +1284,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2002
1284
|
const textModel = input.repository.provider.inputBoxTextModel;
|
|
2003
1285
|
this.inputEditor.setModel(textModel);
|
|
2004
1286
|
if (this.configurationService.getValue('editor.wordBasedSuggestions', { resource: textModel.uri }) !== 'off') {
|
|
2005
|
-
this.configurationService.updateValue('editor.wordBasedSuggestions', 'off', { resource: textModel.uri },
|
|
1287
|
+
this.configurationService.updateValue('editor.wordBasedSuggestions', 'off', { resource: textModel.uri }, 8 );
|
|
2006
1288
|
}
|
|
2007
1289
|
const validationDelayer = ( (new ThrottledDelayer(200)));
|
|
2008
1290
|
const validate = async () => {
|
|
@@ -2015,7 +1297,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2015
1297
|
this.repositoryDisposables.add(validationDelayer);
|
|
2016
1298
|
this.repositoryDisposables.add(this.inputEditor.onDidChangeCursorPosition(triggerValidation));
|
|
2017
1299
|
const opts = this.modelService.getCreationOptions(textModel.getLanguageId(), textModel.uri, textModel.isForSimpleWidget);
|
|
2018
|
-
const onEnter = Event.filter(this.inputEditor.onKeyDown, e => e.keyCode ===
|
|
1300
|
+
const onEnter = Event.filter(this.inputEditor.onKeyDown, e => e.keyCode === 3 , this.repositoryDisposables);
|
|
2019
1301
|
this.repositoryDisposables.add(onEnter(() => textModel.detectIndentation(opts.insertSpaces, opts.tabSize)));
|
|
2020
1302
|
textModel.setValue(input.value);
|
|
2021
1303
|
this.repositoryDisposables.add(input.onDidChange(({ value, reason }) => {
|
|
@@ -2090,7 +1372,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2090
1372
|
this._validationTimer = setTimeout(() => this.setValidation(undefined), SCMInputWidget_1.ValidationTimeouts[validation.type]);
|
|
2091
1373
|
}
|
|
2092
1374
|
}
|
|
2093
|
-
constructor(container, overflowWidgetsDomNode, contextKeyService, modelService, keybindingService, configurationService, instantiationService, scmViewService, contextViewService, openerService
|
|
1375
|
+
constructor(container, overflowWidgetsDomNode, contextKeyService, modelService, keybindingService, configurationService, instantiationService, scmViewService, contextViewService, openerService) {
|
|
2094
1376
|
this.modelService = modelService;
|
|
2095
1377
|
this.keybindingService = keybindingService;
|
|
2096
1378
|
this.configurationService = configurationService;
|
|
@@ -2098,7 +1380,6 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2098
1380
|
this.scmViewService = scmViewService;
|
|
2099
1381
|
this.contextViewService = contextViewService;
|
|
2100
1382
|
this.openerService = openerService;
|
|
2101
|
-
this.contextMenuService = contextMenuService;
|
|
2102
1383
|
this.disposables = ( (new DisposableStore()));
|
|
2103
1384
|
this.repositoryDisposables = ( (new DisposableStore()));
|
|
2104
1385
|
this.validationHasFocus = false;
|
|
@@ -2123,7 +1404,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2123
1404
|
EditorDictation.ID,
|
|
2124
1405
|
FormatOnType.ID,
|
|
2125
1406
|
ContentHoverController.ID,
|
|
2126
|
-
|
|
1407
|
+
GlyphHoverController.ID,
|
|
2127
1408
|
InlineCompletionsController.ID,
|
|
2128
1409
|
LinkDetector.ID,
|
|
2129
1410
|
MenuPreventer.ID,
|
|
@@ -2177,7 +1458,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2177
1458
|
this.toolbar = instantiationService2.createInstance(SCMInputWidgetToolbar, this.toolbarContainer, {
|
|
2178
1459
|
actionViewItemProvider: (action, options) => {
|
|
2179
1460
|
if (action instanceof MenuItemAction && this.toolbar.dropdownActions.length > 1) {
|
|
2180
|
-
return instantiationService.createInstance(DropdownWithPrimaryActionViewItem, action, this.toolbar.dropdownAction, this.toolbar.dropdownActions, '',
|
|
1461
|
+
return instantiationService.createInstance(DropdownWithPrimaryActionViewItem, action, this.toolbar.dropdownAction, this.toolbar.dropdownActions, '', { actionRunner: this.toolbar.actionRunner, hoverDelegate: options.hoverDelegate });
|
|
2181
1462
|
}
|
|
2182
1463
|
return createActionViewItem(instantiationService, action, options);
|
|
2183
1464
|
},
|
|
@@ -2189,8 +1470,8 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2189
1470
|
this.disposables.add(this.toolbar);
|
|
2190
1471
|
}
|
|
2191
1472
|
getContentHeight() {
|
|
2192
|
-
const lineHeight = this.inputEditor.getOption(
|
|
2193
|
-
const { top, bottom } = this.inputEditor.getOption(
|
|
1473
|
+
const lineHeight = this.inputEditor.getOption(69 );
|
|
1474
|
+
const { top, bottom } = this.inputEditor.getOption(86 );
|
|
2194
1475
|
const inputMinLinesConfig = this.configurationService.getValue('scm.inputMinLineCount');
|
|
2195
1476
|
const inputMinLines = typeof inputMinLinesConfig === 'number' ? clamp(inputMinLinesConfig, 1, 50) : 1;
|
|
2196
1477
|
const editorMinHeight = inputMinLines * lineHeight + top + bottom;
|
|
@@ -2234,9 +1515,9 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2234
1515
|
}
|
|
2235
1516
|
renderValidation() {
|
|
2236
1517
|
this.clearValidation();
|
|
2237
|
-
this.element.classList.toggle('validation-info', this.validation?.type ===
|
|
2238
|
-
this.element.classList.toggle('validation-warning', this.validation?.type ===
|
|
2239
|
-
this.element.classList.toggle('validation-error', this.validation?.type ===
|
|
1518
|
+
this.element.classList.toggle('validation-info', this.validation?.type === 2 );
|
|
1519
|
+
this.element.classList.toggle('validation-warning', this.validation?.type === 1 );
|
|
1520
|
+
this.element.classList.toggle('validation-error', this.validation?.type === 0 );
|
|
2240
1521
|
if (!this.validation || !this.inputEditor.hasTextFocus()) {
|
|
2241
1522
|
return;
|
|
2242
1523
|
}
|
|
@@ -2247,9 +1528,9 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2247
1528
|
this.element.style.borderBottomLeftRadius = '0';
|
|
2248
1529
|
this.element.style.borderBottomRightRadius = '0';
|
|
2249
1530
|
const validationContainer = append(container, $('.scm-editor-validation-container'));
|
|
2250
|
-
validationContainer.classList.toggle('validation-info', this.validation.type ===
|
|
2251
|
-
validationContainer.classList.toggle('validation-warning', this.validation.type ===
|
|
2252
|
-
validationContainer.classList.toggle('validation-error', this.validation.type ===
|
|
1531
|
+
validationContainer.classList.toggle('validation-info', this.validation.type === 2 );
|
|
1532
|
+
validationContainer.classList.toggle('validation-warning', this.validation.type === 1 );
|
|
1533
|
+
validationContainer.classList.toggle('validation-error', this.validation.type === 0 );
|
|
2253
1534
|
validationContainer.style.width = `${this.element.clientWidth + 2}px`;
|
|
2254
1535
|
const element = append(validationContainer, $('.scm-editor-validation'));
|
|
2255
1536
|
const message = this.validation.message;
|
|
@@ -2283,7 +1564,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2283
1564
|
}
|
|
2284
1565
|
const actionsContainer = append(validationContainer, $('.scm-editor-validation-actions'));
|
|
2285
1566
|
const actionbar = ( (new ActionBar(actionsContainer)));
|
|
2286
|
-
const action = ( (new Action('scmInputWidget.validationMessage.close', ( localize(
|
|
1567
|
+
const action = ( (new Action('scmInputWidget.validationMessage.close', ( localize(6618, "Close")), ThemeIcon.asClassName(Codicon.close), true, () => {
|
|
2287
1568
|
this.contextViewService.hideContextView();
|
|
2288
1569
|
this.element.style.borderBottomLeftRadius = '2px';
|
|
2289
1570
|
this.element.style.borderBottomRightRadius = '2px';
|
|
@@ -2298,7 +1579,7 @@ let SCMInputWidget = class SCMInputWidget {
|
|
|
2298
1579
|
this.element.style.borderBottomRightRadius = '2px';
|
|
2299
1580
|
disposables.dispose();
|
|
2300
1581
|
},
|
|
2301
|
-
anchorAlignment:
|
|
1582
|
+
anchorAlignment: 0
|
|
2302
1583
|
});
|
|
2303
1584
|
}
|
|
2304
1585
|
getToolbarWidth() {
|
|
@@ -2330,8 +1611,7 @@ SCMInputWidget = SCMInputWidget_1 = ( (__decorate([
|
|
|
2330
1611
|
( (__param(6, IInstantiationService))),
|
|
2331
1612
|
( (__param(7, ISCMViewService))),
|
|
2332
1613
|
( (__param(8, IContextViewService))),
|
|
2333
|
-
( (__param(9, IOpenerService)))
|
|
2334
|
-
( (__param(10, IContextMenuService)))
|
|
1614
|
+
( (__param(9, IOpenerService)))
|
|
2335
1615
|
], SCMInputWidget)));
|
|
2336
1616
|
let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
2337
1617
|
get viewMode() { return this._viewMode; }
|
|
@@ -2346,7 +1626,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2346
1626
|
this._onDidChangeViewMode.fire(mode);
|
|
2347
1627
|
this.viewModeContextKey.set(mode);
|
|
2348
1628
|
this.updateIndentStyles(this.themeService.getFileIconTheme());
|
|
2349
|
-
this.storageService.store(`scm.viewMode`, mode,
|
|
1629
|
+
this.storageService.store(`scm.viewMode`, mode, 1 , 0 );
|
|
2350
1630
|
}
|
|
2351
1631
|
get viewSortKey() { return this._viewSortKey; }
|
|
2352
1632
|
set viewSortKey(sortKey) {
|
|
@@ -2357,11 +1637,11 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2357
1637
|
this.updateChildren();
|
|
2358
1638
|
this.viewSortKeyContextKey.set(sortKey);
|
|
2359
1639
|
this._onDidChangeViewSortKey.fire(sortKey);
|
|
2360
|
-
if (this._viewMode ===
|
|
2361
|
-
this.storageService.store(`scm.viewSortKey`, sortKey,
|
|
1640
|
+
if (this._viewMode === "list" ) {
|
|
1641
|
+
this.storageService.store(`scm.viewSortKey`, sortKey, 1 , 0 );
|
|
2362
1642
|
}
|
|
2363
1643
|
}
|
|
2364
|
-
constructor(options, commandService, editorService, menuService, scmService, scmViewService, storageService, uriIdentityService,
|
|
1644
|
+
constructor(options, commandService, editorService, menuService, scmService, scmViewService, storageService, uriIdentityService, keybindingService, themeService, contextMenuService, instantiationService, viewDescriptorService, configurationService, contextKeyService, openerService, telemetryService, hoverService) {
|
|
2365
1645
|
super({ ...options, titleMenuId: MenuId.SCMTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
|
|
2366
1646
|
this.commandService = commandService;
|
|
2367
1647
|
this.editorService = editorService;
|
|
@@ -2370,7 +1650,6 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2370
1650
|
this.scmViewService = scmViewService;
|
|
2371
1651
|
this.storageService = storageService;
|
|
2372
1652
|
this.uriIdentityService = uriIdentityService;
|
|
2373
|
-
this.layoutService = layoutService;
|
|
2374
1653
|
this._onDidChangeViewMode = ( (new Emitter()));
|
|
2375
1654
|
this.onDidChangeViewMode = this._onDidChangeViewMode.event;
|
|
2376
1655
|
this._onDidChangeViewSortKey = ( (new Emitter()));
|
|
@@ -2394,7 +1673,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2394
1673
|
this.scmProviderHasRootUriContextKey = ContextKeys.SCMProviderHasRootUri.bindTo(contextKeyService);
|
|
2395
1674
|
this._onDidLayout = ( (new Emitter()));
|
|
2396
1675
|
this.layoutCache = { height: undefined, width: undefined, onDidChange: this._onDidLayout.event };
|
|
2397
|
-
this.storageService.onDidChangeValue(
|
|
1676
|
+
this.storageService.onDidChangeValue(1 , undefined, this.disposables)(e => {
|
|
2398
1677
|
switch (e.key) {
|
|
2399
1678
|
case 'scm.viewMode':
|
|
2400
1679
|
this.viewMode = this.getViewMode();
|
|
@@ -2489,14 +1768,6 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2489
1768
|
const resourceActionRunner = ( (new RepositoryPaneActionRunner(() => this.getSelectedResources())));
|
|
2490
1769
|
resourceActionRunner.onWillRun(() => this.tree.domFocus(), this, this.disposables);
|
|
2491
1770
|
this.disposables.add(resourceActionRunner);
|
|
2492
|
-
const historyItemGroupActionRunner = ( (new HistoryItemGroupActionRunner()));
|
|
2493
|
-
historyItemGroupActionRunner.onWillRun(() => this.tree.domFocus(), this, this.disposables);
|
|
2494
|
-
this.disposables.add(historyItemGroupActionRunner);
|
|
2495
|
-
const historyItemActionRunner = ( (new HistoryItemActionRunner()));
|
|
2496
|
-
historyItemActionRunner.onWillRun(() => this.tree.domFocus(), this, this.disposables);
|
|
2497
|
-
this.disposables.add(historyItemActionRunner);
|
|
2498
|
-
const historyItemHoverDelegate = this.instantiationService.createInstance(HistoryItemHoverDelegate, this.viewDescriptorService.getViewLocationById(this.id), this.layoutService.getSideBarPosition());
|
|
2499
|
-
this.disposables.add(historyItemHoverDelegate);
|
|
2500
1771
|
const treeDataSource = this.instantiationService.createInstance(SCMTreeDataSource, () => this.viewMode);
|
|
2501
1772
|
this.disposables.add(treeDataSource);
|
|
2502
1773
|
const compressionEnabled = observableConfigValue('scm.compactFolders', true, this.configurationService);
|
|
@@ -2518,7 +1789,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2518
1789
|
overrideStyles: this.getLocationBasedColors().listOverrideStyles,
|
|
2519
1790
|
compressionEnabled: compressionEnabled.get(),
|
|
2520
1791
|
collapseByDefault: (e) => {
|
|
2521
|
-
if (isSCMRepository(e) || isSCMResourceGroup(e) || isSCMResourceNode(e)
|
|
1792
|
+
if (isSCMRepository(e) || isSCMResourceGroup(e) || isSCMResourceNode(e)) {
|
|
2522
1793
|
return false;
|
|
2523
1794
|
}
|
|
2524
1795
|
return (viewState?.expanded ?? []).indexOf(getSCMResourceId(e)) === -1;
|
|
@@ -2615,43 +1886,6 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2615
1886
|
}
|
|
2616
1887
|
return;
|
|
2617
1888
|
}
|
|
2618
|
-
else if (isSCMHistoryItemGroupTreeElement(e.element)) {
|
|
2619
|
-
this.scmViewService.focus(e.element.repository);
|
|
2620
|
-
return;
|
|
2621
|
-
}
|
|
2622
|
-
else if (isSCMHistoryItemTreeElement(e.element)) {
|
|
2623
|
-
this.scmViewService.focus(e.element.historyItemGroup.repository);
|
|
2624
|
-
return;
|
|
2625
|
-
}
|
|
2626
|
-
else if (isSCMHistoryItemViewModelTreeElement(e.element)) {
|
|
2627
|
-
const historyItem = e.element.historyItemViewModel.historyItem;
|
|
2628
|
-
const historyItemParentId = historyItem.parentIds.length > 0 ? historyItem.parentIds[0] : undefined;
|
|
2629
|
-
const historyProvider = e.element.repository.provider.historyProvider.get();
|
|
2630
|
-
const historyItemChanges = await historyProvider?.provideHistoryItemChanges(historyItem.id, historyItemParentId);
|
|
2631
|
-
if (historyItemChanges) {
|
|
2632
|
-
const title = `${historyItem.id.substring(0, 8)} - ${historyItem.message}`;
|
|
2633
|
-
const rootUri = e.element.repository.provider.rootUri;
|
|
2634
|
-
const path = rootUri ? rootUri.path : e.element.repository.provider.label;
|
|
2635
|
-
const multiDiffSourceUri = ( (URI.from(
|
|
2636
|
-
{ scheme: 'scm-history-item', path: `${path}/${historyItemParentId}..${historyItem.id}` },
|
|
2637
|
-
true
|
|
2638
|
-
)));
|
|
2639
|
-
await this.commandService.executeCommand('_workbench.openMultiDiffEditor', { title, multiDiffSourceUri, resources: historyItemChanges });
|
|
2640
|
-
}
|
|
2641
|
-
this.scmViewService.focus(e.element.repository);
|
|
2642
|
-
return;
|
|
2643
|
-
}
|
|
2644
|
-
else if (isSCMHistoryItemChangeTreeElement(e.element)) {
|
|
2645
|
-
if (e.element.originalUri && e.element.modifiedUri) {
|
|
2646
|
-
await this.commandService.executeCommand(API_OPEN_DIFF_EDITOR_COMMAND_ID, ...toDiffEditorArguments(e.element.uri, e.element.originalUri, e.element.modifiedUri), e);
|
|
2647
|
-
}
|
|
2648
|
-
this.scmViewService.focus(e.element.historyItem.historyItemGroup.repository);
|
|
2649
|
-
return;
|
|
2650
|
-
}
|
|
2651
|
-
else if (isSCMHistoryItemChangeNode(e.element)) {
|
|
2652
|
-
this.scmViewService.focus(e.element.context.historyItemGroup.repository);
|
|
2653
|
-
return;
|
|
2654
|
-
}
|
|
2655
1889
|
}
|
|
2656
1890
|
onDidActiveEditorChange() {
|
|
2657
1891
|
if (!this.configurationService.getValue('scm.autoReveal')) {
|
|
@@ -2677,7 +1911,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2677
1911
|
}
|
|
2678
1912
|
for (let j = repository.provider.groups.length - 1; j >= 0; j--) {
|
|
2679
1913
|
const groupItem = repository.provider.groups[j];
|
|
2680
|
-
const resource = this.viewMode ===
|
|
1914
|
+
const resource = this.viewMode === "tree"
|
|
2681
1915
|
? groupItem.resourceTree.getNode(uri)?.element
|
|
2682
1916
|
: groupItem.resources.find(r => this.uriIdentityService.extUri.isEqual(r.sourceUri, uri));
|
|
2683
1917
|
if (resource) {
|
|
@@ -2768,30 +2002,6 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2768
2002
|
actions = collectContextMenuActions(menu);
|
|
2769
2003
|
}
|
|
2770
2004
|
}
|
|
2771
|
-
else if (isSCMHistoryItemGroupTreeElement(element)) {
|
|
2772
|
-
const menus = this.scmViewService.menus.getRepositoryMenus(element.repository.provider);
|
|
2773
|
-
const menu = menus.historyProviderMenu?.getHistoryItemGroupContextMenu(element);
|
|
2774
|
-
if (menu) {
|
|
2775
|
-
actionRunner = ( (new HistoryItemGroupActionRunner()));
|
|
2776
|
-
createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, actions);
|
|
2777
|
-
}
|
|
2778
|
-
}
|
|
2779
|
-
else if (isSCMHistoryItemTreeElement(element)) {
|
|
2780
|
-
const menus = this.scmViewService.menus.getRepositoryMenus(element.historyItemGroup.repository.provider);
|
|
2781
|
-
const menu = menus.historyProviderMenu?.getHistoryItemMenu(element);
|
|
2782
|
-
if (menu) {
|
|
2783
|
-
actionRunner = ( (new HistoryItemActionRunner()));
|
|
2784
|
-
actions = collectContextMenuActions(menu);
|
|
2785
|
-
}
|
|
2786
|
-
}
|
|
2787
|
-
else if (isSCMHistoryItemViewModelTreeElement(element)) {
|
|
2788
|
-
const menus = this.scmViewService.menus.getRepositoryMenus(element.repository.provider);
|
|
2789
|
-
const menu = menus.historyProviderMenu?.getHistoryItemMenu2(element);
|
|
2790
|
-
if (menu) {
|
|
2791
|
-
actionRunner = ( (new HistoryItemActionRunner2(() => this.getSelectedHistoryItems())));
|
|
2792
|
-
actions = collectContextMenuActions(menu);
|
|
2793
|
-
}
|
|
2794
|
-
}
|
|
2795
2005
|
actionRunner.onWillRun(() => this.tree.domFocus());
|
|
2796
2006
|
this.contextMenuService.showContextMenu({
|
|
2797
2007
|
getAnchor: () => e.anchor,
|
|
@@ -2809,43 +2019,39 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2809
2019
|
return this.tree.getSelection()
|
|
2810
2020
|
.filter(r => !!r && !isSCMResourceGroup(r));
|
|
2811
2021
|
}
|
|
2812
|
-
getSelectedHistoryItems() {
|
|
2813
|
-
return this.tree.getSelection()
|
|
2814
|
-
.filter(r => !!r && isSCMHistoryItemViewModelTreeElement(r));
|
|
2815
|
-
}
|
|
2816
2022
|
getViewMode() {
|
|
2817
|
-
let mode = this.configurationService.getValue('scm.defaultViewMode') === 'list' ?
|
|
2818
|
-
const storageMode = this.storageService.get(`scm.viewMode`,
|
|
2023
|
+
let mode = this.configurationService.getValue('scm.defaultViewMode') === 'list' ? "list" : "tree" ;
|
|
2024
|
+
const storageMode = this.storageService.get(`scm.viewMode`, 1 );
|
|
2819
2025
|
if (typeof storageMode === 'string') {
|
|
2820
2026
|
mode = storageMode;
|
|
2821
2027
|
}
|
|
2822
2028
|
return mode;
|
|
2823
2029
|
}
|
|
2824
2030
|
getViewSortKey() {
|
|
2825
|
-
if (this._viewMode ===
|
|
2826
|
-
return
|
|
2031
|
+
if (this._viewMode === "tree" ) {
|
|
2032
|
+
return "path" ;
|
|
2827
2033
|
}
|
|
2828
2034
|
let viewSortKey;
|
|
2829
2035
|
const viewSortKeyString = this.configurationService.getValue('scm.defaultViewSortKey');
|
|
2830
2036
|
switch (viewSortKeyString) {
|
|
2831
2037
|
case 'name':
|
|
2832
|
-
viewSortKey =
|
|
2038
|
+
viewSortKey = "name" ;
|
|
2833
2039
|
break;
|
|
2834
2040
|
case 'status':
|
|
2835
|
-
viewSortKey =
|
|
2041
|
+
viewSortKey = "status" ;
|
|
2836
2042
|
break;
|
|
2837
2043
|
default:
|
|
2838
|
-
viewSortKey =
|
|
2044
|
+
viewSortKey = "path" ;
|
|
2839
2045
|
break;
|
|
2840
2046
|
}
|
|
2841
|
-
const storageSortKey = this.storageService.get(`scm.viewSortKey`,
|
|
2047
|
+
const storageSortKey = this.storageService.get(`scm.viewSortKey`, 1 );
|
|
2842
2048
|
if (typeof storageSortKey === 'string') {
|
|
2843
2049
|
viewSortKey = storageSortKey;
|
|
2844
2050
|
}
|
|
2845
2051
|
return viewSortKey;
|
|
2846
2052
|
}
|
|
2847
2053
|
loadTreeViewState() {
|
|
2848
|
-
const storageViewState = this.storageService.get('scm.viewState2',
|
|
2054
|
+
const storageViewState = this.storageService.get('scm.viewState2', 1 );
|
|
2849
2055
|
if (!storageViewState) {
|
|
2850
2056
|
return undefined;
|
|
2851
2057
|
}
|
|
@@ -2859,7 +2065,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2859
2065
|
}
|
|
2860
2066
|
storeTreeViewState() {
|
|
2861
2067
|
if (this.tree) {
|
|
2862
|
-
this.storageService.store('scm.viewState2', JSON.stringify(this.tree.getViewState()),
|
|
2068
|
+
this.storageService.store('scm.viewState2', JSON.stringify(this.tree.getViewState()), 1 , 1 );
|
|
2863
2069
|
}
|
|
2864
2070
|
}
|
|
2865
2071
|
updateChildren(element) {
|
|
@@ -2879,10 +2085,10 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
|
|
|
2879
2085
|
}));
|
|
2880
2086
|
}
|
|
2881
2087
|
updateIndentStyles(theme) {
|
|
2882
|
-
this.treeContainer.classList.toggle('list-view-mode', this.viewMode ===
|
|
2883
|
-
this.treeContainer.classList.toggle('tree-view-mode', this.viewMode ===
|
|
2884
|
-
this.treeContainer.classList.toggle('align-icons-and-twisties', (this.viewMode ===
|
|
2885
|
-
this.treeContainer.classList.toggle('hide-arrows', this.viewMode ===
|
|
2088
|
+
this.treeContainer.classList.toggle('list-view-mode', this.viewMode === "list" );
|
|
2089
|
+
this.treeContainer.classList.toggle('tree-view-mode', this.viewMode === "tree" );
|
|
2090
|
+
this.treeContainer.classList.toggle('align-icons-and-twisties', (this.viewMode === "list" && theme.hasFileIcons) || (theme.hasFileIcons && !theme.hasFolderIcons));
|
|
2091
|
+
this.treeContainer.classList.toggle('hide-arrows', this.viewMode === "tree" && theme.hidesExplorerArrows === true);
|
|
2886
2092
|
}
|
|
2887
2093
|
updateScmProviderContextKeys() {
|
|
2888
2094
|
const alwaysShowRepositories = this.configurationService.getValue('scm.alwaysShowRepositories');
|
|
@@ -3032,17 +2238,16 @@ SCMViewPane = ( (__decorate([
|
|
|
3032
2238
|
( (__param(5, ISCMViewService))),
|
|
3033
2239
|
( (__param(6, IStorageService))),
|
|
3034
2240
|
( (__param(7, IUriIdentityService))),
|
|
3035
|
-
( (__param(8,
|
|
3036
|
-
( (__param(9,
|
|
3037
|
-
( (__param(10,
|
|
3038
|
-
( (__param(11,
|
|
3039
|
-
( (__param(12,
|
|
3040
|
-
( (__param(13,
|
|
3041
|
-
( (__param(14,
|
|
3042
|
-
( (__param(15,
|
|
3043
|
-
( (__param(16,
|
|
3044
|
-
( (__param(17,
|
|
3045
|
-
( (__param(18, IHoverService)))
|
|
2241
|
+
( (__param(8, IKeybindingService))),
|
|
2242
|
+
( (__param(9, IThemeService))),
|
|
2243
|
+
( (__param(10, IContextMenuService))),
|
|
2244
|
+
( (__param(11, IInstantiationService))),
|
|
2245
|
+
( (__param(12, IViewDescriptorService))),
|
|
2246
|
+
( (__param(13, IConfigurationService))),
|
|
2247
|
+
( (__param(14, IContextKeyService))),
|
|
2248
|
+
( (__param(15, IOpenerService))),
|
|
2249
|
+
( (__param(16, ITelemetryService))),
|
|
2250
|
+
( (__param(17, IHoverService)))
|
|
3046
2251
|
], SCMViewPane)));
|
|
3047
2252
|
let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
|
|
3048
2253
|
constructor(viewMode, configurationService, scmViewService) {
|
|
@@ -3080,10 +2285,10 @@ let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
|
|
|
3080
2285
|
return children;
|
|
3081
2286
|
}
|
|
3082
2287
|
else if (isSCMResourceGroup(inputOrElement)) {
|
|
3083
|
-
if (this.viewMode() ===
|
|
2288
|
+
if (this.viewMode() === "list" ) {
|
|
3084
2289
|
return inputOrElement.resources;
|
|
3085
2290
|
}
|
|
3086
|
-
else if (this.viewMode() ===
|
|
2291
|
+
else if (this.viewMode() === "tree" ) {
|
|
3087
2292
|
const children = [];
|
|
3088
2293
|
for (const node of inputOrElement.resourceTree.root.children) {
|
|
3089
2294
|
children.push(node.element && node.childrenCount === 0 ? node.element : node);
|
|
@@ -3091,7 +2296,7 @@ let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
|
|
|
3091
2296
|
return children;
|
|
3092
2297
|
}
|
|
3093
2298
|
}
|
|
3094
|
-
else if (isSCMResourceNode(inputOrElement)
|
|
2299
|
+
else if (isSCMResourceNode(inputOrElement)) {
|
|
3095
2300
|
const children = [];
|
|
3096
2301
|
for (const node of inputOrElement.children) {
|
|
3097
2302
|
children.push(node.element && node.childrenCount === 0 ? node.element : node);
|
|
@@ -3113,7 +2318,7 @@ let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
|
|
|
3113
2318
|
}
|
|
3114
2319
|
}
|
|
3115
2320
|
else if (isSCMResource(element)) {
|
|
3116
|
-
if (this.viewMode() ===
|
|
2321
|
+
if (this.viewMode() === "list" ) {
|
|
3117
2322
|
return element.resourceGroup;
|
|
3118
2323
|
}
|
|
3119
2324
|
const node = element.resourceGroup.resourceTree.getNode(element.sourceUri);
|
|
@@ -3162,21 +2367,6 @@ let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
|
|
|
3162
2367
|
else if (ResourceTree.isResourceNode(inputOrElement)) {
|
|
3163
2368
|
return inputOrElement.childrenCount > 0;
|
|
3164
2369
|
}
|
|
3165
|
-
else if (isSCMHistoryItemGroupTreeElement(inputOrElement)) {
|
|
3166
|
-
return true;
|
|
3167
|
-
}
|
|
3168
|
-
else if (isSCMHistoryItemTreeElement(inputOrElement)) {
|
|
3169
|
-
return true;
|
|
3170
|
-
}
|
|
3171
|
-
else if (isSCMHistoryItemViewModelTreeElement(inputOrElement)) {
|
|
3172
|
-
return false;
|
|
3173
|
-
}
|
|
3174
|
-
else if (isSCMHistoryItemChangeTreeElement(inputOrElement)) {
|
|
3175
|
-
return false;
|
|
3176
|
-
}
|
|
3177
|
-
else if (isSCMViewSeparator(inputOrElement)) {
|
|
3178
|
-
return false;
|
|
3179
|
-
}
|
|
3180
2370
|
else {
|
|
3181
2371
|
throw ( (new Error('hasChildren not implemented.')));
|
|
3182
2372
|
}
|