CompilationWithAnalyzers.IsDiagnosticAnalyzerSuppressed Method

Definition

Caution

This API is no longer supported. See https://github.com/dotnet/roslyn/issues/67592 for details

Returns true if all the diagnostics that can be produced by this analyzer are suppressed through options.

public static bool IsDiagnosticAnalyzerSuppressed (Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer analyzer, Microsoft.CodeAnalysis.CompilationOptions options, Action<Exception,Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer,Microsoft.CodeAnalysis.Diagnostic> onAnalyzerException = default);
public static bool IsDiagnosticAnalyzerSuppressed (Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer analyzer, Microsoft.CodeAnalysis.CompilationOptions options, Action<Exception,Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer,Microsoft.CodeAnalysis.Diagnostic>? onAnalyzerException = default);
[System.Obsolete("This API is no longer supported. See https://github.com/dotnet/roslyn/issues/67592 for details")]
public static bool IsDiagnosticAnalyzerSuppressed (Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer analyzer, Microsoft.CodeAnalysis.CompilationOptions options, Action<Exception,Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer,Microsoft.CodeAnalysis.Diagnostic>? onAnalyzerException = default);
static member IsDiagnosticAnalyzerSuppressed : Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer * Microsoft.CodeAnalysis.CompilationOptions * Action<Exception, Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer, Microsoft.CodeAnalysis.Diagnostic> -> bool
[<System.Obsolete("This API is no longer supported. See https://github.com/dotnet/roslyn/issues/67592 for details")>]
static member IsDiagnosticAnalyzerSuppressed : Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer * Microsoft.CodeAnalysis.CompilationOptions * Action<Exception, Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer, Microsoft.CodeAnalysis.Diagnostic> -> bool
Public Shared Function IsDiagnosticAnalyzerSuppressed (analyzer As DiagnosticAnalyzer, options As CompilationOptions, Optional onAnalyzerException As Action(Of Exception, DiagnosticAnalyzer, Diagnostic) = Nothing) As Boolean

Parameters

analyzer
DiagnosticAnalyzer

Analyzer to be checked for suppression.

options
CompilationOptions

Compilation options.

onAnalyzerException
Action<Exception,DiagnosticAnalyzer,Diagnostic>

Optional delegate which is invoked when an analyzer throws an exception. Delegate can do custom tasks such as report the given analyzer exception diagnostic, report a non-fatal watson for the exception, etc.

Returns

Attributes

Applies to