22 instantiations of 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))));
32 references to EmbeddedDiagnostic
Microsoft.AspNetCore.App.Analyzers (32)
Infrastructure\EmbeddedSyntax\EmbeddedDiagnostic.cs (7)
11
internal struct EmbeddedDiagnostic : IEquatable<
EmbeddedDiagnostic
>
24
=> obj is
EmbeddedDiagnostic
diagnostic && Equals(diagnostic);
26
public bool Equals(
EmbeddedDiagnostic
other)
45
public static bool operator ==(
EmbeddedDiagnostic
diagnostic1,
EmbeddedDiagnostic
diagnostic2)
48
public static bool operator !=(
EmbeddedDiagnostic
diagnostic1,
EmbeddedDiagnostic
diagnostic2)
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxToken.cs (5)
17
internal readonly ImmutableArray<
EmbeddedDiagnostic
> Diagnostics;
28
ImmutableArray<
EmbeddedDiagnostic
> diagnostics, object? value)
39
public EmbeddedSyntaxToken<TSyntaxKind> AddDiagnosticIfNone(
EmbeddedDiagnostic
diagnostic)
42
public EmbeddedSyntaxToken<TSyntaxKind> WithDiagnostics(ImmutableArray<
EmbeddedDiagnostic
> diagnostics)
48
Optional<ImmutableArray<
EmbeddedDiagnostic
>> diagnostics = default,
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxTree.cs (2)
16
public readonly ImmutableArray<
EmbeddedDiagnostic
> Diagnostics;
21
ImmutableArray<
EmbeddedDiagnostic
> diagnostics)
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxTrivia.cs (2)
23
internal readonly ImmutableArray<
EmbeddedDiagnostic
> Diagnostics;
25
public EmbeddedSyntaxTrivia(TSyntaxKind kind, VirtualCharSequence virtualChars, ImmutableArray<
EmbeddedDiagnostic
> diagnostics)
Infrastructure\RoutePattern\RoutePatternHelpers.cs (1)
17
=> new(kind, virtualChars, ImmutableArray<
EmbeddedDiagnostic
>.Empty, value: null);
Infrastructure\RoutePattern\RoutePatternParser.cs (13)
71
var seenDiagnostics = new HashSet<
EmbeddedDiagnostic
>();
72
var diagnostics = ImmutableArray.CreateBuilder<
EmbeddedDiagnostic
>();
84
private static void ValidateStart(RoutePatternCompilationUnit root, IList<
EmbeddedDiagnostic
> diagnostics)
125
private static void ValidateCatchAllParameters(RoutePatternCompilationUnit root, IList<
EmbeddedDiagnostic
> diagnostics)
159
private static void ValidateNoConsecutiveParameters(RoutePatternCompilationUnit root, IList<
EmbeddedDiagnostic
> diagnostics)
213
private static void ValidateParameterParts(RoutePatternCompilationUnit root, IList<
EmbeddedDiagnostic
> diagnostics, IList<RouteParameter> routeParameters)
291
private static void ValidateNoConsecutiveSeparators(RoutePatternCompilationUnit root, IList<
EmbeddedDiagnostic
> diagnostics)
315
private static void CollectDiagnostics(RoutePatternNode node, HashSet<
EmbeddedDiagnostic
> seenDiagnostics, IList<
EmbeddedDiagnostic
> diagnostics)
337
HashSet<
EmbeddedDiagnostic
> seenDiagnostics, ImmutableArray<
EmbeddedDiagnostic
> from, IList<
EmbeddedDiagnostic
> to)
339
foreach (
var
diagnostic in from)
Infrastructure\RoutePattern\RoutePatternTree.cs (1)
20
ImmutableArray<
EmbeddedDiagnostic
> diagnostics,
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
58
foreach (
var
diag in routeUsage.RoutePattern.Diagnostics)