@codingame/monaco-vscode-scm-service-override 2.0.3 → 2.1.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.
@@ -1,4 +1,5 @@
1
1
  import { basename } from 'vscode/vscode/vs/base/common/path';
2
+ import { MenuItemAction } from 'vscode/vscode/vs/platform/actions/common/actions';
2
3
  import { Action } from 'vscode/vscode/vs/base/common/actions';
3
4
  import { createAndFillInActionBarActions, createAndFillInContextMenuActions, createActionViewItem } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
4
5
  import { equals } from 'vscode/vscode/vs/base/common/arrays';
@@ -32,7 +33,8 @@ function isSCMHistoryItemGroupTreeElement(element) {
32
33
  return element.type === 'historyItemGroup';
33
34
  }
34
35
  function isSCMHistoryItemTreeElement(element) {
35
- return element.type === 'historyItem';
36
+ return element.type === 'allChanges' ||
37
+ element.type === 'historyItem';
36
38
  }
37
39
  function isSCMHistoryItemChangeTreeElement(element) {
38
40
  return element.type === 'historyItemChange';
@@ -51,7 +53,12 @@ function toDiffEditorArguments(uri, originalUri, modifiedUri) {
51
53
  const modifiedShortRef = modifiedQuery.ref.substring(0, 8).concat(modifiedQuery.ref.endsWith('^') ? '^' : '');
52
54
  return [originalUri, modifiedUri, `${basename$1} (${originalShortRef}) ↔ ${basename$1} (${modifiedShortRef})`, null];
53
55
  }
54
- const compareActions = (a, b) => a.id === b.id && a.enabled === b.enabled;
56
+ const compareActions = (a, b) => {
57
+ if (a instanceof MenuItemAction && b instanceof MenuItemAction) {
58
+ return a.id === b.id && a.enabled === b.enabled && a.hideActions?.isHidden === b.hideActions?.isHidden;
59
+ }
60
+ return a.id === b.id && a.enabled === b.enabled;
61
+ };
55
62
  function connectPrimaryMenu(menu, callback, primaryGroup) {
56
63
  let cachedPrimary = [];
57
64
  let cachedSecondary = [];
@@ -103,7 +103,7 @@ class SCMInput {
103
103
  return;
104
104
  }
105
105
  if (!transient) {
106
- this.saveValue();
106
+ this.historyNavigator.add(this._value);
107
107
  this.historyNavigator.add(value);
108
108
  this.didChangeHistory = true;
109
109
  }
@@ -275,13 +275,10 @@ let SCMService = class SCMService {
275
275
  constructor(logService, workspaceContextService, contextKeyService, storageService) {
276
276
  this.logService = logService;
277
277
  this._repositories = ( new Map());
278
- this._inputValueProviders = ( new Map());
279
278
  this._onDidAddProvider = ( new Emitter());
280
279
  this.onDidAddRepository = this._onDidAddProvider.event;
281
280
  this._onDidRemoveProvider = ( new Emitter());
282
281
  this.onDidRemoveRepository = this._onDidRemoveProvider.event;
283
- this._onDidChangeInputValueProviders = ( new Emitter());
284
- this.onDidChangeInputValueProviders = this._onDidChangeInputValueProviders.event;
285
282
  this.inputHistory = ( new SCMInputHistory(storageService, workspaceContextService));
286
283
  this.providerCount = contextKeyService.createKey('scm.providerCount', 0);
287
284
  }
@@ -304,31 +301,6 @@ let SCMService = class SCMService {
304
301
  getRepository(id) {
305
302
  return this._repositories.get(id);
306
303
  }
307
- registerSCMInputValueProvider(sourceControlId, provider) {
308
- const providers = this._inputValueProviders.get(sourceControlId) ?? ( new Set());
309
- this._inputValueProviders.set(sourceControlId, providers.add(provider));
310
- this._onDidChangeInputValueProviders.fire();
311
- return toDisposable(() => {
312
- const providers = this._inputValueProviders.get(sourceControlId);
313
- providers.delete(provider);
314
- this._inputValueProviders.set(sourceControlId, providers);
315
- if (providers.size === 0) {
316
- this._inputValueProviders.delete(sourceControlId);
317
- }
318
- this._onDidChangeInputValueProviders.fire();
319
- });
320
- }
321
- getDefaultInputValueProvider(repository) {
322
- if (!repository.provider.rootUri) {
323
- return undefined;
324
- }
325
- const sourceControlId = repository.provider.contextValue;
326
- const providers = this._inputValueProviders.get(sourceControlId) ?? ( new Set());
327
- if (providers.size === 0) {
328
- return undefined;
329
- }
330
- return Iterable.first(providers);
331
- }
332
304
  };
333
305
  SCMService = ( __decorate([
334
306
  ( __param(0, ILogService)),