mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 05:28:19 -05:00
Put worker behind setting
This commit is contained in:
@@ -39,6 +39,12 @@
|
||||
"scope": "resource",
|
||||
"markdownDescription": "%ipynb.pasteImagesAsAttachments.enabled%",
|
||||
"default": true
|
||||
},
|
||||
"ipynb.experimental.serialization": {
|
||||
"type": "boolean",
|
||||
"scope": "resource",
|
||||
"markdownDescription": "%ipynb.experimental.serialization%",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"displayName": ".ipynb Support",
|
||||
"description": "Provides basic support for opening and reading Jupyter's .ipynb notebook files",
|
||||
"ipynb.pasteImagesAsAttachments.enabled": "Enable/disable pasting of images into Markdown cells in ipynb notebook files. Pasted images are inserted as attachments to the cell.",
|
||||
"ipynb.experimental.serialization": "Experimental feature to serialize the Jupyter notebook in a worker thread.",
|
||||
"newUntitledIpynb.title": "New Jupyter Notebook",
|
||||
"newUntitledIpynb.shortTitle": "Jupyter Notebook",
|
||||
"openIpynbInNotebookEditor.title": "Open IPYNB File In Notebook Editor",
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user