Skip to content

Commit 3f96146

Browse files
committed
Register the notebook remote save setting
1 parent 001615e commit 3f96146

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,11 @@ configurationRegistry.registerConfiguration({
984984
codeOutput: true
985985
},
986986
tags: ['notebookLayout']
987+
},
988+
[NotebookSetting.remoteSaving]: {
989+
markdownDescription: nls.localize('notebook.remoteSaving', "Enables the incremental saving of notebooks in Remote environment. When enabled, only the changes to the notebook are sent to the extension host, improving performance for large notebooks and slow network connections."),
990+
type: 'boolean',
991+
default: typeof product.quality === 'string' && product.quality !== 'stable' // only enable as default in insiders
987992
}
988993
}
989994
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ export const NotebookSetting = {
952952
findScope: 'notebook.find.scope',
953953
logging: 'notebook.logging',
954954
confirmDeleteRunningCell: 'notebook.confirmDeleteRunningCell',
955+
remoteSaving: 'notebook.experimental.remoteSave'
955956
} as const;
956957

957958
export const enum CellStatusbarAlignment {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { IWriteFileOptions, IFileStatWithMetadata } from 'vs/platform/files/comm
1818
import { IRevertOptions, ISaveOptions, IUntypedEditorInput } from 'vs/workbench/common/editor';
1919
import { EditorModel } from 'vs/workbench/common/editor/editorModel';
2020
import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel';
21-
import { ICellDto2, INotebookEditorModel, INotebookLoadOptions, IResolvedNotebookEditorModel, NotebookCellsChangeType, NotebookData } from 'vs/workbench/contrib/notebook/common/notebookCommon';
21+
import { ICellDto2, INotebookEditorModel, INotebookLoadOptions, IResolvedNotebookEditorModel, NotebookCellsChangeType, NotebookData, NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon';
2222
import { INotebookSerializer, INotebookService, SimpleNotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookService';
2323
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
2424
import { IFileWorkingCopyModelConfiguration } from 'vs/workbench/services/workingCopy/common/fileWorkingCopy';
@@ -215,7 +215,7 @@ export class NotebookFileWorkingCopyModel extends Disposable implements IStoredF
215215
};
216216

217217
// Override save behavior to avoid transferring the buffer across the wire 3 times
218-
if (this._configurationService.getValue('notebook.experimental.remoteSave')) {
218+
if (this._configurationService.getValue(NotebookSetting.remoteSaving)) {
219219
this.save = async (options: IWriteFileOptions, token: CancellationToken) => {
220220
const serializer = await this.getNotebookSerializer();
221221

0 commit comments

Comments
 (0)