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

Make installed completion lazy load #92

Merged
merged 3 commits into from
Apr 26, 2020
Merged

Conversation

tiangolo
Copy link
Member

This enables having a Typer script/program that is only available under a virtual environment that is loaded later, after the shell is already started, and still have completion support there.

This would also improve shell startup performance as it no longer has to call Python during startup, only later when requesting completion.

The way it works is that completion for a program can be installed "globally" for the whole shell, but it won't call the program until a completion is requested. This also means that it would be even possible to have different versions of a program under different environments (or 2 programs with the same name), and after activating the environment, when triggering a completion for that program name, the one inside the environment will be the one used to request the completion.

@github-actions
Copy link

@github-actions
Copy link

@tiangolo
Copy link
Member Author

This should fix / related to #75

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