Open sandboxFocus

Struct ScopedDiagnosticSink

Encapsulates an IDiagnosticSink and the default target of diagnostics, suppressions, and code fixes.

Namespace: Metalama.Framework.Diagnostics
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public readonly struct ScopedDiagnosticSink

Properties

Name Description
DefaultTargetDeclaration

Gets the declaration on which diagnostics or code fixes will be reported or suppressed.

DefaultTargetLocation

Gets the location on which diagnostics or code fixes will be reported or suppressed.

Methods

Name Description
Report(IDiagnostic)

Reports a diagnostic to the default location of the current ScopedDiagnosticSink..

Report(IDiagnostic, IDiagnosticLocation?)

Reports a parametric diagnostic by specifying its location.

Suggest(CodeFix)

Suggest a code fix without reporting a diagnostic.

Suggest(CodeFix, IDiagnosticLocation)

Suggest a code fix without reporting a diagnostic.

Suppress(ISuppression)

Suppresses a diagnostic from the default declaration of the current ScopedDiagnosticSink.

Suppress(ISuppression, IDeclaration)

Suppresses a diagnostic by specifying the declaration in which the suppression must be effective.

See Also