Skip to content

Commit 39da966

Browse files
committed
don't recovery notebook editors from IW notebooks.
don't recover backups for new IW notebook models
1 parent 7a04589 commit 39da966

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ 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 => typeof this._getViewType(workingCopy) && workingCopy.resource.scheme !== Schemas.vscodeInteractive,
617617
isOpen: (workingCopy, editor) => editor instanceof NotebookEditorInput && editor.viewType === this._getViewType(workingCopy) && isEqual(workingCopy.resource, editor.resource),
618618
createEditor: workingCopy => NotebookEditorInput.create(this._instantiationService, workingCopy.resource, this._getViewType(workingCopy)!)
619619
}));

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)