Open sandboxFocus

Interface IDiagnostic

Represents an instance of a diagnostic, including its definition, arguments, and optional extensions.

Namespace: Metalama.Framework.Diagnostics
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
[InternalImplement]
public interface IDiagnostic
Remarks

Diagnostic instances are typically created from a DiagnosticDefinition or DiagnosticDefinition<T> by calling WithArguments(T). The diagnostic instance is then reported using Report(IDiagnostic).

For diagnostics without parameters, use DiagnosticDefinition (without type arguments), which implements both IDiagnosticDefinition and IDiagnostic, allowing it to be used directly when reporting.

Properties

Name Description
Arguments

Gets the arguments passed to the diagnostic's message format string.

Definition

Gets the IDiagnosticDefinition from which the current diagnostic was created.

Extensions

Gets the extensions (such as code fixes) associated with this diagnostic.

Methods

Name Description
WithExtensions(ImmutableArray<IDiagnosticExtension>)

Extension Methods

See Also