22 references to EmbeddedDiagnostic
Microsoft.AspNetCore.App.Analyzers (22)
Infrastructure\RoutePattern\RoutePatternLexer.cs (8)
146
token = token.AddDiagnosticIfNone(new
EmbeddedDiagnostic
(
152
token = token.AddDiagnosticIfNone(new
EmbeddedDiagnostic
(
158
token = token.AddDiagnosticIfNone(new
EmbeddedDiagnostic
(
223
new
EmbeddedDiagnostic
(Resources.TemplateRoute_UnescapedBrace, token.GetSpan()));
228
new
EmbeddedDiagnostic
(Resources.FormatTemplateRoute_InvalidParameterName(token.Value!.ToString().Replace("{{", "{").Replace("}}", "}")), token.GetSpan()));
296
new
EmbeddedDiagnostic
(Resources.TemplateRoute_UnescapedBrace, token.GetSpan()));
386
new
EmbeddedDiagnostic
(Resources.TemplateRoute_UnescapedBrace, token.GetSpan()));
429
new
EmbeddedDiagnostic
(Resources.AttributeRoute_TokenReplacement_UnescapedBraceInToken, token.GetSpan()));
Infrastructure\RoutePattern\RoutePatternParser.cs (14)
106
diagnostics.Add(new
EmbeddedDiagnostic
(Resources.TemplateRoute_InvalidRouteTemplate, segmentPart.GetSpan()));
119
diagnostics.Add(new
EmbeddedDiagnostic
(Resources.TemplateRoute_InvalidRouteTemplate, segmentPart.GetSpan()));
135
diagnostics.Add(new
EmbeddedDiagnostic
(Resources.TemplateRoute_CatchAllMustBeLast, catchAllParameterNode.GetSpan()));
150
diagnostics.Add(new
EmbeddedDiagnostic
(Resources.TemplateRoute_CannotHaveCatchAllInMultiSegment, catchAllParameterNode.GetSpan()));
178
diagnostics.Add(new
EmbeddedDiagnostic
(message, segmentNode.GetSpan()));
195
diagnostics.Add(new
EmbeddedDiagnostic
(message, parameterNode.GetSpan()));
202
diagnostics.Add(new
EmbeddedDiagnostic
(Resources.TemplateRoute_CannotHaveConsecutiveParameters, parameterNode.GetSpan()));
266
diagnostics.Add(new
EmbeddedDiagnostic
(Resources.TemplateRoute_OptionalCannotHaveDefaultValue, parameterNode.GetSpan()));
270
diagnostics.Add(new
EmbeddedDiagnostic
(Resources.TemplateRoute_CatchAllCannotBeOptional, parameterNode.GetSpan()));
282
diagnostics.Add(new
EmbeddedDiagnostic
(Resources.FormatTemplateRoute_RepeatedParameter(name), parameterNode.GetSpan()));
302
new
EmbeddedDiagnostic
(
456
new
EmbeddedDiagnostic
(Resources.AttributeRoute_TokenReplacement_EmptyTokenNotAllowed, _currentToken.GetFullSpan()!.Value));
489
return result.AddDiagnosticIfNone(new
EmbeddedDiagnostic
(error, GetTokenStartPositionSpan(_currentToken)));
531
new
EmbeddedDiagnostic
(Resources.FormatTemplateRoute_InvalidParameterName(""), _currentToken.GetFullSpan()!.Value))));