diff --git a/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts b/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts index e91e96ece99c..b4077a8456c4 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts @@ -218,28 +218,26 @@ export class NotebookFileWorkingCopyModel extends Disposable implements IStoredF } })); - if (_notebookModel.uri.scheme === Schemas.vscodeRemote) { - this.configuration = { - // Intentionally pick a larger delay for triggering backups when - // we are connected to a remote. This saves us repeated roundtrips - // to the remote server when the content changes because the - // remote hosts the extension of the notebook with the contents truth - backupDelay: 10000 + this.configuration = { + // Intentionally pick a larger delay for triggering backups when + // we are connected to a remote. This saves us repeated roundtrips + // to the remote server when the content changes because the + // remote hosts the extension of the notebook with the contents truth + backupDelay: 10000 + }; + + // Override save behavior to avoid transferring the buffer across the wire 3 times + if (this._configurationService.getValue(NotebookSetting.remoteSaving)) { + this.save = async (options: IWriteFileOptions, token: CancellationToken) => { + const serializer = await this.getNotebookSerializer(); + + if (token.isCancellationRequested) { + throw new CancellationError(); + } + + const stat = await serializer.save(this._notebookModel.uri, this._notebookModel.versionId, options, token); + return stat; }; - - // Override save behavior to avoid transferring the buffer across the wire 3 times - if (this._configurationService.getValue(NotebookSetting.remoteSaving)) { - this.save = async (options: IWriteFileOptions, token: CancellationToken) => { - const serializer = await this.getNotebookSerializer(); - - if (token.isCancellationRequested) { - throw new CancellationError(); - } - - const stat = await serializer.save(this._notebookModel.uri, this._notebookModel.versionId, options, token); - return stat; - }; - } } }