use document object identity and not uri equality when checking if a document belongs to a notebook (#206778)

https://github.com/microsoft/vscode/issues/206487
This commit is contained in:
Johannes Rieken
2024-03-04 12:28:36 +01:00
committed by GitHub
parent 5f354675ad
commit 595efea648
2 changed files with 2 additions and 12 deletions

View File

@@ -541,7 +541,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const interalSelector = typeConverters.LanguageSelector.from(selector);
let notebook: vscode.NotebookDocument | undefined;
if (targetsNotebooks(interalSelector)) {
notebook = extHostNotebook.notebookDocuments.find(value => Boolean(value.getCell(document.uri)))?.apiNotebook;
notebook = extHostNotebook.notebookDocuments.find(value => value.apiNotebook.getCells().find(c => c.document === document))?.apiNotebook;
}
return score(interalSelector, document.uri, document.languageId, true, notebook?.uri, notebook?.notebookType);
},