@codingame/monaco-vscode-notebook-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/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +30 -44
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +24 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +30 -53
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +40 -84
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +9 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +35 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +2 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +94 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +8 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +3 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +25 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +71 -89
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +4 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +97 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +7 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +128 -177
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +132 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +70 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +32 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +39 -64
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +28 -43
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +23 -66
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +58 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +162 -264
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +33 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +58 -153
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +15 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +22 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +5 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +100 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +6 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +41 -76
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +42 -45
- package/notebook.d.ts +0 -5
|
@@ -35,6 +35,7 @@ import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/commo
|
|
|
35
35
|
import { INotebookDocumentService } from 'vscode/vscode/vs/workbench/services/notebook/common/notebookDocumentService.service';
|
|
36
36
|
|
|
37
37
|
var NotebookProviderInfoStore_1, NotebookService_1;
|
|
38
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/services/notebookServiceImpl";
|
|
38
39
|
let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposable {
|
|
39
40
|
static { NotebookProviderInfoStore_1 = this; }
|
|
40
41
|
static { this.CUSTOM_EDITORS_STORAGE_ID = 'notebookEditors'; }
|
|
@@ -49,13 +50,13 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
49
50
|
this._notebookEditorModelResolverService = _notebookEditorModelResolverService;
|
|
50
51
|
this.uriIdentService = uriIdentService;
|
|
51
52
|
this._handled = false;
|
|
52
|
-
this._contributedEditors = ( new Map());
|
|
53
|
-
this._contributedEditorDisposables = this._register(( new DisposableStore()));
|
|
54
|
-
this._memento = ( new Memento(NotebookProviderInfoStore_1.CUSTOM_EDITORS_STORAGE_ID, storageService));
|
|
53
|
+
this._contributedEditors = ( (new Map()));
|
|
54
|
+
this._contributedEditorDisposables = this._register(( (new DisposableStore())));
|
|
55
|
+
this._memento = ( (new Memento(NotebookProviderInfoStore_1.CUSTOM_EDITORS_STORAGE_ID, storageService)));
|
|
55
56
|
const mementoObject = this._memento.getMemento(0 , 1 );
|
|
56
57
|
this._editorResolverService.bufferChangeEvents(() => {
|
|
57
58
|
for (const info of (mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] || [])) {
|
|
58
|
-
this.add(( new NotebookProviderInfo(info)));
|
|
59
|
+
this.add(( (new NotebookProviderInfo(info))));
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
this._register(extensionService.onDidRegisterExtensions(() => {
|
|
@@ -73,9 +74,9 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
73
74
|
}
|
|
74
75
|
_setupHandler(extensions) {
|
|
75
76
|
this._handled = true;
|
|
76
|
-
const builtins = [...( this._contributedEditors.values())].filter(info => !info.extension);
|
|
77
|
+
const builtins = [...( (this._contributedEditors.values()))].filter(info => !info.extension);
|
|
77
78
|
this._clear();
|
|
78
|
-
const builtinProvidersFromCache = ( new Map());
|
|
79
|
+
const builtinProvidersFromCache = ( (new Map()));
|
|
79
80
|
builtins.forEach(builtin => {
|
|
80
81
|
builtinProvidersFromCache.set(builtin.id, this.add(builtin));
|
|
81
82
|
});
|
|
@@ -95,7 +96,7 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
95
96
|
continue;
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
|
-
this.add(( new NotebookProviderInfo({
|
|
99
|
+
this.add(( (new NotebookProviderInfo({
|
|
99
100
|
extension: extension.description.identifier,
|
|
100
101
|
id: notebookContribution.type,
|
|
101
102
|
displayName: notebookContribution.displayName,
|
|
@@ -103,11 +104,11 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
103
104
|
priority: this._convertPriority(notebookContribution.priority),
|
|
104
105
|
providerDisplayName: extension.description.displayName ?? extension.description.identifier.value,
|
|
105
106
|
exclusive: false
|
|
106
|
-
})));
|
|
107
|
+
}))));
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
const mementoObject = this._memento.getMemento(0 , 1 );
|
|
110
|
-
mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( this._contributedEditors.values()));
|
|
111
|
+
mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( (this._contributedEditors.values())));
|
|
111
112
|
this._memento.saveMemento();
|
|
112
113
|
}
|
|
113
114
|
clearEditorCache() {
|
|
@@ -125,7 +126,7 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
125
126
|
return RegisteredEditorPriority.option;
|
|
126
127
|
}
|
|
127
128
|
_registerContributionPoint(notebookProviderInfo) {
|
|
128
|
-
const disposables = ( new DisposableStore());
|
|
129
|
+
const disposables = ( (new DisposableStore()));
|
|
129
130
|
for (const selector of notebookProviderInfo.selectors) {
|
|
130
131
|
const globPattern = selector.include || selector;
|
|
131
132
|
const notebookEditorInfo = {
|
|
@@ -214,8 +215,8 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
214
215
|
return this._contributedEditors.get(viewType);
|
|
215
216
|
}
|
|
216
217
|
add(info) {
|
|
217
|
-
if (( this._contributedEditors.has(info.id))) {
|
|
218
|
-
throw new Error(`notebook type '${info.id}' ALREADY EXISTS`);
|
|
218
|
+
if (( (this._contributedEditors.has(info.id)))) {
|
|
219
|
+
throw ( (new Error(`notebook type '${info.id}' ALREADY EXISTS`)));
|
|
219
220
|
}
|
|
220
221
|
this._contributedEditors.set(info.id, info);
|
|
221
222
|
let editorRegistration;
|
|
@@ -224,11 +225,11 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
224
225
|
this._contributedEditorDisposables.add(editorRegistration);
|
|
225
226
|
}
|
|
226
227
|
const mementoObject = this._memento.getMemento(0 , 1 );
|
|
227
|
-
mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( this._contributedEditors.values()));
|
|
228
|
+
mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( (this._contributedEditors.values())));
|
|
228
229
|
this._memento.saveMemento();
|
|
229
230
|
return this._register(toDisposable(() => {
|
|
230
231
|
const mementoObject = this._memento.getMemento(0 , 1 );
|
|
231
|
-
mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( this._contributedEditors.values()));
|
|
232
|
+
mementoObject[NotebookProviderInfoStore_1.CUSTOM_EDITORS_ENTRY_ID] = Array.from(( (this._contributedEditors.values())));
|
|
232
233
|
this._memento.saveMemento();
|
|
233
234
|
editorRegistration?.dispose();
|
|
234
235
|
this._contributedEditors.delete(info.id);
|
|
@@ -236,38 +237,40 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
236
237
|
}
|
|
237
238
|
getContributedNotebook(resource) {
|
|
238
239
|
const result = [];
|
|
239
|
-
for (const info of ( this._contributedEditors.values())) {
|
|
240
|
+
for (const info of ( (this._contributedEditors.values()))) {
|
|
240
241
|
if (info.matches(resource)) {
|
|
241
242
|
result.push(info);
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
if (result.length === 0 && resource.scheme === Schemas.untitled) {
|
|
245
|
-
return Array.from(( this._contributedEditors.values()));
|
|
246
|
+
return Array.from(( (this._contributedEditors.values())));
|
|
246
247
|
}
|
|
247
248
|
return result;
|
|
248
249
|
}
|
|
249
250
|
[Symbol.iterator]() {
|
|
250
|
-
return (
|
|
251
|
+
return (
|
|
252
|
+
(this._contributedEditors.values())
|
|
253
|
+
);
|
|
251
254
|
}
|
|
252
255
|
};
|
|
253
|
-
NotebookProviderInfoStore = NotebookProviderInfoStore_1 = ( __decorate([
|
|
254
|
-
( __param(0, IStorageService)),
|
|
255
|
-
( __param(1, IExtensionService)),
|
|
256
|
-
( __param(2, IEditorResolverService)),
|
|
257
|
-
( __param(3, IConfigurationService)),
|
|
258
|
-
( __param(4, IAccessibilityService)),
|
|
259
|
-
( __param(5, IInstantiationService)),
|
|
260
|
-
( __param(6, IFileService)),
|
|
261
|
-
( __param(7, INotebookEditorModelResolverService)),
|
|
262
|
-
( __param(8, IUriIdentityService))
|
|
263
|
-
], NotebookProviderInfoStore));
|
|
256
|
+
NotebookProviderInfoStore = NotebookProviderInfoStore_1 = ( (__decorate([
|
|
257
|
+
( (__param(0, IStorageService))),
|
|
258
|
+
( (__param(1, IExtensionService))),
|
|
259
|
+
( (__param(2, IEditorResolverService))),
|
|
260
|
+
( (__param(3, IConfigurationService))),
|
|
261
|
+
( (__param(4, IAccessibilityService))),
|
|
262
|
+
( (__param(5, IInstantiationService))),
|
|
263
|
+
( (__param(6, IFileService))),
|
|
264
|
+
( (__param(7, INotebookEditorModelResolverService))),
|
|
265
|
+
( (__param(8, IUriIdentityService)))
|
|
266
|
+
], NotebookProviderInfoStore)));
|
|
264
267
|
let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
265
268
|
constructor(storageService) {
|
|
266
|
-
this.contributedRenderers = ( new Map());
|
|
267
|
-
this.preferredMimetype = ( new Lazy(
|
|
269
|
+
this.contributedRenderers = ( (new Map()));
|
|
270
|
+
this.preferredMimetype = ( (new Lazy(
|
|
268
271
|
() => this.preferredMimetypeMemento.getMemento(1 , 1 )
|
|
269
|
-
));
|
|
270
|
-
this.preferredMimetypeMemento = ( new Memento('workbench.editor.notebook.preferredRenderer2', storageService));
|
|
272
|
+
)));
|
|
273
|
+
this.preferredMimetypeMemento = ( (new Memento('workbench.editor.notebook.preferredRenderer2', storageService)));
|
|
271
274
|
}
|
|
272
275
|
clear() {
|
|
273
276
|
this.contributedRenderers.clear();
|
|
@@ -276,10 +279,10 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
276
279
|
return this.contributedRenderers.get(rendererId);
|
|
277
280
|
}
|
|
278
281
|
getAll() {
|
|
279
|
-
return Array.from(( this.contributedRenderers.values()));
|
|
282
|
+
return Array.from(( (this.contributedRenderers.values())));
|
|
280
283
|
}
|
|
281
284
|
add(info) {
|
|
282
|
-
if (( this.contributedRenderers.has(info.id))) {
|
|
285
|
+
if (( (this.contributedRenderers.has(info.id)))) {
|
|
283
286
|
return;
|
|
284
287
|
}
|
|
285
288
|
this.contributedRenderers.set(info.id, info);
|
|
@@ -299,7 +302,7 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
299
302
|
const preferred = notebookProviderInfo && this.preferredMimetype.value[notebookProviderInfo.id]?.[mimeType];
|
|
300
303
|
const notebookExtId = notebookProviderInfo?.extension?.value;
|
|
301
304
|
const notebookId = notebookProviderInfo?.id;
|
|
302
|
-
const renderers = ( Array.from(( this.contributedRenderers.values()))
|
|
305
|
+
const renderers = ( (Array.from(( (this.contributedRenderers.values())))
|
|
303
306
|
.map(renderer => {
|
|
304
307
|
const ownScore = kernelProvides === undefined
|
|
305
308
|
? renderer.matchesWithoutKernel(mimeType)
|
|
@@ -317,21 +320,23 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
317
320
|
ordered: { mimeType, rendererId: renderer.id, isTrusted: true },
|
|
318
321
|
score: reuseScore | ownScore,
|
|
319
322
|
};
|
|
320
|
-
})).filter(isDefined);
|
|
323
|
+
}))).filter(isDefined);
|
|
321
324
|
if (renderers.length === 0) {
|
|
322
325
|
return [{ mimeType, rendererId: RENDERER_NOT_AVAILABLE, isTrusted: true }];
|
|
323
326
|
}
|
|
324
|
-
return (
|
|
327
|
+
return (
|
|
328
|
+
(renderers.sort((a, b) => a.score - b.score).map(r => r.ordered))
|
|
329
|
+
);
|
|
325
330
|
}
|
|
326
331
|
};
|
|
327
|
-
NotebookOutputRendererInfoStore = ( __decorate([
|
|
328
|
-
( __param(0, IStorageService))
|
|
329
|
-
], NotebookOutputRendererInfoStore));
|
|
332
|
+
NotebookOutputRendererInfoStore = ( (__decorate([
|
|
333
|
+
( (__param(0, IStorageService)))
|
|
334
|
+
], NotebookOutputRendererInfoStore)));
|
|
330
335
|
class ModelData {
|
|
331
336
|
get uri() { return this.model.uri; }
|
|
332
337
|
constructor(model, onWillDispose) {
|
|
333
338
|
this.model = model;
|
|
334
|
-
this._modelEventListeners = ( new DisposableStore());
|
|
339
|
+
this._modelEventListeners = ( (new DisposableStore()));
|
|
335
340
|
this._modelEventListeners.add(model.onWillDispose(() => onWillDispose(model)));
|
|
336
341
|
}
|
|
337
342
|
getCellIndex(cellUri) {
|
|
@@ -358,26 +363,26 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
358
363
|
this._instantiationService = _instantiationService;
|
|
359
364
|
this._storageService = _storageService;
|
|
360
365
|
this._notebookDocumentService = _notebookDocumentService;
|
|
361
|
-
this._notebookProviders = ( new Map());
|
|
366
|
+
this._notebookProviders = ( (new Map()));
|
|
362
367
|
this._notebookProviderInfoStore = undefined;
|
|
363
368
|
this._notebookRenderersInfoStore = this._instantiationService.createInstance(NotebookOutputRendererInfoStore);
|
|
364
|
-
this._onDidChangeOutputRenderers = this._register(( new Emitter()));
|
|
369
|
+
this._onDidChangeOutputRenderers = this._register(( (new Emitter())));
|
|
365
370
|
this.onDidChangeOutputRenderers = this._onDidChangeOutputRenderers.event;
|
|
366
|
-
this._notebookStaticPreloadInfoStore = ( new Set());
|
|
367
|
-
this._models = ( new ResourceMap());
|
|
368
|
-
this._onWillAddNotebookDocument = this._register(( new Emitter()));
|
|
369
|
-
this._onDidAddNotebookDocument = this._register(( new Emitter()));
|
|
370
|
-
this._onWillRemoveNotebookDocument = this._register(( new Emitter()));
|
|
371
|
-
this._onDidRemoveNotebookDocument = this._register(( new Emitter()));
|
|
371
|
+
this._notebookStaticPreloadInfoStore = ( (new Set()));
|
|
372
|
+
this._models = ( (new ResourceMap()));
|
|
373
|
+
this._onWillAddNotebookDocument = this._register(( (new Emitter())));
|
|
374
|
+
this._onDidAddNotebookDocument = this._register(( (new Emitter())));
|
|
375
|
+
this._onWillRemoveNotebookDocument = this._register(( (new Emitter())));
|
|
376
|
+
this._onDidRemoveNotebookDocument = this._register(( (new Emitter())));
|
|
372
377
|
this.onWillAddNotebookDocument = this._onWillAddNotebookDocument.event;
|
|
373
378
|
this.onDidAddNotebookDocument = this._onDidAddNotebookDocument.event;
|
|
374
379
|
this.onDidRemoveNotebookDocument = this._onDidRemoveNotebookDocument.event;
|
|
375
380
|
this.onWillRemoveNotebookDocument = this._onWillRemoveNotebookDocument.event;
|
|
376
|
-
this._onAddViewType = this._register(( new Emitter()));
|
|
381
|
+
this._onAddViewType = this._register(( (new Emitter())));
|
|
377
382
|
this.onAddViewType = this._onAddViewType.event;
|
|
378
|
-
this._onWillRemoveViewType = this._register(( new Emitter()));
|
|
383
|
+
this._onWillRemoveViewType = this._register(( (new Emitter())));
|
|
379
384
|
this.onWillRemoveViewType = this._onWillRemoveViewType.event;
|
|
380
|
-
this._onDidChangeEditorTypes = this._register(( new Emitter()));
|
|
385
|
+
this._onDidChangeEditorTypes = this._register(( (new Emitter())));
|
|
381
386
|
this.onDidChangeEditorTypes = this._onDidChangeEditorTypes.event;
|
|
382
387
|
this._lastClipboardIsCopy = true;
|
|
383
388
|
notebookRendererExtensionPoint.setHandler((renderers) => {
|
|
@@ -393,7 +398,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
393
398
|
extension.collector.error(`Notebook renderer does not specify id-property`);
|
|
394
399
|
continue;
|
|
395
400
|
}
|
|
396
|
-
this._notebookRenderersInfoStore.add(( new NotebookOutputRendererInfo({
|
|
401
|
+
this._notebookRenderersInfoStore.add(( (new NotebookOutputRendererInfo({
|
|
397
402
|
id,
|
|
398
403
|
extension: extension.description,
|
|
399
404
|
entrypoint: notebookContribution.entrypoint,
|
|
@@ -402,7 +407,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
402
407
|
dependencies: notebookContribution.dependencies,
|
|
403
408
|
optionalDependencies: notebookContribution.optionalDependencies,
|
|
404
409
|
requiresMessaging: notebookContribution.requiresMessaging,
|
|
405
|
-
})));
|
|
410
|
+
}))));
|
|
406
411
|
}
|
|
407
412
|
}
|
|
408
413
|
this._onDidChangeOutputRenderers.fire();
|
|
@@ -423,22 +428,22 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
423
428
|
extension.collector.error(`Notebook preload does not specify type-property`);
|
|
424
429
|
continue;
|
|
425
430
|
}
|
|
426
|
-
this._notebookStaticPreloadInfoStore.add(( new NotebookStaticPreloadInfo({
|
|
431
|
+
this._notebookStaticPreloadInfoStore.add(( (new NotebookStaticPreloadInfo({
|
|
427
432
|
type,
|
|
428
433
|
extension: extension.description,
|
|
429
434
|
entrypoint: notebookContribution.entrypoint,
|
|
430
435
|
localResourceRoots: notebookContribution.localResourceRoots ?? [],
|
|
431
|
-
})));
|
|
436
|
+
}))));
|
|
432
437
|
}
|
|
433
438
|
}
|
|
434
439
|
});
|
|
435
440
|
const updateOrder = () => {
|
|
436
|
-
this._displayOrder = ( new MimeTypeDisplayOrder(
|
|
441
|
+
this._displayOrder = ( (new MimeTypeDisplayOrder(
|
|
437
442
|
this._configurationService.getValue(NotebookSetting.displayOrder) || [],
|
|
438
443
|
this._accessibilityService.isScreenReaderOptimized()
|
|
439
444
|
? ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER
|
|
440
445
|
: NOTEBOOK_DISPLAY_ORDER
|
|
441
|
-
));
|
|
446
|
+
)));
|
|
442
447
|
};
|
|
443
448
|
updateOrder();
|
|
444
449
|
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
@@ -449,15 +454,17 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
449
454
|
this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(() => {
|
|
450
455
|
updateOrder();
|
|
451
456
|
}));
|
|
452
|
-
this._memento = ( new Memento(NotebookService_1._storageNotebookViewTypeProvider, this._storageService));
|
|
457
|
+
this._memento = ( (new Memento(NotebookService_1._storageNotebookViewTypeProvider, this._storageService)));
|
|
453
458
|
this._viewTypeCache = this._memento.getMemento(1 , 1 );
|
|
454
459
|
}
|
|
455
460
|
getEditorTypes() {
|
|
456
|
-
return (
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
+
return (
|
|
462
|
+
([...this.notebookProviderInfoStore].map(info => ({
|
|
463
|
+
id: info.id,
|
|
464
|
+
displayName: info.displayName,
|
|
465
|
+
providerDisplayName: info.providerDisplayName
|
|
466
|
+
})))
|
|
467
|
+
);
|
|
461
468
|
}
|
|
462
469
|
clearEditorCache() {
|
|
463
470
|
this.notebookProviderInfoStore.clearEditorCache();
|
|
@@ -467,15 +474,17 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
467
474
|
this._extensionService.activateByEvent(`onNotebook:*`);
|
|
468
475
|
}
|
|
469
476
|
async canResolve(viewType) {
|
|
470
|
-
if (( this._notebookProviders.has(viewType))) {
|
|
477
|
+
if (( (this._notebookProviders.has(viewType)))) {
|
|
471
478
|
return true;
|
|
472
479
|
}
|
|
473
480
|
await this._extensionService.whenInstalledExtensionsRegistered();
|
|
474
481
|
await this._extensionService.activateByEvent(`onNotebookSerializer:${viewType}`);
|
|
475
|
-
return (
|
|
482
|
+
return (
|
|
483
|
+
(this._notebookProviders.has(viewType))
|
|
484
|
+
);
|
|
476
485
|
}
|
|
477
486
|
registerContributedNotebookType(viewType, data) {
|
|
478
|
-
const info = ( new NotebookProviderInfo({
|
|
487
|
+
const info = ( (new NotebookProviderInfo({
|
|
479
488
|
extension: data.extension,
|
|
480
489
|
id: viewType,
|
|
481
490
|
displayName: data.displayName,
|
|
@@ -483,7 +492,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
483
492
|
exclusive: data.exclusive,
|
|
484
493
|
priority: RegisteredEditorPriority.default,
|
|
485
494
|
selectors: []
|
|
486
|
-
}));
|
|
495
|
+
})));
|
|
487
496
|
info.update({ selectors: data.filenamePattern });
|
|
488
497
|
const reg = this.notebookProviderInfoStore.add(info);
|
|
489
498
|
this._onDidChangeEditorTypes.fire();
|
|
@@ -493,8 +502,8 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
493
502
|
});
|
|
494
503
|
}
|
|
495
504
|
_registerProviderData(viewType, data) {
|
|
496
|
-
if (( this._notebookProviders.has(viewType))) {
|
|
497
|
-
throw new Error(`notebook provider for viewtype '${viewType}' already exists`);
|
|
505
|
+
if (( (this._notebookProviders.has(viewType)))) {
|
|
506
|
+
throw ( (new Error(`notebook provider for viewtype '${viewType}' already exists`)));
|
|
498
507
|
}
|
|
499
508
|
this._notebookProviders.set(viewType, data);
|
|
500
509
|
this._onAddViewType.fire(viewType);
|
|
@@ -507,7 +516,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
507
516
|
this.notebookProviderInfoStore.get(viewType)?.update({ options: serializer.options });
|
|
508
517
|
this._viewTypeCache[viewType] = extensionData.id.value;
|
|
509
518
|
this._persistMementos();
|
|
510
|
-
return this._registerProviderData(viewType, ( new SimpleNotebookProviderInfo(viewType, serializer, extensionData)));
|
|
519
|
+
return this._registerProviderData(viewType, ( (new SimpleNotebookProviderInfo(viewType, serializer, extensionData))));
|
|
511
520
|
}
|
|
512
521
|
async withNotebookDataProvider(viewType) {
|
|
513
522
|
const selected = this.notebookProviderInfoStore.get(viewType);
|
|
@@ -515,12 +524,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
515
524
|
const knownProvider = this.getViewTypeProvider(viewType);
|
|
516
525
|
const actions = knownProvider ? [
|
|
517
526
|
toAction({
|
|
518
|
-
id: 'workbench.notebook.action.installMissingViewType', label: ( localizeWithPath(
|
|
519
|
-
'vs/workbench/contrib/notebook/browser/services/notebookServiceImpl',
|
|
520
|
-
'notebookOpenInstallMissingViewType',
|
|
521
|
-
"Install extension for '{0}'",
|
|
522
|
-
viewType
|
|
523
|
-
)), run: async () => {
|
|
527
|
+
id: 'workbench.notebook.action.installMissingViewType', label: ( localizeWithPath(_moduleId, 0, "Install extension for '{0}'", viewType)), run: async () => {
|
|
524
528
|
await this._instantiationService.createInstance(InstallRecommendedExtensionAction, knownProvider).run();
|
|
525
529
|
}
|
|
526
530
|
})
|
|
@@ -530,7 +534,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
530
534
|
await this.canResolve(selected.id);
|
|
531
535
|
const result = this._notebookProviders.get(selected.id);
|
|
532
536
|
if (!result) {
|
|
533
|
-
throw new Error(`NO provider registered for view type: '${selected.id}'`);
|
|
537
|
+
throw ( (new Error(`NO provider registered for view type: '${selected.id}'`)));
|
|
534
538
|
}
|
|
535
539
|
return result;
|
|
536
540
|
}
|
|
@@ -564,11 +568,11 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
564
568
|
}
|
|
565
569
|
}
|
|
566
570
|
createNotebookTextModel(viewType, uri, data, transientOptions) {
|
|
567
|
-
if (( this._models.has(uri))) {
|
|
568
|
-
throw new Error(`notebook for ${uri} already exists`);
|
|
571
|
+
if (( (this._models.has(uri)))) {
|
|
572
|
+
throw ( (new Error(`notebook for ${uri} already exists`)));
|
|
569
573
|
}
|
|
570
574
|
const notebookModel = this._instantiationService.createInstance(NotebookTextModel, viewType, uri, data.cells, data.metadata, transientOptions);
|
|
571
|
-
const modelData = ( new ModelData(notebookModel, this._onWillDisposeDocument.bind(this)));
|
|
575
|
+
const modelData = ( (new ModelData(notebookModel, this._onWillDisposeDocument.bind(this))));
|
|
572
576
|
this._models.set(uri, modelData);
|
|
573
577
|
this._notebookDocumentService.addNotebookDocument(modelData);
|
|
574
578
|
this._onWillAddNotebookDocument.fire(notebookModel);
|
|
@@ -580,10 +584,14 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
580
584
|
return this._models.get(uri)?.model;
|
|
581
585
|
}
|
|
582
586
|
getNotebookTextModels() {
|
|
583
|
-
return (
|
|
587
|
+
return (
|
|
588
|
+
(Iterable.map( (this._models.values()), data => data.model))
|
|
589
|
+
);
|
|
584
590
|
}
|
|
585
591
|
listNotebookDocuments() {
|
|
586
|
-
return (
|
|
592
|
+
return (
|
|
593
|
+
([...this._models].map(e => e[1].model))
|
|
594
|
+
);
|
|
587
595
|
}
|
|
588
596
|
_onWillDisposeDocument(model) {
|
|
589
597
|
const modelData = this._models.get(model.uri);
|
|
@@ -596,7 +604,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
596
604
|
}
|
|
597
605
|
}
|
|
598
606
|
getOutputMimeTypeInfo(textModel, kernelProvides, output) {
|
|
599
|
-
const sorted = this._displayOrder.sort(( new Set((
|
|
607
|
+
const sorted = this._displayOrder.sort(( (new Set( (output.outputs.map(op => op.mime))))));
|
|
600
608
|
const notebookProviderInfo = this.notebookProviderInfoStore.get(textModel.viewType);
|
|
601
609
|
return sorted
|
|
602
610
|
.flatMap(mimeType => this._notebookRenderersInfoStore.findBestRenderers(notebookProviderInfo, mimeType, kernelProvides))
|
|
@@ -631,13 +639,13 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
631
639
|
return undefined;
|
|
632
640
|
}
|
|
633
641
|
};
|
|
634
|
-
NotebookService = NotebookService_1 = ( __decorate([
|
|
635
|
-
( __param(0, IExtensionService)),
|
|
636
|
-
( __param(1, IConfigurationService)),
|
|
637
|
-
( __param(2, IAccessibilityService)),
|
|
638
|
-
( __param(3, IInstantiationService)),
|
|
639
|
-
( __param(4, IStorageService)),
|
|
640
|
-
( __param(5, INotebookDocumentService))
|
|
641
|
-
], NotebookService));
|
|
642
|
+
NotebookService = NotebookService_1 = ( (__decorate([
|
|
643
|
+
( (__param(0, IExtensionService))),
|
|
644
|
+
( (__param(1, IConfigurationService))),
|
|
645
|
+
( (__param(2, IAccessibilityService))),
|
|
646
|
+
( (__param(3, IInstantiationService))),
|
|
647
|
+
( (__param(4, IStorageService))),
|
|
648
|
+
( (__param(5, INotebookDocumentService)))
|
|
649
|
+
], NotebookService)));
|
|
642
650
|
|
|
643
651
|
export { NotebookOutputRendererInfoStore, NotebookProviderInfoStore, NotebookService };
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js
CHANGED
|
@@ -11,7 +11,7 @@ let NotebookEditorWorkerServiceImpl = class NotebookEditorWorkerServiceImpl exte
|
|
|
11
11
|
this._workerManager = this._register(( new WorkerManager(notebookService)));
|
|
12
12
|
}
|
|
13
13
|
canComputeDiff(original, modified) {
|
|
14
|
-
throw new Error('Method not implemented.');
|
|
14
|
+
throw ( new Error('Method not implemented.'));
|
|
15
15
|
}
|
|
16
16
|
computeDiff(original, modified) {
|
|
17
17
|
return this._workerManager.withWorker().then(client => {
|
|
@@ -151,7 +151,7 @@ class NotebookWorkerClient extends Disposable {
|
|
|
151
151
|
this._modelManager = null;
|
|
152
152
|
}
|
|
153
153
|
fhr(method, args) {
|
|
154
|
-
throw new Error(`Not implemented!`);
|
|
154
|
+
throw ( new Error(`Not implemented!`));
|
|
155
155
|
}
|
|
156
156
|
computeDiff(original, modified) {
|
|
157
157
|
return this._withSyncedResources([original, modified]).then(proxy => {
|
|
@@ -15,13 +15,13 @@ class MoveCellEdit {
|
|
|
15
15
|
}
|
|
16
16
|
undo() {
|
|
17
17
|
if (!this.editingDelegate.moveCell) {
|
|
18
|
-
throw new Error('Notebook Move Cell not implemented for Undo/Redo');
|
|
18
|
+
throw ( new Error('Notebook Move Cell not implemented for Undo/Redo'));
|
|
19
19
|
}
|
|
20
20
|
this.editingDelegate.moveCell(this.toIndex, this.length, this.fromIndex, this.endSelections, this.beforedSelections);
|
|
21
21
|
}
|
|
22
22
|
redo() {
|
|
23
23
|
if (!this.editingDelegate.moveCell) {
|
|
24
|
-
throw new Error('Notebook Move Cell not implemented for Undo/Redo');
|
|
24
|
+
throw ( new Error('Notebook Move Cell not implemented for Undo/Redo'));
|
|
25
25
|
}
|
|
26
26
|
this.editingDelegate.moveCell(this.fromIndex, this.length, this.toIndex, this.beforedSelections, this.endSelections);
|
|
27
27
|
}
|
|
@@ -47,7 +47,7 @@ class SpliceCellsEdit {
|
|
|
47
47
|
}
|
|
48
48
|
undo() {
|
|
49
49
|
if (!this.editingDelegate.replaceCell) {
|
|
50
|
-
throw new Error('Notebook Replace Cell not implemented for Undo/Redo');
|
|
50
|
+
throw ( new Error('Notebook Replace Cell not implemented for Undo/Redo'));
|
|
51
51
|
}
|
|
52
52
|
this.diffs.forEach(diff => {
|
|
53
53
|
this.editingDelegate.replaceCell(diff[0], diff[2].length, diff[1], this.beforeHandles);
|
|
@@ -55,7 +55,7 @@ class SpliceCellsEdit {
|
|
|
55
55
|
}
|
|
56
56
|
redo() {
|
|
57
57
|
if (!this.editingDelegate.replaceCell) {
|
|
58
|
-
throw new Error('Notebook Replace Cell not implemented for Undo/Redo');
|
|
58
|
+
throw ( new Error('Notebook Replace Cell not implemented for Undo/Redo'));
|
|
59
59
|
}
|
|
60
60
|
this.diffs.reverse().forEach(diff => {
|
|
61
61
|
this.editingDelegate.replaceCell(diff[0], diff[1].length, diff[2], this.endHandles);
|
|
@@ -441,7 +441,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
else if (edit.editType !== 5 ) {
|
|
444
|
-
throw new Error('Invalid cell edit');
|
|
444
|
+
throw ( new Error('Invalid cell edit'));
|
|
445
445
|
}
|
|
446
446
|
return {
|
|
447
447
|
edit,
|
|
@@ -973,7 +973,7 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
973
973
|
}
|
|
974
974
|
_assertIndex(index) {
|
|
975
975
|
if (this._indexIsInvalid(index)) {
|
|
976
|
-
throw new Error(`model index out of range ${index}`);
|
|
976
|
+
throw ( new Error(`model index out of range ${index}`));
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
979
|
_indexIsInvalid(index) {
|
|
@@ -46,10 +46,14 @@ let NotebookDiffEditorInput = class NotebookDiffEditorInput extends DiffEditorIn
|
|
|
46
46
|
]);
|
|
47
47
|
this._cachedModel?.dispose();
|
|
48
48
|
if (!modifiedEditorModel) {
|
|
49
|
-
throw new Error(
|
|
49
|
+
throw ( new Error(
|
|
50
|
+
`Fail to resolve modified editor model for resource ${this.modified.resource} with notebookType ${this.viewType}`
|
|
51
|
+
));
|
|
50
52
|
}
|
|
51
53
|
if (!originalEditorModel) {
|
|
52
|
-
throw new Error(
|
|
54
|
+
throw ( new Error(
|
|
55
|
+
`Fail to resolve original editor model for resource ${this.original.resource} with notebookType ${this.viewType}`
|
|
56
|
+
));
|
|
53
57
|
}
|
|
54
58
|
this._originalTextModel = originalEditorModel;
|
|
55
59
|
this._modifiedTextModel = modifiedEditorModel;
|
package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js
CHANGED
|
@@ -132,7 +132,7 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
|
|
|
132
132
|
if (!arg0.untitledResource) {
|
|
133
133
|
const info = this._notebookService.getContributedNotebookType(assertIsDefined(viewType));
|
|
134
134
|
if (!info) {
|
|
135
|
-
throw new Error('UNKNOWN view type: ' + viewType);
|
|
135
|
+
throw ( new Error('UNKNOWN view type: ' + viewType));
|
|
136
136
|
}
|
|
137
137
|
const suffix = NotebookProviderInfo.possibleFileEnding(info.selectors) ?? '';
|
|
138
138
|
for (let counter = 1;; counter++) {
|
|
@@ -154,7 +154,7 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
if (resource.scheme === CellUri.scheme) {
|
|
157
|
-
throw new Error(`CANNOT open a cell-uri as notebook. Tried with ${resource.toString()}`);
|
|
157
|
+
throw ( new Error(`CANNOT open a cell-uri as notebook. Tried with ${( resource.toString())}`));
|
|
158
158
|
}
|
|
159
159
|
resource = this._uriIdentService.asCanonicalUri(resource);
|
|
160
160
|
const existingViewType = this._notebookService.getNotebookTextModel(resource)?.viewType;
|
|
@@ -170,13 +170,15 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
if (!viewType) {
|
|
173
|
-
throw new Error(`Missing viewType for '${resource}'`);
|
|
173
|
+
throw ( new Error(`Missing viewType for '${resource}'`));
|
|
174
174
|
}
|
|
175
175
|
if (existingViewType && existingViewType !== viewType) {
|
|
176
176
|
await this._onWillFailWithConflict.fireAsync({ resource, viewType }, CancellationToken.None);
|
|
177
177
|
const existingViewType2 = this._notebookService.getNotebookTextModel(resource)?.viewType;
|
|
178
178
|
if (existingViewType2 && existingViewType2 !== viewType) {
|
|
179
|
-
throw new Error(
|
|
179
|
+
throw ( new Error(
|
|
180
|
+
`A notebook with view type '${existingViewType2}' already exists for '${resource}', CANNOT create another notebook with view type ${viewType}`
|
|
181
|
+
));
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
184
|
const reference = this._data.acquire(( resource.toString()), viewType, hasAssociatedFilePath, limits);
|
|
@@ -108,7 +108,7 @@ class MirrorNotebookDocument {
|
|
|
108
108
|
}
|
|
109
109
|
_assertIndex(index) {
|
|
110
110
|
if (index < 0 || index >= this.cells.length) {
|
|
111
|
-
throw new Error(`Illegal index ${index}. Cells length: ${this.cells.length}`);
|
|
111
|
+
throw ( new Error(`Illegal index ${index}. Cells length: ${this.cells.length}`));
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
_spliceNotebookCells(splices) {
|