rust-lang / rust-lang/rust-analyzer

Vscode extension: Looking for runnables... There's no debug target!

Open
#16,531 11 comments 6 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

Hello.
I've been encountering this specific problem with "Rust-Analyzer: Debug" no matter what platform I am on. I've been able to replicate this on Windows, and Mac OS. Now I'm on Arch Linux and after updating rust from the official repositories I'm encountering this again.

Put simply, running the command "Rust-Analyzer: Debug" leaves me in this state:

Screenshot from 2024-02-11 13-27-58

while clicking the Debug editor action above fn main() works like intended.

Screenshot from 2024-02-11 13-28-09

[pun@owo ~]$ rust-analyzer --version
rust-analyzer 1 (39ad79bec 2024-02-04)
[pun@owo ~]$ rustc --version
rustc 1.76.0 (07dca489a 2024-02-04) (Arch Linux rust 1:1.76.0-1)

Screenshot from 2024-02-11 13-49-06
I also, cannot generate launch configuration using the rust-analyzer vscode extension, receiving the same error.

If I generate launch configuration with the codelldb vscode extension then it works like expected when I press F5.

Edit: There are the custom vscode settings I currently have for rust. I have the same problem if I try to use the bundled rust-analyzer that comes with the vscode extension.

  "rust-analyzer.debug.engine": "vadimcn.vscode-lldb",
  "rust-analyzer.server.path": "rust-analyzer"

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 with the VS Code "Rust-Analyzer: Debug" command and compare it with the working Debug editor action above fn main(). Check the rust-analyzer.debug.engine and rust-analyzer.server.path settings, then reproduce the missing-target and launch-configuration errors. Done means the command finds a debug target and can generate a working launch configuration, as codelldb does with F5.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.