Skip to content

Commit

Permalink
Fix problem with markdown being passed to pylance (#8768)
Browse files Browse the repository at this point in the history
* Fix problem with markdown being passed to pylance

* Add news entry
  • Loading branch information
rchiodo authored Jan 24, 2022
1 parent a21a19d commit adb20eb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/8769.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix problem with markdown cells causing off by one errors in notebooks.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@
"@jupyterlab/services": "^6.1.17",
"@lumino/widgets": "^1.28.0",
"@nteract/messaging": "^7.0.0",
"@vscode/jupyter-lsp-middleware": "^0.2.34",
"@vscode/jupyter-lsp-middleware": "^0.2.36",
"ansi-to-html": "^0.6.7",
"arch": "^2.1.0",
"bootstrap": "^4.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ export class IntellisenseProvider implements INotebookLanguageClientProvider, IE
notebookId = activeInterpreter ? this.getInterpreterIdFromCache(activeInterpreter) : undefined;
}

return interpreterId == notebookId;
// Cell also have to support python
const cell = notebook?.getCells().find((c) => c.document.uri.toString() === uri.toString());

return interpreterId == notebookId && (!cell || cell.document.languageId === 'python');
}

private getNotebookHeader(uri: Uri) {
Expand Down

0 comments on commit adb20eb

Please sign in to comment.