rust-lang / rust-lang/rust-analyzer

Request: Selectively disable `rust-analyzer`-internal warnings, similar to `#[allow]` syntax?

Open
#9,803 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I know that I can use "analyzer.diagnostics.disabled" to suppress certain diagnostics globally or per-workspace, but sometimes I would like to suppress them only sometimes, in some modules or in some occurrences. For example, rust-analyzer(incorrect-ident-case) for auto-generated bindings.

I do use

#![allow(
    non_camel_case_types,
    non_snake_case,
    non_upper_case_globals,
)]

which keeps cargo from complaining on build/check. It would be nice to similarly reduce noise in the "Problems" tab, rather than always have a spurious number badge.
Screenshot_080621_085209_PM

Sorry if this has been proposed/dismissed before. I'm sure I'm not the first person to think about this. I did a cursory look, but there's a lot of activity in A-diagnostics 😄

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

The issue does not name files or tests. Start by tracing how rust-analyzer diagnostics and the analyzer.diagnostics.disabled setting are handled, then determine how module- or occurrence-level suppression could interact with Rust's #[allow] syntax and define tests for the expected Problems-tab behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.