Add upstream Cargo completion spec for terminal suggestions - #305309
Megan Rogge (meganrogge) merged 11 commits into
Conversation
|
Alex Ross (@alexr00) Bryan Chen (@bryanchen-d) review and merge the PR please |
Megan Rogge (meganrogge)
left a comment
There was a problem hiding this comment.
Thank you!
There was a problem hiding this comment.
Pull request overview
Adds a new cargo completion spec to the terminal-suggest extension, including dynamic feature-name suggestions sourced from the local project, and wires it into the spec registry and test runner.
Changes:
- Added a new
cargocompletion spec with common subcommands/options and acargo read-manifest-based feature generator for--features. - Registered the new spec in the extension’s
availableSpecs. - Added a dedicated test suite and included it in the main terminal-suggest test runner.
Show a summary per file
| File | Description |
|---|---|
| extensions/terminal-suggest/src/terminalSuggestMain.ts | Registers the new cargo completion spec in availableSpecs. |
| extensions/terminal-suggest/src/completions/cargo.ts | Implements cargo subcommands/options and a dynamic generator for --features. |
| extensions/terminal-suggest/src/test/completions/cargo.test.ts | Adds basic completion coverage for the cargo spec. |
| extensions/terminal-suggest/src/test/terminalSuggestMain.test.ts | Wires the new cargo test suite into the aggregated runner. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 2
Dmitriy Vasyura (dmitrivMS)
left a comment
There was a problem hiding this comment.
Sangeet (@Muszic) Could you please address Copilot's comments and look at the failing CI?
Head branch was pushed to by a user without write access
963ab34
cfb675a to
963ab34
Compare
|
Dmitriy Vasyura (@dmitrivMS) Could you please review the PR , I have addressed all the comments |
|
Sangeet (@Muszic) Thanks for working on this! Would you be so kind as to review the AI feedback below? My understanding is if not all, but most points make sense: 1. const cargoSpec: Fig.Spec = {
name: 'cargo',
subcommands: [ /* build, run, test, ... */ ],
options: [
{ name: ['-F', '--features'], args: { generators: cargoFeaturesGenerator } },
...
]
};These 2. Coverage is thin for a daily Rust user The spec lists ~14 subcommands and 5 options. Cargo has ~30 subcommands and most of the value of completions is the per-subcommand option set. Missing in particular:
Have you looked at whether we can adopt the upstream withfig/autocomplete cargo spec into 3. Cache TTL of 5s is too aggressive cache: {
strategy: 'stale-while-revalidate',
ttl: 5_000,
cacheByDirectory: true
},
4. } catch (e) {
console.error('Failed to parse cargo manifest:', e);
return [];
}This shouldn't go through |
Replace the hand-written Cargo completion with the complete upstream Fig spec and support exact file-name resource filters used by Cargo manifest options. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Megan Rogge (@meganrogge) This is what a full spec looks like. Do we like? |
|
Pada Sen, 7 Sep 2026 03.38, Dmitriy Vasyura ***@***.***>
menulis:
… ***@***.**** approved this pull request.
—
Reply to this email directly, view it on GitHub
<#305309?email_source=notifications&email_token=CM7ETLIRJJSH7S4ZKL6FMND5NXDNXA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMJSGY2TKMZQGMZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#pullrequestreview-5126553033>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CM7ETLLQY3JXJUKA7YQ42RL5NXDNXAVCNFSNUABEKJSXA33TNF2G64TZHM2DCOBYGE4TAMB3JFZXG5LFHM2DCNBXGQ3TANZZG6QXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CM7ETLPOL4RZVZPHJYQ42GD5NXDNXA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMJSGY2TKMZQGMZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/CM7ETLKPN5G2STOVVTOBARD5NXDNXA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMJSGY2TKMZQGMZ2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Summary
Adds Cargo terminal completions using the complete upstream withfig/autocomplete Cargo spec instead of a hand-written subset.
Details
cargothrough the existing upstream-spec generation pipeline.filepathsadapter to preserve upstream exact-name filters forCargo.tomlanddeny.toml.console.logduring generation.Validation
Fixes #336216.