Skip to content

Commit

Permalink
don't recovery notebook editors from IW notebooks.
Browse files Browse the repository at this point in the history
don't recover backups for new IW notebook models
  • Loading branch information
amunger committed Jan 25, 2023
1 parent 7a04589 commit 39da966
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ class SimpleNotebookWorkingCopyEditorHandler extends Disposable implements IWork
await this._extensionService.whenInstalledExtensionsRegistered();

this._register(this._workingCopyEditorService.registerHandler({
handles: workingCopy => typeof this._getViewType(workingCopy) === 'string',
handles: workingCopy => typeof this._getViewType(workingCopy) && workingCopy.resource.scheme !== Schemas.vscodeInteractive,
isOpen: (workingCopy, editor) => editor instanceof NotebookEditorInput && editor.viewType === this._getViewType(workingCopy) && isEqual(workingCopy.resource, editor.resource),
createEditor: workingCopy => NotebookEditorInput.create(this._instantiationService, workingCopy.resource, this._getViewType(workingCopy)!)
}));
Expand Down
10 changes: 8 additions & 2 deletions src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,14 @@ export class NotebookFileWorkingCopyModelFactory implements IStoredFileWorkingCo
throw new Error('CANNOT open file notebook with this provider');
}

const bytes = await streamToBuffer(stream);
const data = await info.serializer.dataToNotebook(bytes);
let data: NotebookData = {
metadata: {},
cells: []
};
if (resource.scheme !== Schemas.vscodeInteractive) {
const bytes = await streamToBuffer(stream);
data = await info.serializer.dataToNotebook(bytes);
}

if (token.isCancellationRequested) {
throw new CancellationError();
Expand Down

0 comments on commit 39da966

Please sign in to comment.