Tracking Issue for native-completion
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
Summary
Original issue: #6645
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#native-completions
Testing instructions: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#native-completions
Implementation:
- #14493
- Add custom completer for
cargo uninstall <TAB>(#14534) - Add custom completer for
cargo build --bin=<TAB>(#14533) - Add custom completer for
cargo build --bench=<TAB>(#14532) - Add custom completer for
cargo build --example=<TAB>(#14531) - Add custom completer for
cargo test --test=<TAB>(#14548) - Add custom completer for
cargo update <TAB>(#14552) - Add custom completer for
cargo build --package=<TAB>(#15004, #16210) - Add custom completer for
cargo help <TAB>(#14557) - Add custom completer for
cargo -Z <TAB>(#14536) - Add custom completer for
cargo build --target=<TAB>(#14535) - Add custom completer for
cargo +<TAB>to complete toolchain name (#15301) - Add custom completer for
cargo <TAB>to complete aliases defined inconfig.toml(#15319) - Add custom completer for
cargo <TAB>to complete third-party subcommand names (#15961) - Completing arguments after an alias
- Completing arguments after a
+<toolchain> - Ensure vcs, color, and message format possible values are completed (#15322)
- Add custom completer for
cargo publish --registry=<TAB>(#14656) - Add custom completer for
cargo add --registry=<TAB>(#14656) - Add custom completer for
--features(#15309) - Add completer for
cargo build --manifest-path<TAB>(#15225) - Add completer for
cargo build --lockfile-path<TAB>(#15238) - Add completer for
cargo install --path<TAB>(#15266) - Add completer for
cargo add --path<TAB>(#15288) - Registering completions / using completions with
+toolchainargument - #14545
- Stabilize support in clap (clap-rs/clap#3166)
Unresolved Issues
- Some tests are disabled on macOS.
- Distinguish whether different subcommands require path fallback.
- Completion candidates generation test code per completer.
Open Questions
- What should we support?
- Today, cargo supports
bash,zsh - Currently, this adds
fish,elvish,powershell - rustup supports
bash,fish,zsh,powershell,elvish - Are all of sufficient quality? powershell being the biggest question
- Today, cargo supports
Future Extensions
- Completing arguments for third-party subcommands through delegation
- Stable Cargo has supported this for both bash and zsh already.
- Add custom completer for
cargo <TAB>to cargo scripts - Add custom completer for
cargo test <TAB>(blocked on json protocol so we can cache the names of tests) - Add custom completer for
cargo build --profile=<TAB>(#15308) - Add custom completer for
cargo tree --format- Inside of
{, offer each variable with closing}with a description of the variable - Outside of
{}, offer each variable inside{}with description
- Inside of
- Should we add custom completer for
cargo add <TAB>andcargo install <TAB>using crate.io search API- Performance?
- Information leakage when using a different registry but the completer doesn't know
- End-point usage
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the native-completions section of Cargo's unstable documentation and review the unchecked items in this tracking issue, especially completion after aliases or a +toolchain argument and the unresolved macOS and fallback tests. Done means addressing a focused remaining checklist item, linking its implementation or test issue here, and confirming the documented completion behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, fish, powershell, rust, zsh
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100