@codingame/monaco-vscode-extensions-service-override 31.0.1 → 32.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/index.js +2 -0
- package/package.json +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +29 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +25 -25
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.d.ts +3 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.js +9 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +36 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +9 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.d.ts +10 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +33 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +102 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.d.ts +6 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +37 -15
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.d.ts +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +8 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.d.ts +7 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +163 -36
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentDiff.d.ts +10 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentDiff.js +58 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +25 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +10 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +14 -13
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { multibyteAwareBtoa } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
4
|
-
import { createCancelablePromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
5
|
-
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
|
+
import { DeferredPromise, createCancelablePromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
5
|
+
import { CancellationToken, CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
6
6
|
import { onUnexpectedError, isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
7
7
|
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
8
8
|
import { Disposable, DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
@@ -22,6 +22,7 @@ import { UndoRedoElementType } from '@codingame/monaco-vscode-api/vscode/vs/plat
|
|
|
22
22
|
import { IUndoRedoService } from '@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo.service';
|
|
23
23
|
import { reviveWebviewExtension } from './mainThreadWebviews.js';
|
|
24
24
|
import { ExtHostContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
25
|
+
import { CustomEditorDiffInput, CustomEditorSideBySideDiffInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/customEditor/browser/customEditorDiffInput';
|
|
25
26
|
import { CustomEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/customEditor/browser/customEditorInput';
|
|
26
27
|
import { ICustomEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/customEditor/common/customEditor.service';
|
|
27
28
|
import { CustomTextEditorModel } from '../../contrib/customEditor/common/customTextEditorModel.js';
|
|
@@ -38,6 +39,7 @@ import { NO_TYPE_ID, WorkingCopyCapabilities } from '@codingame/monaco-vscode-ap
|
|
|
38
39
|
import { IWorkingCopyFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
|
|
39
40
|
import { IWorkingCopyService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
|
|
40
41
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
42
|
+
import { IUntitledTextEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/untitled/common/untitledTextEditorService.service';
|
|
41
43
|
|
|
42
44
|
var MainThreadCustomEditorModel_1;
|
|
43
45
|
var CustomEditorModelType;
|
|
@@ -59,7 +61,8 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
|
|
|
59
61
|
_editorService,
|
|
60
62
|
_instantiationService,
|
|
61
63
|
_webviewWorkbenchService,
|
|
62
|
-
_uriIdentityService
|
|
64
|
+
_uriIdentityService,
|
|
65
|
+
_untitledTextEditorService
|
|
63
66
|
) {
|
|
64
67
|
super();
|
|
65
68
|
this.mainThreadWebview = mainThreadWebview;
|
|
@@ -70,8 +73,10 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
|
|
|
70
73
|
this._instantiationService = _instantiationService;
|
|
71
74
|
this._webviewWorkbenchService = _webviewWorkbenchService;
|
|
72
75
|
this._uriIdentityService = _uriIdentityService;
|
|
76
|
+
this._untitledTextEditorService = _untitledTextEditorService;
|
|
73
77
|
this._editorProviders = this._register(( new DisposableMap()));
|
|
74
78
|
this._editorRenameBackups = ( new Map());
|
|
79
|
+
this._pendingSideBySideDiffResolutions = ( new Map());
|
|
75
80
|
this._webviewOriginStore = ( new ExtensionKeyedWebviewOriginStore("mainThreadCustomEditors.origins", storageService));
|
|
76
81
|
this._proxyCustomEditors = ( context.getProxy(ExtHostContext.ExtHostCustomEditors));
|
|
77
82
|
this._register(workingCopyFileService.registerWorkingCopyProvider(editorResource => {
|
|
@@ -87,7 +92,7 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
|
|
|
87
92
|
}));
|
|
88
93
|
this._register(_webviewWorkbenchService.registerResolver({
|
|
89
94
|
canResolve: webview => {
|
|
90
|
-
if (webview instanceof CustomEditorInput) {
|
|
95
|
+
if (webview instanceof CustomEditorInput || webview instanceof CustomEditorDiffInput || webview instanceof CustomEditorSideBySideDiffInput) {
|
|
91
96
|
extensionService.activateByEvent(`onCustomEditor:${webview.viewType}`);
|
|
92
97
|
}
|
|
93
98
|
return false;
|
|
@@ -121,6 +126,7 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
|
|
|
121
126
|
extensionData,
|
|
122
127
|
viewType,
|
|
123
128
|
options,
|
|
129
|
+
capabilities,
|
|
124
130
|
supportsMultipleEditorsPerDocument,
|
|
125
131
|
serializeBuffersForPostMessage
|
|
126
132
|
) {
|
|
@@ -129,7 +135,7 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
|
|
|
129
135
|
reviveWebviewExtension(extensionData),
|
|
130
136
|
viewType,
|
|
131
137
|
options,
|
|
132
|
-
|
|
138
|
+
capabilities,
|
|
133
139
|
supportsMultipleEditorsPerDocument,
|
|
134
140
|
serializeBuffersForPostMessage
|
|
135
141
|
);
|
|
@@ -148,86 +154,201 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
|
|
|
148
154
|
}
|
|
149
155
|
const disposables = ( new DisposableStore());
|
|
150
156
|
disposables.add(this._customEditorService.registerCustomEditorCapabilities(viewType, {
|
|
151
|
-
supportsMultipleEditorsPerDocument
|
|
157
|
+
supportsMultipleEditorsPerDocument,
|
|
158
|
+
isTextEditor: modelType === CustomEditorModelType.Text,
|
|
159
|
+
supportsInlineDiff: capabilities.supportsInlineDiff,
|
|
160
|
+
supportsSideBySideDiff: capabilities.supportsSideBySideDiff
|
|
152
161
|
}));
|
|
153
162
|
disposables.add(this._webviewWorkbenchService.registerResolver({
|
|
154
163
|
canResolve: webviewInput => {
|
|
155
|
-
return webviewInput instanceof CustomEditorInput && webviewInput.viewType === viewType;
|
|
164
|
+
return (webviewInput instanceof CustomEditorInput || webviewInput instanceof CustomEditorDiffInput || webviewInput instanceof CustomEditorSideBySideDiffInput) && webviewInput.viewType === viewType;
|
|
156
165
|
},
|
|
157
166
|
resolveWebview: async (webviewInput, cancellation) => {
|
|
167
|
+
if (!(webviewInput instanceof CustomEditorInput || webviewInput instanceof CustomEditorDiffInput || webviewInput instanceof CustomEditorSideBySideDiffInput)) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
158
170
|
const handle = generateUuid();
|
|
159
|
-
const resource = webviewInput.resource;
|
|
160
171
|
webviewInput.webview.origin = this._webviewOriginStore.getOrigin(viewType, extension.id);
|
|
161
172
|
this.mainThreadWebviewPanels.addWebviewInput(handle, webviewInput, {
|
|
162
173
|
serializeBuffersForPostMessage
|
|
163
174
|
});
|
|
164
175
|
webviewInput.webview.options = options;
|
|
165
176
|
webviewInput.webview.extension = extension;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
backupId =
|
|
170
|
-
|
|
177
|
+
const resource = webviewInput instanceof CustomEditorDiffInput ? webviewInput.modifiedResource : webviewInput.resource;
|
|
178
|
+
let backupId;
|
|
179
|
+
if (webviewInput instanceof CustomEditorInput) {
|
|
180
|
+
backupId = webviewInput.backupId;
|
|
181
|
+
if (webviewInput.oldResource && !webviewInput.backupId) {
|
|
182
|
+
const backup = this._editorRenameBackups.get(( webviewInput.oldResource.toString()));
|
|
183
|
+
backupId = backup?.backupId;
|
|
184
|
+
this._editorRenameBackups.delete(( webviewInput.oldResource.toString()));
|
|
185
|
+
}
|
|
171
186
|
}
|
|
172
187
|
let modelRef;
|
|
188
|
+
const additionalModelRefs = ( new DisposableStore());
|
|
173
189
|
try {
|
|
174
190
|
modelRef = await this.getOrCreateCustomEditorModel(modelType, resource, viewType, {
|
|
175
191
|
backupId
|
|
176
192
|
}, cancellation);
|
|
193
|
+
if (webviewInput instanceof CustomEditorDiffInput && !isEqual(webviewInput.originalResource, resource)) {
|
|
194
|
+
additionalModelRefs.add(
|
|
195
|
+
await this.getOrCreateCustomEditorModel(modelType, webviewInput.originalResource, viewType, {}, cancellation)
|
|
196
|
+
);
|
|
197
|
+
} else if (modelType === CustomEditorModelType.Text && webviewInput instanceof CustomEditorSideBySideDiffInput) {
|
|
198
|
+
const otherResource = webviewInput.side === "original" ? webviewInput.modifiedResource : webviewInput.originalResource;
|
|
199
|
+
if (!isEqual(otherResource, resource)) {
|
|
200
|
+
additionalModelRefs.add(
|
|
201
|
+
await this.getOrCreateCustomEditorModel(modelType, otherResource, viewType, {}, cancellation)
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
177
205
|
} catch (error) {
|
|
178
206
|
onUnexpectedError(error);
|
|
179
207
|
webviewInput.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(viewType));
|
|
208
|
+
additionalModelRefs.dispose();
|
|
209
|
+
modelRef?.dispose();
|
|
180
210
|
return;
|
|
181
211
|
}
|
|
212
|
+
if (!modelRef) {
|
|
213
|
+
additionalModelRefs.dispose();
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
let resolvedModelRef = modelRef;
|
|
182
217
|
if (cancellation.isCancellationRequested) {
|
|
183
|
-
|
|
218
|
+
additionalModelRefs.dispose();
|
|
219
|
+
resolvedModelRef.dispose();
|
|
184
220
|
return;
|
|
185
221
|
}
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (!modelRef.object.isDirty()) {
|
|
222
|
+
const disposeModelRefs = () => {
|
|
223
|
+
additionalModelRefs.dispose();
|
|
224
|
+
if (resolvedModelRef.object.isDirty()) {
|
|
225
|
+
const sub = resolvedModelRef.object.onDidChangeDirty(() => {
|
|
226
|
+
if (!resolvedModelRef.object.isDirty()) {
|
|
192
227
|
sub.dispose();
|
|
193
|
-
|
|
228
|
+
resolvedModelRef.dispose();
|
|
194
229
|
}
|
|
195
230
|
});
|
|
196
231
|
return;
|
|
197
232
|
}
|
|
198
|
-
|
|
233
|
+
resolvedModelRef.dispose();
|
|
234
|
+
};
|
|
235
|
+
const disposeSub = webviewInput.webview.onDidDispose(() => {
|
|
236
|
+
disposeSub.dispose();
|
|
237
|
+
inputDisposeSub.dispose();
|
|
238
|
+
disposeModelRefs();
|
|
199
239
|
});
|
|
200
240
|
const inputDisposeSub = webviewInput.onWillDispose(() => {
|
|
201
241
|
inputDisposeSub.dispose();
|
|
202
242
|
disposeSub.dispose();
|
|
203
|
-
|
|
243
|
+
disposeModelRefs();
|
|
204
244
|
});
|
|
205
|
-
if (capabilities.supportsMove) {
|
|
245
|
+
if (webviewInput instanceof CustomEditorInput && capabilities.supportsMove) {
|
|
206
246
|
webviewInput.onMove(async newResource => {
|
|
207
|
-
const oldModel =
|
|
208
|
-
|
|
247
|
+
const oldModel = resolvedModelRef;
|
|
248
|
+
resolvedModelRef = await this.getOrCreateCustomEditorModel(modelType, newResource, viewType, {}, CancellationToken.None);
|
|
209
249
|
this._proxyCustomEditors.$onMoveCustomEditor(handle, newResource, viewType);
|
|
210
250
|
oldModel.dispose();
|
|
211
251
|
});
|
|
212
252
|
}
|
|
213
253
|
try {
|
|
214
|
-
const
|
|
215
|
-
await this._proxyCustomEditors.$resolveCustomEditor(actualResource, handle, viewType, {
|
|
254
|
+
const initData = {
|
|
216
255
|
title: webviewInput.getTitle(),
|
|
217
256
|
contentOptions: webviewInput.webview.contentOptions,
|
|
218
257
|
options: webviewInput.webview.options,
|
|
219
258
|
active: webviewInput === this._editorService.activeEditor
|
|
220
|
-
}
|
|
259
|
+
};
|
|
260
|
+
const position = editorGroupToColumn(this._editorGroupService, webviewInput.group || 0);
|
|
261
|
+
if (webviewInput instanceof CustomEditorDiffInput) {
|
|
262
|
+
const originalResource = modelType === CustomEditorModelType.Text ? this._uriIdentityService.asCanonicalUri(webviewInput.originalResource) : webviewInput.originalResource;
|
|
263
|
+
const modifiedResource = modelType === CustomEditorModelType.Text ? this._uriIdentityService.asCanonicalUri(webviewInput.modifiedResource) : webviewInput.modifiedResource;
|
|
264
|
+
await this._proxyCustomEditors.$resolveCustomEditorInlineDiff(
|
|
265
|
+
originalResource,
|
|
266
|
+
modifiedResource,
|
|
267
|
+
handle,
|
|
268
|
+
viewType,
|
|
269
|
+
initData,
|
|
270
|
+
position,
|
|
271
|
+
cancellation
|
|
272
|
+
);
|
|
273
|
+
} else if (webviewInput instanceof CustomEditorSideBySideDiffInput) {
|
|
274
|
+
await this.resolveCustomEditorSideBySideDiff(
|
|
275
|
+
modelType,
|
|
276
|
+
webviewInput,
|
|
277
|
+
handle,
|
|
278
|
+
viewType,
|
|
279
|
+
initData,
|
|
280
|
+
position,
|
|
281
|
+
cancellation
|
|
282
|
+
);
|
|
283
|
+
} else {
|
|
284
|
+
const actualResource = modelType === CustomEditorModelType.Text ? this._uriIdentityService.asCanonicalUri(resource) : resource;
|
|
285
|
+
await this._proxyCustomEditors.$resolveCustomEditor(actualResource, handle, viewType, initData, position, cancellation);
|
|
286
|
+
}
|
|
221
287
|
} catch (error) {
|
|
222
288
|
onUnexpectedError(error);
|
|
223
289
|
webviewInput.webview.setHtml(this.mainThreadWebview.getWebviewResolvedFailedContent(viewType));
|
|
224
|
-
|
|
290
|
+
additionalModelRefs.dispose();
|
|
291
|
+
resolvedModelRef.dispose();
|
|
225
292
|
return;
|
|
226
293
|
}
|
|
227
294
|
}
|
|
228
295
|
}));
|
|
229
296
|
this._editorProviders.set(viewType, disposables);
|
|
230
297
|
}
|
|
298
|
+
resolveCustomEditorSideBySideDiff(
|
|
299
|
+
modelType,
|
|
300
|
+
webviewInput,
|
|
301
|
+
handle,
|
|
302
|
+
viewType,
|
|
303
|
+
initData,
|
|
304
|
+
position,
|
|
305
|
+
cancellation
|
|
306
|
+
) {
|
|
307
|
+
let pending = this._pendingSideBySideDiffResolutions.get(webviewInput.diffId);
|
|
308
|
+
if (!pending) {
|
|
309
|
+
pending = {
|
|
310
|
+
promise: ( new DeferredPromise()),
|
|
311
|
+
cancellation: ( new CancellationTokenSource()),
|
|
312
|
+
disposables: ( new DisposableStore())
|
|
313
|
+
};
|
|
314
|
+
this._pendingSideBySideDiffResolutions.set(webviewInput.diffId, pending);
|
|
315
|
+
}
|
|
316
|
+
const cleanup = () => {
|
|
317
|
+
this._pendingSideBySideDiffResolutions.delete(webviewInput.diffId);
|
|
318
|
+
pending.disposables.dispose();
|
|
319
|
+
pending.cancellation.dispose();
|
|
320
|
+
};
|
|
321
|
+
pending.disposables.add(cancellation.onCancellationRequested(() => {
|
|
322
|
+
pending.cancellation.cancel();
|
|
323
|
+
if (!pending.started) {
|
|
324
|
+
pending.promise.cancel();
|
|
325
|
+
cleanup();
|
|
326
|
+
}
|
|
327
|
+
}));
|
|
328
|
+
pending[webviewInput.side] = {
|
|
329
|
+
handle,
|
|
330
|
+
initData
|
|
331
|
+
};
|
|
332
|
+
if (pending.original && pending.modified && !pending.started) {
|
|
333
|
+
pending.started = true;
|
|
334
|
+
pending.promise.settleWith((async () => {
|
|
335
|
+
try {
|
|
336
|
+
const originalResource = modelType === CustomEditorModelType.Text ? this._uriIdentityService.asCanonicalUri(webviewInput.originalResource) : webviewInput.originalResource;
|
|
337
|
+
const modifiedResource = modelType === CustomEditorModelType.Text ? this._uriIdentityService.asCanonicalUri(webviewInput.modifiedResource) : webviewInput.modifiedResource;
|
|
338
|
+
await this._proxyCustomEditors.$resolveCustomEditorSideBySideDiff(originalResource, modifiedResource, {
|
|
339
|
+
original: pending.original.handle,
|
|
340
|
+
modified: pending.modified.handle
|
|
341
|
+
}, viewType, {
|
|
342
|
+
original: pending.original.initData,
|
|
343
|
+
modified: pending.modified.initData
|
|
344
|
+
}, position, pending.cancellation.token);
|
|
345
|
+
} finally {
|
|
346
|
+
cleanup();
|
|
347
|
+
}
|
|
348
|
+
})());
|
|
349
|
+
}
|
|
350
|
+
return pending.promise.p;
|
|
351
|
+
}
|
|
231
352
|
$unregisterEditorProvider(viewType) {
|
|
232
353
|
if (!( this._editorProviders.has(viewType))) {
|
|
233
354
|
throw ( new Error(`No provider for ${viewType} registered`));
|
|
@@ -254,9 +375,10 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
|
|
|
254
375
|
viewType,
|
|
255
376
|
resource,
|
|
256
377
|
options,
|
|
378
|
+
this._untitledTextEditorService,
|
|
257
379
|
() => {
|
|
258
380
|
return Array.from(this.mainThreadWebviewPanels.webviewInputs).filter(
|
|
259
|
-
editor => editor instanceof CustomEditorInput && isEqual(editor.resource, resource)
|
|
381
|
+
editor => (editor instanceof CustomEditorInput && isEqual(editor.resource, resource)) || (editor instanceof CustomEditorDiffInput && (isEqual(editor.originalResource, resource) || isEqual(editor.modifiedResource, resource))) || (editor instanceof CustomEditorSideBySideDiffInput && isEqual(editor.resource, resource))
|
|
260
382
|
);
|
|
261
383
|
},
|
|
262
384
|
cancellation
|
|
@@ -303,7 +425,7 @@ let MainThreadCustomEditors = class MainThreadCustomEditors extends Disposable {
|
|
|
303
425
|
})());
|
|
304
426
|
}
|
|
305
427
|
};
|
|
306
|
-
MainThreadCustomEditors = ( __decorate([( __param(3, IExtensionService)), ( __param(4, IStorageService)), ( __param(5, IWorkingCopyService)), ( __param(6, IWorkingCopyFileService)), ( __param(7, ICustomEditorService)), ( __param(8, IEditorGroupsService)), ( __param(9, IEditorService)), ( __param(10, IInstantiationService)), ( __param(11, IWebviewWorkbenchService)), ( __param(12, IUriIdentityService))], MainThreadCustomEditors));
|
|
428
|
+
MainThreadCustomEditors = ( __decorate([( __param(3, IExtensionService)), ( __param(4, IStorageService)), ( __param(5, IWorkingCopyService)), ( __param(6, IWorkingCopyFileService)), ( __param(7, ICustomEditorService)), ( __param(8, IEditorGroupsService)), ( __param(9, IEditorService)), ( __param(10, IInstantiationService)), ( __param(11, IWebviewWorkbenchService)), ( __param(12, IUriIdentityService)), ( __param(13, IUntitledTextEditorService))], MainThreadCustomEditors));
|
|
307
429
|
var HotExitState;
|
|
308
430
|
(function(HotExitState) {
|
|
309
431
|
let Type;
|
|
@@ -333,17 +455,22 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
|
|
|
333
455
|
viewType,
|
|
334
456
|
resource,
|
|
335
457
|
options,
|
|
458
|
+
untitledTextEditorService,
|
|
336
459
|
getEditors,
|
|
337
460
|
cancellation
|
|
338
461
|
) {
|
|
339
462
|
const editors = getEditors();
|
|
340
463
|
let untitledDocumentData;
|
|
341
|
-
|
|
342
|
-
|
|
464
|
+
const primaryCustomEditorInput = editors.find(editor => editor instanceof CustomEditorInput);
|
|
465
|
+
if (primaryCustomEditorInput) {
|
|
466
|
+
untitledDocumentData = primaryCustomEditorInput.untitledDocumentData;
|
|
343
467
|
}
|
|
344
468
|
const {
|
|
345
469
|
editable
|
|
346
470
|
} = await proxy.$createCustomDocument(resource, viewType, options.backupId, untitledDocumentData, cancellation);
|
|
471
|
+
if (untitledDocumentData && resource.scheme === Schemas.untitled) {
|
|
472
|
+
untitledTextEditorService.get(resource)?.revert();
|
|
473
|
+
}
|
|
347
474
|
return instantiationService.createInstance(
|
|
348
475
|
MainThreadCustomEditorModel_1,
|
|
349
476
|
proxy,
|
|
@@ -405,7 +532,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
|
|
|
405
532
|
this._register(workingCopyService.registerWorkingCopy(this));
|
|
406
533
|
this._register(extensionService.onWillStop(e => {
|
|
407
534
|
e.veto(true, ( localize(
|
|
408
|
-
|
|
535
|
+
2591,
|
|
409
536
|
"An extension provided editor for '{0}' is still open that would close otherwise.",
|
|
410
537
|
this.name
|
|
411
538
|
)));
|
|
@@ -473,7 +600,7 @@ let MainThreadCustomEditorModel = MainThreadCustomEditorModel_1 = class MainThre
|
|
|
473
600
|
this._undoService.pushElement({
|
|
474
601
|
type: UndoRedoElementType.Resource,
|
|
475
602
|
resource: this._editorResource,
|
|
476
|
-
label: label ?? ( localize(
|
|
603
|
+
label: label ?? ( localize(2592, "Edit")),
|
|
477
604
|
code: "undoredo.customEditorEdit",
|
|
478
605
|
undo: () => this.undo(),
|
|
479
606
|
redo: () => this.redo()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
+
import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
|
|
3
|
+
import { IDocumentDiffResultDto, MainThreadDocumentDiffShape } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
4
|
+
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
5
|
+
export declare class MainThreadDocumentDiff implements MainThreadDocumentDiffShape {
|
|
6
|
+
private readonly _editorWorkerService;
|
|
7
|
+
constructor(_extHostContext: IExtHostContext, _editorWorkerService: IEditorWorkerService);
|
|
8
|
+
$computeDocumentDiff(originalUri: UriComponents, modifiedUri: UriComponents, ignoreTrimWhitespace: boolean, maxComputationTimeMs: number, computeMoves: boolean): Promise<IDocumentDiffResultDto | null>;
|
|
9
|
+
dispose(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
4
|
+
import { IEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service';
|
|
5
|
+
import { MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
6
|
+
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
7
|
+
|
|
8
|
+
let MainThreadDocumentDiff = class MainThreadDocumentDiff {
|
|
9
|
+
constructor(_extHostContext, _editorWorkerService) {
|
|
10
|
+
this._editorWorkerService = _editorWorkerService;
|
|
11
|
+
}
|
|
12
|
+
async $computeDocumentDiff(
|
|
13
|
+
originalUri,
|
|
14
|
+
modifiedUri,
|
|
15
|
+
ignoreTrimWhitespace,
|
|
16
|
+
maxComputationTimeMs,
|
|
17
|
+
computeMoves
|
|
18
|
+
) {
|
|
19
|
+
const original = URI.revive(originalUri);
|
|
20
|
+
const modified = URI.revive(modifiedUri);
|
|
21
|
+
const result = await this._editorWorkerService.computeDiff(original, modified, {
|
|
22
|
+
ignoreTrimWhitespace,
|
|
23
|
+
maxComputationTimeMs,
|
|
24
|
+
computeMoves
|
|
25
|
+
}, "advanced");
|
|
26
|
+
if (!result) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const toLineRange = r => ({
|
|
30
|
+
startLineNumber: r.startLineNumber,
|
|
31
|
+
startColumn: 1,
|
|
32
|
+
endLineNumber: r.endLineNumberExclusive,
|
|
33
|
+
endColumn: 1
|
|
34
|
+
});
|
|
35
|
+
const mapChange = c => ({
|
|
36
|
+
originalRange: toLineRange(c.original),
|
|
37
|
+
modifiedRange: toLineRange(c.modified),
|
|
38
|
+
innerChanges: c.innerChanges?.map(ic => ({
|
|
39
|
+
originalRange: ic.originalRange,
|
|
40
|
+
modifiedRange: ic.modifiedRange
|
|
41
|
+
}))
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
identical: result.identical,
|
|
45
|
+
quitEarly: result.quitEarly,
|
|
46
|
+
changes: ( result.changes.map(mapChange)),
|
|
47
|
+
moves: ( result.moves.map(m => ({
|
|
48
|
+
originalRange: toLineRange(m.lineRangeMapping.original),
|
|
49
|
+
modifiedRange: toLineRange(m.lineRangeMapping.modified),
|
|
50
|
+
changes: ( m.changes.map(mapChange))
|
|
51
|
+
})))
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
dispose() {}
|
|
55
|
+
};
|
|
56
|
+
MainThreadDocumentDiff = __decorate([extHostNamedCustomer(MainContext.MainThreadDocumentDiff), ( __param(1, IEditorWorkerService))], MainThreadDocumentDiff);
|
|
57
|
+
|
|
58
|
+
export { MainThreadDocumentDiff };
|
|
@@ -14,7 +14,7 @@ class ExtHostEditSessionIdentityCreateParticipant {
|
|
|
14
14
|
}
|
|
15
15
|
async participate(workspaceFolder, token) {
|
|
16
16
|
const p = ( new Promise((resolve, reject) => {
|
|
17
|
-
setTimeout(() => reject(( new Error(( localize(
|
|
17
|
+
setTimeout(() => reject(( new Error(( localize(2593, "Aborted onWillCreateEditSessionIdentity-event after 10000ms"))))), this.timeout);
|
|
18
18
|
this._proxy.$onWillCreateEditSessionIdentity(workspaceFolder.uri, token, this.timeout).then(resolve, reject);
|
|
19
19
|
}));
|
|
20
20
|
return raceCancellationError(p, token);
|
|
@@ -111,7 +111,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
111
111
|
this._notificationService.notify({
|
|
112
112
|
severity: Severity.Error,
|
|
113
113
|
message: ( localize(
|
|
114
|
-
|
|
114
|
+
2594,
|
|
115
115
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is not loaded. Would you like to reload the window to load the extension?",
|
|
116
116
|
extName,
|
|
117
117
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -119,7 +119,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
119
119
|
actions: {
|
|
120
120
|
primary: [toAction({
|
|
121
121
|
id: "reload",
|
|
122
|
-
label: ( localize(
|
|
122
|
+
label: ( localize(2595, "Reload Window")),
|
|
123
123
|
run: () => this._hostService.reload()
|
|
124
124
|
})]
|
|
125
125
|
}
|
|
@@ -130,7 +130,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
130
130
|
this._notificationService.notify({
|
|
131
131
|
severity: Severity.Error,
|
|
132
132
|
message: ( localize(
|
|
133
|
-
|
|
133
|
+
2596,
|
|
134
134
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace",
|
|
135
135
|
extName,
|
|
136
136
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -140,7 +140,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
140
140
|
this._notificationService.notify({
|
|
141
141
|
severity: Severity.Error,
|
|
142
142
|
message: ( localize(
|
|
143
|
-
|
|
143
|
+
2597,
|
|
144
144
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in Restricted Mode",
|
|
145
145
|
extName,
|
|
146
146
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -148,7 +148,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
148
148
|
actions: {
|
|
149
149
|
primary: [toAction({
|
|
150
150
|
id: "manageWorkspaceTrust",
|
|
151
|
-
label: ( localize(
|
|
151
|
+
label: ( localize(2598, "Manage Workspace Trust")),
|
|
152
152
|
run: () => this._commandService.executeCommand("workbench.trust.manage")
|
|
153
153
|
})]
|
|
154
154
|
}
|
|
@@ -157,7 +157,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
157
157
|
this._notificationService.notify({
|
|
158
158
|
severity: Severity.Error,
|
|
159
159
|
message: ( localize(
|
|
160
|
-
|
|
160
|
+
2599,
|
|
161
161
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?",
|
|
162
162
|
extName,
|
|
163
163
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -165,7 +165,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
165
165
|
actions: {
|
|
166
166
|
primary: [toAction({
|
|
167
167
|
id: "enable",
|
|
168
|
-
label: ( localize(
|
|
168
|
+
label: ( localize(2600, "Enable and Reload")),
|
|
169
169
|
enabled: true,
|
|
170
170
|
run: () => this._extensionEnablementService.setEnablement(
|
|
171
171
|
[missingInstalledDependency],
|
|
@@ -178,7 +178,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
178
178
|
this._notificationService.notify({
|
|
179
179
|
severity: Severity.Error,
|
|
180
180
|
message: ( localize(
|
|
181
|
-
|
|
181
|
+
2601,
|
|
182
182
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.",
|
|
183
183
|
extName,
|
|
184
184
|
missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name
|
|
@@ -199,7 +199,7 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
199
199
|
this._notificationService.notify({
|
|
200
200
|
severity: Severity.Error,
|
|
201
201
|
message: ( localize(
|
|
202
|
-
|
|
202
|
+
2602,
|
|
203
203
|
"Cannot activate the '{0}' extension because it depends on the '{1}' extension from '{2}', which is not installed. Would you like to install the extension and reload the window?",
|
|
204
204
|
extName,
|
|
205
205
|
dependencyExtension.displayName,
|
|
@@ -208,14 +208,14 @@ let MainThreadExtensionService = class MainThreadExtensionService {
|
|
|
208
208
|
actions: {
|
|
209
209
|
primary: [toAction({
|
|
210
210
|
id: "install",
|
|
211
|
-
label: ( localize(
|
|
211
|
+
label: ( localize(2603, "Install and Reload")),
|
|
212
212
|
run: () => this._extensionsWorkbenchService.install(dependencyExtension).then(() => this._hostService.reload(), e => this._notificationService.error(e))
|
|
213
213
|
})]
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
} else {
|
|
217
217
|
this._notificationService.error(( localize(
|
|
218
|
-
|
|
218
|
+
2604,
|
|
219
219
|
"Cannot activate the '{0}' extension because it depends on an unknown '{1}' extension.",
|
|
220
220
|
extName,
|
|
221
221
|
missingDependency
|