@codingame/monaco-vscode-scm-service-override 17.2.1 → 18.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/package.json +15 -13
  2. package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +10 -10
  3. package/vscode/src/vs/workbench/contrib/scm/browser/media/scm.css +33 -3
  4. package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +1 -1
  5. package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffDecorator.js +7 -7
  6. package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffModel.d.ts +6 -4
  7. package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffModel.js +53 -32
  8. package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffWidget.d.ts +4 -3
  9. package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffWidget.js +57 -52
  10. package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +89 -82
  11. package/vscode/src/vs/workbench/contrib/scm/browser/scmAccessibilityHelp.js +23 -23
  12. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryChatContext.d.ts +9 -0
  13. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryChatContext.js +185 -0
  14. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.d.ts +7 -5
  15. package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.js +414 -158
  16. package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.d.ts +1 -1
  17. package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +3 -3
  18. package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.d.ts +3 -3
  19. package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.js +3 -3
  20. package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.d.ts +5 -8
  21. package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +82 -45
  22. package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.d.ts +1 -1
  23. package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.js +1 -1
  24. package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js +6 -4
  25. package/vscode/src/vs/workbench/contrib/scm/browser/workingSet.js +3 -3
  26. package/vscode/src/vs/workbench/contrib/scm/common/scmService.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-scm-service-override",
3
- "version": "17.2.1",
3
+ "version": "18.0.1",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - scm service-override",
6
6
  "keywords": [],
@@ -15,18 +15,20 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-25a9b730-95ad-54d3-8807-71421ad9b891-common": "17.2.1",
19
- "@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common": "17.2.1",
20
- "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common": "17.2.1",
21
- "@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common": "17.2.1",
22
- "@codingame/monaco-vscode-api": "17.2.1",
23
- "@codingame/monaco-vscode-b4efa70b-52b9-5670-ab5c-f10b10b6834e-common": "17.2.1",
24
- "@codingame/monaco-vscode-bb83fe45-f4c7-5673-b9f1-5c409a63f19c-common": "17.2.1",
25
- "@codingame/monaco-vscode-be8ddbb5-094a-5657-b1cc-fe106c94c632-common": "17.2.1",
26
- "@codingame/monaco-vscode-e67a0dae-5b2c-54e6-8d61-90102c78362d-common": "17.2.1",
27
- "@codingame/monaco-vscode-f48982c4-9e82-55e2-b800-20e6d1e6096f-common": "17.2.1",
28
- "@codingame/monaco-vscode-f99b74f5-fcb7-512f-8c6c-35f5a107577d-common": "17.2.1",
29
- "@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common": "17.2.1"
18
+ "@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common": "18.0.1",
19
+ "@codingame/monaco-vscode-3a35f433-1297-5707-ab58-c261b8180e6d-common": "18.0.1",
20
+ "@codingame/monaco-vscode-501b06ab-3f58-516b-8a1a-c29d375d3da4-common": "18.0.1",
21
+ "@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common": "18.0.1",
22
+ "@codingame/monaco-vscode-8d39d04c-3201-5bd6-be79-eed8d17a5ad0-common": "18.0.1",
23
+ "@codingame/monaco-vscode-924e8f00-6faf-5059-b518-e43427d29ab3-common": "18.0.1",
24
+ "@codingame/monaco-vscode-937ecbdf-94c7-5b16-aefa-ad78ae557a93-common": "18.0.1",
25
+ "@codingame/monaco-vscode-a8d3bd74-e63e-5327-96e8-4f931661e329-common": "18.0.1",
26
+ "@codingame/monaco-vscode-api": "18.0.1",
27
+ "@codingame/monaco-vscode-f24b7f0a-ceeb-5877-9148-81eb98a4f5d7-common": "18.0.1",
28
+ "@codingame/monaco-vscode-f338ac19-278c-5fe1-bec8-b588de04a788-common": "18.0.1",
29
+ "@codingame/monaco-vscode-f48982c4-9e82-55e2-b800-20e6d1e6096f-common": "18.0.1",
30
+ "@codingame/monaco-vscode-f99b74f5-fcb7-512f-8c6c-35f5a107577d-common": "18.0.1",
31
+ "@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common": "18.0.1"
30
32
  },
31
33
  "main": "index.js",
32
34
  "module": "index.js",
@@ -6,7 +6,7 @@ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/l
6
6
  import { Event, Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
7
7
  import { VIEW_PANE_ID } from '@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common/vscode/vs/workbench/contrib/scm/common/scm';
8
8
  import { ISCMService, ISCMViewService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
9
- import { NumberBadge } from '@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common/vscode/vs/workbench/services/activity/common/activity';
9
+ import { NumberBadge } from '@codingame/monaco-vscode-937ecbdf-94c7-5b16-aefa-ad78ae557a93-common/vscode/vs/workbench/services/activity/common/activity';
10
10
  import { IActivityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/activity/common/activity.service';
11
11
  import { RawContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
12
12
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
@@ -18,12 +18,12 @@ import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/plat
18
18
  import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
19
19
  import { ITitleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/title/browser/titleService.service';
20
20
  import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
21
- import { getRepositoryResourceCount } from '@codingame/monaco-vscode-be8ddbb5-094a-5657-b1cc-fe106c94c632-common/vscode/vs/workbench/contrib/scm/browser/util';
21
+ import { getRepositoryResourceCount } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/scm/browser/util';
22
22
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
23
23
  import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
24
- import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
25
- import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
26
- import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
24
+ import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
25
+ import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
26
+ import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
27
27
 
28
28
  const ActiveRepositoryContextKeys = {
29
29
  ActiveRepositoryName: ( new RawContextKey('scmActiveRepositoryName', '')),
@@ -104,7 +104,7 @@ let SCMActiveRepositoryController = class SCMActiveRepositoryController extends
104
104
  if (count === 0) {
105
105
  return;
106
106
  }
107
- const badge = ( new NumberBadge(count, num => ( localize(9071, '{0} pending changes', num))));
107
+ const badge = ( new NumberBadge(count, num => ( localize(9308, '{0} pending changes', num))));
108
108
  store.add(this.activityService.showViewActivity(VIEW_PANE_ID, { badge }));
109
109
  }
110
110
  _updateStatusBar(repository, commands, store) {
@@ -130,7 +130,7 @@ let SCMActiveRepositoryController = class SCMActiveRepositoryController extends
130
130
  repoAgnosticActionName = '';
131
131
  }
132
132
  const statusbarEntry = {
133
- name: ( localize(9072, "Source Control")) + (repoAgnosticActionName ? ` ${repoAgnosticActionName}` : ''),
133
+ name: ( localize(9309, "Source Control")) + (repoAgnosticActionName ? ` ${repoAgnosticActionName}` : ''),
134
134
  text: command.title,
135
135
  ariaLabel: tooltip,
136
136
  tooltip,
@@ -142,7 +142,7 @@ let SCMActiveRepositoryController = class SCMActiveRepositoryController extends
142
142
  }
143
143
  if (this.scmService.repositoryCount > 1) {
144
144
  const repositoryStatusbarEntry = {
145
- name: ( localize(9073, "Source Control Provider")),
145
+ name: ( localize(9310, "Source Control Provider")),
146
146
  text: `$(repo) ${repository.provider.name}`,
147
147
  ariaLabel: label,
148
148
  tooltip: label,
@@ -171,8 +171,8 @@ let SCMActiveResourceContextKeyController = class SCMActiveResourceContextKeyCon
171
171
  this.scmService = scmService;
172
172
  this.uriIdentityService = uriIdentityService;
173
173
  this._onDidRepositoryChange = ( new Emitter());
174
- const activeResourceHasChangesContextKey = ( new RawContextKey('scmActiveResourceHasChanges', false, ( localize(9074, "Whether the active resource has changes"))));
175
- const activeResourceRepositoryContextKey = ( new RawContextKey('scmActiveResourceRepository', undefined, ( localize(9075, "The active resource's repository"))));
174
+ const activeResourceHasChangesContextKey = ( new RawContextKey('scmActiveResourceHasChanges', false, ( localize(9311, "Whether the active resource has changes"))));
175
+ const activeResourceRepositoryContextKey = ( new RawContextKey('scmActiveResourceRepository', undefined, ( localize(9312, "The active resource's repository"))));
176
176
  this._repositories = observableFromEvent(this, Event.any(this.scmService.onDidAddRepository, this.scmService.onDidRemoveRepository), () => this.scmService.repositories);
177
177
  this._store.add(autorunWithStore((reader, store) => {
178
178
  for (const repository of this._repositories.read(reader)) {
@@ -101,6 +101,9 @@
101
101
  display: flex;
102
102
  align-items: center;
103
103
  }
104
+ .scm-view .monaco-list-row .monaco-tl-twistie:not(.collapsed) + .monaco-tl-contents > .history-item > .graph-container > svg > path:last-of-type {
105
+ stroke-width: 3px;
106
+ }
104
107
  .scm-view .monaco-list-row .history-item > .graph-container {
105
108
  display: flex;
106
109
  flex-shrink: 0;
@@ -121,6 +124,7 @@
121
124
  .scm-view .monaco-list-row .history-item > .label-container {
122
125
  display: flex;
123
126
  flex-shrink: 0;
127
+ margin-left: 4px;
124
128
  gap: 4px;
125
129
  }
126
130
  .scm-view .monaco-list-row .history-item > .label-container > .label {
@@ -165,6 +169,9 @@
165
169
  .scm-view .monaco-list-row .history-item .monaco-icon-label.history-item-current .label-description {
166
170
  font-weight: 500;
167
171
  }
172
+ .scm-view .monaco-list-row .history-item > .actions {
173
+ margin-left: 4px;
174
+ }
168
175
  .scm-view .monaco-list-row .history > .name,
169
176
  .scm-view .monaco-list-row .resource-group > .name {
170
177
  flex: 1;
@@ -182,7 +189,8 @@
182
189
  flex: 1;
183
190
  overflow: hidden;
184
191
  }
185
- .scm-view .monaco-list-row .resource > .name > .monaco-icon-label::after {
192
+ .scm-view .monaco-list-row .resource > .name > .monaco-icon-label::after,
193
+ .scm-view .monaco-list-row .history-item-change > .label-container > .monaco-icon-label::after {
186
194
  margin-right: 3px;
187
195
  }
188
196
  .scm-view .monaco-list-row .resource > .decoration-icon {
@@ -201,7 +209,8 @@
201
209
  }
202
210
  .scm-view .monaco-list .monaco-list-row .resource-group > .actions,
203
211
  .scm-view .monaco-list .monaco-list-row .resource > .name > .monaco-icon-label > .actions,
204
- .scm-view .monaco-list .monaco-list-row .history-item > .actions {
212
+ .scm-view .monaco-list .monaco-list-row .history-item > .actions,
213
+ .scm-view .monaco-list .monaco-list-row .history-item-change > .label-container > .monaco-icon-label > .actions {
205
214
  display: none;
206
215
  max-width: fit-content;
207
216
  }
@@ -211,7 +220,9 @@
211
220
  .scm-view .monaco-list .monaco-list-row.focused .resource > .name > .monaco-icon-label > .actions,
212
221
  .scm-view .monaco-list:not(.selection-multiple) .monaco-list-row .resource:hover > .actions,
213
222
  .scm-view .monaco-list .monaco-list-row:hover .history-item > .actions,
214
- .scm-view .monaco-list .monaco-list-row.focused .history-item > .actions {
223
+ .scm-view .monaco-list .monaco-list-row.focused .history-item > .actions,
224
+ .scm-view .monaco-list .monaco-list-row:hover .history-item-change > .label-container > .monaco-icon-label > .actions,
225
+ .scm-view .monaco-list .monaco-list-row.focused .history-item-change > .label-container > .monaco-icon-label > .actions {
215
226
  display: block;
216
227
  }
217
228
  .scm-view .monaco-list .monaco-list-row.force-no-hover,
@@ -473,6 +484,9 @@
473
484
  overflow: hidden;
474
485
  text-overflow: ellipsis;
475
486
  }
487
+ .scm-history-view .monaco-list-row > .monaco-tl-row > .monaco-tl-twistie.force-no-twistie {
488
+ display: none !important;
489
+ }
476
490
  .scm-history-view .scm-provider .label-name {
477
491
  font-weight: bold;
478
492
  }
@@ -491,6 +505,22 @@
491
505
  display: flex;
492
506
  flex-grow: 1;
493
507
  }
508
+ .scm-view .monaco-list-row .history-item-change {
509
+ display: flex;
510
+ align-items: center;
511
+ }
512
+ .scm-view .monaco-list-row .history-item-change > .graph-placeholder {
513
+ position: absolute;
514
+ height: 22px;
515
+ }
516
+ .scm-view .monaco-list-row .history-item-change > .label-container {
517
+ display: flex;
518
+ flex: 1;
519
+ overflow: hidden;
520
+ }
521
+ .scm-view .monaco-list-row .history-item-change > .label-container > .monaco-icon-label {
522
+ flex-grow: 1;
523
+ }
494
524
  .scm-history-view .history-item-load-more {
495
525
  display: flex;
496
526
  height: 22px;
@@ -233,7 +233,7 @@ SCMMenus = ( __decorate([
233
233
  ( __param(1, IInstantiationService))
234
234
  ], SCMMenus));
235
235
  MenuRegistry.appendMenuItem(MenuId.SCMResourceContext, {
236
- title: ( localize(9076, "Share")),
236
+ title: ( localize(9313, "Share")),
237
237
  submenu: MenuId.SCMResourceContextShare,
238
238
  group: '45_share',
239
239
  order: 3,
@@ -12,7 +12,7 @@ import { isCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/brow
12
12
  import { OverviewRulerLane, MinimapPosition } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
13
13
  import { createStyleSheet } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/domStylesheets';
14
14
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
15
- import { minimapGutterAddedBackground, overviewRulerAddedForeground, minimapGutterModifiedBackground, overviewRulerModifiedForeground, minimapGutterDeletedBackground, overviewRulerDeletedForeground, getChangeType, ChangeType } from '@codingame/monaco-vscode-bb83fe45-f4c7-5673-b9f1-5c409a63f19c-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
15
+ import { minimapGutterAddedBackground, overviewRulerAddedForeground, minimapGutterModifiedBackground, overviewRulerModifiedForeground, minimapGutterDeletedBackground, overviewRulerDeletedForeground, getChangeType, ChangeType } from '@codingame/monaco-vscode-f338ac19-278c-5fe1-bec8-b588de04a788-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
16
16
  import { IQuickDiffService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff.service';
17
17
  import { IQuickDiffModelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/browser/quickDiffModel.service';
18
18
  import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
@@ -21,8 +21,8 @@ import { RawContextKey, ContextKeyTrueExpr, ContextKeyFalseExpr } from '@codinga
21
21
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
22
22
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
23
23
  import { registerAction2, Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
24
- import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
25
- import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
24
+ import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
25
+ import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
26
26
 
27
27
  var QuickDiffDecorator_1;
28
28
  registerCss(dirtydiffDecorator);
@@ -61,7 +61,7 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
61
61
  const gutter = decorations === 'all' || decorations === 'gutter';
62
62
  const overview = decorations === 'all' || decorations === 'overview';
63
63
  const minimap = decorations === 'all' || decorations === 'minimap';
64
- const diffAdded = ( localize(9077, 'Added lines'));
64
+ const diffAdded = ( localize(9314, 'Added lines'));
65
65
  const diffAddedOptions = {
66
66
  gutter,
67
67
  overview: { active: overview, color: overviewRulerAddedForeground },
@@ -72,7 +72,7 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
72
72
  this.addedPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added primary pattern', diffAdded, diffAddedOptions);
73
73
  this.addedSecondaryOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added secondary', diffAdded, diffAddedOptions);
74
74
  this.addedSecondaryPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added secondary pattern', diffAdded, diffAddedOptions);
75
- const diffModified = ( localize(9078, 'Changed lines'));
75
+ const diffModified = ( localize(9315, 'Changed lines'));
76
76
  const diffModifiedOptions = {
77
77
  gutter,
78
78
  overview: { active: overview, color: overviewRulerModifiedForeground },
@@ -83,7 +83,7 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
83
83
  this.modifiedPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified primary pattern', diffModified, diffModifiedOptions);
84
84
  this.modifiedSecondaryOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified secondary', diffModified, diffModifiedOptions);
85
85
  this.modifiedSecondaryPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified secondary pattern', diffModified, diffModifiedOptions);
86
- const diffDeleted = ( localize(9079, 'Removed lines'));
86
+ const diffDeleted = ( localize(9316, 'Removed lines'));
87
87
  const diffDeletedOptions = {
88
88
  gutter,
89
89
  overview: { active: overview, color: overviewRulerDeletedForeground },
@@ -113,7 +113,7 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
113
113
  if (!quickDiff || !this.quickDiffService.isQuickDiffProviderVisible(quickDiff.id)) {
114
114
  continue;
115
115
  }
116
- if (quickDiff.kind !== 'primary' && ( primaryQuickDiffChanges.some(c => c.change2.modified.overlapOrTouch(change.change2.modified)))) {
116
+ if (quickDiff.kind !== 'primary' && ( primaryQuickDiffChanges.some(c => c.change2.modified.intersectsOrTouches(change.change2.modified)))) {
117
117
  continue;
118
118
  }
119
119
  const changeType = getChangeType(change.change);
@@ -8,7 +8,7 @@ import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/plat
8
8
  import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
9
9
  import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
10
10
  import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
11
- import { QuickDiff, QuickDiffChange, QuickDiffResult } from "@codingame/monaco-vscode-bb83fe45-f4c7-5673-b9f1-5c409a63f19c-common/vscode/vs/workbench/contrib/scm/common/quickDiff";
11
+ import { QuickDiff, QuickDiffChange, QuickDiffResult } from "@codingame/monaco-vscode-f338ac19-278c-5fe1-bec8-b588de04a788-common/vscode/vs/workbench/contrib/scm/common/quickDiff";
12
12
  import { IQuickDiffService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff.service";
13
13
  import { ISCMService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service";
14
14
  import { ISplice } from "@codingame/monaco-vscode-api/vscode/vs/base/common/sequence";
@@ -40,7 +40,7 @@ export declare class QuickDiffModel extends Disposable {
40
40
  private readonly textModelResolverService;
41
41
  private readonly _chatEditingService;
42
42
  private readonly progressService;
43
- private _model;
43
+ private readonly _model;
44
44
  private readonly _originalEditorModels;
45
45
  private readonly _originalEditorModelsDisposables;
46
46
  get originalTextModels(): Iterable<ITextModel>;
@@ -53,6 +53,8 @@ export declare class QuickDiffModel extends Disposable {
53
53
  changes: QuickDiffChange[];
54
54
  diff: ISplice<QuickDiffChange>[];
55
55
  }>;
56
+ private _allChanges;
57
+ get allChanges(): QuickDiffChange[];
56
58
  private _changes;
57
59
  get changes(): QuickDiffChange[];
58
60
  private _quickDiffChanges;
@@ -69,7 +71,7 @@ export declare class QuickDiffModel extends Disposable {
69
71
  private _diff;
70
72
  private getQuickDiffsPromise;
71
73
  private getOriginalResource;
72
- findNextClosestChange(lineNumber: number, inclusive?: boolean, provider?: string): number;
73
- findPreviousClosestChange(lineNumber: number, inclusive?: boolean, provider?: string): number;
74
+ findNextClosestChange(lineNumber: number, inclusive?: boolean, providerId?: string): number;
75
+ findPreviousClosestChange(lineNumber: number, inclusive?: boolean, providerId?: string): number;
74
76
  dispose(): void;
75
77
  }
@@ -9,7 +9,7 @@ import { IEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/edi
9
9
  import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
10
10
  import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
11
11
  import { shouldSynchronizeModel } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
12
- import { compareChanges, getModifiedEndLineNumber } from '@codingame/monaco-vscode-bb83fe45-f4c7-5673-b9f1-5c409a63f19c-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
12
+ import { compareChanges, getModifiedEndLineNumber } from '@codingame/monaco-vscode-f338ac19-278c-5fe1-bec8-b588de04a788-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
13
13
  import { IQuickDiffService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff.service';
14
14
  import { ThrottledDelayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
15
15
  import { ISCMService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
@@ -25,10 +25,10 @@ import { ModifiedFileEntryState } from '@codingame/monaco-vscode-api/vscode/vs/w
25
25
  import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
26
26
  import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
27
27
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
28
- import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
28
+ import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
29
29
 
30
30
  const decoratorQuickDiffModelOptions = {
31
- algorithm: 'legacy',
31
+ algorithm: 'advanced',
32
32
  maxComputationTimeMs: 1000
33
33
  };
34
34
  let QuickDiffModelReferenceCollection = class QuickDiffModelReferenceCollection extends ReferenceCollection {
@@ -71,6 +71,7 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
71
71
  get originalTextModels() {
72
72
  return ( Iterable.map(( this._originalEditorModels.values()), editorModel => editorModel.textEditorModel));
73
73
  }
74
+ get allChanges() { return this._allChanges; }
74
75
  get changes() { return this._changes; }
75
76
  get quickDiffChanges() { return this._quickDiffChanges; }
76
77
  constructor(textFileModel, options, scmService, quickDiffService, editorWorkerService, configurationService, textModelResolverService, _chatEditingService, progressService) {
@@ -90,6 +91,7 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
90
91
  this._diffDelayer = ( new ThrottledDelayer(200));
91
92
  this._onDidChange = ( new Emitter());
92
93
  this.onDidChange = this._onDidChange.event;
94
+ this._allChanges = [];
93
95
  this._changes = [];
94
96
  this._quickDiffChanges = ( new Map());
95
97
  this._repositoryDisposables = ( new DisposableMap());
@@ -105,7 +107,7 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
105
107
  this._quickDiffs = [];
106
108
  this._originalEditorModels.clear();
107
109
  this._quickDiffsPromise = undefined;
108
- this.setChanges([], ( new Map()));
110
+ this.setChanges([], [], ( new Map()));
109
111
  this.triggerDiff();
110
112
  }));
111
113
  this._register(this.quickDiffService.onDidChangeQuickDiffProviders(() => this.triggerDiff()));
@@ -126,7 +128,7 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
126
128
  }
127
129
  getQuickDiffResults() {
128
130
  return ( this._quickDiffs.map(quickDiff => {
129
- const changes = this.changes
131
+ const changes = this.allChanges
130
132
  .filter(change => change.providerId === quickDiff.id);
131
133
  return {
132
134
  original: quickDiff.originalResource,
@@ -163,12 +165,13 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
163
165
  if (!result || this._disposed || this._model.isDisposed() || ( editorModels.some(editorModel => editorModel.isDisposed()))) {
164
166
  return;
165
167
  }
166
- this.setChanges(result.changes, result.mapChanges);
168
+ this.setChanges(result.allChanges, result.changes, result.mapChanges);
167
169
  })
168
170
  .catch(err => onUnexpectedError(err));
169
171
  }
170
- setChanges(changes, mapChanges) {
172
+ setChanges(allChanges, changes, mapChanges) {
171
173
  const diff = sortedDiff(this.changes, changes, (a, b) => compareChanges(a.change, b.change));
174
+ this._allChanges = allChanges;
172
175
  this._changes = changes;
173
176
  this._quickDiffChanges = mapChanges;
174
177
  this._onDidChange.fire({ changes, diff });
@@ -177,26 +180,27 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
177
180
  return this.progressService.withProgress({ location: ProgressLocation.Scm, delay: 250 }, async () => {
178
181
  const originalURIs = await this.getQuickDiffsPromise();
179
182
  if (this._disposed || this._model.isDisposed() || (originalURIs.length === 0)) {
180
- return Promise.resolve({ changes: [], mapChanges: ( new Map()) });
183
+ return Promise.resolve({ allChanges: [], changes: [], mapChanges: ( new Map()) });
181
184
  }
182
185
  const quickDiffs = originalURIs
183
186
  .filter(quickDiff => this.editorWorkerService.canComputeDirtyDiff(quickDiff.originalResource, this._model.resource));
184
187
  if (quickDiffs.length === 0) {
185
- return Promise.resolve({ changes: [], mapChanges: ( new Map()) });
188
+ return Promise.resolve({ allChanges: [], changes: [], mapChanges: ( new Map()) });
186
189
  }
187
190
  const quickDiffPrimary = quickDiffs.find(quickDiff => quickDiff.kind === 'primary');
188
191
  const ignoreTrimWhitespaceSetting = this.configurationService.getValue('scm.diffDecorationsIgnoreTrimWhitespace');
189
192
  const ignoreTrimWhitespace = ignoreTrimWhitespaceSetting === 'inherit'
190
193
  ? this.configurationService.getValue('diffEditor.ignoreTrimWhitespace')
191
194
  : ignoreTrimWhitespaceSetting !== 'false';
192
- const allDiffs = [];
195
+ const diffs = [];
196
+ const secondaryDiffs = [];
193
197
  for (const quickDiff of quickDiffs) {
194
198
  const diff = await this._diff(quickDiff.originalResource, this._model.resource, ignoreTrimWhitespace);
195
199
  if (diff.changes && diff.changes2 && diff.changes.length === diff.changes2.length) {
196
200
  for (let index = 0; index < diff.changes.length; index++) {
197
201
  const change2 = diff.changes2[index];
198
202
  if (quickDiffPrimary && quickDiff.kind === 'secondary') {
199
- const primaryQuickDiffChange = allDiffs
203
+ const primaryQuickDiffChange = diffs
200
204
  .find(d => d.change2.modified.equals(change2.modified) &&
201
205
  d.change2.original.length === change2.original.length);
202
206
  if (primaryQuickDiffChange) {
@@ -205,13 +209,19 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
205
209
  const secondaryModel = this._originalEditorModels.get(quickDiff.originalResource)?.textEditorModel;
206
210
  const secondaryContent = secondaryModel?.getValueInRange(change2.toRangeMapping().originalRange);
207
211
  if (primaryContent === secondaryContent) {
212
+ secondaryDiffs.push({
213
+ providerId: quickDiff.id,
214
+ original: quickDiff.originalResource,
215
+ modified: this._model.resource,
216
+ change: diff.changes[index],
217
+ change2: diff.changes2[index]
218
+ });
208
219
  continue;
209
220
  }
210
221
  }
211
222
  }
212
- allDiffs.push({
223
+ diffs.push({
213
224
  providerId: quickDiff.id,
214
- label: quickDiff.label,
215
225
  original: quickDiff.originalResource,
216
226
  modified: this._model.resource,
217
227
  change: diff.changes[index],
@@ -220,16 +230,17 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
220
230
  }
221
231
  }
222
232
  }
223
- const sorted = allDiffs.sort((a, b) => compareChanges(a.change, b.change));
233
+ const diffsSorted = diffs.sort((a, b) => compareChanges(a.change, b.change));
234
+ const allDiffsSorted = [...diffs, ...secondaryDiffs].sort((a, b) => compareChanges(a.change, b.change));
224
235
  const map = ( new Map());
225
- for (let i = 0; i < sorted.length; i++) {
226
- const label = sorted[i].label;
227
- if (!( map.has(label))) {
228
- map.set(label, []);
236
+ for (let i = 0; i < diffsSorted.length; i++) {
237
+ const providerId = diffsSorted[i].providerId;
238
+ if (!( map.has(providerId))) {
239
+ map.set(providerId, []);
229
240
  }
230
- map.get(label).push(i);
241
+ map.get(providerId).push(i);
231
242
  }
232
- return { changes: sorted, mapChanges: map };
243
+ return { allChanges: allDiffsSorted, changes: diffsSorted, mapChanges: map };
233
244
  });
234
245
  }
235
246
  async _diff(original, modified, ignoreTrimWhitespace) {
@@ -302,16 +313,21 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
302
313
  const isSynchronized = this._model.textEditorModel ? shouldSynchronizeModel(this._model.textEditorModel) : undefined;
303
314
  return this.quickDiffService.getQuickDiffs(uri, this._model.getLanguageId(), isSynchronized);
304
315
  }
305
- findNextClosestChange(lineNumber, inclusive = true, provider) {
306
- const visibleQuickDiffLabels = ( this.quickDiffs
307
- .filter(quickDiff => (!provider || quickDiff.label === provider) &&
316
+ findNextClosestChange(lineNumber, inclusive = true, providerId) {
317
+ const visibleQuickDiffIds = ( this.quickDiffs
318
+ .filter(quickDiff => (!providerId || quickDiff.id === providerId) &&
308
319
  this.quickDiffService.isQuickDiffProviderVisible(quickDiff.id))
309
- .map(quickDiff => quickDiff.label));
320
+ .map(quickDiff => quickDiff.id));
310
321
  if (!inclusive) {
311
- const nextChange = this.changes
312
- .findIndex(change => visibleQuickDiffLabels.includes(change.label) &&
322
+ let nextChangeIndex = this.changes
323
+ .findIndex(change => visibleQuickDiffIds.includes(change.providerId) &&
313
324
  change.change.modifiedStartLineNumber > lineNumber);
314
- return nextChange !== -1 ? nextChange : 0;
325
+ if (nextChangeIndex !== -1) {
326
+ return nextChangeIndex;
327
+ }
328
+ nextChangeIndex = this.changes
329
+ .findIndex(change => visibleQuickDiffIds.includes(change.providerId));
330
+ return nextChangeIndex !== -1 ? nextChangeIndex : 0;
315
331
  }
316
332
  const primaryQuickDiffId = this.quickDiffs
317
333
  .find(quickDiff => quickDiff.kind === 'primary')?.id;
@@ -322,15 +338,20 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
322
338
  if (primaryInclusiveChangeIndex !== -1) {
323
339
  return primaryInclusiveChangeIndex;
324
340
  }
325
- const inclusiveChangeIndex = this.changes
326
- .findIndex(change => visibleQuickDiffLabels.includes(change.label) &&
341
+ let nextChangeIndex = this.changes
342
+ .findIndex(change => visibleQuickDiffIds.includes(change.providerId) &&
327
343
  change.change.modifiedStartLineNumber <= lineNumber &&
328
344
  getModifiedEndLineNumber(change.change) >= lineNumber);
329
- return inclusiveChangeIndex !== -1 ? inclusiveChangeIndex : 0;
345
+ if (nextChangeIndex !== -1) {
346
+ return nextChangeIndex;
347
+ }
348
+ nextChangeIndex = this.changes
349
+ .findIndex(change => visibleQuickDiffIds.includes(change.providerId));
350
+ return nextChangeIndex !== -1 ? nextChangeIndex : 0;
330
351
  }
331
- findPreviousClosestChange(lineNumber, inclusive = true, provider) {
352
+ findPreviousClosestChange(lineNumber, inclusive = true, providerId) {
332
353
  for (let i = this.changes.length - 1; i >= 0; i--) {
333
- if (provider && this.changes[i].label !== provider) {
354
+ if (providerId && this.changes[i].providerId !== providerId) {
334
355
  continue;
335
356
  }
336
357
  const quickDiff = this.quickDiffs.find(quickDiff => quickDiff.id === this.changes[i].providerId);
@@ -12,14 +12,15 @@ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/l
12
12
  import { RawContextKey } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey";
13
13
  import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
14
14
  import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
15
+ import { QuickDiff } from "@codingame/monaco-vscode-f338ac19-278c-5fe1-bec8-b588de04a788-common/vscode/vs/workbench/contrib/scm/common/quickDiff";
15
16
  export declare const isQuickDiffVisible: RawContextKey<boolean>;
16
17
  export interface IQuickDiffSelectItem extends ISelectOptionItem {
17
- provider: string;
18
+ providerId: string;
18
19
  }
19
20
  export declare class QuickDiffPickerViewItem extends SelectActionViewItem<IQuickDiffSelectItem> {
20
21
  private optionsItems;
21
- constructor(action: IAction, contextViewService: IContextViewService, themeService: IThemeService);
22
- setSelection(providers: string[], provider: string): void;
22
+ constructor(action: IAction, contextViewService: IContextViewService, themeService: IThemeService, configurationService: IConfigurationService);
23
+ setSelection(quickDiffs: QuickDiff[], providerId: string): void;
23
24
  protected getActionContext(_: string, index: number): IQuickDiffSelectItem;
24
25
  render(container: HTMLElement): void;
25
26
  }