Skip to content

feat(cli): add dynamic completions for rustup target add - #5110

Merged
rami3l merged 1 commit into
rust-lang:mainfrom
14elias:feat/target-add-completion
Oct 6, 2026
Merged

rami3l merged 1 commit into
rust-lang:mainfrom
14elias:feat/target-add-completion

Conversation

@14elias

@14elias 14elias commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Related to #5032

This builds on #5033 and adds dynamic shell completions for target names in rustup target add.

It extends the existing completion_command stuff by attaching an ArgValueCompleter to the target argument, so you can tab-complete available targets for the active toolchain.

  • Manifest reading: uses the sync DistributableToolchain::new and .components() methods to pull available targets from the on-disk manifest
  • Toolchain selection: walks the installed toolchains (sorted alphabetically) and takes targets from the first official distributable one it can parse
  • The "all" keyword is supported and always shows up as a completion option when it matches the current prefix

Also includes tests that check the completion logic against mocked rustup directories and channel manifests.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@14elias
14elias force-pushed the feat/target-add-completion branch 3 times, most recently from 84e5ffc to dc1c308 Compare September 28, 2026 18:36
@rustbot

This comment has been minimized.

Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
@14elias
14elias force-pushed the feat/target-add-completion branch from dc1c308 to 425dffd Compare October 1, 2026 16:14
@rustbot

This comment has been minimized.

Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
@14elias
14elias force-pushed the feat/target-add-completion branch 2 times, most recently from 60a1b08 to 4b30f27 Compare October 2, 2026 14:51
Comment thread src/cli/rustup_mode.rs Resolved
Comment thread src/cli/rustup_mode.rs Resolved
@14elias
14elias force-pushed the feat/target-add-completion branch 2 times, most recently from fbaa255 to 67a2629 Compare October 2, 2026 17:18
@14elias
14elias requested review from djc and rami3l October 4, 2026 08:54

@rami3l rami3l left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo the existing threads, thanks!

Waiting for @djc to confirm that all his concerns have been resolved.

View changes since this review

@djc
djc added this pull request to the merge queue Oct 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 5, 2026
@rami3l

rami3l commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

@Kobzol It looks like rust-lang/team#2816 is now blocking any new merges in this repo (because the docs job is failing constantly)... Could we do anything on our side to speed up the process?

Also, should docs be excluded from deploying when running on GHMQ checks (it seems that the exclusion has happened in the CI yaml, but somehow it still fails, is it configuration-related)?

@rami3l
rami3l added this pull request to the merge queue Oct 5, 2026
@rami3l
rami3l removed this pull request from the merge queue due to a manual request Oct 5, 2026
@rami3l
rami3l force-pushed the feat/target-add-completion branch from 67a2629 to 069577b Compare October 5, 2026 15:54
@rustbot

This comment has been minimized.

@rami3l
rami3l force-pushed the feat/target-add-completion branch from 069577b to ee1bf40 Compare October 6, 2026 08:08
@rustbot

rustbot commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rami3l
rami3l enabled auto-merge October 6, 2026 08:09
@rami3l
rami3l added this pull request to the merge queue Oct 6, 2026
Merged via the queue into rust-lang:main with commit 4be5542 Oct 6, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants