Class Diagnostic
- Namespace
- Cavok
- Assembly
- Cavok.dll
A problem found while parsing: a group that could not be understood (Error) or a group that was understood but looks suspicious (Warning).
public sealed record Diagnostic : IEquatable<Diagnostic>
- Inheritance
-
Diagnostic
- Implements
- Inherited Members
Properties
Code
The kind of problem.
public DiagnosticCode Code { get; }
Property Value
Id
Stable identifier, for example CAV004.
public string Id { get; }
Property Value
Length
Length of Token in characters.
public int Length { get; }
Property Value
Message
English description of the problem.
public string Message { get; }
Property Value
Position
Zero-based character index of Token in the report.
public int Position { get; }
Property Value
Severity
Whether this is an error or a warning.
public DiagnosticSeverity Severity { get; }
Property Value
Token
The offending text as it appears in the report; empty when something is missing.
public string Token { get; }
Property Value
Methods
Describe(Language)
Describes the problem in the given language.
public string Describe(Language language)
Parameters
languageLanguageThe language of the description.
Returns
- string
A one-line description; control characters in the quoted token are shown as spaces.
ToString()
Formats the diagnostic with the report and a caret line pointing at the offending group.
public override string ToString()
Returns
- string
Three lines separated by
\n, or one line when the report is empty.