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,
1021node.AddDiagnostic(ComponentDiagnosticFactory.Create_TemplateInvalidLocation(template.Source));
Language\Components\ComponentDesignTimeNodeWriter.cs (16)
70if (node.Source is { FilePath: not null } sourceSpan)
112if (node.Source != null)
114using (context.BuildLinePragma(node.Source.Value))
123context.CodeWriter.WritePadding(offset, node.Source, context);
185if (isWhiteSpace && node.Source is null)
192if (node.Source is SourceSpan nodeSource && !isWhiteSpace)
202writer.WritePadding(0, node.Source, context);
529using (context.BuildLinePragma(node.Source.AssumeNotNull()))
616WriteCSharpCode(context, new CSharpCodeIntermediateNode() { Source = renderMode.Source, Children = { renderMode.Children[0] } });
1009Source = node.Source,
1102Source = node.Source,
1120Source = node.Source,
1139Source = node.Source,
1169if (token.Source?.FilePath == null)
1175using (context.BuildLinePragma(token.Source))
1177context.CodeWriter.WritePadding(0, token.Source.Value, context);
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)
240Source = elementNode.Source,
334var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source;
354var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source;
371var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source;
432if (current.Source is SourceSpan cs && next.Source is SourceSpan ns)
437else if (current.Source == null)
439current.Source = next.Source;
507child.Source ?? SourceSpan.Undefined, childTagName, parentTagName, allowedChildrenString));
522child.Source ?? SourceSpan.Undefined, childTagName, parentTagName, allowedChildrenString));
534child.Source ?? SourceSpan.Undefined, parentTagName, allowedChildrenString));
543child.Source ?? SourceSpan.Undefined, parentTagName, allowedChildrenString));
573htmlContent.Source ??= valueChild.Source;
581var firstSrc = htmlContent.Children[0].Source;
582var lastSrc = htmlContent.Children[^1].Source;
600Source = unresolvedLiteral.Source,
613Source = unresolvedExpr.Source,
618Source = unresolvedExpr.Source,
704target.Children.Add(new CSharpIntermediateToken(token.Content, token.Source));
788if (token.Source is SourceSpan tokenSource)
794else if (child.Source is SourceSpan childSource)
945var source = attrValue.Children.Count > 0 ? attrValue.Children[0].Source : attrValue.Source;
956? IntermediateNodeFactory.CSharpToken(htmlToken, static t => t.Content, htmlToken.Source)
957: new CSharpIntermediateToken(htmlToken.Content, htmlToken.Source);
1039if (htmlToken.Source is { } s)
1100var diagSource = elementNode.Source;
1157elementNode.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;
1029var htmlContent = new HtmlContentIntermediateNode() { Source = htmlAttr.Source };
1030htmlContent.Children.Add(new HtmlIntermediateToken(attrContent, htmlAttr.Source));
1051var htmlContent = new HtmlContentIntermediateNode() { Source = htmlAttr.Source };
1052htmlContent.Children.Add(new HtmlIntermediateToken(attrContent, htmlAttr.Source));
1064var prefixHtml = new HtmlContentIntermediateNode() { Source = htmlAttr.Source };
1065prefixHtml.Children.Add(new HtmlIntermediateToken(prefix, htmlAttr.Source));
1093var expr = new CSharpExpressionIntermediateNode() { Source = csharpToken.Source };
1135if (current.Source is SourceSpan currentSource && next.Source is SourceSpan nextSource)
1139else if (current.Source == null)
1141current.Source = next.Source;
1213if (a.Source == null || b.Source == null)
1218if (a.Source is SourceSpan aSource && b.Source is SourceSpan bSource)
1296if (firstExpr.Source is { } exprSource && exprSource.Length > 1)
1305if (htmlAttr.Children[i] is UnresolvedAttributeValueIntermediateNode lit && lit.Source is { } litSrc)
1433if (i + 1 < htmlAttr.Children.Count && htmlAttr.Children[i + 1].Source is { } nextSrc)
1444if (unresolvedExpr.ContainsExpression && unresolvedExpr.Source is { Length: > 1 } exprSrc)
1491var mergedSource = ExtendSpanBackward(htmlToken.Source, prefix.Length);
1504pendingLiteralParts.Add((htmlToken.Content, htmlToken.Source));
1505if (htmlToken.Source is { } s)
1539expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : unresolvedExpr.Source;
1602codeChild.Source ?? elementNode.Source ?? SourceSpan.Undefined, elementNode.TagName));
1610var diagSource = exprChild.Source ?? elementNode.Source ?? SourceSpan.Undefined;
1644if (token.Source is { } s)