@codingame/monaco-vscode-scm-service-override 16.1.1 → 17.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-scm-service-override",
3
- "version": "16.1.1",
3
+ "version": "17.0.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - scm service-override",
6
6
  "keywords": [],
@@ -15,19 +15,19 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-12c5f9eb-72d3-57ca-babd-5bef7aa9de3b-common": "16.1.1",
19
- "@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common": "16.1.1",
20
- "@codingame/monaco-vscode-38f25ab8-ea30-5ba9-8a08-ae3308c297c0-common": "16.1.1",
21
- "@codingame/monaco-vscode-3e369455-cc41-54c6-86fb-8b7cd999a5da-common": "16.1.1",
22
- "@codingame/monaco-vscode-4893679b-56e5-52c5-a8fb-c366cce9660f-common": "16.1.1",
23
- "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common": "16.1.1",
24
- "@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common": "16.1.1",
25
- "@codingame/monaco-vscode-ae8a8ca1-f243-508b-9c37-c88ebbd295fa-common": "16.1.1",
26
- "@codingame/monaco-vscode-api": "16.1.1",
27
- "@codingame/monaco-vscode-be8ddbb5-094a-5657-b1cc-fe106c94c632-common": "16.1.1",
28
- "@codingame/monaco-vscode-e67a0dae-5b2c-54e6-8d61-90102c78362d-common": "16.1.1",
29
- "@codingame/monaco-vscode-f99b74f5-fcb7-512f-8c6c-35f5a107577d-common": "16.1.1",
30
- "@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common": "16.1.1"
18
+ "@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common": "17.0.0",
19
+ "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common": "17.0.0",
20
+ "@codingame/monaco-vscode-a7c9ae3c-16d2-5d17-86b2-981be7094566-common": "17.0.0",
21
+ "@codingame/monaco-vscode-api": "17.0.0",
22
+ "@codingame/monaco-vscode-b4efa70b-52b9-5670-ab5c-f10b10b6834e-common": "17.0.0",
23
+ "@codingame/monaco-vscode-bb83fe45-f4c7-5673-b9f1-5c409a63f19c-common": "17.0.0",
24
+ "@codingame/monaco-vscode-be8ddbb5-094a-5657-b1cc-fe106c94c632-common": "17.0.0",
25
+ "@codingame/monaco-vscode-bed2b49f-41ae-5ed2-b61a-1105500a3f8a-common": "17.0.0",
26
+ "@codingame/monaco-vscode-c8227507-8e59-53d6-b50b-71c0ab384cf4-common": "17.0.0",
27
+ "@codingame/monaco-vscode-e67a0dae-5b2c-54e6-8d61-90102c78362d-common": "17.0.0",
28
+ "@codingame/monaco-vscode-f48982c4-9e82-55e2-b800-20e6d1e6096f-common": "17.0.0",
29
+ "@codingame/monaco-vscode-f99b74f5-fcb7-512f-8c6c-35f5a107577d-common": "17.0.0",
30
+ "@codingame/monaco-vscode-ff9fa663-eae3-5274-8573-c2b918871e4b-common": "17.0.0"
31
31
  },
32
32
  "main": "index.js",
33
33
  "module": "index.js",
@@ -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(8970, '{0} pending changes', num))));
107
+ const badge = ( new NumberBadge(count, num => ( localize(9071, '{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(8971, "Source Control")) + (repoAgnosticActionName ? ` ${repoAgnosticActionName}` : ''),
133
+ name: ( localize(9072, "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(8972, "Source Control Provider")),
145
+ name: ( localize(9073, "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(8973, "Whether the active resource has changes"))));
175
- const activeResourceRepositoryContextKey = ( new RawContextKey('scmActiveResourceRepository', undefined, ( localize(8974, "The active resource's repository"))));
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"))));
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)) {
@@ -15,46 +15,72 @@
15
15
  .monaco-editor.modified-in-monaco-diff-editor .margin-view-overlays > div > .dirty-diff-glyph {
16
16
  display: none;
17
17
  }
18
- .monaco-editor .dirty-diff-added {
19
- border-left-color: var(--vscode-editorGutter-addedBackground);
18
+ .monaco-editor .dirty-diff-added:not(.pattern) {
20
19
  border-left-style: solid;
21
20
  }
22
- .monaco-editor .dirty-diff-added:before {
21
+ .monaco-editor .dirty-diff-added.primary {
22
+ border-left-color: var(--vscode-editorGutter-addedBackground);
23
+ }
24
+ .monaco-editor .dirty-diff-added.primary:before {
23
25
  background: var(--vscode-editorGutter-addedBackground);
24
26
  }
25
- .monaco-editor .dirty-diff-added-pattern {
26
- background-image: linear-gradient(-45deg, var(--vscode-editorGutter-addedBackground) 25%, var(--vscode-editorGutter-background) 25%, var(--vscode-editorGutter-background) 50%, var(--vscode-editorGutter-addedBackground) 50%, var(--vscode-editorGutter-addedBackground) 75%, var(--vscode-editorGutter-background) 75%, var(--vscode-editorGutter-background));
27
+ .monaco-editor .dirty-diff-added.secondary {
28
+ border-left-color: var(--vscode-editorGutter-addedSecondaryBackground);
29
+ }
30
+ .monaco-editor .dirty-diff-added.secondary:before {
31
+ background: var(--vscode-editorGutter-addedSecondaryBackground);
32
+ }
33
+ .monaco-editor .dirty-diff-added.pattern {
27
34
  background-repeat: repeat-y;
28
35
  }
29
- .monaco-editor .dirty-diff-added-pattern:before {
30
- background-image: linear-gradient(-45deg, var(--vscode-editorGutter-addedBackground) 25%, var(--vscode-editorGutter-background) 25%, var(--vscode-editorGutter-background) 50%, var(--vscode-editorGutter-addedBackground) 50%, var(--vscode-editorGutter-addedBackground) 75%, var(--vscode-editorGutter-background) 75%, var(--vscode-editorGutter-background));
36
+ .monaco-editor .dirty-diff-added.pattern:before {
31
37
  transform: translateX(3px);
32
38
  }
33
- .monaco-editor .dirty-diff-modified {
34
- border-left-color: var(--vscode-editorGutter-modifiedBackground);
39
+ .monaco-editor .dirty-diff-added.pattern.primary,
40
+ .monaco-editor .dirty-diff-added.pattern.primary:before {
41
+ background-image: linear-gradient(-45deg, var(--vscode-editorGutter-addedBackground) 25%, var(--vscode-editorGutter-background) 25%, var(--vscode-editorGutter-background) 50%, var(--vscode-editorGutter-addedBackground) 50%, var(--vscode-editorGutter-addedBackground) 75%, var(--vscode-editorGutter-background) 75%, var(--vscode-editorGutter-background));
42
+ }
43
+ .monaco-editor .dirty-diff-added.pattern.secondary,
44
+ .monaco-editor .dirty-diff-added.pattern.secondary:before {
45
+ background-image: linear-gradient(45deg, var(--vscode-editorGutter-addedSecondaryBackground) 25%, var(--vscode-editorGutter-background) 25%, var(--vscode-editorGutter-background) 50%, var(--vscode-editorGutter-addedSecondaryBackground) 50%, var(--vscode-editorGutter-addedSecondaryBackground) 75%, var(--vscode-editorGutter-background) 75%, var(--vscode-editorGutter-background));
46
+ }
47
+ .monaco-editor .dirty-diff-modified:not(.pattern) {
35
48
  border-left-style: solid;
36
49
  }
37
- .monaco-editor .dirty-diff-modified:before {
50
+ .monaco-editor .dirty-diff-modified.primary {
51
+ border-left-color: var(--vscode-editorGutter-modifiedBackground);
52
+ }
53
+ .monaco-editor .dirty-diff-modified.primary:before {
38
54
  background: var(--vscode-editorGutter-modifiedBackground);
39
55
  }
40
- .monaco-editor .dirty-diff-modified-pattern {
41
- background-image: linear-gradient(-45deg, var(--vscode-editorGutter-modifiedBackground) 25%, var(--vscode-editorGutter-background) 25%, var(--vscode-editorGutter-background) 50%, var(--vscode-editorGutter-modifiedBackground) 50%, var(--vscode-editorGutter-modifiedBackground) 75%, var(--vscode-editorGutter-background) 75%, var(--vscode-editorGutter-background));
56
+ .monaco-editor .dirty-diff-modified.secondary {
57
+ border-left-color: var(--vscode-editorGutter-modifiedSecondaryBackground);
58
+ }
59
+ .monaco-editor .dirty-diff-modified.secondary:before {
60
+ background: var(--vscode-editorGutter-modifiedSecondaryBackground);
61
+ }
62
+ .monaco-editor .dirty-diff-modified.pattern {
42
63
  background-repeat: repeat-y;
43
64
  }
65
+ .monaco-editor .dirty-diff-modified.pattern:before {
66
+ transform: translateX(3px);
67
+ }
68
+ .monaco-editor .dirty-diff-modified.pattern.primary,
69
+ .monaco-editor .dirty-diff-modified.pattern.primary:before {
70
+ background-image: linear-gradient(-45deg, var(--vscode-editorGutter-modifiedBackground) 25%, var(--vscode-editorGutter-background) 25%, var(--vscode-editorGutter-background) 50%, var(--vscode-editorGutter-modifiedBackground) 50%, var(--vscode-editorGutter-modifiedBackground) 75%, var(--vscode-editorGutter-background) 75%, var(--vscode-editorGutter-background));
71
+ }
72
+ .monaco-editor .dirty-diff-modified.pattern.secondary,
73
+ .monaco-editor .dirty-diff-modified.pattern.secondary:before {
74
+ background-image: linear-gradient(45deg, var(--vscode-editorGutter-modifiedSecondaryBackground) 25%, var(--vscode-editorGutter-background) 25%, var(--vscode-editorGutter-background) 50%, var(--vscode-editorGutter-modifiedSecondaryBackground) 50%, var(--vscode-editorGutter-modifiedSecondaryBackground) 75%, var(--vscode-editorGutter-background) 75%, var(--vscode-editorGutter-background));
75
+ }
44
76
  .monaco-workbench:not(.reduce-motion) .monaco-editor .dirty-diff-added,
45
- .monaco-workbench:not(.reduce-motion) .monaco-editor .dirty-diff-added-pattern,
46
77
  .monaco-workbench:not(.reduce-motion) .monaco-editor .dirty-diff-modified,
47
- .monaco-workbench:not(.reduce-motion) .monaco-editor .dirty-diff-modified-pattern {
78
+ .monaco-workbench:not(.reduce-motion) .monaco-editor .dirty-diff-deleted {
48
79
  transition: opacity 0.5s;
49
80
  }
50
- .monaco-editor .dirty-diff-modified-pattern:before {
51
- background-image: linear-gradient(-45deg, var(--vscode-editorGutter-modifiedBackground) 25%, var(--vscode-editorGutter-background) 25%, var(--vscode-editorGutter-background) 50%, var(--vscode-editorGutter-modifiedBackground) 50%, var(--vscode-editorGutter-modifiedBackground) 75%, var(--vscode-editorGutter-background) 75%, var(--vscode-editorGutter-background));
52
- transform: translateX(3px);
53
- }
54
81
  .monaco-editor .margin:hover .dirty-diff-added,
55
- .monaco-editor .margin:hover .dirty-diff-added-pattern,
56
82
  .monaco-editor .margin:hover .dirty-diff-modified,
57
- .monaco-editor .margin:hover .dirty-diff-modified-pattern {
83
+ .monaco-editor .margin:hover .dirty-diff-deleted {
58
84
  opacity: 1;
59
85
  }
60
86
  .monaco-editor .dirty-diff-deleted:after {
@@ -67,9 +93,14 @@
67
93
  z-index: 9;
68
94
  border-top: 4px solid transparent;
69
95
  border-bottom: 4px solid transparent;
70
- border-left: 4px solid var(--vscode-editorGutter-deletedBackground);
71
96
  pointer-events: none;
72
97
  }
98
+ .monaco-editor .dirty-diff-deleted.primary:after {
99
+ border-left: 4px solid var(--vscode-editorGutter-deletedBackground);
100
+ }
101
+ .monaco-editor .dirty-diff-deleted.secondary:after {
102
+ border-left: 4px solid var(--vscode-editorGutter-deletedSecondaryBackground);
103
+ }
73
104
  .monaco-workbench:not(.reduce-motion) .monaco-editor .dirty-diff-deleted:after {
74
105
  transition: border-top-width 80ms linear, border-bottom-width 80ms linear, bottom 80ms linear, opacity 0.5s;
75
106
  }
@@ -79,6 +110,12 @@
79
110
  height: 0;
80
111
  bottom: 0;
81
112
  }
113
+ .monaco-editor .dirty-diff-deleted.primary:before {
114
+ background: var(--vscode-editorGutter-deletedBackground);
115
+ }
116
+ .monaco-editor .dirty-diff-deleted.secondary:before {
117
+ background: var(--vscode-editorGutter-deletedSecondaryBackground);
118
+ }
82
119
  .monaco-workbench:not(.reduce-motion) .monaco-editor .dirty-diff-deleted:before {
83
120
  transition: height 80ms linear;
84
121
  }
@@ -520,6 +520,3 @@
520
520
  border-radius: 2px;
521
521
  opacity: 0.5;
522
522
  }
523
- .monaco-workbench .part.statusbar > .items-container > .statusbar-item .codicon.codicon-repo {
524
- padding-top: 1px;
525
- }
@@ -233,7 +233,7 @@ SCMMenus = ( __decorate([
233
233
  ( __param(1, IInstantiationService))
234
234
  ], SCMMenus));
235
235
  MenuRegistry.appendMenuItem(MenuId.SCMResourceContext, {
236
- title: ( localize(8975, "Share")),
236
+ title: ( localize(9076, "Share")),
237
237
  submenu: MenuId.SCMResourceContextShare,
238
238
  group: '45_share',
239
239
  order: 3,
@@ -1,6 +1,7 @@
1
1
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
2
  import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
3
  import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
4
+ import { IQuickDiffService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff.service";
4
5
  import { IQuickDiffModelService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/browser/quickDiffModel.service";
5
6
  import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
6
7
  import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
@@ -11,15 +12,17 @@ export declare class QuickDiffWorkbenchController extends Disposable implements
11
12
  private readonly editorService;
12
13
  private readonly configurationService;
13
14
  private readonly quickDiffModelService;
15
+ private readonly quickDiffService;
14
16
  private readonly uriIdentityService;
15
17
  private enabled;
16
18
  private readonly quickDiffDecorationCount;
17
19
  private readonly activeEditor;
20
+ private readonly quickDiffProviders;
18
21
  private readonly decorators;
19
22
  private viewState;
20
23
  private readonly transientDisposables;
21
24
  private readonly stylesheet;
22
- constructor(editorService: IEditorService, configurationService: IConfigurationService, quickDiffModelService: IQuickDiffModelService, uriIdentityService: IUriIdentityService, contextKeyService: IContextKeyService);
25
+ constructor(editorService: IEditorService, configurationService: IConfigurationService, quickDiffModelService: IQuickDiffModelService, quickDiffService: IQuickDiffService, uriIdentityService: IUriIdentityService, contextKeyService: IContextKeyService);
23
26
  private onDidChangeConfiguration;
24
27
  private onDidChangeDiffWidthConfiguration;
25
28
  private onDidChangeDiffVisibilityConfiguration;
@@ -27,6 +30,7 @@ export declare class QuickDiffWorkbenchController extends Disposable implements
27
30
  private enable;
28
31
  private disable;
29
32
  private onDidActiveEditorChange;
33
+ private onDidChangeQuickDiffProviders;
30
34
  private onEditorsChanged;
31
35
  dispose(): void;
32
36
  }
@@ -12,13 +12,15 @@ 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-ae8a8ca1-f243-508b-9c37-c88ebbd295fa-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
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';
16
+ import { IQuickDiffService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff.service';
16
17
  import { IQuickDiffModelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/browser/quickDiffModel.service';
17
18
  import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
18
19
  import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
19
- import { RawContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
20
+ import { RawContextKey, ContextKeyTrueExpr, ContextKeyFalseExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
20
21
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
21
22
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
23
+ import { registerAction2, Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
22
24
  import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
23
25
  import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
24
26
 
@@ -49,47 +51,47 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
49
51
  }
50
52
  return ModelDecorationOptions.createDynamic(decorationOptions);
51
53
  }
52
- constructor(codeEditor, quickDiffModelRef, configurationService) {
54
+ constructor(codeEditor, quickDiffModelRef, configurationService, quickDiffService) {
53
55
  super();
54
56
  this.codeEditor = codeEditor;
55
57
  this.quickDiffModelRef = quickDiffModelRef;
56
58
  this.configurationService = configurationService;
59
+ this.quickDiffService = quickDiffService;
57
60
  const decorations = configurationService.getValue('scm.diffDecorations');
58
61
  const gutter = decorations === 'all' || decorations === 'gutter';
59
62
  const overview = decorations === 'all' || decorations === 'overview';
60
63
  const minimap = decorations === 'all' || decorations === 'minimap';
61
- const diffAdded = ( localize(8976, 'Added lines'));
62
- this.addedOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added', diffAdded, {
64
+ const diffAdded = ( localize(9077, 'Added lines'));
65
+ const diffAddedOptions = {
63
66
  gutter,
64
67
  overview: { active: overview, color: overviewRulerAddedForeground },
65
68
  minimap: { active: minimap, color: minimapGutterAddedBackground },
66
69
  isWholeLine: true
67
- });
68
- this.addedPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added-pattern', diffAdded, {
69
- gutter,
70
- overview: { active: overview, color: overviewRulerAddedForeground },
71
- minimap: { active: minimap, color: minimapGutterAddedBackground },
72
- isWholeLine: true
73
- });
74
- const diffModified = ( localize(8977, 'Changed lines'));
75
- this.modifiedOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified', diffModified, {
76
- gutter,
77
- overview: { active: overview, color: overviewRulerModifiedForeground },
78
- minimap: { active: minimap, color: minimapGutterModifiedBackground },
79
- isWholeLine: true
80
- });
81
- this.modifiedPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified-pattern', diffModified, {
70
+ };
71
+ this.addedOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added primary', diffAdded, diffAddedOptions);
72
+ this.addedPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added primary pattern', diffAdded, diffAddedOptions);
73
+ this.addedSecondaryOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added secondary', diffAdded, diffAddedOptions);
74
+ this.addedSecondaryPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-added secondary pattern', diffAdded, diffAddedOptions);
75
+ const diffModified = ( localize(9078, 'Changed lines'));
76
+ const diffModifiedOptions = {
82
77
  gutter,
83
78
  overview: { active: overview, color: overviewRulerModifiedForeground },
84
79
  minimap: { active: minimap, color: minimapGutterModifiedBackground },
85
80
  isWholeLine: true
86
- });
87
- this.deletedOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-deleted', ( localize(8978, 'Removed lines')), {
81
+ };
82
+ this.modifiedOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified primary', diffModified, diffModifiedOptions);
83
+ this.modifiedPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified primary pattern', diffModified, diffModifiedOptions);
84
+ this.modifiedSecondaryOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified secondary', diffModified, diffModifiedOptions);
85
+ this.modifiedSecondaryPatternOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-modified secondary pattern', diffModified, diffModifiedOptions);
86
+ const diffDeleted = ( localize(9079, 'Removed lines'));
87
+ const diffDeletedOptions = {
88
88
  gutter,
89
89
  overview: { active: overview, color: overviewRulerDeletedForeground },
90
90
  minimap: { active: minimap, color: minimapGutterDeletedBackground },
91
91
  isWholeLine: false
92
- });
92
+ };
93
+ this.deletedOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-deleted primary', diffDeleted, diffDeletedOptions);
94
+ this.deletedSecondaryOptions = QuickDiffDecorator_1.createDecoration('dirty-diff-deleted secondary', diffDeleted, diffDeletedOptions);
93
95
  this._register(configurationService.onDidChangeConfiguration(e => {
94
96
  if (e.affectsConfiguration('scm.diffDecorationsGutterPattern')) {
95
97
  this.onDidChange();
@@ -101,42 +103,58 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
101
103
  if (!this.codeEditor.hasModel()) {
102
104
  return;
103
105
  }
104
- const visibleQuickDiffs = this.quickDiffModelRef.object.quickDiffs.filter(quickDiff => quickDiff.visible);
105
106
  const pattern = this.configurationService.getValue('scm.diffDecorationsGutterPattern');
106
- const decorations = ( this.quickDiffModelRef.object.changes
107
- .filter(labeledChange => ( visibleQuickDiffs.some(quickDiff => quickDiff.label === labeledChange.label)))
108
- .map((labeledChange) => {
109
- const change = labeledChange.change;
110
- const changeType = getChangeType(change);
111
- const startLineNumber = change.modifiedStartLineNumber;
112
- const endLineNumber = change.modifiedEndLineNumber || startLineNumber;
107
+ const primaryQuickDiff = this.quickDiffModelRef.object.quickDiffs.find(quickDiff => quickDiff.kind === 'primary');
108
+ const primaryQuickDiffChanges = this.quickDiffModelRef.object.changes.filter(change => change.providerId === primaryQuickDiff?.id);
109
+ const decorations = [];
110
+ for (const change of this.quickDiffModelRef.object.changes) {
111
+ const quickDiff = this.quickDiffModelRef.object.quickDiffs
112
+ .find(quickDiff => quickDiff.id === change.providerId);
113
+ if (!quickDiff || !this.quickDiffService.isQuickDiffProviderVisible(quickDiff.id)) {
114
+ continue;
115
+ }
116
+ if (quickDiff.kind !== 'primary' && ( primaryQuickDiffChanges.some(c => c.change2.modified.overlapOrTouch(change.change2.modified)))) {
117
+ continue;
118
+ }
119
+ const changeType = getChangeType(change.change);
120
+ const startLineNumber = change.change.modifiedStartLineNumber;
121
+ const endLineNumber = change.change.modifiedEndLineNumber || startLineNumber;
113
122
  switch (changeType) {
114
123
  case ChangeType.Add:
115
- return {
124
+ decorations.push({
116
125
  range: {
117
126
  startLineNumber: startLineNumber, startColumn: 1,
118
127
  endLineNumber: endLineNumber, endColumn: 1
119
128
  },
120
- options: pattern.added ? this.addedPatternOptions : this.addedOptions
121
- };
129
+ options: quickDiff.kind === 'primary' || quickDiff.kind === 'contributed'
130
+ ? pattern.added ? this.addedPatternOptions : this.addedOptions
131
+ : pattern.added ? this.addedSecondaryPatternOptions : this.addedSecondaryOptions
132
+ });
133
+ break;
122
134
  case ChangeType.Delete:
123
- return {
135
+ decorations.push({
124
136
  range: {
125
137
  startLineNumber: startLineNumber, startColumn: Number.MAX_VALUE,
126
138
  endLineNumber: startLineNumber, endColumn: Number.MAX_VALUE
127
139
  },
128
- options: this.deletedOptions
129
- };
140
+ options: quickDiff.kind === 'primary' || quickDiff.kind === 'contributed'
141
+ ? this.deletedOptions
142
+ : this.deletedSecondaryOptions
143
+ });
144
+ break;
130
145
  case ChangeType.Modify:
131
- return {
146
+ decorations.push({
132
147
  range: {
133
148
  startLineNumber: startLineNumber, startColumn: 1,
134
149
  endLineNumber: endLineNumber, endColumn: 1
135
150
  },
136
- options: pattern.modified ? this.modifiedPatternOptions : this.modifiedOptions
137
- };
151
+ options: quickDiff.kind === 'primary' || quickDiff.kind === 'contributed'
152
+ ? pattern.modified ? this.modifiedPatternOptions : this.modifiedOptions
153
+ : pattern.modified ? this.modifiedSecondaryPatternOptions : this.modifiedSecondaryOptions
154
+ });
155
+ break;
138
156
  }
139
- }));
157
+ }
140
158
  if (!this.decorationsCollection) {
141
159
  this.decorationsCollection = this.codeEditor.createDecorationsCollection(decorations);
142
160
  }
@@ -154,14 +172,16 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
154
172
  }
155
173
  };
156
174
  QuickDiffDecorator = QuickDiffDecorator_1 = ( __decorate([
157
- ( __param(2, IConfigurationService))
175
+ ( __param(2, IConfigurationService)),
176
+ ( __param(3, IQuickDiffService))
158
177
  ], QuickDiffDecorator));
159
178
  let QuickDiffWorkbenchController = class QuickDiffWorkbenchController extends Disposable {
160
- constructor(editorService, configurationService, quickDiffModelService, uriIdentityService, contextKeyService) {
179
+ constructor(editorService, configurationService, quickDiffModelService, quickDiffService, uriIdentityService, contextKeyService) {
161
180
  super();
162
181
  this.editorService = editorService;
163
182
  this.configurationService = configurationService;
164
183
  this.quickDiffModelService = quickDiffModelService;
184
+ this.quickDiffService = quickDiffService;
165
185
  this.uriIdentityService = uriIdentityService;
166
186
  this.enabled = false;
167
187
  this.decorators = ( new ResourceMap());
@@ -170,6 +190,7 @@ let QuickDiffWorkbenchController = class QuickDiffWorkbenchController extends Di
170
190
  this.stylesheet = createStyleSheet(undefined, undefined, this._store);
171
191
  this.quickDiffDecorationCount = quickDiffDecorationCount.bindTo(contextKeyService);
172
192
  this.activeEditor = observableFromEvent(this, this.editorService.onDidActiveEditorChange, () => this.editorService.activeEditor);
193
+ this.quickDiffProviders = observableFromEvent(this, this.quickDiffService.onDidChangeQuickDiffProviders, () => this.quickDiffService.providers);
173
194
  const onDidChangeConfiguration = Event.filter(configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('scm.diffDecorations'));
174
195
  this._register(onDidChangeConfiguration(this.onDidChangeConfiguration, this));
175
196
  this.onDidChangeConfiguration();
@@ -207,16 +228,14 @@ let QuickDiffWorkbenchController = class QuickDiffWorkbenchController extends Di
207
228
  .monaco-editor .dirty-diff-modified {
208
229
  border-left-width:${state.width}px;
209
230
  }
210
- .monaco-editor .dirty-diff-added-pattern,
211
- .monaco-editor .dirty-diff-added-pattern:before,
212
- .monaco-editor .dirty-diff-modified-pattern,
213
- .monaco-editor .dirty-diff-modified-pattern:before {
231
+ .monaco-editor .dirty-diff-added.pattern,
232
+ .monaco-editor .dirty-diff-added.pattern:before,
233
+ .monaco-editor .dirty-diff-modified.pattern,
234
+ .monaco-editor .dirty-diff-modified.pattern:before {
214
235
  background-size: ${state.width}px ${state.width}px;
215
236
  }
216
237
  .monaco-editor .dirty-diff-added,
217
- .monaco-editor .dirty-diff-added-pattern,
218
238
  .monaco-editor .dirty-diff-modified,
219
- .monaco-editor .dirty-diff-modified-pattern,
220
239
  .monaco-editor .dirty-diff-deleted {
221
240
  opacity: ${state.visibility === 'always' ? 1 : 0};
222
241
  }
@@ -229,6 +248,7 @@ let QuickDiffWorkbenchController = class QuickDiffWorkbenchController extends Di
229
248
  this.transientDisposables.add(Event.any(this.editorService.onDidCloseEditor, this.editorService.onDidVisibleEditorsChange)(() => this.onEditorsChanged()));
230
249
  this.onEditorsChanged();
231
250
  this.onDidActiveEditorChange();
251
+ this.onDidChangeQuickDiffProviders();
232
252
  this.enabled = true;
233
253
  }
234
254
  disable() {
@@ -258,8 +278,8 @@ let QuickDiffWorkbenchController = class QuickDiffWorkbenchController extends Di
258
278
  }
259
279
  store.add(quickDiffModelRef);
260
280
  const visibleDecorationCount = observableFromEvent(this, quickDiffModelRef.object.onDidChange, () => {
261
- const visibleQuickDiffs = quickDiffModelRef.object.quickDiffs.filter(quickDiff => quickDiff.visible);
262
- return quickDiffModelRef.object.changes.filter(labeledChange => ( visibleQuickDiffs.some(quickDiff => quickDiff.label === labeledChange.label))).length;
281
+ const visibleQuickDiffs = quickDiffModelRef.object.quickDiffs.filter(quickDiff => this.quickDiffService.isQuickDiffProviderVisible(quickDiff.id));
282
+ return quickDiffModelRef.object.changes.filter(change => ( visibleQuickDiffs.some(quickDiff => quickDiff.id === change.providerId))).length;
263
283
  });
264
284
  store.add(autorun(reader => {
265
285
  const count = visibleDecorationCount.read(reader);
@@ -267,6 +287,39 @@ let QuickDiffWorkbenchController = class QuickDiffWorkbenchController extends Di
267
287
  }));
268
288
  }));
269
289
  }
290
+ onDidChangeQuickDiffProviders() {
291
+ this.transientDisposables.add(autorunWithStore((reader, store) => {
292
+ const providers = this.quickDiffProviders.read(reader);
293
+ const labels = [];
294
+ for (let index = 0; index < providers.length; index++) {
295
+ const provider = providers[index];
296
+ if (labels.includes(provider.label)) {
297
+ continue;
298
+ }
299
+ const visible = this.quickDiffService.isQuickDiffProviderVisible(provider.id);
300
+ const group = provider.kind !== 'contributed' ? '0_scm' : '1_contributed';
301
+ const order = index + 1;
302
+ store.add(registerAction2(class extends Action2 {
303
+ constructor() {
304
+ super({
305
+ id: `workbench.scm.action.toggleQuickDiffVisibility.${provider.id}`,
306
+ title: provider.label,
307
+ toggled: visible ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE,
308
+ menu: {
309
+ id: MenuId.SCMQuickDiffDecorations, group, order
310
+ },
311
+ f1: false
312
+ });
313
+ }
314
+ run(accessor) {
315
+ const quickDiffService = accessor.get(IQuickDiffService);
316
+ quickDiffService.toggleQuickDiffProviderVisibility(provider.id);
317
+ }
318
+ }));
319
+ labels.push(provider.label);
320
+ }
321
+ }));
322
+ }
270
323
  onEditorsChanged() {
271
324
  for (const editor of this.editorService.visibleTextEditorControls) {
272
325
  if (!isCodeEditor(editor)) {
@@ -287,7 +340,12 @@ let QuickDiffWorkbenchController = class QuickDiffWorkbenchController extends Di
287
340
  if (!( this.decorators.has(textModel.uri))) {
288
341
  this.decorators.set(textModel.uri, ( new DisposableMap()));
289
342
  }
290
- this.decorators.get(textModel.uri).set(editorId, ( new QuickDiffDecorator(editor, quickDiffModelRef, this.configurationService)));
343
+ this.decorators.get(textModel.uri).set(editorId, ( new QuickDiffDecorator(
344
+ editor,
345
+ quickDiffModelRef,
346
+ this.configurationService,
347
+ this.quickDiffService
348
+ )));
291
349
  }
292
350
  for (const [uri, decoratorMap] of this.decorators.entries()) {
293
351
  for (const editorId of ( decoratorMap.keys())) {
@@ -313,8 +371,9 @@ QuickDiffWorkbenchController = ( __decorate([
313
371
  ( __param(0, IEditorService)),
314
372
  ( __param(1, IConfigurationService)),
315
373
  ( __param(2, IQuickDiffModelService)),
316
- ( __param(3, IUriIdentityService)),
317
- ( __param(4, IContextKeyService))
374
+ ( __param(3, IQuickDiffService)),
375
+ ( __param(4, IUriIdentityService)),
376
+ ( __param(5, IContextKeyService))
318
377
  ], QuickDiffWorkbenchController));
319
378
 
320
379
  export { QuickDiffWorkbenchController, quickDiffDecorationCount };
@@ -1,5 +1,5 @@
1
1
  import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
2
- import { IResolvedTextFileEditorModel } from "@codingame/monaco-vscode-4893679b-56e5-52c5-a8fb-c366cce9660f-common/vscode/vs/workbench/services/textfile/common/textfiles";
2
+ import { IResolvedTextFileEditorModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles";
3
3
  import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
4
4
  import { Disposable, IReference } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
5
5
  import { DiffAlgorithmName } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker";
@@ -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-ae8a8ca1-f243-508b-9c37-c88ebbd295fa-common/vscode/vs/workbench/contrib/scm/common/quickDiff";
11
+ import { QuickDiff, QuickDiffChange, QuickDiffResult } from "@codingame/monaco-vscode-bb83fe45-f4c7-5673-b9f1-5c409a63f19c-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";