rust-lang / rust-lang/rust-analyzer

rust-project.json runnable filtering always selects the first `Run` runnable

Open
#20,435 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

The filtering of bin runnables from the rust-project.json always selects the first Run runnable. In a project with a lot of runnables, this breaks the Run / Debug integration in VSCode.

rust-analyzer version: 3d2c40d705f5663fccf4a4d89ea457876ac32df6 (2025-08-11)

  • In target_spec_for_crate() runnables are copied over instead of selected by current crate / build info. This is one place where filtering could be expected.
  • In runnable_args() the first RunnableKind::Run is selected. This is another place where filtering could be expected.

Related:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing runnable_args() in crates/rust-analyzer/src/target_spec.rs and target_spec_for_crate() in crates/rust-analyzer/src/global_state.rs, then read the related issue and pull request for context. Determine how the current crate or build information should select a runnable, and verify that rust-project.json no longer makes VSCode Run/Debug use the first Run runnable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.