Skip to content

Commit 52dc2fd

Browse files
authored
save in the extension host for non-remote cases as well (microsoft#209988)
1 parent 9c98056 commit 52dc2fd

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

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

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -218,28 +218,26 @@ export class NotebookFileWorkingCopyModel extends Disposable implements IStoredF
218218
}
219219
}));
220220

221-
if (_notebookModel.uri.scheme === Schemas.vscodeRemote) {
222-
this.configuration = {
223-
// Intentionally pick a larger delay for triggering backups when
224-
// we are connected to a remote. This saves us repeated roundtrips
225-
// to the remote server when the content changes because the
226-
// remote hosts the extension of the notebook with the contents truth
227-
backupDelay: 10000
228-
};
221+
this.configuration = {
222+
// Intentionally pick a larger delay for triggering backups when
223+
// we are connected to a remote. This saves us repeated roundtrips
224+
// to the remote server when the content changes because the
225+
// remote hosts the extension of the notebook with the contents truth
226+
backupDelay: 10000
227+
};
229228

230-
// Override save behavior to avoid transferring the buffer across the wire 3 times
231-
if (this._configurationService.getValue(NotebookSetting.remoteSaving)) {
232-
this.save = async (options: IWriteFileOptions, token: CancellationToken) => {
233-
const serializer = await this.getNotebookSerializer();
229+
// Override save behavior to avoid transferring the buffer across the wire 3 times
230+
if (this._configurationService.getValue(NotebookSetting.remoteSaving)) {
231+
this.save = async (options: IWriteFileOptions, token: CancellationToken) => {
232+
const serializer = await this.getNotebookSerializer();
234233

235-
if (token.isCancellationRequested) {
236-
throw new CancellationError();
237-
}
234+
if (token.isCancellationRequested) {
235+
throw new CancellationError();
236+
}
238237

239-
const stat = await serializer.save(this._notebookModel.uri, this._notebookModel.versionId, options, token);
240-
return stat;
241-
};
242-
}
238+
const stat = await serializer.save(this._notebookModel.uri, this._notebookModel.versionId, options, token);
239+
return stat;
240+
};
243241
}
244242
}
245243

0 commit comments

Comments
 (0)