-
Notifications
You must be signed in to change notification settings - Fork 768
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 only on key press #178
Comments
Note that this would need to be a VS Code change and LSP change; neither offer this sort of thing. Completions are a request purely dependent on the file state and the location. A server is typically expected to return the same thing each time, and the client is free to cache requests and not ask the server again. |
I second this (it will be better if we make the auto-import operation more perceivable). The story is: I found there were unexpected auto-imports several times (they were not noticeable until I ran the code) so I disabled this feature. Today I re-enabled it as it is indeed a nice feature. But soon I again got an unexpected auto-import. (I wanted to claim a variable named I think the problem is the mismatch between user expectation and the auto-import behaviors in practice. In short, users cannot notice unexpected auto-imports in time. (A naive solution I could think of is to show a status message (last for 2 seconds) whenever we have an auto-import.) |
I'll note that the original issue would benefit from #163; we shouldn't be offering those sorts of name completions at all. |
Closing since the original issue is resolved. @yzhang-gh, if you would like to, you could add an enhancement discussion in the "discussions" section |
Hi,
I would like to have the ability to choose when the auto-import actually imports modules, functions, etc.
Currently, when I press Tab or Enter on IntelliSense completion suggestion the auto-import always imports the suggestion even if it is not necessary.
For example, when writing tests and using fixtures there is no need to import fixture from conftest.py or any other global module.
Another example, if I define a const variable name
EXAMPLE
in one module when I try to createEXAMPLE
in another module auto-import will import the first oneI think that adding a keystroke to auto-import will be the best solution. Maybe when IntelliSense suggests something enter will take this suggestion without auto-import and tab will auto-import.
Thanks
The text was updated successfully, but these errors were encountered: