-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Feature] Complete packages after require statement #1
Comments
Just for completeness:
... should use the same list. |
Hey @nifr, I'm interested in adding this, though it'll be a bit of challenge making it run fast enough for completion to not be painful and show reasonably up to date package names. The completion behaviour can be implemented in PHP using a callback function as a completion handler. The first call to Another possible way to source package details would be to read the cached composer repository JSON files in
You're welcome to have a go at implementing this. I'll have a think about a good solution in any case. Thanks for your other suggestions too 👍 |
https://github.com/iArren/composer-bash-completion does the caching into "packages.list" file. maybe do the same? extra ttl could be set too, perhaps 10-60 minutes to redo the fetch (could be smaller if cache is fetched in background) |
Hey Stephen,
first of all ... let me thank you for that awesome plugin. The idea of fetching valid suggestions from the available
*Command
s andInputOption
s is brilliant and logical.I've seen other completion functions capable of providing completions for the
require
command by using a (cached) result ofcomposer show
.... can be used to find all available packages without the line ...
... if composer is executed inside a directory that has no
composer.json
.I didn't have the time to dive into the code of the
CompletionCommand
yet.Would you rather add something like this in the bash/zsh-snippets or do this in PHP with a
ComposerCompletionCommand
that extendsCompletionCommand
added to this repository?The text was updated successfully, but these errors were encountered: