Show an error when opening an old unsupported jupyter format

Fix #136544
This commit is contained in:
Rob Lourens 2021-11-05 14:06:31 -07:00
parent 69ca0f29fd
commit 29c5f2d394

View file

@ -40,6 +40,10 @@ export class NotebookSerializer implements vscode.NotebookSerializer {
}
}
if (json.nbformat && json.nbformat < 5) {
throw new Error('Only Jupyter notebooks version 4+ are supported');
}
// Then compute indent from the contents (only use first 1K characters as a perf optimization)
const indentAmount = contents ? detectIndent(contents.substring(0, 1_000)).indent : ' ';