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

Restrict top-level autocompletion for VS Code (PyLance) #2927

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

binste
Copy link
Contributor

@binste binste commented Feb 25, 2023

Currently, this PR is only meant to show some code related to discussions happening in #2918, microsoft/pylance-release#3709 (reply in thread) and #2614.

As described in https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface, I expanded the wildcard import from vegalite and added py.typed. However, selection still shows up in autocompletion although it should be considered private by PyLance as it is not mentioned in __all__:

image

Opening altair/__init__.py in VS Code shows that PyLance is aware that it should be private so this is somehow ignored by the code completion?

image


Before this approach could be merged, we'd need to:

  • Understand what implications are of adding py.typed. Altair is far off from being “type complete” as it is described here. Maybe what we want to achieve is possible without adding py.typed for now?
  • Automate expansion of from .vegalite import *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant