rust-lang / rust-lang/rust-analyzer

Feature Request: In the VS Code Test Explorer, copy the test ID of a test

Open
#21,500 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In the Test Explorer in VS Code, it'd be super handy if you could right-click on a test, then copy the test ID of a specific test (or file, or folder, or any level) to run in a different terminal.

This feature exists in Python with pytest in the VS Code test explorer, and is very handy.

The idea is that you'd right-click on a test, copy its test id, and then you can run cargo test -- paste_the_test_id_here in a new terminal.

A common use case where I'd find this handy is that I often want to run RUST_BACKTRACE=full cargo test --release -- paste_the_test_id_here when a specific test is failing/panicking.

I'm not sure how this would integrate with other IDEs, but I assume it'd be pretty similar. This feature request is currently primarily for VS Code 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

Start at the rust-analyzer VS Code Test Explorer integration and trace how a selected test, file, or folder is represented for execution. Compare the requested context-menu action with the existing cargo test -- <test ID> flow; done means each supported tree level exposes a copy-ID action whose value can be pasted into the command.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.