You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Deno/Rustup uses clap, it provides built-in completions via deno completions fish (though users have to source the output themselves).
I'm not sure if this means we can drop the completions come with Fish, but seeing similar packages like bat and ripgrep's completions are removed, I opened this issue to ask.
Are the auto-generated build-in completions good enough? Quality of such auto-generated completions varies widely. I've seen them in some Python tools and it was horrible. In some cases they erroneously disabled completion of file names and such. On the other hand, the new completions for podman are really awesome. They use features recently added in the Cobra framework (Go) to generate these. How is the quality here?
If the quality is good:
I think completions should work out of the box. If the user needs to be aware of sourcing the output in some config file, that is just bad UX. Two possibilities here.
The code that makes the completions available is shipped with the software package itself. Do you know if this is happening? Are packagers of various distributions creating a file in vendor_completions.d or can they be convinced to do so?
If not, for whatever reason, fish could ship the proper file instead. This would have the advantage that completions still work out of the box but the actual completion logic can change upstream without the need to adapt something in fish.
(Just my opinion how I think completions should be handled.)
I've seen them in some Python tools and it was horrible. In some cases they erroneously disabled completion of file names and such.
Yeah, I believe this is one of the areas Fish should ship its own completions. Communities like pip and npm doesn't provide good completions usually.
On the other hand, the new completions for podman are really awesome. They use features recently added in the Cobra framework (Go) to generate these. How is the quality here?
clap's completion is fairly good, and it's being used by lots of popular CLI tools.
I think completions should work out of the box. If the user needs to be aware of sourcing the output in some config file, that is just bad UX.
It's not bad UX, that's just the "official" way to load completions. But most of time users don't need to do this manually, see below.
The code that makes the completions available is shipped with the software package itself. Do you know if this is happening? Are packagers of various distributions creating a file in vendor_completions.d or can they be convinced to do so?
Most distributions/package managers already do it. They run the completion command at build time, saving the output as a completion script.
If not, for whatever reason, fish could ship the proper file instead. This would have the advantage that completions still work out of the box but the actual completion logic can change upstream without the need to adapt something in fish.
If I remember correctly, Fish prefers upstream provided completions if there are any. While I agree with the importance of out-of-box experience, outdated/improper completions may do more harm. It's not easy to keep them correct and up-to-date if Fish is going to maintain them itself.
As for this issue, I believe the current Deno completion in Fish is already auto generated. And the Rustup one hasn't been updated for some time (except for style edits).
If I remember correctly, Fish prefers upstream provided completions if there are any.
We prefer upstream-provided completions if they are good and maintained. If we can do better than the autogenerated stuff we'll do so.
So the question is: Do we do better than the autogenerated stuff?
(then there's also the question of do we ship a script that calls the generator, because that means fewer people are tempted to add thing | source to config.fish and slow their shell startup down)
Okay, both of these suggest subcommands and options. An excerpt:
'complete -c rustup -n "__fish_use_subcommand" -f -a "completions" -d 'Generate tab-completion scripts for your shell'complete -c rustup -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)'complete -c rustup -n "__fish_seen_subcommand_from dump-testament" -s h -l help -d 'Prints help information'complete -c rustup -n "__fish_seen_subcommand_from dump-testament" -s V -l version -d 'Prints version information'complete -c rustup -n "__fish_seen_subcommand_from show" -s h -l help -d 'Prints help information'
That's basically what the deno completions do right now, but our rustup completions do one better: They also provide arguments, like the doc path, or toolchains and such. So they provide more value.
That's more than the state of the art in clap's generation (which is better than most completion generators!), so we're going to keep it.
And because the deno script might gain similar features, we're keeping it as well, for now.
If any of this changes, we can revisit it. In the meantime I'm closing this. Thanks!
Activity
[-]Drop Deno completion[/-][+]Drop Deno/Rustup completion[/+]exploide commentedon Dec 22, 2020
Are the auto-generated build-in completions good enough? Quality of such auto-generated completions varies widely. I've seen them in some Python tools and it was horrible. In some cases they erroneously disabled completion of file names and such. On the other hand, the new completions for
podmanare really awesome. They use features recently added in the Cobra framework (Go) to generate these. How is the quality here?If the quality is good:
I think completions should work out of the box. If the user needs to be aware of sourcing the output in some config file, that is just bad UX. Two possibilities here.
vendor_completions.dor can they be convinced to do so?(Just my opinion how I think completions should be handled.)
kidonng commentedon Dec 22, 2020
Yeah, I believe this is one of the areas Fish should ship its own completions. Communities like pip and npm doesn't provide good completions usually.
clap's completion is fairly good, and it's being used by lots of popular CLI tools.It's not bad UX, that's just the "official" way to load completions. But most of time users don't need to do this manually, see below.
Most distributions/package managers already do it. They run the completion command at build time, saving the output as a completion script.
If I remember correctly, Fish prefers upstream provided completions if there are any. While I agree with the importance of out-of-box experience, outdated/improper completions may do more harm. It's not easy to keep them correct and up-to-date if Fish is going to maintain them itself.
kidonng commentedon Dec 22, 2020
As for this issue, I believe the current Deno completion in Fish is already auto generated. And the Rustup one hasn't been updated for some time (except for style edits).
faho commentedon Dec 22, 2020
We prefer upstream-provided completions if they are good and maintained. If we can do better than the autogenerated stuff we'll do so.
So the question is: Do we do better than the autogenerated stuff?
(then there's also the question of do we ship a script that calls the generator, because that means fewer people are tempted to add
thing | sourceto config.fish and slow their shell startup down)faho commentedon Dec 22, 2020
Okay, both of these suggest subcommands and options. An excerpt:
That's basically what the
denocompletions do right now, but our rustup completions do one better: They also provide arguments, like the doc path, or toolchains and such. So they provide more value.That's more than the state of the art in clap's generation (which is better than most completion generators!), so we're going to keep it.
And because the deno script might gain similar features, we're keeping it as well, for now.
If any of this changes, we can revisit it. In the meantime I'm closing this. Thanks!