Provides optional structured diagnostic context for rich error rendering.
public CommandDiagnostic(CommandDiagnosticSource Source, string? SourceName, CommandNode? Node, IReadOnlyList<string>? Tokens, CommandTokenSpan? TokenSpan)
The origin of the diagnostic value.
An optional source name (for example environment variable name or response-file name).
The associated command node, when available.
The original invocation tokens, when available.
The location of the relevant token span, when available.
This data is intended for presentation only (for example re-printing the invocation and underlining a token). It must not include secret values.