-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
completion: pip: Only invoke pip when trying to complete it #1834
Conversation
@cornfeedhobo @davidpfarrell @nwinkler what is your opinion on this? |
@NoahGorny I'd love to test this more thoroughly soon, but I'm a little bogged down. If you're okay waiting through this week, I'll probably get to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. It's beautiful. Let's definitely get this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great and tests great, but small change requested. Thanks!
I'm also thinking we might want to generalize the lazy loading of any function, but I think I could handle that in a follow up PR. |
This should greatly reduce shell load time, as the pip invocation takes a lot of time
62585b7
to
61c0357
Compare
@cornfeedhobo finally got around to actaully doing it, thanks for the CR 😄 |
What's the meaning of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I was worried about the surprised delay the user might get on first use, but TIL that bash-completion loads completions lazily by default.
We might consider a framework to also lazy-load completions by default, but until then, this seems legit.
@hongyi-zhao wrote:
I believe @NoahGorny uses |
@cornfeedhobo ping 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. There is a small lag on the first tab, but that's to be expected with lazy loading.
Description
Invokes pip only when actively trying to complete it.
Motivation and Context
This should greatly reduce shell load time, as the pip invocation takes
a lot of time.
How Has This Been Tested?
Locally
Types of changes
Checklist:
clean_files.txt
and formatted it usinglint_clean_files.sh
.