PTVS
PTVS copied to clipboard
Intellisense forgets imports during editing
Describe the bug
When a project is first opened, imports work as expected both from inside the same project as well as installed packages:
After an hour or two of work, they are marked as not resolved and other functionality like "Go to definition" is also broken. Only builtin packages are not impacted:
The behaviour extends to the entire solution, including opening and closing files. After restarting VS, everything works again.
Steps to Reproduce Unfortunately, I haven't been able to find a consistent trigger for this behaviour. It happens regardless of whether the project has been run, whether a lot of files are edited or VS is simply sitting idle.
Configuration information (If you are providing a diagnostics file (see below), skip this section) VS Version: 17.2.2 PTVS version: 17.0.22089.1 Python version: 3.8 and 3.9
I just found out that this issue persist even through reloading the project, eg. after a Git pull. Only restarting Visual Studio fixes it temporarily.
Unfortunately, it has now also started happening as often as every five minutes.
dupe of https://github.com/microsoft/PTVS/issues/7068