22 instantiations of EmbeddedDiagnostic
Microsoft.AspNetCore.App.Analyzers (22)
Infrastructure\RoutePattern\RoutePatternLexer.cs (8)
146token = token.AddDiagnosticIfNone(new EmbeddedDiagnostic( 152token = token.AddDiagnosticIfNone(new EmbeddedDiagnostic( 158token = token.AddDiagnosticIfNone(new EmbeddedDiagnostic( 223new EmbeddedDiagnostic(Resources.TemplateRoute_UnescapedBrace, token.GetSpan())); 228new EmbeddedDiagnostic(Resources.FormatTemplateRoute_InvalidParameterName(token.Value!.ToString().Replace("{{", "{").Replace("}}", "}")), token.GetSpan())); 296new EmbeddedDiagnostic(Resources.TemplateRoute_UnescapedBrace, token.GetSpan())); 386new EmbeddedDiagnostic(Resources.TemplateRoute_UnescapedBrace, token.GetSpan())); 429new EmbeddedDiagnostic(Resources.AttributeRoute_TokenReplacement_UnescapedBraceInToken, token.GetSpan()));
Infrastructure\RoutePattern\RoutePatternParser.cs (14)
106diagnostics.Add(new EmbeddedDiagnostic(Resources.TemplateRoute_InvalidRouteTemplate, segmentPart.GetSpan())); 119diagnostics.Add(new EmbeddedDiagnostic(Resources.TemplateRoute_InvalidRouteTemplate, segmentPart.GetSpan())); 135diagnostics.Add(new EmbeddedDiagnostic(Resources.TemplateRoute_CatchAllMustBeLast, catchAllParameterNode.GetSpan())); 150diagnostics.Add(new EmbeddedDiagnostic(Resources.TemplateRoute_CannotHaveCatchAllInMultiSegment, catchAllParameterNode.GetSpan())); 178diagnostics.Add(new EmbeddedDiagnostic(message, segmentNode.GetSpan())); 195diagnostics.Add(new EmbeddedDiagnostic(message, parameterNode.GetSpan())); 202diagnostics.Add(new EmbeddedDiagnostic(Resources.TemplateRoute_CannotHaveConsecutiveParameters, parameterNode.GetSpan())); 266diagnostics.Add(new EmbeddedDiagnostic(Resources.TemplateRoute_OptionalCannotHaveDefaultValue, parameterNode.GetSpan())); 270diagnostics.Add(new EmbeddedDiagnostic(Resources.TemplateRoute_CatchAllCannotBeOptional, parameterNode.GetSpan())); 282diagnostics.Add(new EmbeddedDiagnostic(Resources.FormatTemplateRoute_RepeatedParameter(name), parameterNode.GetSpan())); 302new EmbeddedDiagnostic( 456new EmbeddedDiagnostic(Resources.AttributeRoute_TokenReplacement_EmptyTokenNotAllowed, _currentToken.GetFullSpan()!.Value)); 489return result.AddDiagnosticIfNone(new EmbeddedDiagnostic(error, GetTokenStartPositionSpan(_currentToken))); 531new EmbeddedDiagnostic(Resources.FormatTemplateRoute_InvalidParameterName(""), _currentToken.GetFullSpan()!.Value))));
32 references to EmbeddedDiagnostic
Microsoft.AspNetCore.App.Analyzers (32)
Infrastructure\EmbeddedSyntax\EmbeddedDiagnostic.cs (7)
11internal struct EmbeddedDiagnostic : IEquatable<EmbeddedDiagnostic> 24=> obj is EmbeddedDiagnostic diagnostic && Equals(diagnostic); 26public bool Equals(EmbeddedDiagnostic other) 45public static bool operator ==(EmbeddedDiagnostic diagnostic1, EmbeddedDiagnostic diagnostic2) 48public static bool operator !=(EmbeddedDiagnostic diagnostic1, EmbeddedDiagnostic diagnostic2)
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxToken.cs (5)
17internal readonly ImmutableArray<EmbeddedDiagnostic> Diagnostics; 28ImmutableArray<EmbeddedDiagnostic> diagnostics, object? value) 39public EmbeddedSyntaxToken<TSyntaxKind> AddDiagnosticIfNone(EmbeddedDiagnostic diagnostic) 42public EmbeddedSyntaxToken<TSyntaxKind> WithDiagnostics(ImmutableArray<EmbeddedDiagnostic> diagnostics) 48Optional<ImmutableArray<EmbeddedDiagnostic>> diagnostics = default,
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxTree.cs (2)
16public readonly ImmutableArray<EmbeddedDiagnostic> Diagnostics; 21ImmutableArray<EmbeddedDiagnostic> diagnostics)
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxTrivia.cs (2)
23internal readonly ImmutableArray<EmbeddedDiagnostic> Diagnostics; 25public 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)
71var seenDiagnostics = new HashSet<EmbeddedDiagnostic>(); 72var diagnostics = ImmutableArray.CreateBuilder<EmbeddedDiagnostic>(); 84private static void ValidateStart(RoutePatternCompilationUnit root, IList<EmbeddedDiagnostic> diagnostics) 125private static void ValidateCatchAllParameters(RoutePatternCompilationUnit root, IList<EmbeddedDiagnostic> diagnostics) 159private static void ValidateNoConsecutiveParameters(RoutePatternCompilationUnit root, IList<EmbeddedDiagnostic> diagnostics) 213private static void ValidateParameterParts(RoutePatternCompilationUnit root, IList<EmbeddedDiagnostic> diagnostics, IList<RouteParameter> routeParameters) 291private static void ValidateNoConsecutiveSeparators(RoutePatternCompilationUnit root, IList<EmbeddedDiagnostic> diagnostics) 315private static void CollectDiagnostics(RoutePatternNode node, HashSet<EmbeddedDiagnostic> seenDiagnostics, IList<EmbeddedDiagnostic> diagnostics) 337HashSet<EmbeddedDiagnostic> seenDiagnostics, ImmutableArray<EmbeddedDiagnostic> from, IList<EmbeddedDiagnostic> to) 339foreach (var diagnostic in from)
Infrastructure\RoutePattern\RoutePatternTree.cs (1)
20ImmutableArray<EmbeddedDiagnostic> diagnostics,
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
58foreach (var diag in routeUsage.RoutePattern.Diagnostics)