Table of Contents

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

DiagnosticCode

Id

Stable identifier, for example CAV004.

public string Id { get; }

Property Value

string

Length

Length of Token in characters.

public int Length { get; }

Property Value

int

Message

English description of the problem.

public string Message { get; }

Property Value

string

Position

Zero-based character index of Token in the report.

public int Position { get; }

Property Value

int

Severity

Whether this is an error or a warning.

public DiagnosticSeverity Severity { get; }

Property Value

DiagnosticSeverity

Token

The offending text as it appears in the report; empty when something is missing.

public string Token { get; }

Property Value

string

Methods

Describe(Language)

Describes the problem in the given language.

public string Describe(Language language)

Parameters

language Language

The 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.