提交 6887b609 编写于 作者: R rebornix

resolve the right view type of a cell when its containing document is already opened.

上级 7785f875
......@@ -446,12 +446,20 @@ class CellContentProvider implements ITextModelContentProvider {
if (!data) {
return null;
}
const info = getFirstNotebookInfo(this._notebookService, data.notebook);
if (!info) {
const documentAlreadyOpened = this._notebookService.listNotebookDocuments().find(document => document.uri.toString() === data.notebook.toString());
let viewType = documentAlreadyOpened?.viewType;
if (!viewType) {
const info = getFirstNotebookInfo(this._notebookService, data.notebook);
viewType = info?.id;
}
if (!viewType) {
return null;
}
const ref = await this._notebookModelResolverService.resolve(data.notebook, info.id);
const ref = await this._notebookModelResolverService.resolve(data.notebook, viewType);
let result: ITextModel | null = null;
for (const cell of ref.object.notebook.cells) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册