-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-import extremely unreliable for files inside workspace #139
Comments
Thanks for the bug report. We're working on improving the behavior. In the meantime, one way you can improve the behavior is to change the |
Actually, as I mentioned in passing in the report, |
Thanks for working on it! In the meantime, I'm wondering if there is a way to just disable auto-imports (while keeping other features in place)? Can't find it in docs. |
There isn't a way at the moment, but we are working on all aspects of this (improving the suggestions, allowing control over which if any are shown, etc). |
should be fixed in the next release. |
This issue has been fixed in version 2020.9.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202090-3-september-2020 |
Environment data
UPD: Also reproduced on Windows 8.1, VS Code 1.47.2, Python 3.8.4. The system didn't have neither VS Code, nor Python before today, completely clean case. No settings were changed after install other than: I installed Python and Pylance extensions, and I disabled linting. The abnormal behavior was the same, as shown on screenshots below.
Expected behaviour
Things in the workspace show up in auto-import suggestions.
Actual behaviour
Auto-import seems extremely unreliable when it comes to things in the workspace. Auto-import appears to discover names in the workspace only if the relevant file is opened and brought into focus. Some time later it may forget about them, even if the file remains open. I also tried changing Diagnostic Mode setting to "workspace", didn't seem to have any effect. Manual imports work fine, the suggestions are there. Additionally, if I write out a manual import and then remove it, the auto-import temporarily "learns" the path as well.
Additional information
I've attached some screenshots of a minimal example on a clean project:
The text was updated successfully, but these errors were encountered: