Put worker behind setting

This commit is contained in:
nojaf
2024-08-28 10:59:51 +02:00
parent eb948e1ab7
commit 366df5a69d
3 changed files with 16 additions and 4 deletions

View File

@@ -107,10 +107,15 @@ export class NotebookSerializer implements vscode.NotebookSerializer {
data.metadata.indentAmount :
' ';
return this.serializeViaWorker({
notebookContent: sorted,
indentAmount
});
const experimentalSave = vscode.workspace.getConfiguration('ipynb').get('experimental.serialization', false);
if (experimentalSave) {
return this.serializeViaWorker({
notebookContent: sorted,
indentAmount
});
} else {
return Promise.resolve(JSON.stringify(sorted, undefined, indentAmount));
}
}
}