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

Shell completion improvements #6128

Merged
merged 7 commits into from
Apr 19, 2022
Merged

Commits on Mar 7, 2022

  1. Accept and discard fragments in getFlakeRefForCompletion

    Otherwise trying to complete `nix build foo#bar --update-input <Tab>`
    fails with "unexpected fragment"
    ncfavier committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    7f5cf87 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7ddcb39 View commit details
    Browse the repository at this point in the history
  3. Fix completion of nested attributes in completeInstallable

    Without this, completing `nix eval -f file.nix foo.<Tab>` suggests `bar`
    instead of `foo.bar`, which messes up the command
    ncfavier committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    5f06a91 View commit details
    Browse the repository at this point in the history
  4. Ensure the completion marker is not processed beyond completion

    I was surprised to see an error mentioning ___COMPLETE___ when trying to
    complete a flag argument that had no completer implemented
    ncfavier committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    a6d7cd4 View commit details
    Browse the repository at this point in the history
  5. Make completeDir follow symlinks

    Allows completing `nix why-depends /run/cur<Tab>` to /run/current-system
    ncfavier committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    5461ff5 View commit details
    Browse the repository at this point in the history
  6. Perform tilde expansion when completing flake fragments

    Allows completing `nix build ~/flake#<Tab>`.
    We can implement expansion for `~user` later if needed.
    Not using wordexp(3) since that expands way too much.
    ncfavier committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    55c6906 View commit details
    Browse the repository at this point in the history
  7. Add shell completion for --override-flake

    Requires moving the MixEvalArgs class from libexpr to libcmd because
    that's where completeFlakeRef is.
    ncfavier committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    da7d8da View commit details
    Browse the repository at this point in the history