A utility class that makes it easy to report diagnostics from code queries in different environments. The default implementation writes messages to the console using the ReportToConsole(IReadOnlyList<IIntrospectionDiagnostic>) method. The action can be changed by setting the ReportAction property.
Namespace: Metalama.Framework.Workspaces
Assembly: Metalama.Framework.Workspaces.dll
Syntax
public static class DiagnosticReporterProperties
| Name | Description |
|---|---|
| ReportAction | Gets or sets the action to execute when diagnostics are reported. The default action is ReportToConsole(IReadOnlyList<IIntrospectionDiagnostic>). |
| ReportedErrors | Gets the number of errors reported since the last call to ClearCounters(). |
| ReportedWarnings | Gets the number of warnings reported since the last call to ClearCounters(). |
Methods
| Name | Description |
|---|---|
| ClearCounters() | Clears the ReportedWarnings and ReportedErrors counters. |
| Report(IEnumerable<IDeclaration>, Severity, string, string) | Creates and reports diagnostics for a set of declarations. |
| Report(IEnumerable<IIntrospectionDiagnostic>) | Reports a collection of diagnostics using the configured ReportAction and updates the diagnostic counters. |
| Report(IEnumerable<IIntrospectionReference>, Severity, string, string) | Creates and reports diagnostics for a set of introspection references. |
| ReportToConsole(IReadOnlyList<IIntrospectionDiagnostic>) | Reports diagnostics to the console with color-coded output based on severity. |