Skip to content

feat: enhance runnable command placeholders#21978

Merged
ChayimFriedman2 merged 2 commits intorust-lang:masterfrom
shorwood:feat/granular-override-placeholders
Apr 9, 2026
Merged

feat: enhance runnable command placeholders#21978
ChayimFriedman2 merged 2 commits intorust-lang:masterfrom
shorwood:feat/granular-override-placeholders

Conversation

@shorwood
Copy link
Copy Markdown
Contributor

@shorwood shorwood commented Apr 7, 2026

add new placeholders for overrideCommand settings: ${exact} (--exact for single targets, empty for modules) and ${include_ignored} (--include-ignored for tests, empty otherwise). Also documents the existing ${test_name} placeholder.

allows nextest-style overrides:

"rust-analyzer.runnables.test.overrideCommand": [
  "cargo", "nextest", "run",
  "--package", "${package}",
  "${target_arg}", "${target}",
  "--", "${test_name}", "${exact}"
]

Existing ${executable_args} configs are unaffected.

Closes #21137

@shorwood shorwood marked this pull request as ready for review April 7, 2026 00:17
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 7, 2026

let exact = match kind {
RunnableKind::Test { test_id } | RunnableKind::Bench { test_id } => match test_id {
TestId::Path(_) => "",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TestId::Path is one specific test and needs --exact, modules are RunnableKind::TestMod.

Copy link
Copy Markdown
Contributor Author

@shorwood shorwood Apr 7, 2026

Choose a reason for hiding this comment

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

yep, had it backward. also fixed include_ignore cond while I was at it, is this the correct behavior ?

Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

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

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 9, 2026
Merged via the queue into rust-lang:master with commit b41a134 Apr 9, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 9, 2026
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.

Is it possible for Run Test and Run Tests in VS Code to invoke nextest?

3 participants