rust-lang / rust-lang/rust-analyzer

Cargo check is not run for all crates in workspace

Open
#11,447 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer version: ba3305480 2022-02-07 stable

rustc version: rustc 1.60.0-nightly (a00e130da 2022-01-29)

I have a workspace with 2 crates:

crates/
├── log_analyzer/
│   ├── src/
│   ├── Cargo.toml
├── terminal_ui/
│   ├── src/
│   ├── Cargo.toml
├── Cargo.toml

Workspace Cargo.toml


[workspace]
members=["crates/*"]

rust-analyzer settings (I've tried enabling disabling certain of these features)

"rust-analyzer.cargo.runBuildScripts": true,
"rust-analyzer.lruCapacity": 1024,
"rust-analyzer.procMacro.enable": true,
"rust-analyzer.cargo.allFeatures": true,
"rust-analyzer.experimental.procAttrMacros": false,
"rust-analyzer.inlayHints.enable": true,

Only the log_analyzer crate shows cargo check analysis, when saving a file I can see the files under this crate blinking as being processed by rust-analyzer but not on the terminal_ui crate:

image

Whereas the same code setup out of a cargo workspace folder is properly analyzed (actually copied out of the workspace, opening the problematic crate folder on vscode doesnt work neither):

image

Any ideas of what can be going on?

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 report with the workspace Cargo.toml and the crates/* members in VS Code, comparing analysis for log_analyzer and terminal_ui. Start by checking why only one crate receives cargo check analysis; done means both workspace crates are analyzed consistently, with a regression test if the relevant test location can be identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.