CompilationWithAnalyzers.IsDiagnosticAnalyzerSuppressed 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
This API is no longer supported. See https://github.com/dotnet/roslyn/issues/67592 for details
如果此分析器可以產生的所有診斷都會透過選項隱藏,則會傳回 true。
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
參數
- analyzer
- DiagnosticAnalyzer
要檢查是否隱藏的分析器。
- options
- CompilationOptions
編譯選項。
- onAnalyzerException
- Action<Exception,DiagnosticAnalyzer,Diagnostic>
當分析器擲回例外狀況時所叫用的選擇性委派。 委派可以執行自訂工作,例如報告指定的分析器例外狀況診斷、報告例外狀況的非嚴重 Watson 等等。
傳回
- 屬性