Attempt to Colorize Code Cells from Notebook Contents (#13473)

* Attempt to colorize from saved language info

* Simplify colorization change

* Fixup
This commit is contained in:
Chris LaFreniere
2020-11-19 19:54:09 -08:00
committed by GitHub
parent bb2a1db6e8
commit 8d42182db8

View File

@@ -336,6 +336,11 @@ export class NotebookModel extends Disposable implements INotebookModel {
this._cells = [];
if (contents) {
this._defaultLanguageInfo = contents.metadata?.language_info;
// If language info was serialized in the notebook, attempt to use that to decrease time
// required until colorization occurs
if (this._defaultLanguageInfo) {
this.updateLanguageInfo(this._defaultLanguageInfo);
}
this._savedKernelInfo = this.getSavedKernelInfo(contents);
this._savedConnectionName = this.getSavedConnectionName(contents);
if (contents.metadata) {