Skip to content

Commit 97817e1

Browse files
amungerhediet
authored andcommitted
Merge pull request #172427 from amunger/aamunger/IWRecovery
don't recovery notebook editors from IW notebooks.
2 parents 0231351 + be90520 commit 97817e1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,10 @@ class SimpleNotebookWorkingCopyEditorHandler extends Disposable implements IWork
613613
await this._extensionService.whenInstalledExtensionsRegistered();
614614

615615
this._register(this._workingCopyEditorService.registerHandler({
616-
handles: workingCopy => typeof this._getViewType(workingCopy) === 'string',
616+
handles: workingCopy => {
617+
const viewType = this._getViewType(workingCopy);
618+
return typeof viewType === 'string' && viewType !== 'interactive';
619+
},
617620
isOpen: (workingCopy, editor) => editor instanceof NotebookEditorInput && editor.viewType === this._getViewType(workingCopy) && isEqual(workingCopy.resource, editor.resource),
618621
createEditor: workingCopy => NotebookEditorInput.create(this._instantiationService, workingCopy.resource, this._getViewType(workingCopy)!)
619622
}));

src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,14 @@ export class NotebookFileWorkingCopyModelFactory implements IStoredFileWorkingCo
252252
throw new Error('CANNOT open file notebook with this provider');
253253
}
254254

255-
const bytes = await streamToBuffer(stream);
256-
const data = await info.serializer.dataToNotebook(bytes);
255+
let data: NotebookData = {
256+
metadata: {},
257+
cells: []
258+
};
259+
if (resource.scheme !== Schemas.vscodeInteractive) {
260+
const bytes = await streamToBuffer(stream);
261+
data = await info.serializer.dataToNotebook(bytes);
262+
}
257263

258264
if (token.isCancellationRequested) {
259265
throw new CancellationError();

0 commit comments

Comments
 (0)