microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.28k stars 286 forks source link

Deleting a code cell or converting it to markdown causes diagnostics in other cells to be (permanently?) cleared #6581

Closed joyceerhl closed 3 years ago

joyceerhl commented 3 years ago

Python extension v2021.7.992362372-dev

I can reliably reproduce this problem:

recording (18)

The existing cell whose diagnostics were cleared doesn't get its diagnostics back even after subsequently modifying its contents or adding new cells.

Diagnostics are also incorrectly reported thereafter if I add a new cell (and the incorrect diagnostics go away if I delete cell 2): image

This may also be related to https://github.com/microsoft/vscode-jupyter/issues/6458

joyceerhl commented 3 years ago

I cannot reproduce this in v2021.6.944021595 so this is a regression fyi @rebornix

joyceerhl commented 3 years ago

Interestingly deleting cells in the native interactive window doesn't cause intellisense to break.

joyceerhl commented 3 years ago

image

The diagnostic range coming in here is transparently forwarded to vscode.NotebookConcatTextDocument.locationAt, so the location that comes back corresponds to cell 1, and this causes diagnostics for cell 2 to be reported in cell 1:

image

greazer commented 3 years ago

Looks like this has been fixed. I can't repro either problem that Joyce mentions.