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
codestringDiagnostic code in the form
UPxxxxorPARSERxxx.titlestringShort diagnostic title.
messageFormatstringComposite format string used to build diagnostic messages.
categorystringOptional diagnostic category.
Exceptions
- ArgumentException
Thrown when the code format is invalid.
Properties
Category
Gets the optional category.
public string? Category { get; }
Property Value
Code
Gets the diagnostic code.
public string Code { get; }
Property Value
MessageFormat
Gets the message format.
public string MessageFormat { get; }
Property Value
Severity
Gets the severity derived from Code.
public DiagnosticSeverity Severity { get; }
Property Value
Title
Gets the short diagnostic title.
public string Title { get; }
Property Value
Methods
FormatMessage(params object?[])
Creates a formatted message using MessageFormat.
public string FormatMessage(params object?[] arguments)
Parameters
argumentsobject[]Message format arguments.
Returns
- string
Formatted diagnostic message.