Skip to content

Drop Deno/Rustup completion #7562

Closed
Closed

Description

@kidonng

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.

Activity

  1. changed the title [-]Drop Deno completion[/-] [+]Drop Deno/Rustup completion[/+] on Dec 20, 2020
  2. exploide commented on Dec 22, 2020

    @exploide
    Contributor

    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.)

  3. kidonng commented on Dec 22, 2020

    @kidonng
    ContributorAuthor

    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.

  4. kidonng commented on Dec 22, 2020

    @kidonng
    ContributorAuthor

    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).

  5. faho commented on Dec 22, 2020

    @faho
    Member

    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)

  6. faho commented on Dec 22, 2020

    @faho
    Member

    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!

  7. added this to the will-not-implement milestone on Dec 22, 2020
  8. locked as resolved and limited conversation to collaborators on Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions