@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
@@ -35,7 +35,7 @@ import { RawContextKey, ContextKeyExpr } from '@codingame/monaco-vscode-api/vsco
35
35
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
36
36
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
37
37
  import { rot } from '@codingame/monaco-vscode-api/vscode/vs/base/common/numbers';
38
- import { getModifiedEndLineNumber, getChangeHeight, getChangeType, getChangeTypeColor, lineIntersectsChange, ChangeType } from '@codingame/monaco-vscode-bb83fe45-f4c7-5673-b9f1-5c409a63f19c-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
38
+ import { getModifiedEndLineNumber, getChangeHeight, getChangeType, getChangeTypeColor, lineIntersectsChange, ChangeType } from '@codingame/monaco-vscode-f338ac19-278c-5fe1-bec8-b588de04a788-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
39
39
  import { IQuickDiffService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff.service';
40
40
  import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service';
41
41
  import { TextCompareEditorActiveContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
@@ -56,23 +56,24 @@ import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color'
56
56
  import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
57
57
  import { getOuterEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget';
58
58
  import { quickDiffDecorationCount } from './quickDiffDecorator.js';
59
+ import { hasNativeContextMenu } from '@codingame/monaco-vscode-api/vscode/vs/platform/window/common/window';
59
60
 
60
61
  var QuickDiffEditorController_1;
61
62
  const isQuickDiffVisible = ( new RawContextKey('dirtyDiffVisible', false));
62
63
  let QuickDiffPickerViewItem = class QuickDiffPickerViewItem extends SelectActionViewItem {
63
- constructor(action, contextViewService, themeService) {
64
+ constructor(action, contextViewService, themeService, configurationService) {
64
65
  const styles = { ...defaultSelectBoxStyles };
65
66
  const theme = themeService.getColorTheme();
66
67
  const editorBackgroundColor = theme.getColor(editorBackground);
67
68
  const peekTitleColor = theme.getColor(peekViewTitleBackground);
68
69
  const opaqueTitleColor = peekTitleColor?.makeOpaque(editorBackgroundColor) ?? editorBackgroundColor;
69
70
  styles.selectBackground = ( ( opaqueTitleColor.lighten(.6)).toString());
70
- super(null, action, [], 0, contextViewService, styles, { ariaLabel: ( localize(9080, 'Switch quick diff base')) });
71
+ super(null, action, [], 0, contextViewService, styles, { ariaLabel: ( localize(9317, 'Switch quick diff base')), useCustomDrawn: !hasNativeContextMenu(configurationService) });
71
72
  this.optionsItems = [];
72
73
  }
73
- setSelection(providers, provider) {
74
- this.optionsItems = ( providers.map(provider => ({ provider, text: provider })));
75
- const index = this.optionsItems.findIndex(item => item.provider === provider);
74
+ setSelection(quickDiffs, providerId) {
75
+ this.optionsItems = ( quickDiffs.map(quickDiff => ({ providerId: quickDiff.id, text: quickDiff.label })));
76
+ const index = this.optionsItems.findIndex(item => item.providerId === providerId);
76
77
  this.setOptions(this.optionsItems, index);
77
78
  }
78
79
  getActionContext(_, index) {
@@ -85,11 +86,12 @@ let QuickDiffPickerViewItem = class QuickDiffPickerViewItem extends SelectAction
85
86
  };
86
87
  QuickDiffPickerViewItem = ( __decorate([
87
88
  ( __param(1, IContextViewService)),
88
- ( __param(2, IThemeService))
89
+ ( __param(2, IThemeService)),
90
+ ( __param(3, IConfigurationService))
89
91
  ], QuickDiffPickerViewItem));
90
92
  class QuickDiffPickerBaseAction extends Action {
91
93
  static { this.ID = 'quickDiff.base.switch'; }
92
- static { this.LABEL = ( localize(9081, "Switch Quick Diff Base")); }
94
+ static { this.LABEL = ( localize(9318, "Switch Quick Diff Base")); }
93
95
  constructor(callback) {
94
96
  super(QuickDiffPickerBaseAction.ID, QuickDiffPickerBaseAction.LABEL, undefined, undefined);
95
97
  this.callback = callback;
@@ -132,7 +134,7 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
132
134
  this.contextKeyService = contextKeyService;
133
135
  this.quickDiffService = quickDiffService;
134
136
  this._index = 0;
135
- this._provider = '';
137
+ this._providerId = '';
136
138
  this.height = undefined;
137
139
  this._disposables.add(themeService.onDidColorThemeChange(this._applyTheme, this));
138
140
  this._applyTheme(themeService.getColorTheme());
@@ -151,8 +153,8 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
151
153
  }
152
154
  this.setTitle(this.title);
153
155
  }
154
- get provider() {
155
- return this._provider;
156
+ get providerId() {
157
+ return this._providerId;
156
158
  }
157
159
  get index() {
158
160
  return this._index;
@@ -168,8 +170,8 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
168
170
  this.contextKeyService.createKey('originalResource', ( this.model.changes[index].original.toString()));
169
171
  this.contextKeyService.createKey('originalResourceScheme', this.model.changes[index].original.scheme);
170
172
  this.updateActions();
171
- this._provider = labeledChange.label;
172
173
  this.change = change;
174
+ this._providerId = labeledChange.providerId;
173
175
  if (Iterable.isEmpty(this.model.originalTextModels)) {
174
176
  return;
175
177
  }
@@ -184,16 +186,16 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
184
186
  const lineHeight = this.editor.getOption(EditorOption.lineHeight);
185
187
  const editorHeight = this.editor.getLayoutInfo().height;
186
188
  const editorHeightInLines = Math.floor(editorHeight / lineHeight);
187
- const height = Math.min(getChangeHeight(change) + 8, Math.floor(editorHeightInLines / 3));
188
- this.updateDropdown(labeledChange.label);
189
- this.renderTitle(labeledChange.label);
189
+ const height = Math.min(getChangeHeight(change) + 2 + 6 , Math.floor(editorHeightInLines / 3));
190
+ this.renderTitle();
191
+ this.updateDropdown();
190
192
  const changeType = getChangeType(change);
191
193
  const changeTypeColor = getChangeTypeColor(this.themeService.getColorTheme(), changeType);
192
194
  this.style({ frameColor: changeTypeColor, arrowColor: changeTypeColor });
193
195
  const providerSpecificChanges = [];
194
196
  let contextIndex = index;
195
197
  for (const change of this.model.changes) {
196
- if (change.label === this.model.changes[this._index].label) {
198
+ if (change.providerId === this.model.changes[this._index].providerId) {
197
199
  providerSpecificChanges.push(change.change);
198
200
  if (labeledChange === change) {
199
201
  contextIndex = providerSpecificChanges.length - 1;
@@ -202,26 +204,28 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
202
204
  }
203
205
  this._actionbarWidget.context = [diffEditorModel.modified.uri, providerSpecificChanges, contextIndex];
204
206
  if (usePosition) {
205
- this.show(position, height);
207
+ this.show(position, height + (1 / lineHeight));
206
208
  this.editor.setPosition(position);
207
209
  this.editor.focus();
208
210
  }
209
211
  }
210
- renderTitle(label) {
211
- const providerChanges = this.model.quickDiffChanges.get(label);
212
+ renderTitle() {
213
+ const providerChanges = this.model.quickDiffChanges.get(this._providerId);
212
214
  const providerIndex = providerChanges.indexOf(this._index);
213
215
  let detail;
214
216
  if (!this.shouldUseDropdown()) {
217
+ const label = this.model.quickDiffs
218
+ .find(quickDiff => quickDiff.id === this._providerId)?.label ?? '';
215
219
  detail = this.model.changes.length > 1
216
220
  ? ( localize(
217
- 9082,
221
+ 9319,
218
222
  "{0} - {1} of {2} changes",
219
223
  label,
220
224
  providerIndex + 1,
221
225
  providerChanges.length
222
226
  ))
223
227
  : ( localize(
224
- 9083,
228
+ 9320,
225
229
  "{0} - {1} of {2} change",
226
230
  label,
227
231
  providerIndex + 1,
@@ -231,27 +235,27 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
231
235
  }
232
236
  else {
233
237
  detail = this.model.changes.length > 1
234
- ? ( localize(9084, "{0} of {1} changes", providerIndex + 1, providerChanges.length))
235
- : ( localize(9085, "{0} of {1} change", providerIndex + 1, providerChanges.length));
238
+ ? ( localize(9321, "{0} of {1} changes", providerIndex + 1, providerChanges.length))
239
+ : ( localize(9322, "{0} of {1} change", providerIndex + 1, providerChanges.length));
236
240
  this.dropdownContainer.style.display = 'inherit';
237
241
  }
238
242
  this.setTitle(this.title, detail);
239
243
  }
240
244
  switchQuickDiff(event) {
241
- const newProvider = event?.provider;
242
- if (newProvider === this.model.changes[this._index].label) {
245
+ const newProviderId = event?.providerId;
246
+ if (newProviderId === this.model.changes[this._index].providerId) {
243
247
  return;
244
248
  }
245
249
  let closestGreaterIndex = this._index < this.model.changes.length - 1 ? this._index + 1 : 0;
246
250
  for (let i = closestGreaterIndex; i !== this._index; i < this.model.changes.length - 1 ? i++ : i = 0) {
247
- if (this.model.changes[i].label === newProvider) {
251
+ if (this.model.changes[i].providerId === newProviderId) {
248
252
  closestGreaterIndex = i;
249
253
  break;
250
254
  }
251
255
  }
252
256
  let closestLesserIndex = this._index > 0 ? this._index - 1 : this.model.changes.length - 1;
253
257
  for (let i = closestLesserIndex; i !== this._index; i > 0 ? i-- : i = this.model.changes.length - 1) {
254
- if (this.model.changes[i].label === newProvider) {
258
+ if (this.model.changes[i].providerId === newProviderId) {
255
259
  closestLesserIndex = i;
256
260
  break;
257
261
  }
@@ -281,16 +285,16 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
281
285
  this._actionbarWidget.clear();
282
286
  this._actionbarWidget.push(actions.reverse(), { label: false, icon: true });
283
287
  this._actionbarWidget.push([next, previous], { label: false, icon: true });
284
- this._actionbarWidget.push(this._disposables.add(( new Action('peekview.close', ( localize(9086, "Close")), ThemeIcon.asClassName(Codicon.close), true, () => this.dispose()))), { label: false, icon: true });
288
+ this._actionbarWidget.push(this._disposables.add(( new Action('peekview.close', ( localize(9323, "Close")), ThemeIcon.asClassName(Codicon.close), true, () => this.dispose()))), { label: false, icon: true });
285
289
  }
286
- updateDropdown(label) {
290
+ updateDropdown() {
287
291
  const quickDiffs = this.getQuickDiffsContainingChange();
288
- this.dropdown?.setSelection(( quickDiffs.map(quickDiff => quickDiff.label)), label);
292
+ this.dropdown?.setSelection(quickDiffs, this._providerId);
289
293
  }
290
294
  getQuickDiffsContainingChange() {
291
295
  const change = this.model.changes[this._index];
292
296
  const quickDiffsWithChange = ( this.model.changes
293
- .filter(c => change.change2.modified.overlapOrTouch(c.change2.modified))
297
+ .filter(c => change.change2.modified.intersectsOrTouches(c.change2.modified))
294
298
  .map(c => c.providerId));
295
299
  return this.model.quickDiffs
296
300
  .filter(quickDiff => quickDiffsWithChange.includes(quickDiff.id) &&
@@ -317,7 +321,15 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
317
321
  }
318
322
  _fillBody(container) {
319
323
  const options = {
320
- scrollBeyondLastLine: true,
324
+ diffAlgorithm: 'advanced',
325
+ fixedOverflowWidgets: true,
326
+ ignoreTrimWhitespace: false,
327
+ minimap: { enabled: false },
328
+ readOnly: false,
329
+ renderGutterMenu: false,
330
+ renderIndicators: false,
331
+ renderOverviewRuler: false,
332
+ renderSideBySide: false,
321
333
  scrollbar: {
322
334
  verticalScrollbarSize: 14,
323
335
  horizontal: 'auto',
@@ -325,14 +337,7 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
325
337
  verticalHasArrows: false,
326
338
  horizontalHasArrows: false
327
339
  },
328
- overviewRulerLanes: 2,
329
- fixedOverflowWidgets: true,
330
- minimap: { enabled: false },
331
- renderSideBySide: false,
332
- readOnly: false,
333
- renderIndicators: false,
334
- diffAlgorithm: 'advanced',
335
- ignoreTrimWhitespace: false,
340
+ scrollBeyondLastLine: false,
336
341
  stickyScroll: { enabled: false }
337
342
  };
338
343
  this.diffEditor = this.instantiationService.createInstance(EmbeddedDiffEditorWidget, container, options, {}, this.editor);
@@ -466,11 +471,11 @@ let QuickDiffEditorController = class QuickDiffEditorController extends Disposab
466
471
  return;
467
472
  }
468
473
  let index;
469
- if (this.editor.hasModel() && (typeof lineNumber === 'number' || !this.widget.provider)) {
470
- index = this.model.findNextClosestChange(typeof lineNumber === 'number' ? lineNumber : this.editor.getPosition().lineNumber, true, this.widget.provider);
474
+ if (this.editor.hasModel() && (typeof lineNumber === 'number' || !this.widget.providerId)) {
475
+ index = this.model.findNextClosestChange(typeof lineNumber === 'number' ? lineNumber : this.editor.getPosition().lineNumber, true, this.widget.providerId);
471
476
  }
472
477
  else {
473
- const providerChanges = this.model.quickDiffChanges.get(this.widget.provider) ?? ( this.model.quickDiffChanges.values()).next().value;
478
+ const providerChanges = this.model.quickDiffChanges.get(this.widget.providerId) ?? ( this.model.quickDiffChanges.values()).next().value;
474
479
  const mapIndex = providerChanges.findIndex(value => value === this.widget.index);
475
480
  index = providerChanges[rot(mapIndex + 1, providerChanges.length)];
476
481
  }
@@ -484,11 +489,11 @@ let QuickDiffEditorController = class QuickDiffEditorController extends Disposab
484
489
  return;
485
490
  }
486
491
  let index;
487
- if (this.editor.hasModel() && (typeof lineNumber === 'number')) {
488
- index = this.model.findPreviousClosestChange(typeof lineNumber === 'number' ? lineNumber : this.editor.getPosition().lineNumber, true, this.widget.provider);
492
+ if (this.editor.hasModel() && (typeof lineNumber === 'number' || !this.widget.providerId)) {
493
+ index = this.model.findPreviousClosestChange(typeof lineNumber === 'number' ? lineNumber : this.editor.getPosition().lineNumber, true, this.widget.providerId);
489
494
  }
490
495
  else {
491
- const providerChanges = this.model.quickDiffChanges.get(this.widget.provider) ?? ( this.model.quickDiffChanges.values()).next().value;
496
+ const providerChanges = this.model.quickDiffChanges.get(this.widget.providerId) ?? ( this.model.quickDiffChanges.values()).next().value;
492
497
  const mapIndex = providerChanges.findIndex(value => value === this.widget.index);
493
498
  index = providerChanges[rot(mapIndex - 1, providerChanges.length)];
494
499
  }
@@ -631,7 +636,7 @@ class ShowPreviousChangeAction extends EditorAction {
631
636
  constructor(outerEditor) {
632
637
  super({
633
638
  id: 'editor.action.dirtydiff.previous',
634
- label: ( localize2(9087, "Show Previous Change")),
639
+ label: ( localize2(9324, "Show Previous Change")),
635
640
  precondition: ( TextCompareEditorActiveContext.toNegated()),
636
641
  kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F3, weight: KeybindingWeight.EditorContrib }
637
642
  });
@@ -657,7 +662,7 @@ class ShowNextChangeAction extends EditorAction {
657
662
  constructor(outerEditor) {
658
663
  super({
659
664
  id: 'editor.action.dirtydiff.next',
660
- label: ( localize2(9088, "Show Next Change")),
665
+ label: ( localize2(9325, "Show Next Change")),
661
666
  precondition: ( TextCompareEditorActiveContext.toNegated()),
662
667
  kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Alt | KeyCode.F3, weight: KeybindingWeight.EditorContrib }
663
668
  });
@@ -683,7 +688,7 @@ class GotoPreviousChangeAction extends EditorAction {
683
688
  constructor() {
684
689
  super({
685
690
  id: 'workbench.action.editor.previousChange',
686
- label: ( localize2(9089, "Go to Previous Change")),
691
+ label: ( localize2(9326, "Go to Previous Change")),
687
692
  precondition: ( ContextKeyExpr.and(( TextCompareEditorActiveContext.toNegated()), ( quickDiffDecorationCount.notEqualsTo(0)))),
688
693
  kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F5, weight: KeybindingWeight.EditorContrib }
689
694
  });
@@ -718,7 +723,7 @@ class GotoNextChangeAction extends EditorAction {
718
723
  constructor() {
719
724
  super({
720
725
  id: 'workbench.action.editor.nextChange',
721
- label: ( localize2(9090, "Go to Next Change")),
726
+ label: ( localize2(9327, "Go to Next Change")),
722
727
  precondition: ( ContextKeyExpr.and(( TextCompareEditorActiveContext.toNegated()), ( quickDiffDecorationCount.notEqualsTo(0)))),
723
728
  kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Alt | KeyCode.F5, weight: KeybindingWeight.EditorContrib }
724
729
  });
@@ -753,7 +758,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
753
758
  group: '7_change_nav',
754
759
  command: {
755
760
  id: 'editor.action.dirtydiff.next',
756
- title: ( localize(9091, "Next &&Change"))
761
+ title: ( localize(9328, "Next &&Change"))
757
762
  },
758
763
  order: 1
759
764
  });
@@ -761,7 +766,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
761
766
  group: '7_change_nav',
762
767
  command: {
763
768
  id: 'editor.action.dirtydiff.previous',
764
- title: ( localize(9092, "Previous &&Change"))
769
+ title: ( localize(9329, "Previous &&Change"))
765
770
  },
766
771
  order: 2
767
772
  });