Skip to content

Commit 4686029

Browse files
committed
Add cargo shell completion project summary
1 parent 494e164 commit 4686029

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

posts/2024-11-01-gsoc-2024-results.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,18 @@ Apart from the mentioned contributions, Eitaro also made a lot of other smaller
6767
- Mentor: [Ed Page](https://github.com/epage)
6868
- [Final report](https://hackmd.io/@PthRWaPvSmS_2Yu_GLbGpg/Hk-ficKpC)
6969

70-
TODO
70+
Cargo's completion scripts have been hand maintained and frequently broken when changed. The goal for this effort was to have the completions automatically generated from the definition of Cargo's command-line, with extension points for dynamically generated results.
71+
72+
[shanmu](https://github.com/shannmu) took the prototype for dynamic completions in [clap][clap] (the command-line parser used by Cargo), got it working and tested for common shells, as well as extended the parser to cover more cases. They then added extension points for CLI's to provide custom completion results that can be generated on the fly.
73+
74+
In the next phase, shanmu added this to nightly Cargo and added different custom completers to match what the handwritten completions do. As an example, with this feature enabled, when you type `cargo test --test=` and hit the Tab key, your shell will autocomplete all the test targets in your current Rust crate! If you are interested, see the [instructions][cargo-shell-completion] for trying this out! The link also lists where you can provide feedback.
75+
76+
You can also check out the following issues to find out what is left before this can be stabilized:
77+
- [clap#3166](https://github.com/clap-rs/clap/issues/3166)
78+
- [cargo#14520](https://github.com/rust-lang/cargo/issues/14520)
79+
80+
[clap]: https://github.com/clap-rs/clap
81+
[cargo-shell-completion]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#native-completions
7182

7283
### Rewriting Esoteric, Error-Prone Makefile Tests Using Robust Rust Features
7384

0 commit comments

Comments
 (0)