mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-05 21:07:16 +01:00
save in the extension host for non-remote cases as well (#209988)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user