-
Notifications
You must be signed in to change notification settings - Fork 770
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
Pylance fails to import just few classes #6209
Comments
Related SO question opened by me |
can you run |
I tried, but issue persists |
I think what is happening is when we dedup import symbols, we think one from third party is better since it has shorter import path. without those third party lib installed, I get what you want. Screen.Recording.2024-07-30.122727.mp4let's improve our logic so, we only dedup between different packages within |
I think the root issue is this setting that basically says
for example, if you add
... that said, I think we can improve user experience on this. |
Thank you @heejaechang Changing my settings.json from
to
removed any 3rd party duplicated import and correctly references the right library. |
Hi guys, thank you for your work on Pylance.
I'm trying VSCode for Python development to move away from PyCharm, but I'm having a strange issue and I don't know if it's a bug or not.
So far, I'm able to get import suggestions like this:
and selecting the class will import it correctly.
But, if I try with other django core views, such as
ListView
orLoginRequiredMixin
, this happens:where
django_tables2.views
andhijack.views
are third party libraries, which import themselves thedjango.views.generic.ListView
class.As you can imagine,
ListView
andUpdateView
are in the same Django package (django.views.generic
). They are in 2 different python files (update.py
andlist.py
respectively), but they are both exported in__init__.py
at package level.I already customized
python.analysis.packageIndexDepths
as suggested in other issues, but it's quite strange to me that UpdateView is resolved and ListView not.I can successfully import other classes in the same
django.views.generic.list.py
file, as expected.Is this a bug or I'm just missing something very basic?
Please find my full settings.json:
The text was updated successfully, but these errors were encountered: