rust-lang / rust-lang/rust-analyzer

Customize Run / Debug with Command Line Arguments

Open
#10,408 2 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Having the ability to quickly run and/or debug an individual test has been absolutely fantastic and in the case of tests and benchmarks, this is very straightforward. It would be nice though if the run/debug could be customized in some way within examples/ (and I'm guessing bin/ too?) where the main function could reasonably expect command line arguments.

I'm not sure what might be the best way to approach this. I can see a two main options:

  1. Adding 'Run with args' and 'Debug with args' to the list of possibilities. Four different run/debug options could become a big cluttered, but as this would not apply to most tests / benchmarks, I'm not sure this would be a big issue.
  2. Adding a 'Customize' option which would create a pre-filled entry in launch.json allowing for the task to be run this way (and customized). Perhaps this could apply more generally?

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 the existing run and debug actions for individual tests and benchmarks, then inspect how examples/ and bin/ targets are discovered. Compare the proposed Run with args, Debug with args, and launch.json customization approaches; done means one chosen behavior is clearly specified and supports command-line arguments without unnecessary action clutter.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.