-
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
Autocomplete in imports doesn't work when we have packages that are symlinks #1031
Comments
Just to precheck, does the import itself work if you were to just say |
autocomplete doesn't work with |
Thanks, that's very helpful. |
Oops I think I got it wrong. autocomplete doesn't work with |
As in when you write |
Typing |
So long as no import resolution error happens (e.g. we find the module when manually specified), then things are still getting narrowed down to the completion provider, which is what I'm looking for. 🙂 |
This is a simple copy/paste error here: https://github.com/microsoft/pyright/blob/2eba7458eb38952822a144bb2e111b7c0d90ff72/packages/pyright-internal/src/common/pathUtils.ts#L600 If I fix it so that it's adding the directory to the directories list, things work as expected. |
This will be fixed in the next version of Pylance. Many thanks for the test case, it was very helpful! |
Awesome! Thanks for the great work! |
This issue has been fixed in version 2021.3.2, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202132-17-march-2021 |
Pleace take look to this mine comment: microsoft/vscode-python#13198 (comment) |
@Hadatko Can you please file a new issue with your reproduction? |
Sure. Sorry. |
Sorry nevermind. Fixed with python.analysis.extraPaths |
Hello, this is no longer working for me in v2023.09.30 It is not just autocomplete not working; Pylance is also throwing an import not resolved error. I have tried python.analysis.extraPaths to no avail |
@Benkendorfer I tested the symbolic link issue in version v2023.09.30 and autocomplete worked. You must have another problem. I suggest you open another issue detailing your problem in more detail. |
Ok. I just started writing a new issue and when extracting the environment configuration I noticed that it is suddenly working now... if the problem appears again I will open a new issue. |
Environment data
Expected behaviour
Fill the configuration in settings.json:
Packages inside
/home/user/lib
are symlinks to real path.Type in the code:
I hope the autocomplete will suggest all packages that start with my inside the
/home/user/lib
folder.Actual behaviour
The autocomplete doesn't suggest packages inside the /home/user/lib folder .
Logs
Code Snippet / Additional information
See:
In the figure,
lib
is a folder that is inpython.analysis.extraPaths
.my
, inside the lib folder is a symbolic link to the real package.I created a repository to simulate this:
https://github.com/wesleybl/symbolic.package
See:
https://github.com/wesleybl/symbolic.package#symbolicpackage
It appears that there has been an increase in support for symbolic links in:
microsoft/pyright#1607
But that didn’t solve the autocomplete problem.
@jakebailey @erictraut FYI
The text was updated successfully, but these errors were encountered: