rust-lang / rust-lang/rust-analyzer

Improve "Generate launch configuration" user experience

Open
#15,533 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

"Generate launch configuration" is extremely useful, but the generated configuration is missing several items I consider to be necessary for smooth debugging in vscode:
program should be relative to ${workspaceFolder} if possible. Can we leave off the .exe in program? If so we should forward slash for Windows and strip the exe. The idea here is to make it easier to share a given debug configuration with others, even if you don't check in your launch.json.

"preLaunchTask": "rust: cargo build",

should be specified to ensure that we are built before launching. The exact task should be changed to whatever task is most likely to actually build the target we are debugging (for example, test targets probably need a different task).

"internalConsoleOptions": "openOnSessionStart",

ensures that the debug pane opens on debug session start (should be vscode default imo).

env contains far too many keys by default. I don't know if there is a good way of fixing this though.

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

No file or test is named in the issue. Start by locating the code that generates VS Code launch configurations, then compare its output with the requested program path, build task, console setting, and environment handling. Done means the generated launch.json is easier to share and supports the intended build-and-debug flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.