Skip to main content

Class DiagnosticCollector

Namespace: OceanApocalypse.RSML.Toolchain.Abstractions.Diagnostics
Assembly: RSML.Toolchain.Abstractions.dll

A list of RSML toolchain errors.

public sealed record DiagnosticCollector : IEnumerable<Diagnostic>, IEnumerable, IEquatable<DiagnosticCollector>

Inheritance

ObjectDiagnosticCollector

Implements

IEnumerable<Diagnostic>, IEnumerable, IEquatable<DiagnosticCollector>

Inherited Members

Object.Equals(Object?), Object.Equals(Object?, Object?), Object.GetHashCode(), Object.GetType(), Object.ReferenceEquals(Object?, Object?), Object.ToString()

Constructors

DiagnosticCollector(Severity)

Creates a new diagnostic collector.

public DiagnosticCollector(Severity minimumCriticalSeverity = Severity.Error)

Parameters

minimumCriticalSeverity Severity

The minimum diagnostic severity for a diagnostic to be considered critical.

Properties

HasCriticalErrors

A property that indicates whether there are critical diagnostics. The toolchain should break if this is true.

public Boolean HasCriticalErrors { get; }

Property Value

Boolean

MinimumCriticalSeverity

The minimum diagnostic severity for a diagnostic to be considered critical.

public Severity MinimumCriticalSeverity { get; }

Property Value

Severity

Methods

Add(Diagnostic)

Adds an error to the list of errors.

public DiagnosticCollector Add(Diagnostic diagnostic)

Parameters

diagnostic Diagnostic

Returns

DiagnosticCollector

Clear()

Clears the DiagnosticCollector, leaving it fully empty.

public DiagnosticCollector Clear()

Returns

DiagnosticCollector

GetAll()

Returns all

public ImmutableArray<Diagnostic> GetAll()

Returns

ImmutableArray<Diagnostic>

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Diagnostic> GetEnumerator()

Returns

IEnumerator<Diagnostic>

An enumerator that can be used to iterate through the collection.

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator

An IEnumerator object that can be used to iterate through the collection.