-
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
Suggest more sources for auto imports #291
Comments
currently, in the next release, "from m import *" form is not considered, but "from m import t as t" is considered when choosing what to show in completion for auto import. but let me play with it and see how much it affects our auto-import experiences. |
Note that the new heuristic wouldn't help for this case, as I'm not sure how libraries can clearly indicate that they are the intended way to use libraries, if that intended way is not just the top level module. |
we show both actual definition and best 1 import alias, so zero.all will at least show up. |
I agree with this issue. I think we should certainly improve it. Hope this issue priority could be more urgent. |
now, "python.analysis.indexing" became a real option. Set "python.analysis.indexing": true to enable indexing which will improve auto-import experience. Also, new hidden option "python.analysis.packageIndexDepths" is added which can be used as below to control how much get indexed.
by default, only 1 level module of third party libraries will be indexed, but now, you can use ["package name", module levels to be scanned] to control that. if you put "" to package name, then that will affect all packages. for your example, ["zero", 2] will make all.py to be picked up. thank you fix will be in the next release 2022.1.2 |
This issue has been fixed in version 2022.1.3, which we've just released. You can find the changelog here: CHANGELOG.md |
Hi! The feature that allows to import things automatically while typing is super cool! However, in my opinion, there is one case where it can be improved even further.
I experienced the issue when using the feature when using my library (as a third-party module): https://github.com/Yura52/zero
The library contains the
zero/all.py
module that is designed specifically for importing things without producing many lines. However, the auto-import feature suggests imports only from submodules (such aszero.io
), where entities are actually implemented. Instead, I would prefer importing them fromzero.all
.The text was updated successfully, but these errors were encountered: