Skip to content

Allow an analyzer to suppress diagnostics #20242

@sharwell

Description

@sharwell

There are several situations where it would be helpful for an analyzer, or an analyzer assembly, to have the ability to suppress diagnostics reported by another analyzer or as a warning by the compiler. For example:

  • StyleCop Analyzers rule to "Use 'this.'" could automatically disable the IDE warning with the same intent
  • Analyzers could suppress compiler warnings like CS1591 using application-specific logic

Such a "Diagnostic Filter" feature would likely run after analysis is complete, and be provided a list of reported diagnostics with the ability to suppress specific diagnostics. It would be helpful if the diagnostics were treated as suppressed in the Error List window, with the suppression source set to the name of the filter responsible for suppressing it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions