@codingame/monaco-vscode-scm-service-override 18.4.0 → 19.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.
@@ -12,7 +12,7 @@ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
12
12
  import { registerAction2, Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
13
13
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
14
14
  import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
15
- import { showChatView } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/chat/browser/chat';
15
+ import { showChatView } from '@codingame/monaco-vscode-9911aec2-e4dd-5483-8369-9d695cc70d8a-common/vscode/vs/workbench/contrib/chat/browser/chat';
16
16
  import { picksWithPromiseFn } from '@codingame/monaco-vscode-f338ac19-278c-5fe1-bec8-b588de04a788-common/vscode/vs/workbench/contrib/chat/browser/chatContextPickService';
17
17
  import { IChatContextPickService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContextPickService.service';
18
18
  import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
@@ -51,7 +51,7 @@ let SCMHistoryItemContext = SCMHistoryItemContext_1 = class SCMHistoryItemContex
51
51
  constructor(_scmViewService) {
52
52
  this._scmViewService = _scmViewService;
53
53
  this.type = 'pickerPick';
54
- this.label = ( localize(9465, 'Source Control...'));
54
+ this.label = ( localize(9704, 'Source Control...'));
55
55
  this.icon = Codicon.gitCommit;
56
56
  this._delayer = ( new ThrottledDelayer(200));
57
57
  }
@@ -61,7 +61,7 @@ let SCMHistoryItemContext = SCMHistoryItemContext_1 = class SCMHistoryItemContex
61
61
  }
62
62
  asPicker(_widget) {
63
63
  return {
64
- placeholder: ( localize(9466, 'Select a change')),
64
+ placeholder: ( localize(9705, 'Select a change')),
65
65
  picks: picksWithPromiseFn((query, token) => {
66
66
  const filterText = query.trim() !== '' ? query.trim() : undefined;
67
67
  const activeRepository = this._scmViewService.activeRepository.get();
@@ -86,7 +86,7 @@ let SCMHistoryItemContext = SCMHistoryItemContext_1 = class SCMHistoryItemContex
86
86
  details.push(historyItem.author);
87
87
  }
88
88
  if (historyItem.statistics) {
89
- details.push(`${historyItem.statistics.files} ${( localize(9467, 'file(s)'))}`);
89
+ details.push(`${historyItem.statistics.files} ${( localize(9706, 'file(s)'))}`);
90
90
  }
91
91
  if (historyItem.timestamp) {
92
92
  details.push(fromNow(historyItem.timestamp, true, true));
@@ -142,7 +142,7 @@ registerAction2(class extends Action2 {
142
142
  constructor() {
143
143
  super({
144
144
  id: 'workbench.scm.action.graph.addHistoryItemToChat',
145
- title: ( localize(9468, 'Add History Item to Chat')),
145
+ title: ( localize(9707, 'Add History Item to Chat')),
146
146
  f1: false,
147
147
  menu: {
148
148
  id: MenuId.SCMHistoryItemChatContext,
@@ -163,7 +163,7 @@ registerAction2(class extends Action2 {
163
163
  constructor() {
164
164
  super({
165
165
  id: 'workbench.scm.action.graph.summarizeHistoryItem',
166
- title: ( localize(9469, 'Summarize History Item')),
166
+ title: ( localize(9708, 'Summarize History Item')),
167
167
  f1: false,
168
168
  menu: {
169
169
  id: MenuId.SCMHistoryItemChatContext,
@@ -34,8 +34,8 @@ import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/t
34
34
  import { ViewAction, ViewPane, ViewPaneShowActions } from '@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common/vscode/vs/workbench/browser/parts/views/viewPane';
35
35
  import { ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
36
36
  import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
37
- import { renderSCMHistoryItemGraph, historyItemHoverDefaultLabelBackground, historyItemHoverLabelForeground, SWIMLANE_WIDTH, renderSCMHistoryGraphPlaceholder, getHistoryItemIndex, toISCMHistoryItemViewModelArray } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/scm/browser/scmHistory';
38
- import { getHistoryItemEditorTitle, isSCMHistoryItemViewModelTreeElement, isSCMHistoryItemChangeViewModelTreeElement, isSCMHistoryItemChangeNode, isSCMHistoryItemLoadMoreTreeElement, getHistoryItemHoverContent, isSCMRepository, getProviderKey } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/scm/browser/util';
37
+ import { renderSCMHistoryItemGraph, historyItemHoverDefaultLabelBackground, historyItemHoverLabelForeground, SWIMLANE_WIDTH, renderSCMHistoryGraphPlaceholder, getHistoryItemIndex, toISCMHistoryItemViewModelArray } from '@codingame/monaco-vscode-9ebd6daf-8734-5a28-ad24-b238f5e5819d-common/vscode/vs/workbench/contrib/scm/browser/scmHistory';
38
+ import { getHistoryItemEditorTitle, isSCMHistoryItemViewModelTreeElement, isSCMHistoryItemChangeViewModelTreeElement, isSCMHistoryItemChangeNode, isSCMHistoryItemLoadMoreTreeElement, getHistoryItemHoverContent, isSCMRepository, getProviderKey } from '@codingame/monaco-vscode-9ebd6daf-8734-5a28-ad24-b238f5e5819d-common/vscode/vs/workbench/contrib/scm/browser/util';
39
39
  import { HISTORY_VIEW_PANE_ID, ViewMode } from '@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common/vscode/vs/workbench/contrib/scm/common/scm';
40
40
  import { ISCMService, ISCMViewService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
41
41
  import { stripIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iconLabels';
@@ -65,14 +65,14 @@ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform
65
65
  import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
66
66
  import { groupBy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/collections';
67
67
  import { getActionBarActions, getFlatContextMenuActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
68
- import { ResourceLabels } from '@codingame/monaco-vscode-f24b7f0a-ceeb-5877-9148-81eb98a4f5d7-common/vscode/vs/workbench/browser/labels';
68
+ import { ResourceLabels } from '@codingame/monaco-vscode-2726569c-a06b-5f25-b851-14311bef12fa-common/vscode/vs/workbench/browser/labels';
69
69
  import { FileKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
70
70
  import { WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
71
71
  import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
72
72
  import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
73
73
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
74
74
  import { ScmHistoryItemResolver } from '@codingame/monaco-vscode-f99b74f5-fcb7-512f-8c6c-35f5a107577d-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver';
75
- import { ResourceTree } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/base/common/resourceTree';
75
+ import { ResourceTree } from '@codingame/monaco-vscode-9ebd6daf-8734-5a28-ad24-b238f5e5819d-common/vscode/vs/base/common/resourceTree';
76
76
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
77
77
  import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
78
78
  import { autorun, autorunWithStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
@@ -121,23 +121,23 @@ class SCMHistoryItemRefsActionViewItem extends ActionViewItem {
121
121
  icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.gitBranch));
122
122
  const name = $('.name');
123
123
  if (this._historyItemsFilter === 'all') {
124
- name.textContent = ( localize(9470, "All"));
124
+ name.textContent = ( localize(9709, "All"));
125
125
  }
126
126
  else if (this._historyItemsFilter === 'auto') {
127
- name.textContent = ( localize(9471, "Auto"));
127
+ name.textContent = ( localize(9710, "Auto"));
128
128
  }
129
129
  else if (this._historyItemsFilter.length === 1) {
130
130
  name.textContent = this._historyItemsFilter[0].name;
131
131
  }
132
132
  else {
133
- name.textContent = ( localize(9472, "{0} Items", this._historyItemsFilter.length));
133
+ name.textContent = ( localize(9711, "{0} Items", this._historyItemsFilter.length));
134
134
  }
135
135
  reset(this.label, icon, name);
136
136
  }
137
137
  }
138
138
  getTooltip() {
139
139
  if (this._historyItemsFilter === 'all') {
140
- return localize(9473, "All history item references");
140
+ return localize(9712, "All history item references");
141
141
  }
142
142
  else if (this._historyItemsFilter === 'auto') {
143
143
  const historyProvider = this._repository.provider.historyProvider.get();
@@ -159,7 +159,7 @@ registerAction2(class extends ViewAction {
159
159
  constructor() {
160
160
  super({
161
161
  id: PICK_REPOSITORY_ACTION_ID,
162
- title: ( localize(9474, "Repository Picker")),
162
+ title: ( localize(9713, "Repository Picker")),
163
163
  viewId: HISTORY_VIEW_PANE_ID,
164
164
  f1: false,
165
165
  menu: {
@@ -178,7 +178,7 @@ registerAction2(class extends ViewAction {
178
178
  constructor() {
179
179
  super({
180
180
  id: PICK_HISTORY_ITEM_REFS_ACTION_ID,
181
- title: ( localize(9475, "History Item Reference Picker")),
181
+ title: ( localize(9714, "History Item Reference Picker")),
182
182
  icon: Codicon.gitBranch,
183
183
  viewId: HISTORY_VIEW_PANE_ID,
184
184
  precondition: ( ContextKeys.SCMHistoryItemCount.notEqualsTo(0)),
@@ -198,7 +198,7 @@ registerAction2(class extends ViewAction {
198
198
  constructor() {
199
199
  super({
200
200
  id: 'workbench.scm.action.graph.revealCurrentHistoryItem',
201
- title: ( localize(9476, "Go to Current History Item")),
201
+ title: ( localize(9715, "Go to Current History Item")),
202
202
  icon: Codicon.target,
203
203
  viewId: HISTORY_VIEW_PANE_ID,
204
204
  precondition: ( ContextKeyExpr.and(( ContextKeys.SCMHistoryItemCount.notEqualsTo(0)), ( ContextKeys.SCMCurrentHistoryItemRefInFilter.isEqualTo(true)))),
@@ -218,7 +218,7 @@ registerAction2(class extends ViewAction {
218
218
  constructor() {
219
219
  super({
220
220
  id: 'workbench.scm.action.graph.refresh',
221
- title: ( localize(9477, "Refresh")),
221
+ title: ( localize(9716, "Refresh")),
222
222
  viewId: HISTORY_VIEW_PANE_ID,
223
223
  f1: false,
224
224
  icon: Codicon.refresh,
@@ -237,7 +237,7 @@ registerAction2(class extends ViewAction {
237
237
  constructor() {
238
238
  super({
239
239
  id: 'workbench.scm.action.graph.setListViewMode',
240
- title: ( localize(9478, "View as List")),
240
+ title: ( localize(9717, "View as List")),
241
241
  viewId: HISTORY_VIEW_PANE_ID,
242
242
  toggled: ( ContextKeys.SCMHistoryViewMode.isEqualTo(ViewMode.List)),
243
243
  menu: { id: MenuId.SCMHistoryTitle, group: '9_viewmode', order: 1 },
@@ -252,7 +252,7 @@ registerAction2(class extends ViewAction {
252
252
  constructor() {
253
253
  super({
254
254
  id: 'workbench.scm.action.graph.setTreeViewMode',
255
- title: ( localize(9479, "View as Tree")),
255
+ title: ( localize(9718, "View as Tree")),
256
256
  viewId: HISTORY_VIEW_PANE_ID,
257
257
  toggled: ( ContextKeys.SCMHistoryViewMode.isEqualTo(ViewMode.Tree)),
258
258
  menu: { id: MenuId.SCMHistoryTitle, group: '9_viewmode', order: 2 },
@@ -267,7 +267,7 @@ registerAction2(class extends Action2 {
267
267
  constructor() {
268
268
  super({
269
269
  id: 'workbench.scm.action.graph.viewChanges',
270
- title: ( localize(9480, "Open Changes")),
270
+ title: ( localize(9719, "Open Changes")),
271
271
  icon: Codicon.diffMultiple,
272
272
  f1: false,
273
273
  menu: [
@@ -303,7 +303,7 @@ registerAction2(class extends Action2 {
303
303
  const title = historyItems.length === 1 ?
304
304
  getHistoryItemEditorTitle(historyItem) :
305
305
  ( localize(
306
- 9481,
306
+ 9720,
307
307
  "All Changes ({0} ↔ {1})",
308
308
  historyItemLast.displayId ?? historyItemLast.id,
309
309
  historyItem.displayId ?? historyItem.id
@@ -316,7 +316,7 @@ registerAction2(class extends Action2 {
316
316
  constructor() {
317
317
  super({
318
318
  id: 'workbench.scm.action.graph.openFile',
319
- title: ( localize(9482, "Open File")),
319
+ title: ( localize(9721, "Open File")),
320
320
  icon: Codicon.goToFile,
321
321
  f1: false,
322
322
  menu: [
@@ -649,7 +649,7 @@ let HistoryItemLoadMoreRenderer = class HistoryItemLoadMoreRenderer {
649
649
  templateData.elementDisposables.add(autorun(reader => {
650
650
  const isLoadingMore = this._isLoadingMore.read(reader);
651
651
  const icon = `$(${isLoadingMore ? 'loading~spin' : 'fold-down'})`;
652
- templateData.historyItemPlaceholderLabel.setLabel(( localize(9483, "{0} Load More...", icon)));
652
+ templateData.historyItemPlaceholderLabel.setLabel(( localize(9722, "{0} Load More...", icon)));
653
653
  }));
654
654
  }
655
655
  }
@@ -668,7 +668,9 @@ HistoryItemLoadMoreRenderer = HistoryItemLoadMoreRenderer_1 = ( __decorate([
668
668
  ], HistoryItemLoadMoreRenderer));
669
669
  let HistoryItemHoverDelegate = class HistoryItemHoverDelegate extends WorkbenchHoverDelegate {
670
670
  constructor(_viewContainerLocation, layoutService, configurationService, hoverService) {
671
- super('element', { instantHover: true }, () => this.getHoverOptions(), configurationService, hoverService);
671
+ super(_viewContainerLocation === ViewContainerLocation.Panel ? 'mouse' : 'element', {
672
+ instantHover: _viewContainerLocation !== ViewContainerLocation.Panel
673
+ }, () => this.getHoverOptions(), configurationService, hoverService);
672
674
  this._viewContainerLocation = _viewContainerLocation;
673
675
  this.layoutService = layoutService;
674
676
  }
@@ -706,7 +708,7 @@ SCMHistoryViewPaneActionRunner = ( __decorate([
706
708
  ], SCMHistoryViewPaneActionRunner));
707
709
  class SCMHistoryTreeAccessibilityProvider {
708
710
  getWidgetAriaLabel() {
709
- return localize(9484, "Source Control History");
711
+ return localize(9723, "Source Control History");
710
712
  }
711
713
  getAriaLabel(element) {
712
714
  if (isSCMRepository(element)) {
@@ -1089,8 +1091,8 @@ let RepositoryPicker = class RepositoryPicker {
1089
1091
  this._quickInputService = _quickInputService;
1090
1092
  this._scmViewService = _scmViewService;
1091
1093
  this._autoQuickPickItem = {
1092
- label: ( localize(9471, "Auto")),
1093
- description: ( localize(9485, "Show the source control graph for the active repository")),
1094
+ label: ( localize(9710, "Auto")),
1095
+ description: ( localize(9724, "Show the source control graph for the active repository")),
1094
1096
  repository: 'auto'
1095
1097
  };
1096
1098
  }
@@ -1106,7 +1108,7 @@ let RepositoryPicker = class RepositoryPicker {
1106
1108
  repository: r
1107
1109
  }))));
1108
1110
  return this._quickInputService.pick(picks, {
1109
- placeHolder: ( localize(9486, "Select the repository to view, type to filter all repositories"))
1111
+ placeHolder: ( localize(9725, "Select the repository to view, type to filter all repositories"))
1110
1112
  });
1111
1113
  }
1112
1114
  };
@@ -1122,21 +1124,21 @@ let HistoryItemRefPicker = class HistoryItemRefPicker extends Disposable {
1122
1124
  this._quickInputService = _quickInputService;
1123
1125
  this._allQuickPickItem = {
1124
1126
  id: 'all',
1125
- label: ( localize(9470, "All")),
1126
- description: ( localize(9473, "All history item references")),
1127
+ label: ( localize(9709, "All")),
1128
+ description: ( localize(9712, "All history item references")),
1127
1129
  historyItemRef: 'all'
1128
1130
  };
1129
1131
  this._autoQuickPickItem = {
1130
1132
  id: 'auto',
1131
- label: ( localize(9471, "Auto")),
1132
- description: ( localize(9487, "Current history item reference(s)")),
1133
+ label: ( localize(9710, "Auto")),
1134
+ description: ( localize(9726, "Current history item reference(s)")),
1133
1135
  historyItemRef: 'auto'
1134
1136
  };
1135
1137
  }
1136
1138
  async pickHistoryItemRef() {
1137
1139
  const quickPick = this._quickInputService.createQuickPick({ useSeparators: true });
1138
1140
  this._store.add(quickPick);
1139
- quickPick.placeholder = ( localize(9488, "Select one/more history item references to view, type to filter"));
1141
+ quickPick.placeholder = ( localize(9727, "Select one/more history item references to view, type to filter"));
1140
1142
  quickPick.canSelectMany = true;
1141
1143
  quickPick.hideCheckAll = true;
1142
1144
  quickPick.busy = true;
@@ -1266,7 +1268,7 @@ let SCMHistoryViewPane = class SCMHistoryViewPane extends ViewPane {
1266
1268
  container.appendChild(element.root);
1267
1269
  this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('mouse'), element.root, {
1268
1270
  markdown: {
1269
- value: ( localize(9489, "Please refresh the graph using the refresh action ($(refresh)).")),
1271
+ value: ( localize(9728, "Please refresh the graph using the refresh action ($(refresh)).")),
1270
1272
  supportThemeIcons: true
1271
1273
  },
1272
1274
  markdownNotSupportedFallback: undefined
@@ -11,17 +11,24 @@ import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/
11
11
  import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
12
12
  export declare class SCMRepositoriesViewPane extends ViewPane {
13
13
  protected scmViewService: ISCMViewService;
14
- private list;
15
- private readonly disposables;
14
+ private tree;
15
+ private treeViewModel;
16
+ private treeDataSource;
17
+ private treeIdentityProvider;
18
+ private readonly treeOperationSequencer;
19
+ private readonly visibleCountObs;
20
+ private readonly providerCountBadgeObs;
21
+ private readonly visibilityDisposables;
16
22
  constructor(options: IViewPaneOptions, scmViewService: ISCMViewService, keybindingService: IKeybindingService, contextMenuService: IContextMenuService, instantiationService: IInstantiationService, viewDescriptorService: IViewDescriptorService, contextKeyService: IContextKeyService, configurationService: IConfigurationService, openerService: IOpenerService, themeService: IThemeService, hoverService: IHoverService);
17
23
  protected renderBody(container: HTMLElement): void;
18
- private onDidChangeRepositories;
19
- focus(): void;
20
24
  protected layoutBody(height: number, width: number): void;
25
+ focus(): void;
26
+ private createTree;
27
+ private onTreeContextMenu;
28
+ private onTreeSelectionChange;
29
+ private onTreeDidChangeFocus;
30
+ private updateChildren;
21
31
  private updateBodySize;
22
- private onListContextMenu;
23
- private onListSelectionChange;
24
- private onDidChangeFocus;
25
- private updateListSelection;
32
+ private updateTreeSelection;
26
33
  dispose(): void;
27
34
  }
@@ -3,26 +3,30 @@ import { registerCss } from '@codingame/monaco-vscode-api/css';
3
3
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
4
  import * as scm from './media/scm.css';
5
5
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
6
- import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
7
6
  import { ViewPane } from '@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common/vscode/vs/workbench/browser/parts/views/viewPane';
8
7
  import { append, $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
8
+ import { WorkbenchCompressibleAsyncDataTree } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
9
9
  import { ISCMViewService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
10
10
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
11
11
  import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
12
12
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
13
13
  import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
14
14
  import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
15
- import { WorkbenchList } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
15
+ import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
16
16
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
17
17
  import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
18
18
  import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
19
19
  import { RepositoryRenderer, RepositoryActionRunner } from './scmRepositoryRenderer.js';
20
- import { getActionViewItemProvider, collectContextMenuActions } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/scm/browser/util';
20
+ import { getActionViewItemProvider, collectContextMenuActions } from '@codingame/monaco-vscode-9ebd6daf-8734-5a28-ad24-b238f5e5819d-common/vscode/vs/workbench/contrib/scm/browser/util';
21
21
  import { Orientation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/sash/sash';
22
22
  import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
23
- import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
24
23
  import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
25
24
  import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
25
+ import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
26
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
27
+ import { Sequencer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
28
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
29
+ import { observableSignalFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignalFromEvent';
26
30
 
27
31
  registerCss(scm);
28
32
  class ListDelegate {
@@ -33,77 +37,115 @@ class ListDelegate {
33
37
  return RepositoryRenderer.TEMPLATE_ID;
34
38
  }
35
39
  }
40
+ class RepositoryTreeDataSource extends Disposable {
41
+ async getChildren(inputOrElement) {
42
+ if (inputOrElement instanceof SCMRepositoriesViewModel) {
43
+ return inputOrElement.repositories;
44
+ }
45
+ return [];
46
+ }
47
+ hasChildren(inputOrElement) {
48
+ return inputOrElement instanceof SCMRepositoriesViewModel;
49
+ }
50
+ }
51
+ class RepositoryTreeIdentityProvider {
52
+ getId(element) {
53
+ return element.provider.id;
54
+ }
55
+ }
56
+ let SCMRepositoriesViewModel = class SCMRepositoriesViewModel extends Disposable {
57
+ constructor(scmViewService) {
58
+ super();
59
+ this.scmViewService = scmViewService;
60
+ this.onDidChangeRepositoriesSignal = observableSignalFromEvent(this, this.scmViewService.onDidChangeRepositories);
61
+ this.onDidChangeVisibleRepositoriesSignal = observableSignalFromEvent(this, this.scmViewService.onDidChangeVisibleRepositories);
62
+ }
63
+ get repositories() {
64
+ return this.scmViewService.repositories;
65
+ }
66
+ };
67
+ SCMRepositoriesViewModel = ( __decorate([
68
+ ( __param(0, ISCMViewService))
69
+ ], SCMRepositoriesViewModel));
36
70
  let SCMRepositoriesViewPane = class SCMRepositoriesViewPane extends ViewPane {
37
71
  constructor(options, scmViewService, keybindingService, contextMenuService, instantiationService, viewDescriptorService, contextKeyService, configurationService, openerService, themeService, hoverService) {
38
72
  super({ ...options, titleMenuId: MenuId.SCMSourceControlTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, hoverService);
39
73
  this.scmViewService = scmViewService;
40
- this.disposables = ( new DisposableStore());
74
+ this.treeOperationSequencer = ( new Sequencer());
75
+ this.visibilityDisposables = ( new DisposableStore());
76
+ this.visibleCountObs = observableConfigValue('scm.repositories.visible', 10, this.configurationService);
77
+ this.providerCountBadgeObs = observableConfigValue('scm.providerCountBadge', 'hidden', this.configurationService);
41
78
  }
42
79
  renderBody(container) {
43
80
  super.renderBody(container);
44
- const listContainer = append(container, $('.scm-view.scm-repositories-view'));
45
- const updateProviderCountVisibility = () => {
46
- const value = this.configurationService.getValue('scm.providerCountBadge');
47
- listContainer.classList.toggle('hide-provider-counts', value === 'hidden');
48
- listContainer.classList.toggle('auto-provider-counts', value === 'auto');
49
- };
50
- this._register(Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.providerCountBadge'), this.disposables)(updateProviderCountVisibility));
51
- updateProviderCountVisibility();
52
- const delegate = ( new ListDelegate());
53
- const renderer = this.instantiationService.createInstance(RepositoryRenderer, MenuId.SCMSourceControlInline, getActionViewItemProvider(this.instantiationService));
54
- const identityProvider = { getId: (r) => r.provider.id };
55
- this.list = this.instantiationService.createInstance(WorkbenchList, `SCM Main`, listContainer, delegate, [renderer], {
56
- identityProvider,
81
+ const treeContainer = append(container, $('.scm-view.scm-repositories-view'));
82
+ this._register(autorun(reader => {
83
+ const providerCountBadge = this.providerCountBadgeObs.read(reader);
84
+ treeContainer.classList.toggle('hide-provider-counts', providerCountBadge === 'hidden');
85
+ treeContainer.classList.toggle('auto-provider-counts', providerCountBadge === 'auto');
86
+ }));
87
+ this.createTree(treeContainer);
88
+ this.onDidChangeBodyVisibility(async (visible) => {
89
+ if (!visible) {
90
+ this.visibilityDisposables.clear();
91
+ return;
92
+ }
93
+ this.treeViewModel = this.instantiationService.createInstance(SCMRepositoriesViewModel);
94
+ this._register(this.treeViewModel);
95
+ this.treeOperationSequencer.queue(async () => {
96
+ await this.tree.setInput(this.treeViewModel);
97
+ this.visibilityDisposables.add(autorun(reader => {
98
+ const visibleCount = this.visibleCountObs.read(reader);
99
+ this.updateBodySize(visibleCount);
100
+ }));
101
+ this.visibilityDisposables.add(autorun(async (reader) => {
102
+ this.treeViewModel.onDidChangeRepositoriesSignal.read(reader);
103
+ await this.treeOperationSequencer.queue(() => this.updateChildren());
104
+ }));
105
+ this.visibilityDisposables.add(autorun(async (reader) => {
106
+ this.treeViewModel.onDidChangeVisibleRepositoriesSignal.read(reader);
107
+ await this.treeOperationSequencer.queue(async () => this.updateTreeSelection());
108
+ }));
109
+ });
110
+ }, this, this._store);
111
+ }
112
+ layoutBody(height, width) {
113
+ super.layoutBody(height, width);
114
+ this.tree.layout(height, width);
115
+ }
116
+ focus() {
117
+ super.focus();
118
+ this.tree.domFocus();
119
+ }
120
+ createTree(container) {
121
+ this.treeIdentityProvider = ( new RepositoryTreeIdentityProvider());
122
+ this.treeDataSource = this.instantiationService.createInstance(RepositoryTreeDataSource);
123
+ this._register(this.treeDataSource);
124
+ const compressionEnabled = observableConfigValue('scm.compactFolders', true, this.configurationService);
125
+ this.tree = this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree, 'SCM Repositories', container, ( new ListDelegate()), {
126
+ isIncompressible: () => true
127
+ }, [
128
+ this.instantiationService.createInstance(RepositoryRenderer, MenuId.SCMSourceControlInline, getActionViewItemProvider(this.instantiationService))
129
+ ], this.treeDataSource, {
130
+ identityProvider: this.treeIdentityProvider,
57
131
  horizontalScrolling: false,
132
+ compressionEnabled: compressionEnabled.get(),
58
133
  overrideStyles: this.getLocationBasedColors().listOverrideStyles,
59
134
  accessibilityProvider: {
60
135
  getAriaLabel(r) {
61
136
  return r.provider.label;
62
137
  },
63
138
  getWidgetAriaLabel() {
64
- return localize(9490, "Source Control Repositories");
139
+ return localize(9729, "Source Control Repositories");
65
140
  }
66
141
  }
67
142
  });
68
- this._register(this.list);
69
- this._register(this.list.onDidChangeSelection(this.onListSelectionChange, this));
70
- this._register(this.list.onDidChangeFocus(this.onDidChangeFocus, this));
71
- this._register(this.list.onContextMenu(this.onListContextMenu, this));
72
- this._register(this.scmViewService.onDidChangeRepositories(this.onDidChangeRepositories, this));
73
- this._register(this.scmViewService.onDidChangeVisibleRepositories(this.updateListSelection, this));
74
- if (this.orientation === Orientation.VERTICAL) {
75
- this._register(this.configurationService.onDidChangeConfiguration(e => {
76
- if (e.affectsConfiguration('scm.repositories.visible')) {
77
- this.updateBodySize();
78
- }
79
- }));
80
- }
81
- this.onDidChangeRepositories();
82
- this.updateListSelection();
143
+ this._register(this.tree);
144
+ this._register(this.tree.onDidChangeSelection(this.onTreeSelectionChange, this));
145
+ this._register(this.tree.onDidChangeFocus(this.onTreeDidChangeFocus, this));
146
+ this._register(this.tree.onContextMenu(this.onTreeContextMenu, this));
83
147
  }
84
- onDidChangeRepositories() {
85
- this.list.splice(0, this.list.length, this.scmViewService.repositories);
86
- this.updateBodySize();
87
- }
88
- focus() {
89
- super.focus();
90
- this.list.domFocus();
91
- }
92
- layoutBody(height, width) {
93
- super.layoutBody(height, width);
94
- this.list.layout(height, width);
95
- }
96
- updateBodySize() {
97
- if (this.orientation === Orientation.HORIZONTAL) {
98
- return;
99
- }
100
- const visibleCount = this.configurationService.getValue('scm.repositories.visible');
101
- const empty = this.list.length === 0;
102
- const size = Math.min(this.list.length, visibleCount) * 22;
103
- this.minimumBodySize = visibleCount === 0 ? 22 : size;
104
- this.maximumBodySize = visibleCount === 0 ? Number.POSITIVE_INFINITY : empty ? Number.POSITIVE_INFINITY : size;
105
- }
106
- onListContextMenu(e) {
148
+ onTreeContextMenu(e) {
107
149
  if (!e.element) {
108
150
  return;
109
151
  }
@@ -111,54 +153,68 @@ let SCMRepositoriesViewPane = class SCMRepositoriesViewPane extends ViewPane {
111
153
  const menus = this.scmViewService.menus.getRepositoryMenus(provider);
112
154
  const menu = menus.repositoryContextMenu;
113
155
  const actions = collectContextMenuActions(menu);
156
+ const disposables = ( new DisposableStore());
114
157
  const actionRunner = ( new RepositoryActionRunner(() => {
115
- return this.list.getSelectedElements();
158
+ return this.tree.getSelection();
116
159
  }));
117
- actionRunner.onWillRun(() => this.list.domFocus());
160
+ disposables.add(actionRunner);
161
+ disposables.add(actionRunner.onWillRun(() => this.tree.domFocus()));
118
162
  this.contextMenuService.showContextMenu({
119
163
  actionRunner,
120
164
  getAnchor: () => e.anchor,
121
165
  getActions: () => actions,
122
166
  getActionsContext: () => provider,
123
- onHide: () => actionRunner.dispose()
167
+ onHide: () => disposables.dispose()
124
168
  });
125
169
  }
126
- onListSelectionChange(e) {
170
+ onTreeSelectionChange(e) {
127
171
  if (e.browserEvent && e.elements.length > 0) {
128
- const scrollTop = this.list.scrollTop;
172
+ const scrollTop = this.tree.scrollTop;
129
173
  this.scmViewService.visibleRepositories = e.elements;
130
- this.list.scrollTop = scrollTop;
174
+ this.tree.scrollTop = scrollTop;
131
175
  }
132
176
  }
133
- onDidChangeFocus(e) {
177
+ onTreeDidChangeFocus(e) {
134
178
  if (e.browserEvent && e.elements.length > 0) {
135
179
  this.scmViewService.focus(e.elements[0]);
136
180
  }
137
181
  }
138
- updateListSelection() {
139
- const oldSelection = this.list.getSelection();
140
- const oldSet = ( new Set(( Iterable.map(oldSelection, i => this.list.element(i)))));
182
+ async updateChildren() {
183
+ await this.tree.updateChildren(this.treeViewModel);
184
+ this.updateBodySize(this.visibleCountObs.get());
185
+ }
186
+ updateBodySize(visibleCount) {
187
+ if (this.orientation === Orientation.HORIZONTAL) {
188
+ return;
189
+ }
190
+ const empty = this.scmViewService.repositories.length === 0;
191
+ const size = Math.min(this.scmViewService.repositories.length, visibleCount) * 22;
192
+ this.minimumBodySize = visibleCount === 0 ? 22 : size;
193
+ this.maximumBodySize = visibleCount === 0 ? Number.POSITIVE_INFINITY : empty ? Number.POSITIVE_INFINITY : size;
194
+ }
195
+ updateTreeSelection() {
196
+ const oldSelection = this.tree.getSelection();
197
+ const oldSet = ( new Set(oldSelection));
141
198
  const set = ( new Set(this.scmViewService.visibleRepositories));
142
199
  const added = ( new Set(Iterable.filter(set, r => !( oldSet.has(r)))));
143
200
  const removed = ( new Set(Iterable.filter(oldSet, r => !( set.has(r)))));
144
201
  if (added.size === 0 && removed.size === 0) {
145
202
  return;
146
203
  }
147
- const selection = oldSelection
148
- .filter(i => !( removed.has(this.list.element(i))));
149
- for (let i = 0; i < this.list.length; i++) {
150
- if (( added.has(this.list.element(i)))) {
151
- selection.push(i);
204
+ const selection = oldSelection.filter(repo => !( removed.has(repo)));
205
+ for (const repo of this.scmViewService.repositories) {
206
+ if (( added.has(repo))) {
207
+ selection.push(repo);
152
208
  }
153
209
  }
154
- this.list.setSelection(selection);
155
- if (selection.length > 0 && selection.indexOf(this.list.getFocus()[0]) === -1) {
156
- this.list.setAnchor(selection[0]);
157
- this.list.setFocus([selection[0]]);
210
+ this.tree.setSelection(selection);
211
+ if (selection.length > 0 && !this.tree.getFocus().includes(selection[0])) {
212
+ this.tree.setAnchor(selection[0]);
213
+ this.tree.setFocus([selection[0]]);
158
214
  }
159
215
  }
160
216
  dispose() {
161
- this.disposables.dispose();
217
+ this.visibilityDisposables.dispose();
162
218
  super.dispose();
163
219
  }
164
220
  };
@@ -10,7 +10,7 @@ import { CountBadge } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/
10
10
  import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
11
11
  import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
12
12
  import { ActionRunner } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
13
- import { isSCMRepository, StatusBarAction, getRepositoryResourceCount, connectPrimaryMenu } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/scm/browser/util';
13
+ import { isSCMRepository, StatusBarAction, getRepositoryResourceCount, connectPrimaryMenu } from '@codingame/monaco-vscode-9ebd6daf-8734-5a28-ad24-b238f5e5819d-common/vscode/vs/workbench/contrib/scm/browser/util';
14
14
  import { defaultCountBadgeStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
15
15
  import { WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
16
16
  import { MenuItemAction, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
@@ -15,7 +15,7 @@ import { IMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/ac
15
15
  import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
16
16
  import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
17
17
  import { ITreeNode, ITreeSorter } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/tree/tree";
18
- import { IResourceNode } from "@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/base/common/resourceTree";
18
+ import { IResourceNode } from "@codingame/monaco-vscode-9ebd6daf-8734-5a28-ad24-b238f5e5819d-common/vscode/vs/base/common/resourceTree";
19
19
  import { ICompressibleTreeRenderer, ICompressibleKeyboardNavigationLabelProvider } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/tree/objectTree";
20
20
  import { FuzzyScore } from "@codingame/monaco-vscode-api/vscode/vs/base/common/filters";
21
21
  import { IViewDescriptorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service";