pylance-release
pylance-release copied to clipboard
Notebook IntelliSense incorrectly reports code as unreachable
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.

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
Another repo, have two cells in a notebook like so:
raise Exception('fail')
print('stuff')
Second cell will be marked as unreachable

@debonte can you repro this with the LSP prototype?
@luabud, yes this will be fixed by the LSP notebooks work since each cell will be a treated as a separate document.
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.