rust-lang / rust-lang/rust-analyzer

VSCode Test Explorer regularly requires a full rebuild

Open
#17,149 6 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer version: rust-analyzer version: 0.3.1932-standalone (47a901b9b 2024-04-21)

rustc version: 1.77.2

editor or extension: VSCode Insiders with RA 0.3.1932

It's pretty common for running tests via the Test Explorer to require a full rebuild of all dependencies. Seems like build results are getting trampled and lost when check runs. That is, the common test - fix/save file - test - fix/save file loop seems to require a rebuild of everything at every step.

Seems to happen regardless of rust-analyzer.cargo.targetDir being set to true or not. However, "rust-analyzer.check.extraArgs": ["--target-dir", "rust-analyzer-check"] seems to mitigate it, but running cargo test from the CLI requires and forces a full rebuild.

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

Reproduce the test-fix/save-test loop in VSCode Test Explorer using the reported rust-analyzer and rustc versions, then compare it with cargo test from the CLI. Check behavior with rust-analyzer.cargo.targetDir enabled or disabled and with check.extraArgs set to --target-dir rust-analyzer-check. Done means repeated test runs preserve incremental build results without rebuilding all dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
build-system, devtools, testing-qa
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.