@codingame/monaco-vscode-multi-diff-editor-service-override 4.5.0 → 4.5.2
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/index.d.ts +1 -1
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/actions.js +20 -19
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditor.contribution.js +5 -8
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +42 -42
- package/multiDiffEditor.d.ts +0 -5
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from 'vscode/service-override/multiDiffEditor';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-multi-diff-editor-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -8,15 +8,12 @@ import { MultiDiffEditor } from './multiDiffEditor.js';
|
|
|
8
8
|
import { MultiDiffEditorInput } from 'vscode/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput';
|
|
9
9
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
10
10
|
|
|
11
|
+
const _moduleId = "vs/workbench/contrib/multiDiffEditor/browser/actions";
|
|
11
12
|
class GoToFileAction extends Action2 {
|
|
12
13
|
constructor() {
|
|
13
14
|
super({
|
|
14
15
|
id: 'multiDiffEditor.goToFile',
|
|
15
|
-
title: ( localize2WithPath(
|
|
16
|
-
'vs/workbench/contrib/multiDiffEditor/browser/actions',
|
|
17
|
-
'goToFile',
|
|
18
|
-
'Open File'
|
|
19
|
-
)),
|
|
16
|
+
title: ( localize2WithPath(_moduleId, 0, 'Open File')),
|
|
20
17
|
icon: Codicon.goToFile,
|
|
21
18
|
precondition: EditorContextKeys.inMultiDiffEditor,
|
|
22
19
|
menu: {
|
|
@@ -52,15 +49,17 @@ class CollapseAllAction extends Action2 {
|
|
|
52
49
|
constructor() {
|
|
53
50
|
super({
|
|
54
51
|
id: 'multiDiffEditor.collapseAll',
|
|
55
|
-
title: ( localize2WithPath(
|
|
56
|
-
'vs/workbench/contrib/multiDiffEditor/browser/actions',
|
|
57
|
-
'collapseAllDiffs',
|
|
58
|
-
'Collapse All Diffs'
|
|
59
|
-
)),
|
|
52
|
+
title: ( localize2WithPath(_moduleId, 1, 'Collapse All Diffs')),
|
|
60
53
|
icon: Codicon.collapseAll,
|
|
61
|
-
precondition: ( ContextKeyExpr.and(
|
|
54
|
+
precondition: ( (ContextKeyExpr.and(
|
|
55
|
+
(ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID)),
|
|
56
|
+
ContextKeyExpr.not('multiDiffEditorAllCollapsed')
|
|
57
|
+
))),
|
|
62
58
|
menu: {
|
|
63
|
-
when: ( ContextKeyExpr.and(
|
|
59
|
+
when: ( (ContextKeyExpr.and(
|
|
60
|
+
(ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID)),
|
|
61
|
+
ContextKeyExpr.not('multiDiffEditorAllCollapsed')
|
|
62
|
+
))),
|
|
64
63
|
id: MenuId.EditorTitle,
|
|
65
64
|
group: 'navigation',
|
|
66
65
|
order: 100
|
|
@@ -81,15 +80,17 @@ class ExpandAllAction extends Action2 {
|
|
|
81
80
|
constructor() {
|
|
82
81
|
super({
|
|
83
82
|
id: 'multiDiffEditor.expandAll',
|
|
84
|
-
title: ( localize2WithPath(
|
|
85
|
-
'vs/workbench/contrib/multiDiffEditor/browser/actions',
|
|
86
|
-
'ExpandAllDiffs',
|
|
87
|
-
'Expand All Diffs'
|
|
88
|
-
)),
|
|
83
|
+
title: ( localize2WithPath(_moduleId, 2, 'Expand All Diffs')),
|
|
89
84
|
icon: Codicon.expandAll,
|
|
90
|
-
precondition: ( ContextKeyExpr.and(
|
|
85
|
+
precondition: ( (ContextKeyExpr.and(
|
|
86
|
+
(ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID)),
|
|
87
|
+
(ContextKeyExpr.has('multiDiffEditorAllCollapsed'))
|
|
88
|
+
))),
|
|
91
89
|
menu: {
|
|
92
|
-
when: ( ContextKeyExpr.and(
|
|
90
|
+
when: ( (ContextKeyExpr.and(
|
|
91
|
+
(ContextKeyExpr.equals('activeEditor', MultiDiffEditor.ID)),
|
|
92
|
+
(ContextKeyExpr.has('multiDiffEditorAllCollapsed'))
|
|
93
|
+
))),
|
|
93
94
|
id: MenuId.EditorTitle,
|
|
94
95
|
group: 'navigation',
|
|
95
96
|
order: 100
|
package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditor.contribution.js
CHANGED
|
@@ -14,10 +14,11 @@ import 'vscode/vscode/vs/base/common/lifecycle';
|
|
|
14
14
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
15
|
import { OpenScmGroupAction, ScmMultiDiffSourceResolverContribution } from './scmMultiDiffSourceResolver.js';
|
|
16
16
|
|
|
17
|
+
const _moduleId = "vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditor.contribution";
|
|
17
18
|
registerAction2(GoToFileAction);
|
|
18
19
|
registerAction2(CollapseAllAction);
|
|
19
20
|
registerAction2(ExpandAllAction);
|
|
20
|
-
( Registry.as(Extensions.Configuration))
|
|
21
|
+
( (Registry.as(Extensions.Configuration)))
|
|
21
22
|
.registerConfiguration({
|
|
22
23
|
properties: {
|
|
23
24
|
'multiDiffEditor.experimental.enabled': {
|
|
@@ -28,13 +29,9 @@ registerAction2(ExpandAllAction);
|
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
registerWorkbenchContribution2(MultiDiffEditorResolverContribution.ID, MultiDiffEditorResolverContribution, 1 );
|
|
31
|
-
( Registry.as(EditorExtensions.EditorPane))
|
|
32
|
-
.registerEditorPane(EditorPaneDescriptor.create(MultiDiffEditor, MultiDiffEditor.ID, ( localizeWithPath(
|
|
33
|
-
|
|
34
|
-
'name',
|
|
35
|
-
"Multi Diff Editor"
|
|
36
|
-
))), [( new SyncDescriptor(MultiDiffEditorInput))]);
|
|
37
|
-
( Registry.as(EditorExtensions.EditorFactory))
|
|
32
|
+
( (Registry.as(EditorExtensions.EditorPane)))
|
|
33
|
+
.registerEditorPane(EditorPaneDescriptor.create(MultiDiffEditor, MultiDiffEditor.ID, ( localizeWithPath(_moduleId, 0, "Multi Diff Editor"))), [( (new SyncDescriptor(MultiDiffEditorInput)))]);
|
|
34
|
+
( (Registry.as(EditorExtensions.EditorFactory)))
|
|
38
35
|
.registerEditorSerializer(MultiDiffEditorInput.ID, MultiDiffEditorSerializer);
|
|
39
36
|
registerAction2(OpenScmGroupAction);
|
|
40
37
|
registerWorkbenchContribution2(ScmMultiDiffSourceResolverContribution.ID, ScmMultiDiffSourceResolverContribution, 1 );
|
package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js
CHANGED
|
@@ -16,14 +16,17 @@ import { ISCMService } from 'vscode/vscode/vs/workbench/contrib/scm/common/scm.s
|
|
|
16
16
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
17
17
|
|
|
18
18
|
var ScmMultiDiffSourceResolver_1;
|
|
19
|
+
const _moduleId = "vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver";
|
|
19
20
|
let ScmMultiDiffSourceResolver = class ScmMultiDiffSourceResolver {
|
|
20
21
|
static { ScmMultiDiffSourceResolver_1 = this; }
|
|
21
22
|
static { this._scheme = 'scm-multi-diff-source'; }
|
|
22
23
|
static getMultiDiffSourceUri(repositoryUri, groupId) {
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
return (
|
|
25
|
+
(URI.from({
|
|
26
|
+
scheme: ScmMultiDiffSourceResolver_1._scheme,
|
|
27
|
+
query: JSON.stringify({ repositoryUri, groupId }),
|
|
28
|
+
}))
|
|
29
|
+
);
|
|
27
30
|
}
|
|
28
31
|
static parseUri(uri) {
|
|
29
32
|
if (uri.scheme !== ScmMultiDiffSourceResolver_1._scheme) {
|
|
@@ -43,7 +46,7 @@ let ScmMultiDiffSourceResolver = class ScmMultiDiffSourceResolver {
|
|
|
43
46
|
if (typeof repositoryUri !== 'string' || typeof groupId !== 'string') {
|
|
44
47
|
return undefined;
|
|
45
48
|
}
|
|
46
|
-
return { repositoryUri: ( URI.parse(repositoryUri)), groupId };
|
|
49
|
+
return { repositoryUri: ( (URI.parse(repositoryUri))), groupId };
|
|
47
50
|
}
|
|
48
51
|
constructor(_scmService) {
|
|
49
52
|
this._scmService = _scmService;
|
|
@@ -54,28 +57,30 @@ let ScmMultiDiffSourceResolver = class ScmMultiDiffSourceResolver {
|
|
|
54
57
|
async resolveDiffSource(uri) {
|
|
55
58
|
const { repositoryUri, groupId } = ScmMultiDiffSourceResolver_1.parseUri(uri);
|
|
56
59
|
const repository = await promiseFromEventState(this._scmService.onDidAddRepository, () => {
|
|
57
|
-
const repository = [...this._scmService.repositories].find(r => r.provider.rootUri?.toString() === ( repositoryUri.toString()));
|
|
60
|
+
const repository = [...this._scmService.repositories].find(r => r.provider.rootUri?.toString() === ( (repositoryUri.toString())));
|
|
58
61
|
return repository ?? false;
|
|
59
62
|
});
|
|
60
63
|
const group = await promiseFromEventState(repository.provider.onDidChangeResourceGroups, () => {
|
|
61
64
|
const group = repository.provider.groups.find(g => g.id === groupId);
|
|
62
65
|
return group ?? false;
|
|
63
66
|
});
|
|
64
|
-
const resources = observableFromEvent(group.onDidChangeResources, () => ( group.resources.map(e => {
|
|
67
|
+
const resources = observableFromEvent(group.onDidChangeResources, () => ( (group.resources.map(e => {
|
|
65
68
|
return {
|
|
66
69
|
original: e.multiDiffEditorOriginalUri,
|
|
67
70
|
modified: e.multiDiffEditorModifiedUri
|
|
68
71
|
};
|
|
69
|
-
})));
|
|
70
|
-
return (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
}))));
|
|
73
|
+
return (
|
|
74
|
+
(new ScmResolvedMultiDiffSource(resources, {
|
|
75
|
+
scmResourceGroup: groupId,
|
|
76
|
+
scmProvider: repository.provider.contextValue,
|
|
77
|
+
}))
|
|
78
|
+
);
|
|
74
79
|
}
|
|
75
80
|
};
|
|
76
|
-
ScmMultiDiffSourceResolver = ScmMultiDiffSourceResolver_1 = ( __decorate([
|
|
77
|
-
( __param(0, ISCMService))
|
|
78
|
-
], ScmMultiDiffSourceResolver));
|
|
81
|
+
ScmMultiDiffSourceResolver = ScmMultiDiffSourceResolver_1 = ( (__decorate([
|
|
82
|
+
( (__param(0, ISCMService)))
|
|
83
|
+
], ScmMultiDiffSourceResolver)));
|
|
79
84
|
class ScmResolvedMultiDiffSource {
|
|
80
85
|
get resources() { return this._resources.get(); }
|
|
81
86
|
constructor(_resources, contextKeys) {
|
|
@@ -89,15 +94,17 @@ function promiseFromEventState(event, checkState) {
|
|
|
89
94
|
if (state) {
|
|
90
95
|
return Promise.resolve(state);
|
|
91
96
|
}
|
|
92
|
-
return (
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
return (
|
|
98
|
+
(new Promise(resolve => {
|
|
99
|
+
const listener = event(() => {
|
|
100
|
+
const state = checkState();
|
|
101
|
+
if (state) {
|
|
102
|
+
listener.dispose();
|
|
103
|
+
resolve(state);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}))
|
|
107
|
+
);
|
|
101
108
|
}
|
|
102
109
|
let ScmMultiDiffSourceResolverContribution = class ScmMultiDiffSourceResolverContribution extends Disposable {
|
|
103
110
|
static { this.ID = 'workbench.contrib.scmMultiDiffSourceResolver'; }
|
|
@@ -106,22 +113,21 @@ let ScmMultiDiffSourceResolverContribution = class ScmMultiDiffSourceResolverCon
|
|
|
106
113
|
this._register(multiDiffSourceResolverService.registerResolver(instantiationService.createInstance(ScmMultiDiffSourceResolver)));
|
|
107
114
|
}
|
|
108
115
|
};
|
|
109
|
-
ScmMultiDiffSourceResolverContribution = ( __decorate([
|
|
110
|
-
( __param(0, IInstantiationService)),
|
|
111
|
-
( __param(1, IMultiDiffSourceResolverService))
|
|
112
|
-
], ScmMultiDiffSourceResolverContribution));
|
|
116
|
+
ScmMultiDiffSourceResolverContribution = ( (__decorate([
|
|
117
|
+
( (__param(0, IInstantiationService))),
|
|
118
|
+
( (__param(1, IMultiDiffSourceResolverService)))
|
|
119
|
+
], ScmMultiDiffSourceResolverContribution)));
|
|
113
120
|
class OpenScmGroupAction extends Action2 {
|
|
114
121
|
constructor() {
|
|
115
122
|
super({
|
|
116
123
|
id: 'multiDiffEditor.openScmDiff',
|
|
117
|
-
title: ( localize2WithPath(
|
|
118
|
-
'vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver',
|
|
119
|
-
'viewChanges',
|
|
120
|
-
'View Changes'
|
|
121
|
-
)),
|
|
124
|
+
title: ( localize2WithPath(_moduleId, 0, 'View Changes')),
|
|
122
125
|
icon: Codicon.diffMultiple,
|
|
123
126
|
menu: {
|
|
124
|
-
when: ( ContextKeyExpr.and(
|
|
127
|
+
when: ( (ContextKeyExpr.and(
|
|
128
|
+
(ContextKeyExpr.has('config.multiDiffEditor.experimental.enabled')),
|
|
129
|
+
(ContextKeyExpr.has('multiDiffEditorEnableViewChanges'))
|
|
130
|
+
))),
|
|
125
131
|
id: MenuId.SCMResourceGroupContext,
|
|
126
132
|
group: 'inline',
|
|
127
133
|
},
|
|
@@ -133,14 +139,8 @@ class OpenScmGroupAction extends Action2 {
|
|
|
133
139
|
if (!group.provider.rootUri) {
|
|
134
140
|
return;
|
|
135
141
|
}
|
|
136
|
-
const multiDiffSource = ScmMultiDiffSourceResolver.getMultiDiffSourceUri(( group.provider.rootUri.toString()), group.id);
|
|
137
|
-
const label = ( localizeWithPath(
|
|
138
|
-
'vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver',
|
|
139
|
-
'scmDiffLabel',
|
|
140
|
-
'{0}: {1}',
|
|
141
|
-
group.provider.label,
|
|
142
|
-
group.label
|
|
143
|
-
));
|
|
142
|
+
const multiDiffSource = ScmMultiDiffSourceResolver.getMultiDiffSourceUri(( (group.provider.rootUri.toString())), group.id);
|
|
143
|
+
const label = ( localizeWithPath(_moduleId, 1, '{0}: {1}', group.provider.label, group.label));
|
|
144
144
|
await editorService.openEditor({ label, multiDiffSource });
|
|
145
145
|
}
|
|
146
146
|
}
|