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

Autocomplete suggestions for import don't work without entry in __init__.py #359

Closed
vishwa-raj opened this issue Sep 11, 2020 · 6 comments
Closed
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@vishwa-raj
Copy link

Environment data

  • Language Server version: 2020.9.4
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7, Anaconda

Expected behaviour

Autocomplete suggestion for import should be shown during typing even without entry in __init__.py.
This is the behaviour when using Jedi.

jedi

Actual behaviour

Without entry in __init__.py, autocomplete suggestion is showed with Ctrl+Space but not while typing.

pylance

@vishwa-raj vishwa-raj changed the title Autocomplete suggestions for import don't work without __init__ Autocomplete suggestions for import don't work without entry in __init__.py Sep 11, 2020
@heejaechang heejaechang added bug Something isn't working and removed triage labels Sep 11, 2020
@heejaechang heejaechang self-assigned this Sep 11, 2020
@vishwa-raj
Copy link
Author

Any update on this issue ?

@erictraut
Copy link
Contributor

Could you provide more information or perhaps a self-contained example of the problem? I can't tell from your description or the animated gifs what you mean by "without entry in init.py".

@vishwa-raj
Copy link
Author

vishwa-raj commented Oct 14, 2020

@erictraut I've attached example code for the problem.

Simply put, the difference between Jedi and Pylance, when trying to import the file child_1.py in parent.py,
is that the name of the file child_1 automatically shows up in suggestion while typing with Jedi but not with Pylance.

Jedi:
jedi

Pylance:
pylance

autocomplete_check.zip

@erictraut
Copy link
Contributor

Thanks for the example — very helpful. I've diagnosed and fixed the problem. The bug fix will be included in the next release.

@erictraut erictraut added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Oct 15, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.10.2, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#2020102-21-october-2020

@vishwa-raj
Copy link
Author

Thanks @erictraut @jakebailey

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

4 participants