@codingame/monaco-vscode-scm-service-override 8.0.4 → 9.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.
@@ -16,11 +16,10 @@ 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, Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
19
+ import { MenuItemAction, MenuId, MenuRegistry, registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
20
20
  import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
21
- import { ActionRunner, Action, toAction, Separator } from 'vscode/vscode/vs/base/common/actions';
21
+ import { ActionRunner, Separator, Action } from 'vscode/vscode/vs/base/common/actions';
22
22
  import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
23
- import { registerThemingParticipant } from 'vscode/vscode/vs/platform/theme/common/themeService';
24
23
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
25
24
  import { isSCMResource, connectPrimaryMenuToInlineActionBar, connectPrimaryMenu, isSCMInput, isSCMActionButton, isSCMRepository, isSCMResourceGroup, isSCMResourceNode, isSCMHistoryItemGroupTreeElement, isSCMHistoryItemTreeElement, isSCMHistoryItemViewModelTreeElement, isSCMHistoryItemChangeTreeElement, isSCMHistoryItemChangeNode, isSCMViewSeparator, getActionViewItemProvider, toDiffEditorArguments, collectContextMenuActions, isSCMViewService } from './util.js';
26
25
  import { WorkbenchCompressibleAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
@@ -40,7 +39,7 @@ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/c
40
39
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
41
40
  import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
42
41
  import { CodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
43
- import { getSimpleEditorOptions } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
42
+ import { getSimpleEditorOptions, setupSimpleEditorSelectionStyling } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
44
43
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
45
44
  import { EditorExtensionsRegistry } from 'vscode/vscode/vs/editor/browser/editorExtensions';
46
45
  import { MenuPreventer } from 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/menuPreventer';
@@ -75,7 +74,7 @@ import { CopyPasteController } from 'vscode/vscode/vs/editor/contrib/dropOrPaste
75
74
  import { DropIntoEditorController } from 'vscode/vscode/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController';
76
75
  import { MessageController } from 'vscode/vscode/vs/editor/contrib/message/browser/messageController';
77
76
  import { defaultCountBadgeStyles, defaultButtonStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
78
- import { InlineCompletionsController } from 'vscode/vscode/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController';
77
+ import { InlineCompletionsController } from 'vscode/vscode/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController';
79
78
  import { CodeActionController } from 'vscode/vscode/vs/editor/contrib/codeAction/browser/codeActionController';
80
79
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
81
80
  import { fillEditorsDragData } from 'vscode/vscode/vs/workbench/browser/dnd';
@@ -87,10 +86,10 @@ import { EditOperation } from 'vscode/vscode/vs/editor/common/core/editOperation
87
86
  import { stripIcons } from 'vscode/vscode/vs/base/common/iconLabels';
88
87
  import { IconLabel } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabel';
89
88
  import { registerColor, transparent } from 'vscode/vscode/vs/platform/theme/common/colorUtils';
90
- import { foreground, selectionBackground } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
89
+ import { foreground } from 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
91
90
  import 'vscode/vscode/vs/platform/theme/common/colors/chartsColors';
92
- import { editorSelectionBackground } from 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
93
- import { inputBackground, inputForeground } from 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
91
+ import 'vscode/vscode/vs/platform/theme/common/colors/editorColors';
92
+ import 'vscode/vscode/vs/platform/theme/common/colors/inputColors';
94
93
  import { listActiveSelectionForeground } from 'vscode/vscode/vs/platform/theme/common/colors/listColors';
95
94
  import 'vscode/vscode/vs/platform/theme/common/colors/menuColors';
96
95
  import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
@@ -105,24 +104,26 @@ import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
105
104
  import { WorkbenchHoverDelegate } from 'vscode/vscode/vs/platform/hover/browser/hover';
106
105
  import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
107
106
  import { OpenScmGroupAction } from 'vscode/vscode/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver';
108
- import { HoverController } from 'vscode/vscode/vs/editor/contrib/hover/browser/hoverController';
109
- import { equals } from 'vscode/vscode/vs/base/common/arrays';
107
+ import { ContentHoverController } from 'vscode/vscode/vs/editor/contrib/hover/browser/contentHoverController2';
108
+ import { MarginHoverController } from 'vscode/vscode/vs/editor/contrib/hover/browser/marginHoverController';
109
+ import 'vscode/vscode/vs/base/common/arrays';
110
110
  import 'vscode/vscode/vs/base/common/observableInternal/derived';
111
111
  import { autorun } from 'vscode/vscode/vs/base/common/observableInternal/autorun';
112
112
  import 'vscode/vscode/vs/base/common/observableInternal/utils';
113
113
  import { getDefaultHoverDelegate, createInstantHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
114
- import { renderSCMHistoryItemGraph, historyItemGroupLocal, historyItemGroupRemote, historyItemGroupBase, historyItemGroupHoverLabelForeground, toISCMHistoryItemViewModelArray } from './scmHistory.js';
114
+ import { renderSCMHistoryItemGraph, historyItemGroupLocal, historyItemGroupRemote, historyItemGroupBase, historyItemGroupHoverLabelForeground } from './scmHistory.js';
115
115
  import { PlaceholderTextContribution } from 'vscode/vscode/vs/editor/contrib/placeholderText/browser/placeholderTextContribution';
116
116
  import { HoverPosition } from 'vscode/vscode/vs/base/browser/ui/hover/hoverWidget';
117
117
  import { Position } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
118
118
  import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
119
119
  import { fromNow } from 'vscode/vscode/vs/base/common/date';
120
+ import { observableConfigValue } from 'vscode/vscode/vs/platform/observable/common/platformObservableUtils';
120
121
 
121
122
  var ActionButtonRenderer_1, InputRenderer_1, ResourceGroupRenderer_1, ResourceRenderer_1, HistoryItemGroupRenderer_1, HistoryItemRenderer_1, HistoryItem2Renderer_1, HistoryItemChangeRenderer_1, SeparatorRenderer_1, SCMInputWidget_1;
122
- const historyItemAdditionsForeground = registerColor('scm.historyItemAdditionsForeground', 'gitDecoration.addedResourceForeground', ( localize(6357, "History item additions foreground color.")));
123
- const historyItemDeletionsForeground = registerColor('scm.historyItemDeletionsForeground', 'gitDecoration.deletedResourceForeground', ( localize(6358, "History item deletions foreground color.")));
124
- registerColor('scm.historyItemStatisticsBorder', ( (transparent(foreground, 0.2))), ( localize(6359, "History item statistics border color.")));
125
- registerColor('scm.historyItemSelectedStatisticsBorder', ( (transparent(listActiveSelectionForeground, 0.2))), ( localize(6360, "History item selected statistics border color.")));
123
+ const historyItemAdditionsForeground = registerColor('scm.historyItemAdditionsForeground', 'gitDecoration.addedResourceForeground', ( localize(6300, "History item additions foreground color.")));
124
+ const historyItemDeletionsForeground = registerColor('scm.historyItemDeletionsForeground', 'gitDecoration.deletedResourceForeground', ( localize(6301, "History item deletions foreground color.")));
125
+ registerColor('scm.historyItemStatisticsBorder', ( (transparent(foreground, 0.2))), ( localize(6302, "History item statistics border color.")));
126
+ registerColor('scm.historyItemSelectedStatisticsBorder', ( (transparent(listActiveSelectionForeground, 0.2))), ( localize(6303, "History item selected statistics border color.")));
126
127
  function processResourceFilterData(uri, filterData) {
127
128
  if (!filterData) {
128
129
  return [undefined, undefined];
@@ -809,12 +810,12 @@ let HistoryItemRenderer = class HistoryItemRenderer {
809
810
  if (historyItem.statistics) {
810
811
  const statsAriaLabel = [
811
812
  historyItem.statistics.files === 1 ?
812
- ( localize(6361, "{0} file changed", historyItem.statistics.files)) :
813
- ( localize(6362, "{0} files changed", historyItem.statistics.files)),
814
- historyItem.statistics.insertions === 1 ? ( localize(6363, "{0} insertion{1}", historyItem.statistics.insertions, '(+)')) :
815
- historyItem.statistics.insertions > 1 ? ( localize(6364, "{0} insertions{1}", historyItem.statistics.insertions, '(+)')) : '',
816
- historyItem.statistics.deletions === 1 ? ( localize(6365, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
817
- historyItem.statistics.deletions > 1 ? ( localize(6366, "{0} deletions{1}", historyItem.statistics.deletions, '(-)')) : ''
813
+ ( localize(6304, "{0} file changed", historyItem.statistics.files)) :
814
+ ( localize(6305, "{0} files changed", historyItem.statistics.files)),
815
+ historyItem.statistics.insertions === 1 ? ( localize(6306, "{0} insertion{1}", historyItem.statistics.insertions, '(+)')) :
816
+ historyItem.statistics.insertions > 1 ? ( localize(6307, "{0} insertions{1}", historyItem.statistics.insertions, '(+)')) : '',
817
+ historyItem.statistics.deletions === 1 ? ( localize(6308, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
818
+ historyItem.statistics.deletions > 1 ? ( localize(6309, "{0} deletions{1}", historyItem.statistics.deletions, '(-)')) : ''
818
819
  ];
819
820
  const statsTitle = statsAriaLabel.filter(l => l !== '').join(', ');
820
821
  templateData.statsContainer.setAttribute('aria-label', statsTitle);
@@ -902,19 +903,19 @@ let HistoryItem2Renderer = class HistoryItem2Renderer {
902
903
  if (historyItem.statistics) {
903
904
  markdown.appendMarkdown(`---\n\n`);
904
905
  markdown.appendMarkdown(`<span>${historyItem.statistics.files === 1 ?
905
- ( localize(6361, "{0} file changed", historyItem.statistics.files)) :
906
- ( localize(6362, "{0} files changed", historyItem.statistics.files))}</span>`);
906
+ ( localize(6304, "{0} file changed", historyItem.statistics.files)) :
907
+ ( localize(6305, "{0} files changed", historyItem.statistics.files))}</span>`);
907
908
  if (historyItem.statistics.insertions) {
908
909
  const historyItemAdditionsForegroundColor = colorTheme.getColor(historyItemAdditionsForeground);
909
910
  markdown.appendMarkdown(`,&nbsp;<span style="color:${historyItemAdditionsForegroundColor};">${historyItem.statistics.insertions === 1 ?
910
- ( localize(6363, "{0} insertion{1}", historyItem.statistics.insertions, '(+)')) :
911
- ( localize(6364, "{0} insertions{1}", historyItem.statistics.insertions, '(+)'))}</span>`);
911
+ ( localize(6306, "{0} insertion{1}", historyItem.statistics.insertions, '(+)')) :
912
+ ( localize(6307, "{0} insertions{1}", historyItem.statistics.insertions, '(+)'))}</span>`);
912
913
  }
913
914
  if (historyItem.statistics.deletions) {
914
915
  const historyItemDeletionsForegroundColor = colorTheme.getColor(historyItemDeletionsForeground);
915
916
  markdown.appendMarkdown(`,&nbsp;<span style="color:${historyItemDeletionsForegroundColor};">${historyItem.statistics.deletions === 1 ?
916
- ( localize(6365, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
917
- ( localize(6366, "{0} deletions{1}", historyItem.statistics.deletions, '(-)'))}</span>`);
917
+ ( localize(6308, "{0} deletion{1}", historyItem.statistics.deletions, '(-)')) :
918
+ ( localize(6309, "{0} deletions{1}", historyItem.statistics.deletions, '(-)'))}</span>`);
918
919
  }
919
920
  }
920
921
  if (historyItem.labels) {
@@ -1050,7 +1051,7 @@ let SeparatorRenderer = class SeparatorRenderer {
1050
1051
  ]);
1051
1052
  const menu = this.menuService.createMenu(MenuId.SCMChangesSeparator, contextKeyService);
1052
1053
  templateData.elementDisposables.add(connectPrimaryMenu(menu, (primary, secondary) => {
1053
- secondary.push(...this.getFilterActions(element.element.repository));
1054
+ secondary.splice(0, 0, ...this.getFilterActions(element.element.repository), ( (new Separator())));
1054
1055
  templateData.toolBar.setActions(primary, secondary, [MenuId.SCMChangesSeparator]);
1055
1056
  }));
1056
1057
  templateData.toolBar.context = provider;
@@ -1341,7 +1342,7 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
1341
1342
  this.labelService = labelService;
1342
1343
  }
1343
1344
  getWidgetAriaLabel() {
1344
- return ( localize(6367, "Source Control Management"));
1345
+ return ( localize(6310, "Source Control Management"));
1345
1346
  }
1346
1347
  getAriaLabel(element) {
1347
1348
  if (ResourceTree.isResourceNode(element)) {
@@ -1351,7 +1352,7 @@ let SCMAccessibilityProvider = class SCMAccessibilityProvider {
1351
1352
  return `${element.provider.name} ${element.provider.label}`;
1352
1353
  }
1353
1354
  else if (isSCMInput(element)) {
1354
- return ( localize(6368, "Source Control Input"));
1355
+ return ( localize(6311, "Source Control Input"));
1355
1356
  }
1356
1357
  else if (isSCMActionButton(element)) {
1357
1358
  return element.button?.command.title ?? '';
@@ -1430,7 +1431,7 @@ const ContextKeys = {
1430
1431
  }
1431
1432
  };
1432
1433
  MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
1433
- title: ( localize(6369, "View & Sort")),
1434
+ title: ( localize(6312, "View & Sort")),
1434
1435
  submenu: Menus.ViewSort,
1435
1436
  when: ( (ContextKeyExpr.and(
1436
1437
  (ContextKeyExpr.equals('view', VIEW_PANE_ID)),
@@ -1439,162 +1440,17 @@ MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
1439
1440
  group: '0_view&sort',
1440
1441
  order: 1
1441
1442
  });
1442
- MenuRegistry.appendMenuItem(MenuId.SCMTitle, {
1443
- title: ( localize(6370, "Incoming & Outgoing")),
1444
- submenu: Menus.ChangesSettings,
1445
- when: ( (ContextKeyExpr.and(
1446
- (ContextKeyExpr.equals('view', VIEW_PANE_ID)),
1447
- (ContextKeys.RepositoryCount.notEqualsTo(0)),
1448
- (( (ContextKeyExpr.equals('config.scm.showHistoryGraph', true))).negate())
1449
- ))),
1450
- group: '0_view&sort',
1451
- order: 2
1452
- });
1453
1443
  MenuRegistry.appendMenuItem(Menus.ViewSort, {
1454
- title: ( localize(6371, "Repositories")),
1444
+ title: ( localize(6313, "Repositories")),
1455
1445
  submenu: Menus.Repositories,
1456
1446
  when: ContextKeyExpr.greater(ContextKeys.RepositoryCount.key, 1),
1457
1447
  group: '0_repositories'
1458
1448
  });
1459
- class SCMChangesSettingAction extends Action2 {
1460
- constructor(settingKey, settingValue, desc) {
1461
- super({
1462
- ...desc,
1463
- f1: false,
1464
- toggled: ( (ContextKeyExpr.equals(`config.${settingKey}`, settingValue))),
1465
- });
1466
- this.settingKey = settingKey;
1467
- this.settingValue = settingValue;
1468
- }
1469
- run(accessor) {
1470
- const configurationService = accessor.get(IConfigurationService);
1471
- configurationService.updateValue(this.settingKey, this.settingValue);
1472
- }
1473
- }
1474
- MenuRegistry.appendMenuItem(MenuId.SCMChangesSeparator, {
1475
- title: ( localize(6372, "Show Incoming Changes")),
1476
- submenu: MenuId.SCMIncomingChangesSetting,
1477
- group: '1_incoming&outgoing',
1478
- order: 1,
1479
- when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
1480
- });
1481
- MenuRegistry.appendMenuItem(Menus.ChangesSettings, {
1482
- title: ( localize(6372, "Show Incoming Changes")),
1483
- submenu: MenuId.SCMIncomingChangesSetting,
1484
- group: '1_incoming&outgoing',
1485
- order: 1,
1486
- when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
1487
- });
1488
- registerAction2(class extends SCMChangesSettingAction {
1489
- constructor() {
1490
- super('scm.showIncomingChanges', 'always', {
1491
- id: 'workbench.scm.action.showIncomingChanges.always',
1492
- title: ( localize(6373, "Always")),
1493
- menu: { id: MenuId.SCMIncomingChangesSetting },
1494
- });
1495
- }
1496
- });
1497
- registerAction2(class extends SCMChangesSettingAction {
1498
- constructor() {
1499
- super('scm.showIncomingChanges', 'auto', {
1500
- id: 'workbench.scm.action.showIncomingChanges.auto',
1501
- title: ( localize(6374, "Auto")),
1502
- menu: {
1503
- id: MenuId.SCMIncomingChangesSetting,
1504
- }
1505
- });
1506
- }
1507
- });
1508
- registerAction2(class extends SCMChangesSettingAction {
1509
- constructor() {
1510
- super('scm.showIncomingChanges', 'never', {
1511
- id: 'workbench.scm.action.showIncomingChanges.never',
1512
- title: ( localize(6375, "Never")),
1513
- menu: {
1514
- id: MenuId.SCMIncomingChangesSetting,
1515
- }
1516
- });
1517
- }
1518
- });
1519
- MenuRegistry.appendMenuItem(MenuId.SCMChangesSeparator, {
1520
- title: ( localize(6376, "Show Outgoing Changes")),
1521
- submenu: MenuId.SCMOutgoingChangesSetting,
1522
- group: '1_incoming&outgoing',
1523
- order: 2,
1524
- when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
1525
- });
1526
- MenuRegistry.appendMenuItem(Menus.ChangesSettings, {
1527
- title: ( localize(6376, "Show Outgoing Changes")),
1528
- submenu: MenuId.SCMOutgoingChangesSetting,
1529
- group: '1_incoming&outgoing',
1530
- order: 2,
1531
- when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
1532
- });
1533
- registerAction2(class extends SCMChangesSettingAction {
1534
- constructor() {
1535
- super('scm.showOutgoingChanges', 'always', {
1536
- id: 'workbench.scm.action.showOutgoingChanges.always',
1537
- title: ( localize(6373, "Always")),
1538
- menu: {
1539
- id: MenuId.SCMOutgoingChangesSetting,
1540
- }
1541
- });
1542
- }
1543
- });
1544
- registerAction2(class extends SCMChangesSettingAction {
1545
- constructor() {
1546
- super('scm.showOutgoingChanges', 'auto', {
1547
- id: 'workbench.scm.action.showOutgoingChanges.auto',
1548
- title: ( localize(6374, "Auto")),
1549
- menu: {
1550
- id: MenuId.SCMOutgoingChangesSetting,
1551
- }
1552
- });
1553
- }
1554
- });
1555
- registerAction2(class extends SCMChangesSettingAction {
1556
- constructor() {
1557
- super('scm.showOutgoingChanges', 'never', {
1558
- id: 'workbench.scm.action.showOutgoingChanges.never',
1559
- title: ( localize(6375, "Never")),
1560
- menu: {
1561
- id: MenuId.SCMOutgoingChangesSetting,
1562
- }
1563
- });
1564
- }
1565
- });
1566
- registerAction2(class extends Action2 {
1567
- constructor() {
1568
- super({
1569
- id: 'workbench.scm.action.scm.showChangesSummary',
1570
- title: ( localize(6377, "Show Changes Summary")),
1571
- f1: false,
1572
- toggled: ( (ContextKeyExpr.equals('config.scm.showChangesSummary', true))),
1573
- menu: [
1574
- {
1575
- id: MenuId.SCMChangesSeparator,
1576
- order: 3,
1577
- when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
1578
- },
1579
- {
1580
- id: Menus.ChangesSettings,
1581
- order: 3,
1582
- when: ( (ContextKeyExpr.equals('config.scm.showHistoryGraph', false)))
1583
- },
1584
- ]
1585
- });
1586
- }
1587
- run(accessor) {
1588
- const configurationService = accessor.get(IConfigurationService);
1589
- const configValue = configurationService.getValue('scm.showChangesSummary') === true;
1590
- configurationService.updateValue('scm.showChangesSummary', !configValue);
1591
- }
1592
- });
1593
1449
  registerAction2(class extends Action2 {
1594
1450
  constructor() {
1595
1451
  super({
1596
1452
  id: 'workbench.scm.action.scm.viewChanges',
1597
- title: ( localize(6378, "View Changes")),
1453
+ title: ( localize(6314, "View Changes")),
1598
1454
  f1: false,
1599
1455
  menu: [
1600
1456
  {
@@ -1627,16 +1483,15 @@ registerAction2(class extends Action2 {
1627
1483
  const title = historyItems.length === 1 ?
1628
1484
  `${historyItems[0].id.substring(0, 8)} - ${historyItems[0].message}` :
1629
1485
  ( localize(
1630
- 6379,
1486
+ 6315,
1631
1487
  "All Changes ({0} ↔ {1})",
1632
- historyItem.id.substring(0, 8),
1633
- historyItemLast.id.substring(0, 8)
1488
+ historyItemLast.id.substring(0, 8),
1489
+ historyItem.id.substring(0, 8)
1634
1490
  ));
1635
1491
  const rootUri = provider.rootUri;
1636
- const multiDiffSourceUri = rootUri ?
1637
- rootUri.with({ scheme: 'scm-history-item', path: `${rootUri.path}/${historyItem.id}..${historyItemParentId}` }) :
1638
- ( (URI.from(
1639
- { scheme: 'scm-history-item', path: `${provider.label}/${historyItem.id}..${historyItemParentId}` },
1492
+ const path = rootUri ? rootUri.path : provider.label;
1493
+ const multiDiffSourceUri = ( (URI.from(
1494
+ { scheme: 'scm-history-item', path: `${path}/${historyItemParentId}..${historyItem.id}` },
1640
1495
  true
1641
1496
  )));
1642
1497
  commandService.executeCommand('_workbench.openMultiDiffEditor', { title, multiDiffSourceUri, resources: historyItemChanges });
@@ -1730,7 +1585,7 @@ class SetListViewModeAction extends ViewAction {
1730
1585
  constructor(id = 'workbench.scm.action.setListViewMode', menu = {}) {
1731
1586
  super({
1732
1587
  id,
1733
- title: ( localize(6380, "View as List")),
1588
+ title: ( localize(6316, "View as List")),
1734
1589
  viewId: VIEW_PANE_ID,
1735
1590
  f1: false,
1736
1591
  icon: Codicon.listTree,
@@ -1760,7 +1615,7 @@ class SetTreeViewModeAction extends ViewAction {
1760
1615
  constructor(id = 'workbench.scm.action.setTreeViewMode', menu = {}) {
1761
1616
  super({
1762
1617
  id,
1763
- title: ( localize(6381, "View as Tree")),
1618
+ title: ( localize(6317, "View as Tree")),
1764
1619
  viewId: VIEW_PANE_ID,
1765
1620
  f1: false,
1766
1621
  icon: Codicon.listFlat,
@@ -1817,17 +1672,17 @@ class RepositorySortAction extends ViewAction {
1817
1672
  }
1818
1673
  class RepositorySortByDiscoveryTimeAction extends RepositorySortAction {
1819
1674
  constructor() {
1820
- super(ISCMRepositorySortKey.DiscoveryTime, ( localize(6382, "Sort by Discovery Time")));
1675
+ super(ISCMRepositorySortKey.DiscoveryTime, ( localize(6318, "Sort by Discovery Time")));
1821
1676
  }
1822
1677
  }
1823
1678
  class RepositorySortByNameAction extends RepositorySortAction {
1824
1679
  constructor() {
1825
- super(ISCMRepositorySortKey.Name, ( localize(6383, "Sort by Name")));
1680
+ super(ISCMRepositorySortKey.Name, ( localize(6319, "Sort by Name")));
1826
1681
  }
1827
1682
  }
1828
1683
  class RepositorySortByPathAction extends RepositorySortAction {
1829
1684
  constructor() {
1830
- super(ISCMRepositorySortKey.Path, ( localize(6384, "Sort by Path")));
1685
+ super(ISCMRepositorySortKey.Path, ( localize(6320, "Sort by Path")));
1831
1686
  }
1832
1687
  }
1833
1688
  registerAction2(RepositorySortByDiscoveryTimeAction);
@@ -1852,17 +1707,17 @@ class SetSortKeyAction extends ViewAction {
1852
1707
  }
1853
1708
  class SetSortByNameAction extends SetSortKeyAction {
1854
1709
  constructor() {
1855
- super(ViewSortKey.Name, ( localize(6385, "Sort Changes by Name")));
1710
+ super(ViewSortKey.Name, ( localize(6321, "Sort Changes by Name")));
1856
1711
  }
1857
1712
  }
1858
1713
  class SetSortByPathAction extends SetSortKeyAction {
1859
1714
  constructor() {
1860
- super(ViewSortKey.Path, ( localize(6386, "Sort Changes by Path")));
1715
+ super(ViewSortKey.Path, ( localize(6322, "Sort Changes by Path")));
1861
1716
  }
1862
1717
  }
1863
1718
  class SetSortByStatusAction extends SetSortKeyAction {
1864
1719
  constructor() {
1865
- super(ViewSortKey.Status, ( localize(6387, "Sort Changes by Status")));
1720
+ super(ViewSortKey.Status, ( localize(6323, "Sort Changes by Status")));
1866
1721
  }
1867
1722
  }
1868
1723
  registerAction2(SetSortByNameAction);
@@ -1872,7 +1727,7 @@ class CollapseAllRepositoriesAction extends ViewAction {
1872
1727
  constructor() {
1873
1728
  super({
1874
1729
  id: `workbench.scm.action.collapseAllRepositories`,
1875
- title: ( localize(6388, "Collapse All Repositories")),
1730
+ title: ( localize(6324, "Collapse All Repositories")),
1876
1731
  viewId: VIEW_PANE_ID,
1877
1732
  f1: false,
1878
1733
  icon: Codicon.collapseAll,
@@ -1895,7 +1750,7 @@ class ExpandAllRepositoriesAction extends ViewAction {
1895
1750
  constructor() {
1896
1751
  super({
1897
1752
  id: `workbench.scm.action.expandAllRepositories`,
1898
- title: ( localize(6389, "Expand All Repositories")),
1753
+ title: ( localize(6325, "Expand All Repositories")),
1899
1754
  viewId: VIEW_PANE_ID,
1900
1755
  f1: false,
1901
1756
  icon: Codicon.expandAll,
@@ -1974,10 +1829,10 @@ let SCMInputWidgetToolbar = class SCMInputWidgetToolbar extends WorkbenchToolBar
1974
1829
  this._onDidChange = ( (new Emitter()));
1975
1830
  this.onDidChange = this._onDidChange.event;
1976
1831
  this._disposables = this._register(( (new MutableDisposable())));
1977
- this._dropdownAction = ( (new Action('scmInputMoreActions', ( localize(6390, "More Actions...")), 'codicon-chevron-down')));
1832
+ this._dropdownAction = ( (new Action('scmInputMoreActions', ( localize(6326, "More Actions...")), 'codicon-chevron-down')));
1978
1833
  this._cancelAction = ( (new MenuItemAction({
1979
1834
  id: SCMInputWidgetCommandId.CancelAction,
1980
- title: ( localize(6391, "Cancel")),
1835
+ title: ( localize(6327, "Cancel")),
1981
1836
  icon: Codicon.debugStop,
1982
1837
  }, undefined, undefined, undefined, undefined, contextKeyService, commandService)));
1983
1838
  }
@@ -2267,7 +2122,8 @@ let SCMInputWidget = class SCMInputWidget {
2267
2122
  DropIntoEditorController.ID,
2268
2123
  EditorDictation.ID,
2269
2124
  FormatOnType.ID,
2270
- HoverController.ID,
2125
+ ContentHoverController.ID,
2126
+ MarginHoverController.ID,
2271
2127
  InlineCompletionsController.ID,
2272
2128
  LinkDetector.ID,
2273
2129
  MenuPreventer.ID,
@@ -2427,7 +2283,7 @@ let SCMInputWidget = class SCMInputWidget {
2427
2283
  }
2428
2284
  const actionsContainer = append(validationContainer, $('.scm-editor-validation-actions'));
2429
2285
  const actionbar = ( (new ActionBar(actionsContainer)));
2430
- const action = ( (new Action('scmInputWidget.validationMessage.close', ( localize(6392, "Close")), ThemeIcon.asClassName(Codicon.close), true, () => {
2286
+ const action = ( (new Action('scmInputWidget.validationMessage.close', ( localize(6328, "Close")), ThemeIcon.asClassName(Codicon.close), true, () => {
2431
2287
  this.contextViewService.hideContextView();
2432
2288
  this.element.style.borderBottomLeftRadius = '2px';
2433
2289
  this.element.style.borderBottomRightRadius = '2px';
@@ -2597,14 +2453,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
2597
2453
  }, this, this.visibilityDisposables);
2598
2454
  Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.inputMinLineCount') ||
2599
2455
  e.affectsConfiguration('scm.inputMaxLineCount') ||
2600
- e.affectsConfiguration('scm.showActionButton') ||
2601
- e.affectsConfiguration('scm.showIncomingChanges') ||
2602
- e.affectsConfiguration('scm.showOutgoingChanges') ||
2603
- e.affectsConfiguration('scm.showHistoryGraph'), this.visibilityDisposables)(() => this.updateChildren(), this, this.visibilityDisposables);
2604
- Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.showChangesSummary'), this.visibilityDisposables)(() => {
2605
- this.historyProviderDataSource.clearCache();
2606
- this.updateChildren();
2607
- }, this, this.visibilityDisposables);
2456
+ e.affectsConfiguration('scm.showActionButton'), this.visibilityDisposables)(() => this.updateChildren(), this, this.visibilityDisposables);
2608
2457
  this.editorService.onDidActiveEditorChange(this.onDidActiveEditorChange, this, this.visibilityDisposables);
2609
2458
  this.scmViewService.onDidChangeVisibleRepositories(this.onDidChangeVisibleRepositories, this, this.visibilityDisposables);
2610
2459
  this.onDidChangeVisibleRepositories({ added: this.scmViewService.visibleRepositories, removed: Iterable.empty() });
@@ -2648,21 +2497,15 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
2648
2497
  this.disposables.add(historyItemActionRunner);
2649
2498
  const historyItemHoverDelegate = this.instantiationService.createInstance(HistoryItemHoverDelegate, this.viewDescriptorService.getViewLocationById(this.id), this.layoutService.getSideBarPosition());
2650
2499
  this.disposables.add(historyItemHoverDelegate);
2651
- this.historyProviderDataSource = this.instantiationService.createInstance(SCMTreeHistoryProviderDataSource, () => this.viewMode);
2652
- this.disposables.add(this.historyProviderDataSource);
2653
- const treeDataSource = this.instantiationService.createInstance(SCMTreeDataSource, () => this.viewMode, this.historyProviderDataSource);
2500
+ const treeDataSource = this.instantiationService.createInstance(SCMTreeDataSource, () => this.viewMode);
2654
2501
  this.disposables.add(treeDataSource);
2502
+ const compressionEnabled = observableConfigValue('scm.compactFolders', true, this.configurationService);
2655
2503
  this.tree = this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'SCM Tree Repo', container, ( (new ListDelegate(this.inputRenderer))), ( (new SCMTreeCompressionDelegate())), [
2656
2504
  this.inputRenderer,
2657
2505
  this.actionButtonRenderer,
2658
2506
  this.instantiationService.createInstance(RepositoryRenderer, MenuId.SCMTitle, getActionViewItemProvider(this.instantiationService)),
2659
2507
  this.instantiationService.createInstance(ResourceGroupRenderer, getActionViewItemProvider(this.instantiationService)),
2660
- this.instantiationService.createInstance(ResourceRenderer, () => this.viewMode, this.listLabels, getActionViewItemProvider(this.instantiationService), resourceActionRunner),
2661
- this.instantiationService.createInstance(HistoryItemGroupRenderer, historyItemGroupActionRunner),
2662
- this.instantiationService.createInstance(HistoryItemRenderer, historyItemActionRunner, getActionViewItemProvider(this.instantiationService)),
2663
- this.instantiationService.createInstance(HistoryItem2Renderer, historyItemHoverDelegate),
2664
- this.instantiationService.createInstance(HistoryItemChangeRenderer, () => this.viewMode, this.listLabels),
2665
- this.instantiationService.createInstance(SeparatorRenderer, (repository) => this.getHistoryItemGroupFilterActions(repository)),
2508
+ this.instantiationService.createInstance(ResourceRenderer, () => this.viewMode, this.listLabels, getActionViewItemProvider(this.instantiationService), resourceActionRunner)
2666
2509
  ], treeDataSource, {
2667
2510
  horizontalScrolling: false,
2668
2511
  setRowLineHeight: false,
@@ -2673,6 +2516,7 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
2673
2516
  sorter: ( (new SCMTreeSorter(() => this.viewMode, () => this.viewSortKey))),
2674
2517
  keyboardNavigationLabelProvider: this.instantiationService.createInstance(SCMTreeKeyboardNavigationLabelProvider, () => this.viewMode),
2675
2518
  overrideStyles: this.getLocationBasedColors().listOverrideStyles,
2519
+ compressionEnabled: compressionEnabled.get(),
2676
2520
  collapseByDefault: (e) => {
2677
2521
  if (isSCMRepository(e) || isSCMResourceGroup(e) || isSCMResourceNode(e) || isSCMHistoryItemChangeNode(e)) {
2678
2522
  return false;
@@ -2686,6 +2530,11 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
2686
2530
  this.tree.onContextMenu(this.onListContextMenu, this, this.disposables);
2687
2531
  this.tree.onDidScroll(this.inputRenderer.clearValidation, this.inputRenderer, this.disposables);
2688
2532
  Event.filter(this.tree.onDidChangeCollapseState, e => isSCMRepository(e.node.element?.element), this.disposables)(this.updateRepositoryCollapseAllContextKeys, this, this.disposables);
2533
+ this.disposables.add(autorun(reader => {
2534
+ this.tree.updateOptions({
2535
+ compressionEnabled: compressionEnabled.read(reader)
2536
+ });
2537
+ }));
2689
2538
  append(container, overflowWidgetsDomNode);
2690
2539
  }
2691
2540
  async open(e) {
@@ -2782,10 +2631,9 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
2782
2631
  if (historyItemChanges) {
2783
2632
  const title = `${historyItem.id.substring(0, 8)} - ${historyItem.message}`;
2784
2633
  const rootUri = e.element.repository.provider.rootUri;
2785
- const multiDiffSourceUri = rootUri ?
2786
- rootUri.with({ scheme: 'scm-history-item', path: `${rootUri.path}/${historyItem.id}..${historyItemParentId}` }) :
2787
- ( (URI.from(
2788
- { scheme: 'scm-history-item', path: `${e.element.repository.provider.label}/${historyItem.id}..${historyItemParentId}` },
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}` },
2789
2637
  true
2790
2638
  )));
2791
2639
  await this.commandService.executeCommand('_workbench.openMultiDiffEditor', { title, multiDiffSourceUri, resources: historyItemChanges });
@@ -2849,12 +2697,6 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
2849
2697
  repositoryDisposables.add(repository.provider.onDidChange(() => this.updateChildren(repository)));
2850
2698
  repositoryDisposables.add(repository.input.onDidChangeVisibility(() => this.updateChildren(repository)));
2851
2699
  repositoryDisposables.add(repository.provider.onDidChangeResourceGroups(() => this.updateChildren(repository)));
2852
- repositoryDisposables.add(autorun(reader => {
2853
- repository.provider.historyProvider.read(reader)?.currentHistoryItemGroup.read(reader);
2854
- this.historyProviderDataSource.deleteCacheEntry(repository);
2855
- this.historyProviderDataSource.deleteHistoryItemGroupFilter(repository);
2856
- this.updateChildren(repository);
2857
- }));
2858
2700
  const resourceGroupDisposables = repositoryDisposables.add(( (new DisposableMap())));
2859
2701
  const onDidChangeResourceGroups = () => {
2860
2702
  for (const [resourceGroup] of resourceGroupDisposables) {
@@ -2876,7 +2718,6 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
2876
2718
  this.items.set(repository, repositoryDisposables);
2877
2719
  }
2878
2720
  for (const repository of removed) {
2879
- this.historyProviderDataSource.deleteCacheEntry(repository);
2880
2721
  this.items.deleteAndDispose(repository);
2881
2722
  }
2882
2723
  this.updateChildren();
@@ -3147,32 +2988,6 @@ let SCMViewPane = class SCMViewPane extends ViewPane {
3147
2988
  this.tree.domFocus();
3148
2989
  }
3149
2990
  }
3150
- getHistoryItemGroupFilterActions(repository) {
3151
- const currentHistoryItemGroup = repository.provider.historyProvider.get()?.currentHistoryItemGroup?.get();
3152
- if (!currentHistoryItemGroup) {
3153
- return [];
3154
- }
3155
- const toHistoryItemGroupFilterAction = (historyItemGroupId, historyItemGroupName) => {
3156
- return toAction({
3157
- id: `workbench.scm.action.toggleHistoryItemGroupVisibility.${repository.id}.${historyItemGroupId}`,
3158
- label: historyItemGroupName,
3159
- checked: !( (this.historyProviderDataSource.getHistoryItemGroupFilter(repository).has(historyItemGroupId))),
3160
- run: () => {
3161
- this.historyProviderDataSource.toggleHistoryItemGroupFilter(repository, historyItemGroupId);
3162
- this.historyProviderDataSource.deleteCacheEntry(repository);
3163
- this.updateChildren(repository);
3164
- }
3165
- });
3166
- };
3167
- const actions = [];
3168
- if (currentHistoryItemGroup.remote) {
3169
- actions.push(toHistoryItemGroupFilterAction(currentHistoryItemGroup.remote.id, currentHistoryItemGroup.remote.name));
3170
- }
3171
- if (currentHistoryItemGroup.base) {
3172
- actions.push(toHistoryItemGroupFilterAction(currentHistoryItemGroup.base.id, currentHistoryItemGroup.base.name));
3173
- }
3174
- return actions;
3175
- }
3176
2991
  shouldShowWelcome() {
3177
2992
  return this.scmService.repositoryCount === 0;
3178
2993
  }
@@ -3229,268 +3044,10 @@ SCMViewPane = ( (__decorate([
3229
3044
  ( (__param(17, ITelemetryService))),
3230
3045
  ( (__param(18, IHoverService)))
3231
3046
  ], SCMViewPane)));
3232
- let SCMTreeHistoryProviderDataSource = class SCMTreeHistoryProviderDataSource extends Disposable {
3233
- constructor(viewMode, configurationService, uriIdentityService) {
3234
- super();
3235
- this.viewMode = viewMode;
3236
- this.configurationService = configurationService;
3237
- this.uriIdentityService = uriIdentityService;
3238
- this._cache = ( (new Map()));
3239
- this._historyItemGroupFilter = ( (new Map()));
3240
- }
3241
- clearCache() {
3242
- this._cache.clear();
3243
- }
3244
- deleteCacheEntry(repository) {
3245
- this._cache.delete(repository);
3246
- }
3247
- async getHistoryItemGroups(element) {
3248
- const { showIncomingChanges, showOutgoingChanges, showHistoryGraph } = this._getConfiguration();
3249
- const scmProvider = element.provider;
3250
- const historyProvider = scmProvider.historyProvider.get();
3251
- const currentHistoryItemGroup = historyProvider?.currentHistoryItemGroup.get();
3252
- if (!historyProvider || !currentHistoryItemGroup || (showIncomingChanges === 'never' && showOutgoingChanges === 'never') || showHistoryGraph) {
3253
- return [];
3254
- }
3255
- const children = [];
3256
- const historyProviderCacheEntry = this._getCacheEntry(element);
3257
- let incomingHistoryItemGroup = historyProviderCacheEntry?.incomingHistoryItemGroup;
3258
- let outgoingHistoryItemGroup = historyProviderCacheEntry?.outgoingHistoryItemGroup;
3259
- if (!incomingHistoryItemGroup && !outgoingHistoryItemGroup) {
3260
- const ancestor = await historyProvider.resolveHistoryItemGroupCommonAncestor(currentHistoryItemGroup.id, currentHistoryItemGroup.remote?.id);
3261
- if (!ancestor) {
3262
- return [];
3263
- }
3264
- incomingHistoryItemGroup = currentHistoryItemGroup.remote ? {
3265
- id: currentHistoryItemGroup.remote.id,
3266
- label: currentHistoryItemGroup.remote.name,
3267
- ariaLabel: ( localize(6393, "Incoming changes from {0}", currentHistoryItemGroup.remote.name)),
3268
- icon: Codicon.arrowCircleDown,
3269
- direction: 'incoming',
3270
- ancestor: ancestor.id,
3271
- count: ancestor.behind,
3272
- repository: element,
3273
- type: 'historyItemGroup'
3274
- } : undefined;
3275
- outgoingHistoryItemGroup = {
3276
- id: currentHistoryItemGroup.id,
3277
- label: currentHistoryItemGroup.name,
3278
- ariaLabel: ( localize(6394, "Outgoing changes to {0}", currentHistoryItemGroup.name)),
3279
- icon: Codicon.arrowCircleUp,
3280
- direction: 'outgoing',
3281
- ancestor: ancestor.id,
3282
- count: ancestor.ahead,
3283
- repository: element,
3284
- type: 'historyItemGroup'
3285
- };
3286
- this._updateCacheEntry(element, {
3287
- incomingHistoryItemGroup,
3288
- outgoingHistoryItemGroup
3289
- });
3290
- }
3291
- if (incomingHistoryItemGroup &&
3292
- (showIncomingChanges === 'always' ||
3293
- (showIncomingChanges === 'auto' && (incomingHistoryItemGroup.count ?? 0) > 0))) {
3294
- children.push(incomingHistoryItemGroup);
3295
- }
3296
- if (outgoingHistoryItemGroup &&
3297
- (showOutgoingChanges === 'always' ||
3298
- (showOutgoingChanges === 'auto' && (outgoingHistoryItemGroup.count ?? 0) > 0))) {
3299
- children.push(outgoingHistoryItemGroup);
3300
- }
3301
- return children;
3302
- }
3303
- getHistoryItemGroupFilter(element) {
3304
- return this._historyItemGroupFilter.get(element) ?? ( (new Set()));
3305
- }
3306
- deleteHistoryItemGroupFilter(repository) {
3307
- this._historyItemGroupFilter.delete(repository);
3308
- }
3309
- toggleHistoryItemGroupFilter(element, historyItemGroupId) {
3310
- const filters = this.getHistoryItemGroupFilter(element);
3311
- if (!filters.delete(historyItemGroupId)) {
3312
- filters.add(historyItemGroupId);
3313
- }
3314
- this._historyItemGroupFilter.set(element, filters);
3315
- }
3316
- async getHistoryItems(element) {
3317
- const repository = element.repository;
3318
- const historyProvider = repository.provider.historyProvider.get();
3319
- if (!historyProvider) {
3320
- return [];
3321
- }
3322
- const historyProviderCacheEntry = this._getCacheEntry(repository);
3323
- const historyItemsMap = historyProviderCacheEntry.historyItems;
3324
- let historyItemsElement = historyProviderCacheEntry.historyItems.get(element.id);
3325
- if (!historyItemsElement) {
3326
- const historyItems = (await historyProvider.provideHistoryItems(element.id, { limit: { id: element.ancestor } })) ?? [];
3327
- const { showChangesSummary } = this._getConfiguration();
3328
- const allChanges = showChangesSummary && historyItems.length >= 2 ?
3329
- await historyProvider.provideHistoryItemSummary(historyItems[0].id, element.ancestor) : undefined;
3330
- historyItemsElement = [allChanges, historyItems];
3331
- this._updateCacheEntry(repository, {
3332
- historyItems: historyItemsMap.set(element.id, historyItemsElement)
3333
- });
3334
- }
3335
- const children = [];
3336
- if (historyItemsElement[0]) {
3337
- children.push({
3338
- ...historyItemsElement[0],
3339
- icon: historyItemsElement[0].icon ?? Codicon.files,
3340
- message: ( localize(6395, "All Changes")),
3341
- historyItemGroup: element,
3342
- type: 'allChanges'
3343
- });
3344
- }
3345
- children.push(...( (historyItemsElement[1]
3346
- .map(historyItem => ({
3347
- ...historyItem,
3348
- historyItemGroup: element,
3349
- type: 'historyItem'
3350
- })))));
3351
- return children;
3352
- }
3353
- async getHistoryItems2(element) {
3354
- const { showHistoryGraph } = this._getConfiguration();
3355
- const historyProvider = element.provider.historyProvider.get();
3356
- const currentHistoryItemGroup = historyProvider?.currentHistoryItemGroup.get();
3357
- if (!historyProvider || !currentHistoryItemGroup || !showHistoryGraph) {
3358
- return [];
3359
- }
3360
- const historyProviderCacheEntry = this._getCacheEntry(element);
3361
- let historyItemsElement = historyProviderCacheEntry.historyItems2.get(element.id);
3362
- const historyItemsMap = historyProviderCacheEntry.historyItems2;
3363
- if (!historyItemsElement) {
3364
- const historyItemGroupIds = [
3365
- currentHistoryItemGroup.id,
3366
- ...(currentHistoryItemGroup.remote ? [currentHistoryItemGroup.remote.id] : []),
3367
- ...(currentHistoryItemGroup.base ? [currentHistoryItemGroup.base.id] : []),
3368
- ];
3369
- const ancestor = await historyProvider.resolveHistoryItemGroupCommonAncestor2(historyItemGroupIds);
3370
- if (!ancestor) {
3371
- return [];
3372
- }
3373
- const filters = this.getHistoryItemGroupFilter(element);
3374
- historyItemsElement = (await historyProvider.provideHistoryItems2({
3375
- historyItemGroupIds: historyItemGroupIds.filter(id => !( (filters.has(id)))),
3376
- limit: { id: ancestor }
3377
- })) ?? [];
3378
- this._updateCacheEntry(element, {
3379
- historyItems2: historyItemsMap.set(element.id, historyItemsElement)
3380
- });
3381
- }
3382
- if (historyItemsElement.length === 1) {
3383
- const currentHistoryItemGroupLabels = [
3384
- currentHistoryItemGroup.name,
3385
- ...(currentHistoryItemGroup.remote ? [currentHistoryItemGroup.remote.name] : []),
3386
- ...(currentHistoryItemGroup.base ? [currentHistoryItemGroup.base.name] : []),
3387
- ];
3388
- const labels = ( ((historyItemsElement[0].labels ?? [])
3389
- .map(l => l.title)));
3390
- if (equals(currentHistoryItemGroupLabels.sort(), labels.sort())) {
3391
- return [];
3392
- }
3393
- }
3394
- const colorMap = ( (new Map([
3395
- [currentHistoryItemGroup.name, historyItemGroupLocal]
3396
- ])));
3397
- if (currentHistoryItemGroup.remote) {
3398
- colorMap.set(currentHistoryItemGroup.remote.name, historyItemGroupRemote);
3399
- }
3400
- if (currentHistoryItemGroup.base) {
3401
- colorMap.set(currentHistoryItemGroup.base.name, historyItemGroupBase);
3402
- }
3403
- return (
3404
- (toISCMHistoryItemViewModelArray(historyItemsElement, colorMap)
3405
- .map(historyItemViewModel => ({
3406
- repository: element,
3407
- historyItemViewModel,
3408
- type: 'historyItem2'
3409
- })))
3410
- );
3411
- }
3412
- async getHistoryItemChanges(element) {
3413
- const repository = element.historyItemGroup.repository;
3414
- const historyProvider = repository.provider.historyProvider.get();
3415
- if (!historyProvider) {
3416
- return [];
3417
- }
3418
- const historyProviderCacheEntry = this._getCacheEntry(repository);
3419
- const historyItemChangesMap = historyProviderCacheEntry.historyItemChanges;
3420
- const historyItemParentId = element.parentIds.length > 0 ? element.parentIds[0] : undefined;
3421
- let historyItemChanges = historyItemChangesMap.get(`${element.id}/${historyItemParentId}`);
3422
- if (!historyItemChanges) {
3423
- const historyItemParentId = element.parentIds.length > 0 ? element.parentIds[0] : undefined;
3424
- historyItemChanges = (await historyProvider.provideHistoryItemChanges(element.id, historyItemParentId)) ?? [];
3425
- this._updateCacheEntry(repository, {
3426
- historyItemChanges: historyItemChangesMap.set(`${element.id}/${historyItemParentId}`, historyItemChanges)
3427
- });
3428
- }
3429
- if (this.viewMode() === ViewMode.List) {
3430
- return (
3431
- (historyItemChanges.map(change => ({
3432
- ...change,
3433
- historyItem: element,
3434
- type: 'historyItemChange'
3435
- })))
3436
- );
3437
- }
3438
- const tree = ( (new ResourceTree(
3439
- element,
3440
- repository.provider.rootUri ?? URI.file('/'),
3441
- this.uriIdentityService.extUri
3442
- )));
3443
- for (const change of historyItemChanges) {
3444
- tree.add(change.uri, {
3445
- ...change,
3446
- historyItem: element,
3447
- type: 'historyItemChange'
3448
- });
3449
- }
3450
- const children = [];
3451
- for (const node of tree.root.children) {
3452
- children.push(node.element ?? node);
3453
- }
3454
- return children;
3455
- }
3456
- _getCacheEntry(repository) {
3457
- let entry = this._cache.get(repository);
3458
- if (!entry) {
3459
- entry = {
3460
- incomingHistoryItemGroup: undefined,
3461
- outgoingHistoryItemGroup: undefined,
3462
- historyItems: ( (new Map())),
3463
- historyItems2: ( (new Map())),
3464
- historyItemChanges: ( (new Map()))
3465
- };
3466
- this._cache.set(repository, entry);
3467
- }
3468
- return entry;
3469
- }
3470
- _updateCacheEntry(repository, entry) {
3471
- this._cache.set(repository, {
3472
- ...this._getCacheEntry(repository),
3473
- ...entry
3474
- });
3475
- }
3476
- _getConfiguration() {
3477
- return {
3478
- showChangesSummary: this.configurationService.getValue('scm.showChangesSummary'),
3479
- showIncomingChanges: this.configurationService.getValue('scm.showIncomingChanges'),
3480
- showOutgoingChanges: this.configurationService.getValue('scm.showOutgoingChanges'),
3481
- showHistoryGraph: this.configurationService.getValue('scm.showHistoryGraph')
3482
- };
3483
- }
3484
- };
3485
- SCMTreeHistoryProviderDataSource = ( (__decorate([
3486
- ( (__param(1, IConfigurationService))),
3487
- ( (__param(2, IUriIdentityService)))
3488
- ], SCMTreeHistoryProviderDataSource)));
3489
3047
  let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
3490
- constructor(viewMode, historyProviderDataSource, configurationService, scmViewService) {
3048
+ constructor(viewMode, configurationService, scmViewService) {
3491
3049
  super();
3492
3050
  this.viewMode = viewMode;
3493
- this.historyProviderDataSource = historyProviderDataSource;
3494
3051
  this.configurationService = configurationService;
3495
3052
  this.scmViewService = scmViewService;
3496
3053
  }
@@ -3520,30 +3077,6 @@ let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
3520
3077
  if (hasSomeChanges || (repositoryCount === 1 && (!showActionButton || !actionButton))) {
3521
3078
  children.push(...resourceGroups);
3522
3079
  }
3523
- const historyItemGroups = await this.historyProviderDataSource.getHistoryItemGroups(inputOrElement);
3524
- if (historyItemGroups.length > 0) {
3525
- let label = ( localize(6396, "Incoming/Outgoing"));
3526
- let ariaLabel = ( localize(6397, "Incoming and outgoing changes"));
3527
- const incomingHistoryItems = historyItemGroups.find(g => g.direction === 'incoming');
3528
- const outgoingHistoryItems = historyItemGroups.find(g => g.direction === 'outgoing');
3529
- if (incomingHistoryItems && !outgoingHistoryItems) {
3530
- label = ( localize(6398, "Incoming"));
3531
- ariaLabel = ( localize(6399, "Incoming changes"));
3532
- }
3533
- else if (!incomingHistoryItems && outgoingHistoryItems) {
3534
- label = ( localize(6400, "Outgoing"));
3535
- ariaLabel = ( localize(6401, "Outgoing changes"));
3536
- }
3537
- children.push({ label, ariaLabel, repository: inputOrElement, type: 'separator' });
3538
- }
3539
- children.push(...historyItemGroups);
3540
- const historyItems = await this.historyProviderDataSource.getHistoryItems2(inputOrElement);
3541
- if (historyItems.length > 0) {
3542
- const label = ( localize(6396, "Incoming/Outgoing"));
3543
- const ariaLabel = ( localize(6397, "Incoming and outgoing changes"));
3544
- children.push({ label, ariaLabel, repository: inputOrElement, type: 'separator' });
3545
- }
3546
- children.push(...historyItems);
3547
3080
  return children;
3548
3081
  }
3549
3082
  else if (isSCMResourceGroup(inputOrElement)) {
@@ -3565,12 +3098,6 @@ let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
3565
3098
  }
3566
3099
  return children;
3567
3100
  }
3568
- else if (isSCMHistoryItemGroupTreeElement(inputOrElement)) {
3569
- return this.historyProviderDataSource.getHistoryItems(inputOrElement);
3570
- }
3571
- else if (isSCMHistoryItemTreeElement(inputOrElement)) {
3572
- return this.historyProviderDataSource.getHistoryItemChanges(inputOrElement);
3573
- }
3574
3101
  return [];
3575
3102
  }
3576
3103
  getParent(element) {
@@ -3656,8 +3183,8 @@ let SCMTreeDataSource = class SCMTreeDataSource extends Disposable {
3656
3183
  }
3657
3184
  };
3658
3185
  SCMTreeDataSource = ( (__decorate([
3659
- ( (__param(2, IConfigurationService))),
3660
- ( (__param(3, ISCMViewService)))
3186
+ ( (__param(1, IConfigurationService))),
3187
+ ( (__param(2, ISCMViewService)))
3661
3188
  ], SCMTreeDataSource)));
3662
3189
  class SCMActionButton {
3663
3190
  constructor(container, contextMenuService, commandService, notificationService) {
@@ -3733,23 +3260,6 @@ class SCMActionButton {
3733
3260
  }
3734
3261
  }
3735
3262
  }
3736
- registerThemingParticipant((theme, collector) => {
3737
- const selectionBackgroundColor = theme.getColor(selectionBackground);
3738
- if (selectionBackgroundColor) {
3739
- const inputBackgroundColor = theme.getColor(inputBackground);
3740
- if (inputBackgroundColor) {
3741
- collector.addRule(`.scm-view .scm-editor-container .monaco-editor-background { background-color: ${inputBackgroundColor}; } `);
3742
- collector.addRule(`.scm-view .scm-editor-container .monaco-editor .selected-text { background-color: ${( (inputBackgroundColor.transparent(0.4)))}; }`);
3743
- }
3744
- const inputForegroundColor = theme.getColor(inputForeground);
3745
- if (inputForegroundColor) {
3746
- collector.addRule(`.scm-view .scm-editor-container .monaco-editor .view-line span.inline-selected-text { color: ${inputForegroundColor}; }`);
3747
- }
3748
- collector.addRule(`.scm-view .scm-editor-container .monaco-editor .focused .selected-text { background-color: ${selectionBackgroundColor}; }`);
3749
- }
3750
- else {
3751
- collector.addRule(`.scm-view .scm-editor-container .monaco-editor .focused .selected-text { background-color: ${theme.getColor(editorSelectionBackground)}; }`);
3752
- }
3753
- });
3263
+ setupSimpleEditorSelectionStyling('.scm-view .scm-editor-container');
3754
3264
 
3755
3265
  export { ActionButtonRenderer, ContextKeys, SCMAccessibilityProvider, SCMActionButton, SCMTreeKeyboardNavigationLabelProvider, SCMTreeSorter, SCMViewPane };