Language\Components\ComponentBindLoweringPass.cs (12)
101node.Source,
116node.Source,
142node.Source,
149node.Source,
179node.Source,
201afterNode.Source,
355node.Source,
419bindNode.Source,
429bindGetNode.Source,
518Source = targetNode.Source,
540Source = targetNode.Source,
1023node.AddDiagnostic(ComponentDiagnosticFactory.Create_TemplateInvalidLocation(template.Source));
Language\Components\ComponentLoweringPass.cs (18)
142node.AddDiagnostic(ComponentDiagnosticFactory.Create_MultipleComponents(node.Source, node.TagName, matched));
181node.Source,
351Source = node.Source,
389node.Source,
447Source = node.Source,
519_children.Add(RewriteChildContent(attribute, node.Source, node.Children));
542var rewrittenChildContent = RewriteChildContent(attribute, child.Source, child.Children);
552child.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentMixedWithExplicitChildContent(child.Source, _component));
609childContent.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidParameter(property.Source, property.AttributeName, attribute.Name));
614childContent.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidAttribute(property.Source, property.AttributeName, attribute.Name));
619childContent.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidAttribute(a.Source, a.AttributeName, attribute.Name));
624childContent.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidAttribute(directiveAttribute.Source, directiveAttribute.OriginalAttributeName, attribute.Name));
663Source = htmlValue.Source,
676Source = expressionValue.Source,
689Source = codeValue.Source,
735_component.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidParameterOnComponent(node.Source, node.AttributeName, _component.TagName));
786Source = node.Source,
823Source = content.Source,
Language\DefaultTagHelperResolutionPhase.ComponentTagHelperResolver.cs (38)
36ComponentDiagnosticFactory.Create_UnexpectedMarkupElement(tagName, elementNode.StartTagSpan ?? elementNode.Source));
60ComponentDiagnosticFactory.Create_UnexpectedMarkupElement(originalNode.TagName, originalNode.StartTagSpan ?? originalNode.Source));
280?? (directiveNode.Children.Count > 0 ? directiveNode.Children[0].Source : null);
303expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : directiveNode.Source;
360prop.Source = unresolvedAttr.ValueSourceSpan ?? (prop.Children.Count > 0 ? prop.Children[0].Source : null);
442csharpExprAttrValue.Prefix + "@" + firstToken.Content, firstToken.Source);
449var expr = new CSharpExpressionIntermediateNode() { Source = csharpExprAttrValue.Source };
456csharpExprAttrValue.Prefix + "@" + csharpToken.Content, csharpToken.Source));
480var expr = new CSharpExpressionIntermediateNode() { Source = csharpExprAttrValue.Source };
490var expr = new CSharpExpressionIntermediateNode() { Source = csharpCodeAttrValue.Source };
497ConvertHtmlTokensToCSharp(child.Children, ref newChildren.AsRef(), child.Source, wrapLiteralsInCSharpExpression);
560if (csharpToken.Source is { } s)
573if (innerToken.Source is { } s)
643var mergedSource = ExtendSpanBackward(htmlToken.Source, prefix.Length);
652htmlContent.Source ??= valueChild.Source;
676expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : unresolvedExpr.Source;
682var htmlContent = new HtmlContentIntermediateNode() { Source = token.Source };
751ConvertExpressionChildToCSharpExpression(node, i, csharpExprAttrValue.Prefix, csharpExprAttrValue.Children, csharpExprAttrValue.Source);
760ConvertExpressionChildToCSharpExpression(node, i, unresolvedExprAttrValue.Prefix, unresolvedExprAttrValue.Children, unresolvedExprAttrValue.Source);
775var mergedSource = ExtendSpanBackward(firstToken.Source, prefix.Length);
778htmlContent.Source = mergedSource ?? htmlAttrValue.Source;
787htmlContent.Source = htmlAttrValue.Source;
796var csharpCode = new CSharpCodeIntermediateNode() { Source = csharpCodeAttrValue.Source };
798csharpCode.Source = csharpCode.Children.Count > 0 ? csharpCode.Children[0].Source : csharpCodeAttrValue.Source;
805var htmlContent = new HtmlContentIntermediateNode() { Source = markupBlock.Source };
838expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : fallbackSource;
958Source = source.Source,
973var spanSource = firstValue.Source;
977var totalLength = source.Children[^1] is HtmlAttributeValueIntermediateNode lastValue && lastValue.Source is { } ls
998Source = htmlValue.Source,
1019if (htmlAttr.Source is not SourceSpan attrSource)
1051if (htmlAttr.Children is [{ Source: SourceSpan childSource }, ..])
1061if (lastChild.Source is SourceSpan lastSource)
1076if (htmlAttr.Source is not SourceSpan attrSource)
1139Source = elementNode.Source,
Language\DefaultTagHelperResolutionPhase.cs (28)
235Source = elementNode.Source,
329var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source;
349var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source;
366var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source;
430if (current.Source is SourceSpan cs && next.Source is SourceSpan ns)
435else if (current.Source == null)
437current.Source = next.Source;
505child.Source ?? SourceSpan.Undefined, childTagName, parentTagName, allowedChildrenString));
520child.Source ?? SourceSpan.Undefined, childTagName, parentTagName, allowedChildrenString));
532child.Source ?? SourceSpan.Undefined, parentTagName, allowedChildrenString));
541child.Source ?? SourceSpan.Undefined, parentTagName, allowedChildrenString));
571htmlContent.Source ??= valueChild.Source;
579var firstSrc = htmlContent.Children[0].Source;
580var lastSrc = htmlContent.Children[^1].Source;
598Source = unresolvedLiteral.Source,
611Source = unresolvedExpr.Source,
616Source = unresolvedExpr.Source,
702target.Children.Add(new CSharpIntermediateToken(token.Content, token.Source));
786if (token.Source is SourceSpan tokenSource)
792else if (child.Source is SourceSpan childSource)
943var source = attrValue.Children.Count > 0 ? attrValue.Children[0].Source : attrValue.Source;
954? IntermediateNodeFactory.CSharpToken(htmlToken, static t => t.Content, htmlToken.Source)
955: new CSharpIntermediateToken(htmlToken.Content, htmlToken.Source);
1037if (htmlToken.Source is { } s)
1098var diagSource = elementNode.Source;
1155elementNode.Source ?? SourceSpan.Undefined,
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (47)
162prop.Source= unresolvedAttr.ValueSourceSpan ?? (prop.Children.Count > 0 ? prop.Children[0].Source : null);
369var emptyHtml = new HtmlContentIntermediateNode() { Source = htmlAttr.Source };
370emptyHtml.Children.Add(new HtmlIntermediateToken(string.Empty, htmlAttr.Source));
573if (htmlAttr.Source is SourceSpan attrSource && sourceDocument != null)
627if (intermediateToken.Content == "@" && intermediateToken.Source is SourceSpan src)
633targetNode.Children.Add(new CSharpIntermediateToken(intermediateToken.Content, intermediateToken.Source));
638targetNode.Children.Add(new CSharpIntermediateToken(intermediateToken.Content, intermediateToken.Source));
655var tokenSource = htmlAttrValue.Children.Count > 0 ? htmlAttrValue.Children[0].Source : htmlAttrValue.Source;
687if (firstInnerChild.Source is SourceSpan innerSource)
700if (lastInnerChild.Source is SourceSpan lastSource)
720if (htmlAttr.Source is SourceSpan attrSource && sourceDocument != null)
754targetNode.Children.Add(new CSharpIntermediateToken(innerToken.Content, innerToken.Source));
795static (token) => new CSharpExpressionIntermediateNode() { Source = token.Source });
800static (token) => new CSharpCodeIntermediateNode() { Source = token.Source });
837var htmlContent = new HtmlContentIntermediateNode() { Source = htmlToken.Source };
853if (htmlAttr.Source is not SourceSpan attrSource)
931var source = htmlAttr.Source;
1044var htmlContent = new HtmlContentIntermediateNode() { Source = htmlAttr.Source };
1045htmlContent.Children.Add(new HtmlIntermediateToken(attrContent, htmlAttr.Source));
1066var htmlContent = new HtmlContentIntermediateNode() { Source = htmlAttr.Source };
1067htmlContent.Children.Add(new HtmlIntermediateToken(attrContent, htmlAttr.Source));
1079var prefixHtml = new HtmlContentIntermediateNode() { Source = htmlAttr.Source };
1080prefixHtml.Children.Add(new HtmlIntermediateToken(prefix, htmlAttr.Source));
1108var expr = new CSharpExpressionIntermediateNode() { Source = csharpToken.Source };
1155if (current.Source is SourceSpan currentSource && next.Source is SourceSpan nextSource)
1159else if (current.Source == null)
1161current.Source = next.Source;
1233if (a.Source == null || b.Source == null)
1238if (a.Source is SourceSpan aSource && b.Source is SourceSpan bSource)
1316if (firstExpr.Source is { } exprSource && exprSource.Length > 1)
1325if (htmlAttr.Children[i] is UnresolvedAttributeValueIntermediateNode lit && lit.Source is { } litSrc)
1453if (i + 1 < htmlAttr.Children.Count && htmlAttr.Children[i + 1].Source is { } nextSrc)
1464if (unresolvedExpr.ContainsExpression && unresolvedExpr.Source is { Length: > 1 } exprSrc)
1511var mergedSource = ExtendSpanBackward(htmlToken.Source, prefix.Length);
1524pendingLiteralParts.Add((htmlToken.Content, htmlToken.Source));
1525if (htmlToken.Source is { } s)
1559expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : unresolvedExpr.Source;
1622codeChild.Source ?? elementNode.Source ?? SourceSpan.Undefined, elementNode.TagName));
1630var diagSource = exprChild.Source ?? elementNode.Source ?? SourceSpan.Undefined;
1664if (token.Source is { } s)