Tracking Issue for native-completion · Issue #14520 · rust-lang/cargo (original) (raw)
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:
- feat: Add native comlpetion with CompleteEnv under the nightly #14493
- Add custom completer for
cargo uninstall <TAB>
(feat: Add custom completer for completing installed binaries #14534) - Add custom completer for
cargo build --bin=<TAB>
(feat: Add custom completer for completing bin names #14533) - Add custom completer for
cargo build --bench=<TAB>
(feat: Add custom completer for completing benchmark names #14532) - Add custom completer for
cargo build --example=<TAB>
(feat: Add custom completer for cargo build --example= #14531) - Add custom completer for
cargo test --test=<TAB>
(feat: Add custom completer for completing test names #14548) - Add custom completer for
cargo update <TAB>
(feat: Add support for completing cargo update #14552) - Add custom completer for
cargo build --package=<TAB>
(cli suggestions for --package #15004, feat: Add custom completer for completing cargo build --packge #14553) - Add custom completer for
cargo help <TAB>
(feat: Add custom completer for cargo help #14557) - Add custom completer for
cargo -Z <TAB>
(feat: Add custom completer for cargo -Z #14536) - Add custom completer for
cargo build --target=<TAB>
(feat: Add custom completer for completing target triple #14535) - Add custom completer for
cargo +<TAB>
to complete toolchain name (feat: Add custom completer for cargo + to complete toolchain name #15301) - Add custom completer for
cargo <TAB>
to complete aliases defined inconfig.toml
(feat: Add custom completer for cargo to complete aliases defined in config.toml #15319) - Add custom completer for
cargo <TAB>
to complete third-party subcommand names - Completing arguments after an alias
- Completing arguments after a
+<toolchain>
- Ensure vcs, color, and message format possible values are completed (feat: vcs, color, and message format native completion #15322)
- Add custom completer for
cargo publish --registry=<TAB>
(feat: Add custom completer for completing registry name #14656) - Add custom completer for
cargo add --registry=<TAB>
(feat: Add custom completer for completing registry name #14656) - Add custom completer for
--features
(feat(completer): Added completion for --features flag #15309) - Add completer for
cargo build --manifest-path<TAB>
(feat: add completions for --manifest-path #15225) - Add completer for
cargo build --lockfile-path<TAB>
(feat: add completions for --lockfile-path #15238) - Add completer for
cargo install --path<TAB>
(feat: add completions for install --path #15266) - Add completer for
cargo add --path<TAB>
(feat: add completions for add --path #15288) - Registering completions / using completions with
+toolchain
argument - shell_completions test issues #14545
- Stabilize support in clap (Stablize Rust-Native Completion Engine Tracking Issue 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
- Should we add custom completer for
cargo add <TAB>
andcargo install <TAB>
using crate.io search API
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>
(feat(complete): Added completion for --profile #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
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.