Table of Contents

Class ParserDiagnosticDescriptor

Namespace
Utils.Parser.Diagnostics
Assembly
Utils.Parser.Diagnostics.dll

Immutable descriptor that defines a reusable parser diagnostic template.

public sealed class ParserDiagnosticDescriptor
Inheritance
ParserDiagnosticDescriptor
Inherited Members
Extension Methods

Constructors

ParserDiagnosticDescriptor(string, string, string, string?)

Initializes a new diagnostic descriptor and validates the diagnostic code format.

public ParserDiagnosticDescriptor(string code, string title, string messageFormat, string? category = null)

Parameters

code string

Diagnostic code in the form UPxxxx or PARSERxxx.

title string

Short diagnostic title.

messageFormat string

Composite format string used to build diagnostic messages.

category string

Optional diagnostic category.

Exceptions

ArgumentException

Thrown when the code format is invalid.

Properties

Category

Gets the optional category.

public string? Category { get; }

Property Value

string

Code

Gets the diagnostic code.

public string Code { get; }

Property Value

string

MessageFormat

Gets the message format.

public string MessageFormat { get; }

Property Value

string

Severity

Gets the severity derived from Code.

public DiagnosticSeverity Severity { get; }

Property Value

DiagnosticSeverity

Title

Gets the short diagnostic title.

public string Title { get; }

Property Value

string

Methods

FormatMessage(params object?[])

Creates a formatted message using MessageFormat.

public string FormatMessage(params object?[] arguments)

Parameters

arguments object[]

Message format arguments.

Returns

string

Formatted diagnostic message.