Skip to content
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

Buggy autocomplete for relative local imports #1479

Closed
maegul opened this issue Jun 22, 2021 · 3 comments
Closed

Buggy autocomplete for relative local imports #1479

maegul opened this issue Jun 22, 2021 · 3 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@maegul
Copy link

maegul commented Jun 22, 2021

Describe the bug
Autocomplete is providing incorrect options when importing from local directories with a relative import.

At first, only the already imported top-level import is listed as an option. Then, once the first character of any of the actual sub-directories or modules is typed, the autocomplete will refresh with appropriate options.

The issue is that one cannot lazily rely on autocomplete for writing relative imports.

I'm using pyright in sublime text, but the issue is reproducible in VS Code. See sublimelsp/LSP-pyright#76 (comment)

See screenshots below for demonstration.

To Reproduce
Screen Shot 2021-06-22 at 12 18 04 am

Screen Shot 2021-06-22 at 12 18 33 am

@erictraut
Copy link
Contributor

Since this isn't a core type checking issue, I'm going to transfer it to the "pylance-release" repo so it gets the attention it deserves there.

@erictraut erictraut transferred this issue from microsoft/pyright Jun 22, 2021
@erictraut
Copy link
Contributor

I shouldn't have been so quick to assume this was a bug in the completion provider. It turned out to be a bug in pyright's parser. It tries to provide hints to the completion provider in certain error conditions. In this particular case, it wasn't providing the right hint that the partially-completed package name ended in a dot.

Thanks for reporting the problem. It will be fixed in the next release.

@erictraut erictraut added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed triage labels Jun 22, 2021
@bschnurr
Copy link
Member

This issue has been fixed in version 2021.6.3, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202163-23-june-2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants