@codingame/monaco-vscode-view-common-service-override 22.1.9 → 23.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.
- package/index.js +5 -5
- package/package.json +41 -41
- package/vscode/src/vs/platform/actions/browser/actionViewItemService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +92 -69
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +4 -4
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +175 -175
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +8 -8
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +12 -12
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +5 -5
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +3 -3
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +18 -5
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +6 -6
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +8 -7
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.d.ts +64 -14
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +79 -77
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.js +7 -7
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +30 -30
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +14 -14
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +13 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +12 -12
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +6 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +3 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +2 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +12 -12
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/scrollLocking/browser/scrollLocking.js +8 -8
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +5 -5
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +3 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +1 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +2 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +7 -7
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +2 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +3 -3
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +12 -12
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +10 -10
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +10 -10
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.d.ts +2 -2
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +2 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +5 -5
|
@@ -27,22 +27,22 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
|
|
|
27
27
|
static { this.AUTO_LOCK_EXTRA_EDITORS = [
|
|
28
28
|
{
|
|
29
29
|
id: 'workbench.input.interactive',
|
|
30
|
-
label: ( localize(
|
|
30
|
+
label: ( localize(3334, 'Interactive Window')),
|
|
31
31
|
priority: RegisteredEditorPriority.builtin
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
id: 'mainThreadWebview-markdown.preview',
|
|
35
|
-
label: ( localize(
|
|
35
|
+
label: ( localize(3335, "Markdown Preview")),
|
|
36
36
|
priority: RegisteredEditorPriority.builtin
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
id: 'mainThreadWebview-simpleBrowser.view',
|
|
40
|
-
label: ( localize(
|
|
40
|
+
label: ( localize(3336, "Simple Browser")),
|
|
41
41
|
priority: RegisteredEditorPriority.builtin
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
id: 'mainThreadWebview-browserPreview',
|
|
45
|
-
label: ( localize(
|
|
45
|
+
label: ( localize(3337, "Live Preview")),
|
|
46
46
|
priority: RegisteredEditorPriority.builtin
|
|
47
47
|
}
|
|
48
48
|
]; }
|
|
@@ -87,7 +87,7 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
|
|
|
87
87
|
'workbench.editor.autoLockGroups': {
|
|
88
88
|
type: 'object',
|
|
89
89
|
description: ( localize(
|
|
90
|
-
|
|
90
|
+
3338,
|
|
91
91
|
"If an editor matching one of the listed types is opened as the first in an editor group and more than one group is open, the group is automatically locked. Locked groups will only be used for opening editors when explicitly chosen by a user gesture (for example drag and drop), but not by default. Consequently, the active editor in a locked group is less likely to be replaced accidentally with a different editor."
|
|
92
92
|
)),
|
|
93
93
|
properties: autoLockGroupConfiguration,
|
|
@@ -105,7 +105,7 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
|
|
|
105
105
|
default: '',
|
|
106
106
|
enum: [...binaryEditorCandidates, ''],
|
|
107
107
|
description: ( localize(
|
|
108
|
-
|
|
108
|
+
3339,
|
|
109
109
|
"The default editor for files detected as binary. If undefined, the user will be presented with a picker."
|
|
110
110
|
)),
|
|
111
111
|
}
|
|
@@ -118,7 +118,7 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
|
|
|
118
118
|
'workbench.editorAssociations': {
|
|
119
119
|
type: 'object',
|
|
120
120
|
markdownDescription: ( localize(
|
|
121
|
-
|
|
121
|
+
3340,
|
|
122
122
|
"Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `\"*.hex\": \"hexEditor.hexedit\"`). These have precedence over the default behavior."
|
|
123
123
|
)),
|
|
124
124
|
patternProperties: {
|
|
@@ -140,7 +140,7 @@ let DynamicEditorConfigurations = class DynamicEditorConfigurations extends Disp
|
|
|
140
140
|
minimum: 1,
|
|
141
141
|
scope: ConfigurationScope.RESOURCE,
|
|
142
142
|
markdownDescription: ( localize(
|
|
143
|
-
|
|
143
|
+
3341,
|
|
144
144
|
"Controls the minimum size of a file in MB before asking for confirmation when opening in the editor. Note that this setting may not apply to all editor types and environments."
|
|
145
145
|
)),
|
|
146
146
|
}
|
|
@@ -24,12 +24,12 @@ import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/th
|
|
|
24
24
|
import { isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
25
25
|
|
|
26
26
|
var CallHierarchyController_1;
|
|
27
|
-
const _ctxHasCallHierarchyProvider = ( new RawContextKey('editorHasCallHierarchyProvider', false, ( localize(
|
|
28
|
-
const _ctxCallHierarchyVisible = ( new RawContextKey('callHierarchyVisible', false, ( localize(
|
|
27
|
+
const _ctxHasCallHierarchyProvider = ( new RawContextKey('editorHasCallHierarchyProvider', false, ( localize(4487, 'Whether a call hierarchy provider is available'))));
|
|
28
|
+
const _ctxCallHierarchyVisible = ( new RawContextKey('callHierarchyVisible', false, ( localize(4488, 'Whether call hierarchy peek is currently showing'))));
|
|
29
29
|
const _ctxCallHierarchyDirection = ( new RawContextKey(
|
|
30
30
|
'callHierarchyDirection',
|
|
31
31
|
undefined,
|
|
32
|
-
{ type: 'string', description: ( localize(
|
|
32
|
+
{ type: 'string', description: ( localize(4489, 'Whether call hierarchy shows incoming or outgoing calls')) }
|
|
33
33
|
));
|
|
34
34
|
function sanitizedDirection(candidate) {
|
|
35
35
|
return candidate === CallHierarchyDirection.CallsFrom || candidate === CallHierarchyDirection.CallsTo
|
|
@@ -117,14 +117,14 @@ let CallHierarchyController = class CallHierarchyController {
|
|
|
117
117
|
this._widget.showModel(model);
|
|
118
118
|
}
|
|
119
119
|
else {
|
|
120
|
-
this._widget.showMessage(( localize(
|
|
120
|
+
this._widget.showMessage(( localize(4490, "No results")));
|
|
121
121
|
}
|
|
122
122
|
}).catch(err => {
|
|
123
123
|
if (isCancellationError(err)) {
|
|
124
124
|
this.endCallHierarchy();
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
this._widget.showMessage(( localize(
|
|
127
|
+
this._widget.showMessage(( localize(4491, "Failed to show call hierarchy")));
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
showOutgoingCalls() {
|
|
@@ -152,7 +152,7 @@ registerAction2(class PeekCallHierarchyAction extends EditorAction2 {
|
|
|
152
152
|
constructor() {
|
|
153
153
|
super({
|
|
154
154
|
id: 'editor.showCallHierarchy',
|
|
155
|
-
title: ( localize2(
|
|
155
|
+
title: ( localize2(4492, 'Peek Call Hierarchy')),
|
|
156
156
|
menu: {
|
|
157
157
|
id: MenuId.EditorContextPeek,
|
|
158
158
|
group: 'navigation',
|
|
@@ -176,8 +176,8 @@ registerAction2(class extends EditorAction2 {
|
|
|
176
176
|
constructor() {
|
|
177
177
|
super({
|
|
178
178
|
id: 'editor.showIncomingCalls',
|
|
179
|
-
title: ( localize2(
|
|
180
|
-
icon: registerIcon('callhierarchy-incoming', Codicon.callIncoming, ( localize(
|
|
179
|
+
title: ( localize2(4493, 'Show Incoming Calls')),
|
|
180
|
+
icon: registerIcon('callhierarchy-incoming', Codicon.callIncoming, ( localize(4494, 'Icon for incoming calls in the call hierarchy view.'))),
|
|
181
181
|
precondition: ( ContextKeyExpr.and(_ctxCallHierarchyVisible, ( _ctxCallHierarchyDirection.isEqualTo(CallHierarchyDirection.CallsFrom)))),
|
|
182
182
|
keybinding: {
|
|
183
183
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
@@ -198,8 +198,8 @@ registerAction2(class extends EditorAction2 {
|
|
|
198
198
|
constructor() {
|
|
199
199
|
super({
|
|
200
200
|
id: 'editor.showOutgoingCalls',
|
|
201
|
-
title: ( localize2(
|
|
202
|
-
icon: registerIcon('callhierarchy-outgoing', Codicon.callOutgoing, ( localize(
|
|
201
|
+
title: ( localize2(4495, 'Show Outgoing Calls')),
|
|
202
|
+
icon: registerIcon('callhierarchy-outgoing', Codicon.callOutgoing, ( localize(4496, 'Icon for outgoing calls in the call hierarchy view.'))),
|
|
203
203
|
precondition: ( ContextKeyExpr.and(_ctxCallHierarchyVisible, ( _ctxCallHierarchyDirection.isEqualTo(CallHierarchyDirection.CallsTo)))),
|
|
204
204
|
keybinding: {
|
|
205
205
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
@@ -220,7 +220,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
220
220
|
constructor() {
|
|
221
221
|
super({
|
|
222
222
|
id: 'editor.refocusCallHierarchy',
|
|
223
|
-
title: ( localize2(
|
|
223
|
+
title: ( localize2(4497, 'Refocus Call Hierarchy')),
|
|
224
224
|
precondition: _ctxCallHierarchyVisible,
|
|
225
225
|
keybinding: {
|
|
226
226
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
@@ -236,7 +236,7 @@ registerAction2(class extends EditorAction2 {
|
|
|
236
236
|
constructor() {
|
|
237
237
|
super({
|
|
238
238
|
id: 'editor.closeCallHierarchy',
|
|
239
|
-
title: ( localize(
|
|
239
|
+
title: ( localize(4498, 'Close')),
|
|
240
240
|
icon: Codicon.close,
|
|
241
241
|
precondition: _ctxCallHierarchyVisible,
|
|
242
242
|
keybinding: {
|
|
@@ -270,13 +270,13 @@ let CallHierarchyTreePeekWidget = class CallHierarchyTreePeekWidget extends Peek
|
|
|
270
270
|
}
|
|
271
271
|
this._previewDisposable.add(value);
|
|
272
272
|
const title = this._direction === CallHierarchyDirection.CallsFrom
|
|
273
|
-
? ( localize(
|
|
274
|
-
: ( localize(
|
|
273
|
+
? ( localize(4499, "Calls from '{0}'", element.model.root.name))
|
|
274
|
+
: ( localize(4500, "Callers of '{0}'", element.model.root.name));
|
|
275
275
|
this.setTitle(title);
|
|
276
276
|
}
|
|
277
277
|
showLoading() {
|
|
278
278
|
this._parent.dataset['state'] = State.Loading;
|
|
279
|
-
this.setTitle(( localize(
|
|
279
|
+
this.setTitle(( localize(4501, "Loading...")));
|
|
280
280
|
this._show();
|
|
281
281
|
}
|
|
282
282
|
showMessage(message) {
|
|
@@ -295,8 +295,8 @@ let CallHierarchyTreePeekWidget = class CallHierarchyTreePeekWidget extends Peek
|
|
|
295
295
|
await this._tree.expand(root.element);
|
|
296
296
|
if (root.children.length === 0) {
|
|
297
297
|
this.showMessage(this._direction === CallHierarchyDirection.CallsFrom
|
|
298
|
-
? ( localize(
|
|
299
|
-
: ( localize(
|
|
298
|
+
? ( localize(4502, "No calls from '{0}'", model.root.name))
|
|
299
|
+
: ( localize(4503, "No callers of '{0}'", model.root.name)));
|
|
300
300
|
}
|
|
301
301
|
else {
|
|
302
302
|
this._parent.dataset['state'] = State.Data;
|
|
@@ -108,14 +108,14 @@ class AccessibilityProvider {
|
|
|
108
108
|
this.getDirection = getDirection;
|
|
109
109
|
}
|
|
110
110
|
getWidgetAriaLabel() {
|
|
111
|
-
return localize(
|
|
111
|
+
return localize(4504, "Call Hierarchy");
|
|
112
112
|
}
|
|
113
113
|
getAriaLabel(element) {
|
|
114
114
|
if (this.getDirection() === CallHierarchyDirection.CallsFrom) {
|
|
115
|
-
return localize(
|
|
115
|
+
return localize(4505, "calls from {0}", element.item.name);
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
|
-
return localize(
|
|
118
|
+
return localize(4506, "callers of {0}", element.item.name);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -8,13 +8,18 @@ import { ICustomEditorService } from "@codingame/monaco-vscode-api/vscode/vs/wor
|
|
|
8
8
|
import { IWebviewService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview.service";
|
|
9
9
|
import { DeserializedWebview, SerializedWebview, SerializedWebviewOptions, WebviewEditorInputSerializer } from "../../webviewPanel/browser/webviewEditorInputSerializer.js";
|
|
10
10
|
import { IWebviewWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.service";
|
|
11
|
-
import { IWorkingCopyBackupMeta, IWorkingCopyIdentifier } from "@codingame/monaco-vscode-
|
|
11
|
+
import { IWorkingCopyBackupMeta, IWorkingCopyIdentifier } from "@codingame/monaco-vscode-d392702e-4ad7-5904-a915-f6063284cf14-common/vscode/vs/workbench/services/workingCopy/common/workingCopy";
|
|
12
12
|
import { IWorkingCopyBackupService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.service";
|
|
13
13
|
import { IWorkingCopyEditorHandler } from "@codingame/monaco-vscode-working-copy-service-override/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService";
|
|
14
14
|
import { IWorkingCopyEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.service";
|
|
15
15
|
export interface CustomDocumentBackupData extends IWorkingCopyBackupMeta {
|
|
16
16
|
readonly viewType: string;
|
|
17
17
|
readonly editorResource: UriComponents;
|
|
18
|
+
readonly customTitle: string | undefined;
|
|
19
|
+
readonly iconPath: {
|
|
20
|
+
dark: UriComponents;
|
|
21
|
+
light: UriComponents;
|
|
22
|
+
} | undefined;
|
|
18
23
|
backupId: string;
|
|
19
24
|
readonly extension: undefined | {
|
|
20
25
|
readonly location: UriComponents;
|
|
@@ -7,8 +7,8 @@ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
|
7
7
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
8
|
import { CustomEditorInput } from '@codingame/monaco-vscode-7f39b6f1-3542-5430-8760-0f404d7a7cee-common/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput';
|
|
9
9
|
import { ICustomEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/customEditor/common/customEditor.service';
|
|
10
|
-
import { NotebookEditorInput } from '@codingame/monaco-vscode-
|
|
11
|
-
import { WebviewContentPurpose } from '@codingame/monaco-vscode-
|
|
10
|
+
import { NotebookEditorInput } from '@codingame/monaco-vscode-9d2c06d1-1f89-51a5-9964-aa01fe50c198-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
11
|
+
import { WebviewContentPurpose } from '@codingame/monaco-vscode-2a04f0cd-b806-5886-909e-418183d32279-common/vscode/vs/workbench/contrib/webview/browser/webview';
|
|
12
12
|
import { IWebviewService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview.service';
|
|
13
13
|
import { WebviewEditorInputSerializer, reviveWebviewExtensionDescription, restoreWebviewContentOptions, restoreWebviewOptions } from '../../webviewPanel/browser/webviewEditorInputSerializer.js';
|
|
14
14
|
import { IWebviewWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.service';
|
|
@@ -47,7 +47,12 @@ let CustomEditorInputSerializer = class CustomEditorInputSerializer extends Webv
|
|
|
47
47
|
deserialize(_instantiationService, serializedEditorInput) {
|
|
48
48
|
const data = this.fromJson(JSON.parse(serializedEditorInput));
|
|
49
49
|
const webview = reviveWebview(this._webviewService, data);
|
|
50
|
-
const customInput = this._instantiationService.createInstance(CustomEditorInput, {
|
|
50
|
+
const customInput = this._instantiationService.createInstance(CustomEditorInput, {
|
|
51
|
+
resource: data.editorResource,
|
|
52
|
+
viewType: data.viewType,
|
|
53
|
+
webviewTitle: data.title,
|
|
54
|
+
iconPath: data.iconPath,
|
|
55
|
+
}, webview, { startsDirty: data.dirty, backupId: data.backupId });
|
|
51
56
|
if (typeof data.group === 'number') {
|
|
52
57
|
customInput.updateGroup(data.group);
|
|
53
58
|
}
|
|
@@ -63,7 +68,7 @@ function reviveWebview(webviewService, data) {
|
|
|
63
68
|
const webview = webviewService.createWebviewOverlay({
|
|
64
69
|
providedViewType: data.viewType,
|
|
65
70
|
origin: data.origin,
|
|
66
|
-
title:
|
|
71
|
+
title: data.title,
|
|
67
72
|
options: {
|
|
68
73
|
purpose: WebviewContentPurpose.CustomEditor,
|
|
69
74
|
enableFindWidget: data.webviewOptions.enableFindWidget,
|
|
@@ -131,8 +136,16 @@ let ComplexCustomWorkingCopyEditorHandler = class ComplexCustomWorkingCopyEditor
|
|
|
131
136
|
contentOptions: restoreWebviewContentOptions(backupData.webview.options),
|
|
132
137
|
state: backupData.webview.state,
|
|
133
138
|
extension,
|
|
139
|
+
title: backupData.customTitle,
|
|
134
140
|
});
|
|
135
|
-
const editor = this._instantiationService.createInstance(CustomEditorInput, {
|
|
141
|
+
const editor = this._instantiationService.createInstance(CustomEditorInput, {
|
|
142
|
+
resource: URI.revive(backupData.editorResource),
|
|
143
|
+
viewType: backupData.viewType,
|
|
144
|
+
webviewTitle: backupData.customTitle,
|
|
145
|
+
iconPath: backupData.iconPath
|
|
146
|
+
? { dark: URI.revive(backupData.iconPath.dark), light: URI.revive(backupData.iconPath.light) }
|
|
147
|
+
: undefined
|
|
148
|
+
}, webview, { backupId: backupData.backupId });
|
|
136
149
|
editor.updateGroup(0);
|
|
137
150
|
return editor;
|
|
138
151
|
}
|
|
@@ -104,12 +104,12 @@ let CustomEditorService = class CustomEditorService extends Disposable {
|
|
|
104
104
|
singlePerResource: () => !(this.getCustomEditorCapabilities(contributedEditor.id)?.supportsMultipleEditorsPerDocument ?? false)
|
|
105
105
|
}, {
|
|
106
106
|
createEditorInput: ({ resource }, group) => {
|
|
107
|
-
return { editor: CustomEditorInput.create(this.instantiationService, resource, contributedEditor.id, group.id) };
|
|
107
|
+
return { editor: CustomEditorInput.create(this.instantiationService, { resource, viewType: contributedEditor.id, webviewTitle: undefined, iconPath: undefined }, group.id) };
|
|
108
108
|
},
|
|
109
109
|
createUntitledEditorInput: ({ resource }, group) => {
|
|
110
|
-
return { editor: CustomEditorInput.create(this.instantiationService, resource ?? ( URI.from(
|
|
110
|
+
return { editor: CustomEditorInput.create(this.instantiationService, { resource: resource ?? ( URI.from(
|
|
111
111
|
{ scheme: Schemas.untitled, authority: `Untitled-${this._untitledCounter++}` }
|
|
112
|
-
)), contributedEditor.id, group.id) };
|
|
112
|
+
)), viewType: contributedEditor.id, webviewTitle: undefined, iconPath: undefined }, group.id) };
|
|
113
113
|
},
|
|
114
114
|
createDiffEditorInput: (diffEditorInput, group) => {
|
|
115
115
|
return { editor: this.createDiffEditorInput(diffEditorInput, contributedEditor.id, group) };
|
|
@@ -119,8 +119,8 @@ let CustomEditorService = class CustomEditorService extends Disposable {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
createDiffEditorInput(editor, editorID, group) {
|
|
122
|
-
const modifiedOverride = CustomEditorInput.create(this.instantiationService, assertReturnsDefined(editor.modified.resource), editorID, group.id, { customClasses: 'modified' });
|
|
123
|
-
const originalOverride = CustomEditorInput.create(this.instantiationService, assertReturnsDefined(editor.original.resource), editorID, group.id, { customClasses: 'original' });
|
|
122
|
+
const modifiedOverride = CustomEditorInput.create(this.instantiationService, { resource: assertReturnsDefined(editor.modified.resource), viewType: editorID, webviewTitle: undefined, iconPath: undefined }, group.id, { customClasses: 'modified' });
|
|
123
|
+
const originalOverride = CustomEditorInput.create(this.instantiationService, { resource: assertReturnsDefined(editor.original.resource), viewType: editorID, webviewTitle: undefined, iconPath: undefined }, group.id, { customClasses: 'original' });
|
|
124
124
|
return this.instantiationService.createInstance(DiffEditorInput, editor.label, editor.description, originalOverride, modifiedOverride, true);
|
|
125
125
|
}
|
|
126
126
|
get models() { return this._models; }
|
|
@@ -200,7 +200,7 @@ let CustomEditorService = class CustomEditorService extends Disposable {
|
|
|
200
200
|
let replacement;
|
|
201
201
|
if (possibleEditors.defaultEditor) {
|
|
202
202
|
const viewType = possibleEditors.defaultEditor.id;
|
|
203
|
-
replacement = CustomEditorInput.create(this.instantiationService, newResource, viewType, group);
|
|
203
|
+
replacement = CustomEditorInput.create(this.instantiationService, { resource: newResource, viewType, webviewTitle: undefined, iconPath: undefined }, group);
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
206
206
|
replacement = { resource: newResource, options: { override: DEFAULT_EDITOR_ASSOCIATION.id } };
|
|
@@ -4,7 +4,7 @@ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
4
4
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
5
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
6
6
|
import { Memento } from '@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common/vscode/vs/workbench/common/memento';
|
|
7
|
-
import { CustomEditorInfo } from './customEditor.js';
|
|
7
|
+
import { CustomEditorInfo, CustomEditorPriority } from './customEditor.js';
|
|
8
8
|
import { customEditorsExtensionPoint } from './extensionPoint.js';
|
|
9
9
|
import { RegisteredEditorPriority } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
10
10
|
|
|
@@ -18,7 +18,7 @@ class ContributedCustomEditors extends Disposable {
|
|
|
18
18
|
this.onChange = this._onChange.event;
|
|
19
19
|
this._memento = ( new Memento(ContributedCustomEditors.CUSTOM_EDITORS_STORAGE_ID, storageService));
|
|
20
20
|
const mementoObject = this._memento.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
|
|
21
|
-
for (const info of
|
|
21
|
+
for (const info of mementoObject[ContributedCustomEditors.CUSTOM_EDITORS_ENTRY_ID] || []) {
|
|
22
22
|
this.add(( new CustomEditorInfo(info)));
|
|
23
23
|
}
|
|
24
24
|
this._register(customEditorsExtensionPoint.setHandler(extensions => {
|
|
@@ -32,7 +32,7 @@ class ContributedCustomEditors extends Disposable {
|
|
|
32
32
|
this.add(( new CustomEditorInfo({
|
|
33
33
|
id: webviewEditorContribution.viewType,
|
|
34
34
|
displayName: webviewEditorContribution.displayName,
|
|
35
|
-
providerDisplayName: extension.description.isBuiltin ? ( localize(
|
|
35
|
+
providerDisplayName: extension.description.isBuiltin ? ( localize(6259, "Built-in")) : extension.description.displayName || extension.description.identifier.value,
|
|
36
36
|
selector: webviewEditorContribution.selector || [],
|
|
37
37
|
priority: getPriorityFromContribution(webviewEditorContribution, extension.description),
|
|
38
38
|
})));
|
|
@@ -63,10 +63,11 @@ class ContributedCustomEditors extends Disposable {
|
|
|
63
63
|
}
|
|
64
64
|
function getPriorityFromContribution(contribution, extension) {
|
|
65
65
|
switch (contribution.priority) {
|
|
66
|
-
case
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
case CustomEditorPriority.default:
|
|
67
|
+
return RegisteredEditorPriority.default;
|
|
68
|
+
case CustomEditorPriority.option:
|
|
69
|
+
return RegisteredEditorPriority.option;
|
|
70
|
+
case CustomEditorPriority.builtin:
|
|
70
71
|
return extension.isBuiltin ? RegisteredEditorPriority.builtin : RegisteredEditorPriority.default;
|
|
71
72
|
default:
|
|
72
73
|
return RegisteredEditorPriority.default;
|
|
@@ -6,7 +6,7 @@ import { globMatchesResource, RegisteredEditorPriority, priorityToRank } from '@
|
|
|
6
6
|
|
|
7
7
|
const CONTEXT_ACTIVE_CUSTOM_EDITOR_ID = ( new RawContextKey('activeCustomEditorId', '', {
|
|
8
8
|
type: 'string',
|
|
9
|
-
description: ( localize(
|
|
9
|
+
description: ( localize(6260, "The viewType of the currently active custom editor.")),
|
|
10
10
|
}));
|
|
11
11
|
const CONTEXT_FOCUSED_CUSTOM_EDITOR_IS_EDITABLE = ( new RawContextKey('focusedCustomEditorIsEditable', false));
|
|
12
12
|
var CustomEditorPriority;
|
|
@@ -1,15 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { TypeFromJsonSchema } from "@codingame/monaco-vscode-api/vscode/vs/base/common/jsonSchema";
|
|
2
|
+
import { CustomEditorPriority } from "./customEditor.js";
|
|
3
|
+
declare const customEditorsContributionSchema: {
|
|
4
|
+
readonly type: "object";
|
|
5
|
+
readonly required: [
|
|
6
|
+
"viewType",
|
|
7
|
+
"displayName",
|
|
8
|
+
"selector"
|
|
9
|
+
];
|
|
10
|
+
readonly additionalProperties: false;
|
|
11
|
+
readonly properties: {
|
|
12
|
+
readonly viewType: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly markdownDescription: string;
|
|
15
|
+
};
|
|
16
|
+
readonly displayName: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly description: string;
|
|
19
|
+
};
|
|
20
|
+
readonly selector: {
|
|
21
|
+
readonly type: "array";
|
|
22
|
+
readonly description: string;
|
|
23
|
+
readonly items: {
|
|
24
|
+
readonly type: "object";
|
|
25
|
+
readonly defaultSnippets: [
|
|
26
|
+
{
|
|
27
|
+
readonly body: {
|
|
28
|
+
readonly filenamePattern: "$1";
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
readonly additionalProperties: false;
|
|
33
|
+
readonly properties: {
|
|
34
|
+
readonly filenamePattern: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly description: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly priority: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly markdownDeprecationMessage: string;
|
|
44
|
+
readonly enum: [
|
|
45
|
+
CustomEditorPriority.default,
|
|
46
|
+
CustomEditorPriority.option
|
|
47
|
+
];
|
|
48
|
+
readonly markdownEnumDescriptions: [
|
|
49
|
+
string,
|
|
50
|
+
string
|
|
51
|
+
];
|
|
52
|
+
readonly default: CustomEditorPriority.default;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export type ICustomEditorsExtensionPoint = TypeFromJsonSchema<typeof customEditorsContributionSchema>;
|
|
57
|
+
export declare const customEditorsExtensionPoint: import("@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensionsRegistry").IExtensionPoint<{
|
|
58
|
+
readonly viewType: string;
|
|
59
|
+
readonly displayName: string;
|
|
60
|
+
readonly selector: {
|
|
61
|
+
readonly filenamePattern: string | undefined;
|
|
62
|
+
}[];
|
|
63
|
+
readonly priority: CustomEditorPriority.default | CustomEditorPriority.option | undefined;
|
|
64
|
+
}[]>;
|
|
15
65
|
export {};
|
|
@@ -15,87 +15,89 @@ const Fields = ( Object.freeze({
|
|
|
15
15
|
selector: 'selector',
|
|
16
16
|
priority: 'priority',
|
|
17
17
|
}));
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
defaultSnippets: [{
|
|
58
|
-
body: {
|
|
59
|
-
filenamePattern: '$1',
|
|
60
|
-
}
|
|
61
|
-
}],
|
|
62
|
-
properties: {
|
|
63
|
-
filenamePattern: {
|
|
64
|
-
type: 'string',
|
|
65
|
-
description: ( localize(6023, 'Glob that the custom editor is enabled for.')),
|
|
66
|
-
},
|
|
67
|
-
}
|
|
18
|
+
const customEditorsContributionSchema = {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: [
|
|
21
|
+
Fields.viewType,
|
|
22
|
+
Fields.displayName,
|
|
23
|
+
Fields.selector,
|
|
24
|
+
],
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: {
|
|
27
|
+
[Fields.viewType]: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
markdownDescription: ( localize(
|
|
30
|
+
6262,
|
|
31
|
+
'Identifier for the custom editor. This must be unique across all custom editors, so we recommend including your extension id as part of `viewType`. The `viewType` is used when registering custom editors with `vscode.registerCustomEditorProvider` and in the `onCustomEditor:${id}` [activation event](https://code.visualstudio.com/api/references/activation-events).'
|
|
32
|
+
)),
|
|
33
|
+
},
|
|
34
|
+
[Fields.displayName]: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: ( localize(
|
|
37
|
+
6263,
|
|
38
|
+
'Human readable name of the custom editor. This is displayed to users when selecting which editor to use.'
|
|
39
|
+
)),
|
|
40
|
+
},
|
|
41
|
+
[Fields.selector]: {
|
|
42
|
+
type: 'array',
|
|
43
|
+
description: ( localize(6264, 'Set of globs that the custom editor is enabled for.')),
|
|
44
|
+
items: {
|
|
45
|
+
type: 'object',
|
|
46
|
+
defaultSnippets: [{
|
|
47
|
+
body: {
|
|
48
|
+
filenamePattern: '$1',
|
|
49
|
+
}
|
|
50
|
+
}],
|
|
51
|
+
additionalProperties: false,
|
|
52
|
+
properties: {
|
|
53
|
+
filenamePattern: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
description: ( localize(6265, 'Glob that the custom editor is enabled for.')),
|
|
56
|
+
},
|
|
68
57
|
}
|
|
69
|
-
},
|
|
70
|
-
[Fields.priority]: {
|
|
71
|
-
type: 'string',
|
|
72
|
-
markdownDeprecationMessage: ( localize(
|
|
73
|
-
6024,
|
|
74
|
-
'Controls if the custom editor is enabled automatically when the user opens a file. This may be overridden by users using the `workbench.editorAssociations` setting.'
|
|
75
|
-
)),
|
|
76
|
-
enum: [
|
|
77
|
-
CustomEditorPriority.default,
|
|
78
|
-
CustomEditorPriority.option,
|
|
79
|
-
],
|
|
80
|
-
markdownEnumDescriptions: [
|
|
81
|
-
( localize(
|
|
82
|
-
6025,
|
|
83
|
-
'The editor is automatically used when the user opens a resource, provided that no other default custom editors are registered for that resource.'
|
|
84
|
-
)),
|
|
85
|
-
( localize(
|
|
86
|
-
6026,
|
|
87
|
-
'The editor is not automatically used when the user opens a resource, but a user can switch to the editor using the `Reopen With` command.'
|
|
88
|
-
)),
|
|
89
|
-
],
|
|
90
|
-
default: 'default'
|
|
91
58
|
}
|
|
59
|
+
},
|
|
60
|
+
[Fields.priority]: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
markdownDeprecationMessage: ( localize(
|
|
63
|
+
6266,
|
|
64
|
+
'Controls if the custom editor is enabled automatically when the user opens a file. This may be overridden by users using the `workbench.editorAssociations` setting.'
|
|
65
|
+
)),
|
|
66
|
+
enum: [
|
|
67
|
+
CustomEditorPriority.default,
|
|
68
|
+
CustomEditorPriority.option,
|
|
69
|
+
],
|
|
70
|
+
markdownEnumDescriptions: [
|
|
71
|
+
( localize(
|
|
72
|
+
6267,
|
|
73
|
+
'The editor is automatically used when the user opens a resource, provided that no other default custom editors are registered for that resource.'
|
|
74
|
+
)),
|
|
75
|
+
( localize(
|
|
76
|
+
6268,
|
|
77
|
+
'The editor is not automatically used when the user opens a resource, but a user can switch to the editor using the `Reopen With` command.'
|
|
78
|
+
)),
|
|
79
|
+
],
|
|
80
|
+
default: CustomEditorPriority.default
|
|
92
81
|
}
|
|
93
82
|
}
|
|
94
83
|
};
|
|
95
84
|
const customEditorsExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
96
85
|
extensionPoint: 'customEditors',
|
|
97
86
|
deps: [languagesExtPoint],
|
|
98
|
-
jsonSchema:
|
|
87
|
+
jsonSchema: {
|
|
88
|
+
description: ( localize(6269, 'Contributed custom editors.')),
|
|
89
|
+
type: 'array',
|
|
90
|
+
defaultSnippets: [{
|
|
91
|
+
body: [{
|
|
92
|
+
[Fields.viewType]: '$1',
|
|
93
|
+
[Fields.displayName]: '$2',
|
|
94
|
+
[Fields.selector]: [{
|
|
95
|
+
filenamePattern: '$3'
|
|
96
|
+
}],
|
|
97
|
+
}]
|
|
98
|
+
}],
|
|
99
|
+
items: customEditorsContributionSchema
|
|
100
|
+
},
|
|
99
101
|
activationEventsGenerator: function* (contribs) {
|
|
100
102
|
for (const contrib of contribs) {
|
|
101
103
|
const viewType = contrib[Fields.viewType];
|
|
@@ -119,9 +121,9 @@ class CustomEditorsDataRenderer extends Disposable {
|
|
|
119
121
|
return { data: { headers: [], rows: [] }, dispose: () => { } };
|
|
120
122
|
}
|
|
121
123
|
const headers = [
|
|
122
|
-
( localize(
|
|
123
|
-
( localize(
|
|
124
|
-
( localize(
|
|
124
|
+
( localize(6270, "View Type")),
|
|
125
|
+
( localize(6271, "Priority")),
|
|
126
|
+
( localize(6272, "Filename Pattern")),
|
|
125
127
|
];
|
|
126
128
|
const rows = ( customEditors
|
|
127
129
|
.map(customEditor => {
|
|
@@ -142,7 +144,7 @@ class CustomEditorsDataRenderer extends Disposable {
|
|
|
142
144
|
}
|
|
143
145
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
144
146
|
id: 'customEditors',
|
|
145
|
-
label: ( localize(
|
|
147
|
+
label: ( localize(6273, "Custom Editors")),
|
|
146
148
|
access: {
|
|
147
149
|
canToggle: false
|
|
148
150
|
},
|