rust-lang / rust-lang/rust-analyzer

Skip checking some workspace members

Open
#14,186 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

Hi! At uutils/coreutils we have a workspace with many crates, but some of those crates are not available on all platforms. However, rust-analyzer checks all crates and keeps giving error messages for the crates that aren't supposed to work on the current platform.

Here's a minimal example, which I also put in a repository.

We have a workspace with 2 crates: foo and bar. The foo crate works on our current platform, but bar doesn't. Hence we want to prevent rust-analyzer checking the bar crate. In the repository, I've done this by making bar depend on the selinux-sys crate, which only compiles if you have the selinux headers installed.

What I'd like is some configuration feature to specify some crates in the workspace that should not be checked. It'd be great if I could specify this per platform or on features, but the simplest version is that at the very least contributors would be able to configure rust-analyzer themselves so that they don't get the unnecessary errors.

The issue that inspired this feature request is https://github.com/uutils/coreutils/issues/4400.

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 linked minimal reproduction and compare rust-analyzer's workspace checking behavior for the foo and bar crates, including the selinux-sys platform constraint. Define a configuration that lets contributors exclude selected workspace members, then verify that excluded crates no longer produce diagnostics while supported crates continue to be checked.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.