pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Notebook IntelliSense incorrectly reports code as unreachable

Open joyceerhl opened this issue 4 years ago • 4 comments

From our test plan,

Open the src/test/datascience/manualTestFiles/manualTestFile.py in VSCode. Run all of the cells in the file. Interactive Window should open Export the cells in the interactive window and open the notebook editor

The cells below the exception cell are incorrectly marked as unreachable. We should probably suppress these types of warnings, they create lots of noise and might contribute to Pylance churn.

image

joyceerhl avatar Aug 24 '21 23:08 joyceerhl

I think the language server team needs to bake on the concept of notebooks. Our work around (concat) are reaching their limits, and we're regularly running into issues and playing catch-up

DonJayamanne avatar Aug 25 '21 01:08 DonJayamanne

Another repo, have two cells in a notebook like so:

raise Exception('fail')
print('stuff')

Second cell will be marked as unreachable

image

rchiodo avatar Jan 24 '22 23:01 rchiodo

@debonte can you repro this with the LSP prototype?

luabud avatar Mar 01 '22 19:03 luabud

@luabud, yes this will be fixed by the LSP notebooks work since each cell will be a treated as a separate document.

debonte avatar Apr 14 '22 21:04 debonte

We're closing this issue since it is fixed when python.pylanceLspNotebooksEnabled is set to true and as of Python extension version 2022.14.0 that is now the default.

If you are setting python.pylanceLspNotebooksEnabled to false, we would like to understand why. Please file an issue.

debonte avatar Sep 08 '22 05:09 debonte