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

cli suggestions for --package #15004

Open
dev-ardi opened this issue Jan 2, 2025 · 4 comments · May be fixed by #14553
Open

cli suggestions for --package #15004

dev-ardi opened this issue Jan 2, 2025 · 4 comments · May be fixed by #14553
Labels
A-completions Area: shell completions C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@dev-ardi
Copy link

dev-ardi commented Jan 2, 2025

Problem

cargo build --package Tab doesn't complete anything. It would be very useful!

Proposed Solution

I'd expect packages from my workspace to be suggested and if there's no match, then the dependencies.

Notes

No response

@dev-ardi dev-ardi added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Jan 2, 2025
@epage epage added the A-completions Area: shell completions label Jan 2, 2025
@epage
Copy link
Contributor

epage commented Jan 2, 2025

Huh, we don't have this in bash and in zsh, we have it stubbed out

cargo/src/etc/_cargo

Lines 421 to 425 in fbca21b

#FIXME: Disabled until fixed
#gets package names from the manifest file
_cargo_package_names() {
_message -e packages package
}

We are working on replacing those completions with native completions, see https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#native-completions

It appears the PR for cargo build --package has stalled out, see #14553.

@epage epage added S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review and removed S-triage Status: This issue is waiting on initial triage. labels Jan 2, 2025
@dev-ardi
Copy link
Author

dev-ardi commented Jan 2, 2025

bash and in zsh

I'm using fish, will it work for it?

@epage
Copy link
Contributor

epage commented Jan 2, 2025

Fish provides their own completions for Cargo
https://github.com/fish-shell/fish-shell/blob/master/share/completions/cargo.fish

You might want to open an issue in their repo.

atm our native completions also provide fish completions. Unsure how well they play with fish's own completions. As we stabilize the feature, we'll need to decide what shells we officially support. If we consider supporting fish, we'll then need to work with fish regarding our two different set of completions. Fish does complete things that Cargo likely won't, like cargo add [TAB].

@dev-ardi
Copy link
Author

dev-ardi commented Jan 3, 2025

I think it's good to survey the community and ask what shell they use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completions Area: shell completions C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants