MetalamaAPI documentationAdvanced APIMetalama.​CompilerTransformer­ContextRegister­Diagnostic­Filter
Open sandboxFocus

TransformerContext.RegisterDiagnosticFilter Method

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
System.InvalidOperationException