Metalama 1.0 / / Metalama Documentation / Advanced API / Metalama.​Compiler / Transformer­Context / Register­Diagnostic­Filter

Method RegisterDiagnosticFilter

RegisterDiagnosticFilter(SuppressionDescriptor, Action<DiagnosticFilteringRequest>)

Registers a delegate that can suppress a diagnostic.

Declaration
public void RegisterDiagnosticFilter(SuppressionDescriptor descriptor, Action<DiagnosticFilteringRequest> filter)
Parameters
Type Name Description
SuppressionDescriptor descriptor
Action<DiagnosticFilteringRequest> filter

A delegate that can suppress a diagnostic using Suppress().

Exceptions
Type Condition
InvalidOperationException