Commit a1635e8
authored
feat: add completions for
### What does this PR try to resolve?
Add auto completion for `cargo build --manifest-path <TAB>`
Related to #14520
Ways this could be handled:
1. Complete nothing **(current nightly behavior)**: users must manually
type every character of the path.
2. Complete all files **(current stable behavior)**: users see every
file, more than this PR
3. Complete every file name that is accepted by `--manifest-path`
**(this PR)**: this may match files that don't have a manifest inside
them, implicit or explicit
4. Complete only `Cargo.toml`: Cargo script users will have to manually
type in every of the path
Generally, completions should err on the side of being overly broad,
rather than less, because otherwise users will have to manually type
things out
This is still an improvement over the stable behavior because you don't
have
1. `foo/C[TAB]`, see `Cargo.toml` and `Cargo.lock`
2. `foo/Ca[TAB]`, get `foo/Cargo.toml`
### How should we test and review this PR?
[Screencast from 23-02-25 04:09:17 PM
IST.webm](https://github.com/user-attachments/assets/6290801c-85bf-4b44-9dcd-6cc431891897)--manifest-path (#15225)1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
328 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
329 | 341 | | |
330 | 342 | | |
331 | 343 | | |
| |||
0 commit comments