@codingame/monaco-vscode-scm-service-override 37.2.0 → 37.3.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.
- package/common.d.ts +2 -0
- package/common.js +25 -0
- package/index.d.ts +2 -2
- package/index.js +1 -24
- package/package.json +10 -2
- package/session.d.ts +2 -0
- package/session.js +2 -0
- package/vscode/src/vs/workbench/contrib/scm/browser/activity.js +9 -9
- package/vscode/src/vs/workbench/contrib/scm/browser/menus.js +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiff.contribution.js +14 -14
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffDecorator.js +5 -5
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffModel.js +11 -11
- package/vscode/src/vs/workbench/contrib/scm/browser/quickDiffWidget.js +24 -18
- package/vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js +71 -71
- package/vscode/src/vs/workbench/contrib/scm/browser/scmAccessibilityHelp.js +25 -25
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.js +41 -41
- package/vscode/src/vs/workbench/contrib/scm/browser/scmInput.js +9 -9
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.js +12 -12
- package/vscode/src/vs/workbench/contrib/scm/browser/scmRepositoryRenderer.js +8 -6
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPane.js +39 -39
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewPaneContainer.js +1 -1
- package/vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js +12 -12
package/common.d.ts
ADDED
package/common.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
3
|
+
import { ISCMViewService, ISCMService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
4
|
+
import { SCMService } from './vscode/src/vs/workbench/contrib/scm/common/scmService.js';
|
|
5
|
+
import { SCMViewService } from './vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js';
|
|
6
|
+
import { IQuickDiffService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff.service';
|
|
7
|
+
import { QuickDiffService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiffService';
|
|
8
|
+
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
9
|
+
import { IQuickDiffModelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/browser/quickDiffModel.service';
|
|
10
|
+
import { QuickDiffModelService } from './vscode/src/vs/workbench/contrib/scm/browser/quickDiffModel.js';
|
|
11
|
+
import { IGitService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/git/common/gitService.service';
|
|
12
|
+
import { GitService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/git/browser/gitService';
|
|
13
|
+
import './vscode/src/vs/workbench/contrib/scm/browser/quickDiff.contribution.js';
|
|
14
|
+
|
|
15
|
+
function getServiceOverride() {
|
|
16
|
+
return {
|
|
17
|
+
[ISCMService.toString()]: new SyncDescriptor(SCMService, [], true),
|
|
18
|
+
[ISCMViewService.toString()]: new SyncDescriptor(SCMViewService, [], true),
|
|
19
|
+
[IQuickDiffService.toString()]: new SyncDescriptor(QuickDiffService, [], true),
|
|
20
|
+
[IQuickDiffModelService.toString()]: new SyncDescriptor(QuickDiffModelService, [], true),
|
|
21
|
+
[IGitService.toString()]: new SyncDescriptor(GitService, [], true)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { getServiceOverride as default };
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { default } from "./common.js";
|
|
2
|
+
export * from "./common.js";
|
package/index.js
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
import { ISCMViewService, ISCMService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
4
|
-
import { SCMService } from './vscode/src/vs/workbench/contrib/scm/common/scmService.js';
|
|
5
|
-
import { SCMViewService } from './vscode/src/vs/workbench/contrib/scm/browser/scmViewService.js';
|
|
6
|
-
import { IQuickDiffService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff.service';
|
|
7
|
-
import { QuickDiffService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiffService';
|
|
8
|
-
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
9
|
-
import { IQuickDiffModelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/browser/quickDiffModel.service';
|
|
10
|
-
import { QuickDiffModelService } from './vscode/src/vs/workbench/contrib/scm/browser/quickDiffModel.js';
|
|
11
|
-
import { IGitService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/git/common/gitService.service';
|
|
12
|
-
import { GitService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/git/browser/gitService';
|
|
2
|
+
export { default } from './common.js';
|
|
13
3
|
import './vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.js';
|
|
14
|
-
import './vscode/src/vs/workbench/contrib/scm/browser/quickDiff.contribution.js';
|
|
15
|
-
|
|
16
|
-
function getServiceOverride() {
|
|
17
|
-
return {
|
|
18
|
-
[ISCMService.toString()]: new SyncDescriptor(SCMService, [], true),
|
|
19
|
-
[ISCMViewService.toString()]: new SyncDescriptor(SCMViewService, [], true),
|
|
20
|
-
[IQuickDiffService.toString()]: new SyncDescriptor(QuickDiffService, [], true),
|
|
21
|
-
[IQuickDiffModelService.toString()]: new SyncDescriptor(QuickDiffModelService, [], true),
|
|
22
|
-
[IGitService.toString()]: new SyncDescriptor(GitService, [], true)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { getServiceOverride as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-scm-service-override",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - scm service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "37.
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.3.1"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -31,6 +31,14 @@
|
|
|
31
31
|
"types": "./vscode/src/*.d.ts",
|
|
32
32
|
"default": "./vscode/src/*.js"
|
|
33
33
|
},
|
|
34
|
+
"./session": {
|
|
35
|
+
"types": "./session.d.ts",
|
|
36
|
+
"default": "./session.js"
|
|
37
|
+
},
|
|
38
|
+
"./common": {
|
|
39
|
+
"types": "./common.d.ts",
|
|
40
|
+
"default": "./common.js"
|
|
41
|
+
},
|
|
34
42
|
"./*": {
|
|
35
43
|
"types": "./*.d.ts",
|
|
36
44
|
"default": "./*.js"
|
package/session.d.ts
ADDED
package/session.js
ADDED
|
@@ -25,8 +25,8 @@ import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/obse
|
|
|
25
25
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
26
26
|
|
|
27
27
|
const ActiveRepositoryContextKeys = {
|
|
28
|
-
ActiveRepositoryName:
|
|
29
|
-
ActiveRepositoryBranchName:
|
|
28
|
+
ActiveRepositoryName: new RawContextKey("scmActiveRepositoryName", ""),
|
|
29
|
+
ActiveRepositoryBranchName: new RawContextKey("scmActiveRepositoryBranchName", "")
|
|
30
30
|
};
|
|
31
31
|
let SCMActiveRepositoryController = class SCMActiveRepositoryController extends Disposable {
|
|
32
32
|
constructor(
|
|
@@ -72,10 +72,10 @@ let SCMActiveRepositoryController = class SCMActiveRepositoryController extends
|
|
|
72
72
|
case "all":
|
|
73
73
|
{
|
|
74
74
|
const repositories = this._visibleRepositories.read(reader);
|
|
75
|
-
return
|
|
75
|
+
return repositories.map(r => ({
|
|
76
76
|
provider: r.provider,
|
|
77
77
|
resourceCount: this._getRepositoryResourceCount(r)
|
|
78
|
-
}))
|
|
78
|
+
}));
|
|
79
79
|
}
|
|
80
80
|
case "focused":
|
|
81
81
|
{
|
|
@@ -126,7 +126,7 @@ let SCMActiveRepositoryController = class SCMActiveRepositoryController extends
|
|
|
126
126
|
if (count === 0) {
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
|
-
const badge = ( new NumberBadge(count, num => ( localize(
|
|
129
|
+
const badge = ( new NumberBadge(count, num => ( localize(17761, "{0} pending changes", num))));
|
|
130
130
|
store.add(this.activityService.showViewActivity(VIEW_PANE_ID, {
|
|
131
131
|
badge
|
|
132
132
|
}));
|
|
@@ -141,7 +141,7 @@ let SCMActiveRepositoryController = class SCMActiveRepositoryController extends
|
|
|
141
141
|
const tooltip = `${label}${command.tooltip ? ` - ${command.tooltip}` : ""}`;
|
|
142
142
|
const genericCommandName = getStatusBarCommandGenericName(command);
|
|
143
143
|
const statusbarEntry = {
|
|
144
|
-
name: ( localize(
|
|
144
|
+
name: ( localize(17762, "Source Control")) + (genericCommandName ? ` ${genericCommandName}` : ""),
|
|
145
145
|
text: command.title,
|
|
146
146
|
ariaLabel: tooltip,
|
|
147
147
|
tooltip,
|
|
@@ -169,7 +169,7 @@ let SCMActiveRepositoryController = class SCMActiveRepositoryController extends
|
|
|
169
169
|
if (this.scmViewService.repositories.length > 1) {
|
|
170
170
|
const icon = getSCMRepositoryIcon(activeRepository, activeRepository.repository);
|
|
171
171
|
const repositoryStatusbarEntry = {
|
|
172
|
-
name: ( localize(
|
|
172
|
+
name: ( localize(17763, "Source Control Provider")),
|
|
173
173
|
text: `$(${icon.id}) ${activeRepository.repository.provider.name}`,
|
|
174
174
|
ariaLabel: label,
|
|
175
175
|
tooltip: label,
|
|
@@ -202,8 +202,8 @@ let SCMActiveResourceContextKeyController = class SCMActiveResourceContextKeyCon
|
|
|
202
202
|
this.scmService = scmService;
|
|
203
203
|
this.uriIdentityService = uriIdentityService;
|
|
204
204
|
this._onDidRepositoryChange = ( new Emitter());
|
|
205
|
-
const activeResourceHasChangesContextKey =
|
|
206
|
-
const activeResourceRepositoryContextKey =
|
|
205
|
+
const activeResourceHasChangesContextKey = new RawContextKey("scmActiveResourceHasChanges", false, ( localize(17764, "Whether the active resource has changes")));
|
|
206
|
+
const activeResourceRepositoryContextKey = new RawContextKey("scmActiveResourceRepository", undefined, ( localize(17765, "The active resource's repository")));
|
|
207
207
|
this._repositories = observableFromEvent(
|
|
208
208
|
this,
|
|
209
209
|
Event.any(this.scmService.onDidAddRepository, this.scmService.onDidRemoveRepository),
|
|
@@ -14,7 +14,7 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
14
14
|
import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
15
15
|
import { ISCMService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/scm.service';
|
|
16
16
|
|
|
17
|
-
registerCss(scm);
|
|
17
|
+
registerCss(scm, 1);
|
|
18
18
|
function actionEquals(a, b) {
|
|
19
19
|
return a.id === b.id;
|
|
20
20
|
}
|
|
@@ -313,7 +313,7 @@ let SCMMenus = class SCMMenus {
|
|
|
313
313
|
};
|
|
314
314
|
SCMMenus = ( __decorate([( __param(0, ISCMService)), ( __param(1, IInstantiationService))], SCMMenus));
|
|
315
315
|
MenuRegistry.appendMenuItem(MenuId.SCMResourceContext, {
|
|
316
|
-
title: ( localize(
|
|
316
|
+
title: ( localize(17766, "Share")),
|
|
317
317
|
submenu: MenuId.SCMResourceContextShare,
|
|
318
318
|
group: "45_share",
|
|
319
319
|
order: 3
|
|
@@ -15,7 +15,7 @@ import './quickDiffModel.js';
|
|
|
15
15
|
import { QuickDiffEditorController } from './quickDiffWidget.js';
|
|
16
16
|
|
|
17
17
|
MenuRegistry.appendMenuItem(MenuId.EditorLineNumberContext, {
|
|
18
|
-
title: ( localize(
|
|
18
|
+
title: ( localize(17767, "Diff Decorations")),
|
|
19
19
|
submenu: MenuId.SCMQuickDiffDecorations,
|
|
20
20
|
when: ( ContextKeyExpr.or(( ContextKeyExpr.equals("config.scm.diffDecorations", "all")), ( ContextKeyExpr.equals("config.scm.diffDecorations", "gutter")))),
|
|
21
21
|
group: "9_quickDiffDecorations"
|
|
@@ -29,32 +29,32 @@ registerEditorContribution(
|
|
|
29
29
|
( Registry.as(Extensions$1.Configuration)).registerConfiguration({
|
|
30
30
|
id: "scm",
|
|
31
31
|
order: 5,
|
|
32
|
-
title: ( localize(
|
|
32
|
+
title: ( localize(17768, "Source Control")),
|
|
33
33
|
type: "object",
|
|
34
34
|
scope: ConfigurationScope.RESOURCE,
|
|
35
35
|
properties: {
|
|
36
36
|
"scm.diffDecorations": {
|
|
37
37
|
type: "string",
|
|
38
38
|
enum: ["all", "gutter", "overview", "minimap", "none"],
|
|
39
|
-
enumDescriptions: [( localize(
|
|
39
|
+
enumDescriptions: [( localize(17769, "Show the diff decorations in all available locations.")), ( localize(17770, "Show the diff decorations only in the editor gutter.")), ( localize(17771, "Show the diff decorations only in the overview ruler.")), ( localize(17772, "Show the diff decorations only in the minimap.")), ( localize(17773, "Do not show the diff decorations."))],
|
|
40
40
|
default: "all",
|
|
41
|
-
description: ( localize(
|
|
41
|
+
description: ( localize(17774, "Controls diff decorations in the editor."))
|
|
42
42
|
},
|
|
43
43
|
"scm.diffDecorationsGutterWidth": {
|
|
44
44
|
type: "number",
|
|
45
45
|
enum: [1, 2, 3, 4, 5],
|
|
46
46
|
default: 3,
|
|
47
47
|
description: ( localize(
|
|
48
|
-
|
|
48
|
+
17775,
|
|
49
49
|
"Controls the width(px) of diff decorations in gutter (added & modified)."
|
|
50
50
|
))
|
|
51
51
|
},
|
|
52
52
|
"scm.diffDecorationsGutterVisibility": {
|
|
53
53
|
type: "string",
|
|
54
54
|
enum: ["always", "hover"],
|
|
55
|
-
enumDescriptions: [( localize(
|
|
55
|
+
enumDescriptions: [( localize(17776, "Show the diff decorator in the gutter at all times.")), ( localize(17777, "Show the diff decorator in the gutter only on hover."))],
|
|
56
56
|
description: ( localize(
|
|
57
|
-
|
|
57
|
+
17778,
|
|
58
58
|
"Controls the visibility of the Source Control diff decorator in the gutter."
|
|
59
59
|
)),
|
|
60
60
|
default: "always"
|
|
@@ -62,26 +62,26 @@ registerEditorContribution(
|
|
|
62
62
|
"scm.diffDecorationsGutterAction": {
|
|
63
63
|
type: "string",
|
|
64
64
|
enum: ["diff", "none"],
|
|
65
|
-
enumDescriptions: [( localize(
|
|
66
|
-
description: ( localize(
|
|
65
|
+
enumDescriptions: [( localize(17779, "Show the inline diff Peek view on click.")), ( localize(17780, "Do nothing."))],
|
|
66
|
+
description: ( localize(17781, "Controls the behavior of Source Control diff gutter decorations.")),
|
|
67
67
|
default: "diff"
|
|
68
68
|
},
|
|
69
69
|
"scm.diffDecorationsGutterPattern": {
|
|
70
70
|
type: "object",
|
|
71
71
|
description: ( localize(
|
|
72
|
-
|
|
72
|
+
17782,
|
|
73
73
|
"Controls whether a pattern is used for the diff decorations in gutter."
|
|
74
74
|
)),
|
|
75
75
|
additionalProperties: false,
|
|
76
76
|
properties: {
|
|
77
77
|
"added": {
|
|
78
78
|
type: "boolean",
|
|
79
|
-
description: ( localize(
|
|
79
|
+
description: ( localize(17783, "Use pattern for the diff decorations in gutter for added lines."))
|
|
80
80
|
},
|
|
81
81
|
"modified": {
|
|
82
82
|
type: "boolean",
|
|
83
83
|
description: ( localize(
|
|
84
|
-
|
|
84
|
+
17784,
|
|
85
85
|
"Use pattern for the diff decorations in gutter for modified lines."
|
|
86
86
|
))
|
|
87
87
|
}
|
|
@@ -94,9 +94,9 @@ registerEditorContribution(
|
|
|
94
94
|
"scm.diffDecorationsIgnoreTrimWhitespace": {
|
|
95
95
|
type: "string",
|
|
96
96
|
enum: ["true", "false", "inherit"],
|
|
97
|
-
enumDescriptions: [( localize(
|
|
97
|
+
enumDescriptions: [( localize(17785, "Ignore leading and trailing whitespace.")), ( localize(17786, "Do not ignore leading and trailing whitespace.")), ( localize(17787, "Inherit from `diffEditor.ignoreTrimWhitespace`."))],
|
|
98
98
|
description: ( localize(
|
|
99
|
-
|
|
99
|
+
17788,
|
|
100
100
|
"Controls whether leading and trailing whitespace is ignored in Source Control diff gutter decorations."
|
|
101
101
|
)),
|
|
102
102
|
default: "false"
|
|
@@ -25,8 +25,8 @@ import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base
|
|
|
25
25
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
26
26
|
|
|
27
27
|
var QuickDiffDecorator_1;
|
|
28
|
-
registerCss(dirtydiffDecorator);
|
|
29
|
-
const quickDiffDecorationCount =
|
|
28
|
+
registerCss(dirtydiffDecorator, 1);
|
|
29
|
+
const quickDiffDecorationCount = new RawContextKey("quickDiffDecorationCount", 0);
|
|
30
30
|
let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends Disposable {
|
|
31
31
|
static createDecoration(className, tooltip, options) {
|
|
32
32
|
const decorationOptions = {
|
|
@@ -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(
|
|
64
|
+
const diffAdded = ( localize(17789, "Added lines"));
|
|
65
65
|
const diffAddedOptions = {
|
|
66
66
|
gutter,
|
|
67
67
|
overview: {
|
|
@@ -78,7 +78,7 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
|
|
|
78
78
|
this.addedPatternOptions = QuickDiffDecorator_1.createDecoration("dirty-diff-added primary pattern", diffAdded, diffAddedOptions);
|
|
79
79
|
this.addedSecondaryOptions = QuickDiffDecorator_1.createDecoration("dirty-diff-added secondary", diffAdded, diffAddedOptions);
|
|
80
80
|
this.addedSecondaryPatternOptions = QuickDiffDecorator_1.createDecoration("dirty-diff-added secondary pattern", diffAdded, diffAddedOptions);
|
|
81
|
-
const diffModified = ( localize(
|
|
81
|
+
const diffModified = ( localize(17790, "Changed lines"));
|
|
82
82
|
const diffModifiedOptions = {
|
|
83
83
|
gutter,
|
|
84
84
|
overview: {
|
|
@@ -95,7 +95,7 @@ let QuickDiffDecorator = QuickDiffDecorator_1 = class QuickDiffDecorator extends
|
|
|
95
95
|
this.modifiedPatternOptions = QuickDiffDecorator_1.createDecoration("dirty-diff-modified primary pattern", diffModified, diffModifiedOptions);
|
|
96
96
|
this.modifiedSecondaryOptions = QuickDiffDecorator_1.createDecoration("dirty-diff-modified secondary", diffModified, diffModifiedOptions);
|
|
97
97
|
this.modifiedSecondaryPatternOptions = QuickDiffDecorator_1.createDecoration("dirty-diff-modified secondary pattern", diffModified, diffModifiedOptions);
|
|
98
|
-
const diffDeleted = ( localize(
|
|
98
|
+
const diffDeleted = ( localize(17791, "Removed lines"));
|
|
99
99
|
const diffDeletedOptions = {
|
|
100
100
|
gutter,
|
|
101
101
|
overview: {
|
|
@@ -66,7 +66,7 @@ let QuickDiffModelService = class QuickDiffModelService {
|
|
|
66
66
|
QuickDiffModelService = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, ITextFileService)), ( __param(2, IUriIdentityService))], QuickDiffModelService));
|
|
67
67
|
let QuickDiffModel = class QuickDiffModel extends Disposable {
|
|
68
68
|
get originalTextModels() {
|
|
69
|
-
return
|
|
69
|
+
return Iterable.map(( this._originalEditorModels.values()), editorModel => editorModel.textEditorModel);
|
|
70
70
|
}
|
|
71
71
|
get allChanges() {
|
|
72
72
|
return this._allChanges;
|
|
@@ -152,17 +152,17 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
|
|
|
152
152
|
return this._quickDiffs;
|
|
153
153
|
}
|
|
154
154
|
getQuickDiffResults() {
|
|
155
|
-
return
|
|
155
|
+
return this._quickDiffs.map(quickDiff => {
|
|
156
156
|
const changes = this.allChanges.filter(change => change.providerId === quickDiff.id);
|
|
157
157
|
return {
|
|
158
158
|
providerId: quickDiff.id,
|
|
159
159
|
providerKind: quickDiff.kind,
|
|
160
160
|
original: quickDiff.originalResource,
|
|
161
161
|
modified: this._model.resource,
|
|
162
|
-
changes:
|
|
163
|
-
changes2:
|
|
162
|
+
changes: changes.map(change => change.change),
|
|
163
|
+
changes2: changes.map(change => change.change2)
|
|
164
164
|
};
|
|
165
|
-
})
|
|
165
|
+
});
|
|
166
166
|
}
|
|
167
167
|
getDiffEditorModel(originalUri) {
|
|
168
168
|
const editorModel = this._originalEditorModels.get(originalUri);
|
|
@@ -325,7 +325,7 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
|
|
|
325
325
|
this._quickDiffs = quickDiffs;
|
|
326
326
|
this._originalEditorModels.clear();
|
|
327
327
|
this._originalEditorModelsDisposables.clear();
|
|
328
|
-
return (await Promise.all(
|
|
328
|
+
return (await Promise.all(quickDiffs.map(async quickDiff => {
|
|
329
329
|
try {
|
|
330
330
|
const ref = await this.textModelResolverService.createModelReference(quickDiff.originalResource);
|
|
331
331
|
if (this._disposed) {
|
|
@@ -345,7 +345,7 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
|
|
|
345
345
|
} catch (error) {
|
|
346
346
|
return [];
|
|
347
347
|
}
|
|
348
|
-
})))
|
|
348
|
+
}))).flat();
|
|
349
349
|
});
|
|
350
350
|
return this._quickDiffsPromise.finally(() => {
|
|
351
351
|
this._quickDiffsPromise = undefined;
|
|
@@ -366,9 +366,9 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
|
|
|
366
366
|
return this.quickDiffService.getQuickDiffs(uri, this._model.getLanguageId(), isSynchronized);
|
|
367
367
|
}
|
|
368
368
|
findNextClosestChange(lineNumber, inclusive = true, providerId) {
|
|
369
|
-
const visibleQuickDiffIds = ( new Set(
|
|
369
|
+
const visibleQuickDiffIds = ( new Set(this.quickDiffs.filter(
|
|
370
370
|
quickDiff => this.quickDiffService.isQuickDiffProviderVisible(quickDiff.id)
|
|
371
|
-
).map(quickDiff => quickDiff.id)))
|
|
371
|
+
).map(quickDiff => quickDiff.id)));
|
|
372
372
|
for (let i = 0; i < this.changes.length; i++) {
|
|
373
373
|
if (providerId && this.changes[i].providerId !== providerId) {
|
|
374
374
|
continue;
|
|
@@ -390,9 +390,9 @@ let QuickDiffModel = class QuickDiffModel extends Disposable {
|
|
|
390
390
|
return 0;
|
|
391
391
|
}
|
|
392
392
|
findPreviousClosestChange(lineNumber, inclusive = true, providerId) {
|
|
393
|
-
const visibleQuickDiffIds = ( new Set(
|
|
393
|
+
const visibleQuickDiffIds = ( new Set(this.quickDiffs.filter(
|
|
394
394
|
quickDiff => this.quickDiffService.isQuickDiffProviderVisible(quickDiff.id)
|
|
395
|
-
).map(quickDiff => quickDiff.id)))
|
|
395
|
+
).map(quickDiff => quickDiff.id)));
|
|
396
396
|
for (let i = this.changes.length - 1; i >= 0; i--) {
|
|
397
397
|
if (providerId && this.changes[i].providerId !== providerId) {
|
|
398
398
|
continue;
|
|
@@ -59,7 +59,7 @@ import { quickDiffDecorationCount } from './quickDiffDecorator.js';
|
|
|
59
59
|
import { hasNativeContextMenu } from '@codingame/monaco-vscode-api/vscode/vs/platform/window/common/window';
|
|
60
60
|
|
|
61
61
|
var QuickDiffEditorController_1;
|
|
62
|
-
const isQuickDiffVisible =
|
|
62
|
+
const isQuickDiffVisible = new RawContextKey("dirtyDiffVisible", false);
|
|
63
63
|
let QuickDiffPickerViewItem = class QuickDiffPickerViewItem extends SelectActionViewItem {
|
|
64
64
|
constructor(action, contextViewService, themeService, configurationService) {
|
|
65
65
|
const styles = {
|
|
@@ -71,16 +71,16 @@ let QuickDiffPickerViewItem = class QuickDiffPickerViewItem extends SelectAction
|
|
|
71
71
|
const opaqueTitleColor = peekTitleColor?.makeOpaque(editorBackgroundColor) ?? editorBackgroundColor;
|
|
72
72
|
styles.selectBackground = ( ( opaqueTitleColor.lighten(.6)).toString());
|
|
73
73
|
super(null, action, [], 0, contextViewService, styles, {
|
|
74
|
-
ariaLabel: ( localize(
|
|
74
|
+
ariaLabel: ( localize(17792, "Switch quick diff base")),
|
|
75
75
|
useCustomDrawn: !hasNativeContextMenu(configurationService)
|
|
76
76
|
});
|
|
77
77
|
this.optionsItems = [];
|
|
78
78
|
}
|
|
79
79
|
setSelection(quickDiffs, providerId) {
|
|
80
|
-
this.optionsItems =
|
|
80
|
+
this.optionsItems = quickDiffs.map(quickDiff => ({
|
|
81
81
|
providerId: quickDiff.id,
|
|
82
82
|
text: quickDiff.label
|
|
83
|
-
}))
|
|
83
|
+
}));
|
|
84
84
|
const index = this.optionsItems.findIndex(item => item.providerId === providerId);
|
|
85
85
|
this.setOptions(this.optionsItems, index);
|
|
86
86
|
}
|
|
@@ -98,7 +98,7 @@ class QuickDiffPickerBaseAction extends Action {
|
|
|
98
98
|
this.ID = "quickDiff.base.switch";
|
|
99
99
|
}
|
|
100
100
|
static {
|
|
101
|
-
this.LABEL = ( localize(
|
|
101
|
+
this.LABEL = ( localize(17793, "Switch Quick Diff Base"));
|
|
102
102
|
}
|
|
103
103
|
constructor(callback) {
|
|
104
104
|
super(
|
|
@@ -166,7 +166,10 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
|
|
|
166
166
|
contextKeyService = contextKeyService.createOverlay([[
|
|
167
167
|
"originalResourceScheme",
|
|
168
168
|
Iterable.first(this.model.originalTextModels)?.uri.scheme
|
|
169
|
-
], [
|
|
169
|
+
], [
|
|
170
|
+
"originalResourceSchemes",
|
|
171
|
+
Iterable.map(this.model.originalTextModels, textModel => textModel.uri.scheme)
|
|
172
|
+
]]);
|
|
170
173
|
}
|
|
171
174
|
this.create();
|
|
172
175
|
if (editor.hasModel()) {
|
|
@@ -245,13 +248,13 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
|
|
|
245
248
|
if (!this.shouldUseDropdown()) {
|
|
246
249
|
const label = this.model.quickDiffs.find(quickDiff => quickDiff.id === this._providerId)?.label ?? "";
|
|
247
250
|
detail = this.model.changes.length > 1 ? ( localize(
|
|
248
|
-
|
|
251
|
+
17794,
|
|
249
252
|
"{0} - {1} of {2} changes",
|
|
250
253
|
label,
|
|
251
254
|
providerIndex + 1,
|
|
252
255
|
providerChanges.length
|
|
253
256
|
)) : ( localize(
|
|
254
|
-
|
|
257
|
+
17795,
|
|
255
258
|
"{0} - {1} of {2} change",
|
|
256
259
|
label,
|
|
257
260
|
providerIndex + 1,
|
|
@@ -259,7 +262,7 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
|
|
|
259
262
|
));
|
|
260
263
|
this.dropdownContainer.style.display = "none";
|
|
261
264
|
} else {
|
|
262
|
-
detail = this.model.changes.length > 1 ? ( localize(
|
|
265
|
+
detail = this.model.changes.length > 1 ? ( localize(17796, "{0} of {1} changes", providerIndex + 1, providerChanges.length)) : ( localize(17797, "{0} of {1} change", providerIndex + 1, providerChanges.length));
|
|
263
266
|
this.dropdownContainer.style.display = "inherit";
|
|
264
267
|
}
|
|
265
268
|
this.setTitle(this.title, detail);
|
|
@@ -318,7 +321,7 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
|
|
|
318
321
|
label: false,
|
|
319
322
|
icon: true
|
|
320
323
|
});
|
|
321
|
-
this._actionbarWidget.push(this._disposables.add(( new Action("peekview.close", ( localize(
|
|
324
|
+
this._actionbarWidget.push(this._disposables.add(( new Action("peekview.close", ( localize(17798, "Close")), ThemeIcon.asClassName(Codicon.close), true, () => this.dispose()))), {
|
|
322
325
|
label: false,
|
|
323
326
|
icon: true
|
|
324
327
|
});
|
|
@@ -329,7 +332,7 @@ let QuickDiffWidget = class QuickDiffWidget extends PeekViewWidget {
|
|
|
329
332
|
}
|
|
330
333
|
getQuickDiffsContainingChange() {
|
|
331
334
|
const change = this.model.changes[this._index];
|
|
332
|
-
const quickDiffsWithChange =
|
|
335
|
+
const quickDiffsWithChange = this.model.changes.filter(c => change.change2.modified.intersectsOrTouches(c.change2.modified)).map(c => c.providerId);
|
|
333
336
|
return this.model.quickDiffs.filter(
|
|
334
337
|
quickDiff => quickDiffsWithChange.includes(quickDiff.id) && this.quickDiffService.isQuickDiffProviderVisible(quickDiff.id)
|
|
335
338
|
);
|
|
@@ -600,7 +603,10 @@ let QuickDiffEditorController = class QuickDiffEditorController extends Disposab
|
|
|
600
603
|
this.isQuickDiffVisible.set(true);
|
|
601
604
|
const disposables = ( new DisposableStore());
|
|
602
605
|
disposables.add(Event.once(this.widget.onDidClose)(this.close, this));
|
|
603
|
-
const onDidModelChange = Event.chain(
|
|
606
|
+
const onDidModelChange = Event.chain(
|
|
607
|
+
this.model.onDidChange,
|
|
608
|
+
$ => $.filter(e => e.diff.length > 0).map(e => e.diff)
|
|
609
|
+
);
|
|
604
610
|
onDidModelChange(this.onDidModelChange, this, disposables);
|
|
605
611
|
disposables.add(modelRef);
|
|
606
612
|
disposables.add(this.widget);
|
|
@@ -700,7 +706,7 @@ class ShowPreviousChangeAction extends EditorAction {
|
|
|
700
706
|
constructor(outerEditor) {
|
|
701
707
|
super({
|
|
702
708
|
id: "editor.action.dirtydiff.previous",
|
|
703
|
-
label: ( localize2(
|
|
709
|
+
label: ( localize2(17799, "Show Previous Change")),
|
|
704
710
|
precondition: ( TextCompareEditorActiveContext.toNegated()),
|
|
705
711
|
kbOpts: {
|
|
706
712
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -730,7 +736,7 @@ class ShowNextChangeAction extends EditorAction {
|
|
|
730
736
|
constructor(outerEditor) {
|
|
731
737
|
super({
|
|
732
738
|
id: "editor.action.dirtydiff.next",
|
|
733
|
-
label: ( localize2(
|
|
739
|
+
label: ( localize2(17800, "Show Next Change")),
|
|
734
740
|
precondition: ( TextCompareEditorActiveContext.toNegated()),
|
|
735
741
|
kbOpts: {
|
|
736
742
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -760,7 +766,7 @@ class GotoPreviousChangeAction extends EditorAction {
|
|
|
760
766
|
constructor() {
|
|
761
767
|
super({
|
|
762
768
|
id: "workbench.action.editor.previousChange",
|
|
763
|
-
label: ( localize2(
|
|
769
|
+
label: ( localize2(17801, "Go to Previous Change")),
|
|
764
770
|
precondition: ( ContextKeyExpr.and(( TextCompareEditorActiveContext.toNegated()), ( quickDiffDecorationCount.notEqualsTo(0)))),
|
|
765
771
|
kbOpts: {
|
|
766
772
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -798,7 +804,7 @@ class GotoNextChangeAction extends EditorAction {
|
|
|
798
804
|
constructor() {
|
|
799
805
|
super({
|
|
800
806
|
id: "workbench.action.editor.nextChange",
|
|
801
|
-
label: ( localize2(
|
|
807
|
+
label: ( localize2(17802, "Go to Next Change")),
|
|
802
808
|
precondition: ( ContextKeyExpr.and(( TextCompareEditorActiveContext.toNegated()), ( quickDiffDecorationCount.notEqualsTo(0)))),
|
|
803
809
|
kbOpts: {
|
|
804
810
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -836,7 +842,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
|
836
842
|
group: "7_change_nav",
|
|
837
843
|
command: {
|
|
838
844
|
id: "editor.action.dirtydiff.next",
|
|
839
|
-
title: ( localize(
|
|
845
|
+
title: ( localize(17803, "Next &&Change"))
|
|
840
846
|
},
|
|
841
847
|
order: 1
|
|
842
848
|
});
|
|
@@ -844,7 +850,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
|
844
850
|
group: "7_change_nav",
|
|
845
851
|
command: {
|
|
846
852
|
id: "editor.action.dirtydiff.previous",
|
|
847
|
-
title: ( localize(
|
|
853
|
+
title: ( localize(17804, "Previous &&Change"))
|
|
848
854
|
},
|
|
849
855
|
order: 2
|
|
850
856
|
});
|