From b71e2bb0c7dc52075758540d836524869e2b17c4 Mon Sep 17 00:00:00 2001 From: sunshinesmilelk <1176136681@qq.com> Date: Fri, 13 Sep 2024 17:20:45 +0800 Subject: [PATCH] fix(jupyter): load content error --- .changeset/loud-jeans-pump.md | 33 +++++++++++++++++++ .../libro-jupyter/src/libro-jupyter-model.ts | 4 +-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .changeset/loud-jeans-pump.md diff --git a/.changeset/loud-jeans-pump.md b/.changeset/loud-jeans-pump.md new file mode 100644 index 00000000..70a12c45 --- /dev/null +++ b/.changeset/loud-jeans-pump.md @@ -0,0 +1,33 @@ +--- +'@difizen/libro-codemirror': patch +'@difizen/libro-jupyter': patch +'@difizen/libro-lsp': patch +'@difizen/libro-toc': patch +'@difizen/libro-docs': patch +'@difizen/libro-code-cell': patch +'@difizen/libro-code-editor': patch +'@difizen/libro-cofine-editor': patch +'@difizen/libro-cofine-editor-contribution': patch +'@difizen/libro-cofine-editor-core': patch +'@difizen/libro-cofine-textmate': patch +'@difizen/libro-common': patch +'@difizen/libro-core': patch +'@difizen/libro-kernel': patch +'@difizen/libro-l10n': patch +'@difizen/libro-lab': patch +'@difizen/libro-language-client': patch +'@difizen/libro-markdown': patch +'@difizen/libro-markdown-cell': patch +'@difizen/libro-output': patch +'@difizen/libro-prompt-cell': patch +'@difizen/libro-raw-cell': patch +'@difizen/libro-rendermime': patch +'@difizen/libro-search': patch +'@difizen/libro-search-code-cell': patch +'@difizen/libro-shared-model': patch +'@difizen/libro-terminal': patch +'@difizen/libro-virtualized': patch +'@difizen/libro-widget': patch +--- + +fix(jupyter): load content error diff --git a/packages/libro-jupyter/src/libro-jupyter-model.ts b/packages/libro-jupyter/src/libro-jupyter-model.ts index 552a3e4b..5aac3b92 100644 --- a/packages/libro-jupyter/src/libro-jupyter-model.ts +++ b/packages/libro-jupyter/src/libro-jupyter-model.ts @@ -148,8 +148,8 @@ export class LibroJupyterModel extends LibroModel implements ExecutableNotebookM await this.contentsManager.deleteCheckpoint(this.filePath, checkpointID); } - override loadNotebookContent(): Promise { - const content = super.loadNotebookContent(); + override async loadNotebookContent(): Promise { + const content = await super.loadNotebookContent(); this.id = this.currentFileContents.path; // use file path as id, will be passed to editor and lsp if (this.executable && !this.kernelConnecting) { this.startKernelConnection();