You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validationContext.AddError(newParseError($"Range validator missing for {valueSymbol.Name}"));
27
+
validationContext.AddError(newCliDiagnostic(new("","","Range validator missing for {valueSymbol}",severity:CliDiagnosticSeverity.Error,null),[valueSymbol.Name],cliSymbolResult:valueResult));
// TODO: Review the handling of errors. They are currently transient and returned by the Validate method, and to avoid allocating in the case of no errors (the common case) this method is used. This adds complexity to creating a new validator.
validationContext.AddError(newParseError($"{valueSymbol.Name} must have {condition.Name} validator."));
127
+
validationContext.AddError(newCliDiagnostic(new("","","{valueSymbol} must have {condition} validator.",severity:CliDiagnosticSeverity.Error,null),[valueSymbol.Name,condition.Name],cliSymbolResult:valueResult));
validationContext.AddError(newParseError($"{commandResult.Command.Name} must have {condition.Name} validator."));
173
+
validationContext.AddError(newCliDiagnostic(new("","","{commandResult} must have {condition} validator.",severity:CliDiagnosticSeverity.Error,null),[commandResult.Command.Name,condition.Name]));
validationContext.AddError(newParseError($"The value for '{valueSymbol.Name}' is below the lower bound of {LowerBound}"));
62
+
validationContext.AddError(newCliDiagnostic(new("","","The value for '{valueSymbol}' is below the lower bound of {lowerBound}",severity:CliDiagnosticSeverity.Error,null),[valueSymbol.Name,LowerBound],cliSymbolResult:valueResult));
validationContext.AddError(newParseError($"The value for '{valueSymbol.Name}' is above the upper bound of {UpperBound}"));
70
+
validationContext.AddError(newCliDiagnostic(new("","","The value for '{valueSymbol}' is above the upper bound of {upperBound}",severity:CliDiagnosticSeverity.Error,null),[valueSymbol.Name,UpperBound],cliSymbolResult:valueResult));
@@ -65,19 +68,18 @@ public sealed class CliDiagnostic
65
68
/// <param name="descriptor">Contains information about the error.</param>
66
69
/// <param name="messageArgs">The arguments to be passed to the <see cref="CliDiagnosticDescriptor.MessageFormat"/> in the <paramref name="descriptor"/>.</param>
67
70
/// <param name="properties">Properties to be associated with the diagnostic.</param>
68
-
/// <param name="symbolResult">The symbol result detailing the symbol that failed to parse and the tokens involved.</param>
71
+
/// <param name="cliSymbolResult">Contains information about a single value entered.</param>
69
72
/// <param name="location">The location of the error.</param>
0 commit comments