rust-lang / rust-lang/rust-analyzer

Setting check.workspace to false still emits diagnostics from all members the first time they are seen

Open
#17,126 4 comments 0 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

rust-analyzer version: v0.3.1906

rustc version: rustc 1.79.0-nightly (1684a753d 2024-04-01)

editor or extension: I've tested this on VSCode, NeoVim, Helix.

relevant settings: check.workspace = false

code snippet to reproduce:

https://github.com/rust-lang/rust-analyzer/pull/16510 brings check.workspace setting, it works well except the first time RA starts.

The reproducing steps are:

  • make a workspace containing a member and the root crate: make some diagnostics in both
  • set check.workspace to false
  • open a file from one of the package, wait for RA starts, then you'll see diagnostics from both pkgs (=> this is the bug)
  • save the file, you'll finally see diagnostics from single pkg

Found in https://users.rust-lang.org/t/rust-analyzer-cargo-workspaces-and-members-in-helix-editor/110284/8

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 check.workspace implementation introduced by pull request 16510 and reproduce the reported workspace startup sequence using a root crate and member with diagnostics. Compare the initial diagnostics with those after saving a file. Done means check.workspace=false limits diagnostics to the selected package from startup, without requiring a save.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.