153 writes to Source
Microsoft.CodeAnalysis.Razor.Compiler (153)
Language\Components\ComponentBindLoweringPass.cs (2)
543Source = targetNode.Source, 565Source = targetNode.Source,
Language\Components\ComponentDocumentClassifierPass.cs (1)
83@namespace.Source = computedNamespaceSpan;
Language\Components\ComponentEventHandlerLoweringPass.cs (1)
196Source = node.Source,
Language\Components\ComponentFormNameLoweringPass.cs (4)
48Source = node.Source 58Source = node.Source, 65Source = node.Source, 75result.Source = child.Source;
Language\Components\ComponentLoweringPass.cs (8)
351Source = node.Source, 447Source = node.Source, 575Source = source, 673Source = htmlValue.Source, 686Source = expressionValue.Source, 699Source = codeValue.Source, 796Source = node.Source, 833Source = content.Source,
Language\Components\ComponentNodeWriter.cs (4)
1224WriteCSharpCode(context, new CSharpCodeIntermediateNode() { Source = renderMode.Source, Children = { renderMode.Children[0] } }); 1547Source = node.Source, 1641Source = node.Source, 1655Source = node.Source,
Language\Components\ComponentPageDirectivePass.cs (1)
62@namespace.Children.Insert(index++, new RouteAttributeExtensionNode(routeToken.Content) { Source = routeToken.Source });
Language\Components\ComponentRenderModeDirectivePass.cs (1)
71Source = child.Source,
Language\Components\ComponentRenderModeLoweringPass.cs (1)
43var renderModeNode = new RenderModeIntermediateNode() { Source = node.Source, Children = { expression } };
Language\Components\ComponentSplatLoweringPass.cs (1)
39Source = node.Source,
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (43)
118Source = reference.Source, 354Source = BuildSourceSpanFromNode(node), 363Source = BuildSourceSpanFromNode(node), 395Source = BuildSourceSpanFromNode(node), 412Source = BuildSourceSpanFromNode(node), 421Source = BuildSourceSpanFromNode(node), 436Source = BuildSourceSpanFromNode(node), 451Source = BuildSourceSpanFromNode(node), 460Source = BuildSourceSpanFromNode(node), 475Source = BuildSourceSpanFromNode(node), 490Source = BuildSourceSpanFromNode(node), 499Source = BuildSourceSpanFromNode(node), 514Source = BuildSourceSpanFromNode(node), 708Source = BuildSourceSpanFromNode(node), 722Source = BuildSourceSpanFromNode(node), 730Source = BuildSourceSpanFromNode(node), 746Source = BuildSourceSpanFromNode(node), 761Source = BuildSourceSpanFromNode(node), 905node.Source = new SourceSpan( 1025node.Source = new SourceSpan( 1085Source = BuildSourceSpanFromNode(node), 1184Source = BuildSourceSpanFromNode(node), 1222Source = BuildSourceSpanFromNode(node), 1285Source = BuildSourceSpanFromNode(node), 1300Source = BuildSourceSpanFromNode(node), 1364Source = rewrittenSource, 1404var fallback = new HtmlContentIntermediateNode() { Source = fallbackSource }; 1414Source = BuildSourceSpanFromNode(node), 1496Source = BuildSourceSpanFromNode(node) 1598Source = source 1652Source = BuildSourceSpanFromNode(node), 1749Source = source, 1768Source = source, 1811Source = BuildSourceSpanFromNode(node), 1843Source = rewrittenSource, 1886Source = source, 1896Source = source, 1930Source = attrValueSource, 1935Source = attrValueSource, 1983Source = source, 2012Source = this.BuildSourceSpanFromNode(node), 2047Source = this.BuildSourceSpanFromNode(node), 2102Source = BuildSourceSpanFromNode(node)
Language\DefaultTagHelperResolutionPhase.ComponentTagHelperResolver.cs (23)
292directiveNode.Source = unresolvedAttr.ValueSourceSpan 316expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : directiveNode.Source; 373prop.Source = unresolvedAttr.ValueSourceSpan ?? (prop.Children.Count > 0 ? prop.Children[0].Source : null); 464var expr = new CSharpExpressionIntermediateNode() { Source = csharpExprAttrValue.Source }; 495var expr = new CSharpExpressionIntermediateNode() { Source = csharpExprAttrValue.Source }; 505var expr = new CSharpExpressionIntermediateNode() { Source = csharpCodeAttrValue.Source }; 661htmlContent.Source ??= mergedSource; 667htmlContent.Source ??= valueChild.Source; 691expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : unresolvedExpr.Source; 697var htmlContent = new HtmlContentIntermediateNode() { Source = token.Source }; 793htmlContent.Source = mergedSource ?? htmlAttrValue.Source; 802htmlContent.Source = htmlAttrValue.Source; 811var csharpCode = new CSharpCodeIntermediateNode() { Source = csharpCodeAttrValue.Source }; 813csharpCode.Source = csharpCode.Children.Count > 0 ? csharpCode.Children[0].Source : csharpCodeAttrValue.Source; 820var htmlContent = new HtmlContentIntermediateNode() { Source = markupBlock.Source }; 853expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : fallbackSource; 898Source = attributeValueSpan, 906Source = attributeValueSpan, 925Source = attributeValueSpan, 974Source = source.Source, 999mergedContent.Source = spanSource; 1014Source = htmlValue.Source, 1155Source = elementNode.Source,
Language\DefaultTagHelperResolutionPhase.cs (12)
260Source = elementNode.Source, 493current.Source = MergeSourceSpans(cs, ns); 497current.Source = next.Source; 640htmlContent.Source ??= valueChild.Source; 652htmlContent.Source = MergeSourceSpans(fs, ls); 667Source = unresolvedLiteral.Source, 680Source = unresolvedExpr.Source, 685Source = unresolvedExpr.Source, 724var expr = new CSharpExpressionIntermediateNode() { Source = source }; 990expr.Source = expressionSource.WithLineIndex(exprLoc.Line) 1034Source = source, 1349var htmlContent = new HtmlContentIntermediateNode() { Source = mergedSpan };
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (25)
162prop.Source= unresolvedAttr.ValueSourceSpan ?? (prop.Children.Count > 0 ? prop.Children[0].Source : null); 192Source = null, 290Source = null, 302Source = ComputeValueSource(htmlAttr), 369var emptyHtml = new HtmlContentIntermediateNode() { Source = htmlAttr.Source }; 432var htmlContent = new HtmlContentIntermediateNode() { Source = tokenSource }; 500var htmlContent = new HtmlContentIntermediateNode() { Source = source }; 787var htmlContent = new HtmlContentIntermediateNode() { Source = tokenSource }; 795static (token) => new CSharpExpressionIntermediateNode() { Source = token.Source }); 800static (token) => new CSharpCodeIntermediateNode() { Source = token.Source }); 837var htmlContent = new HtmlContentIntermediateNode() { Source = htmlToken.Source }; 933var htmlContent = new HtmlContentIntermediateNode() { Source = source }; 1044var htmlContent = new HtmlContentIntermediateNode() { Source = htmlAttr.Source }; 1066var htmlContent = new HtmlContentIntermediateNode() { Source = htmlAttr.Source }; 1079var prefixHtml = new HtmlContentIntermediateNode() { Source = htmlAttr.Source }; 1090var hc = new HtmlContentIntermediateNode() { Source = tokenSource }; 1108var expr = new CSharpExpressionIntermediateNode() { Source = csharpToken.Source }; 1157current.Source = MergeSourceSpans(currentSource, nextSource); 1161current.Source = next.Source; 1342expr.Source = new SourceSpan(exprSource.FilePath, contentStart, openLoc.Line, openLoc.Character, contentLength, 0, closeLoc.Character + 1); 1357expr.Source = contentSpan; 1387expr.Source = tokenSpan; 1559expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : unresolvedExpr.Source; 1594var htmlContent = new HtmlContentIntermediateNode() { Source = pendingFirstSpan }; 1602htmlContent.Source = MergeSourceSpans(f, l);
Language\Extensions\AttributeDirectivePass.cs (1)
32Source = token.Source
Language\Extensions\DefaultTagHelperBodyIntermediateNode.cs (1)
25Source = bodyNode.Source;
Language\Extensions\DefaultTagHelperHtmlAttributeIntermediateNode.cs (1)
27Source = htmlAttributeNode.Source;
Language\Extensions\DefaultTagHelperPropertyIntermediateNode.cs (1)
29Source = propertyNode.Source;
Language\Extensions\PreallocatedTagHelperHtmlAttributeValueIntermediateNode.cs (1)
25Source = htmlAttributeNode.Source;
Language\Extensions\PreallocatedTagHelperPropertyIntermediateNode.cs (1)
31Source = propertyNode.Source;
Language\Intermediate\BaseTypeWithModel.cs (4)
30BaseType.Source = span[..greaterThanIndex]; 31GreaterThan.Source = span[greaterThanIndex..(greaterThanIndex + 1)]; 32ModelType.Source = span[(greaterThanIndex + 1)..^1]; 33LessThan.Source = span[^1..];
Language\Intermediate\ComponentAttributeIntermediateNode.cs (4)
67Source = attributeNode.Source; 91Source = propertyNode.Source; 109Source = node.Source; 129Source = node.Source;
Language\Intermediate\ComponentTypeArgumentIntermediateNode.cs (1)
24Source = node.Source;
Language\Intermediate\IntermediateNode.cs (1)
95clone.Source = Source;
Language\Intermediate\IntermediateToken.cs (2)
24Source = source; 35Source = source;
Language\Intermediate\ReferenceCaptureIntermediateNode.cs (1)
40Source = IdentifierToken.Source;
Language\Intermediate\SetKeyIntermediateNode.cs (1)
17Source = KeyValueToken.Source;
Language\MarkupSplitter.Slicing.cs (1)
36pieces[i] = new CSharpCodeIntermediateNode { Source = node.Source, IsImported = node.IsImported };
Language\RazorCSharpDocumentWriter.cs (3)
66Source = node.Source, 77Source = node.Source, 92Source = node.Source,
Mvc.Version2_X\RazorPageDocumentClassifierPass.cs (1)
103Source = pageDirective.Source,
Mvc\RazorPageDocumentClassifierPass.cs (1)
122Source = pageDirective.Source,
288 references to Source
Microsoft.CodeAnalysis.Razor.Compiler (288)
Language\CodeGeneration\CodeRenderingContext.cs (1)
120if (node.Source is not SourceSpan nodeSource)
Language\CodeGeneration\CodeWriterExtensions.cs (2)
514WritePropertyDeclarationPreamble(writer, modifiers, type.Content, name, type.Source, nameSpan: null, context); 781if (token.Source is { } source)
Language\CodeGeneration\IntermediateNodeWriter.cs (16)
39if (node.Source is { FilePath: not null } sourceSpan) 94using (context.BuildEnhancedLinePragma(firstCSharpChild?.Source, characterOffset)) 115using (context.BuildEnhancedLinePragma(csharpToken.Source)) 158using (context.BuildEnhancedLinePragma(token.Source)) 181var prefixLocation = node.Source.Value.AbsoluteIndex; 182var suffixLocation = node.Source.Value.AbsoluteIndex + node.Source.Value.Length - node.Suffix.Length; 207var prefixLocation = node.Source.Value.AbsoluteIndex; 208var valueLocation = node.Source.Value.AbsoluteIndex + node.Prefix.Length; 209var valueLength = node.Source.Value.Length; 243var prefixLocation = node.Source.Value.AbsoluteIndex; 253var valueLocation = node.Source.Value.AbsoluteIndex + node.Prefix.Length; 254var valueLength = node.Source.Value.Length - node.Prefix.Length; 269var prefixLocation = node.Source.Value.AbsoluteIndex; 270var valueLocation = node.Source.Value.AbsoluteIndex + node.Prefix.Length; 271var valueLength = node.Source.Value.Length - node.Prefix.Length;
Language\Components\ComponentBindLoweringPass.cs (14)
101node.Source, 116node.Source, 142node.Source, 149node.Source, 179node.Source, 201afterNode.Source, 355node.Source, 419bindNode.Source, 429bindGetNode.Source, 451var source = GetOriginalPropertySpan(targetNode) ?? targetNode.Source; 465bindEntry.BindEventNode?.Source ?? source, 543Source = targetNode.Source, 565Source = targetNode.Source, 1048node.AddDiagnostic(ComponentDiagnosticFactory.Create_TemplateInvalidLocation(template.Source));
Language\Components\ComponentChildContentDiagnosticPass.cs (2)
41attribute.Source, 71node.Source,
Language\Components\ComponentDiagnosticFactory.cs (1)
100return RazorDiagnostic.Create(UnsupportedComplexContent, node.Source, attributeName, content);
Language\Components\ComponentDocumentClassifierPass.cs (3)
72ComponentDiagnosticFactory.Create_ComponentNamesCannotStartWithLowerCase(computedClass, documentNode.Source)); 122typeParameters.Add(new(name.Content, name.Source, constraints?.Content, constraints?.Source));
Language\Components\ComponentEventHandlerLoweringPass.cs (4)
131parent.Source, 150parent.Source, 196Source = node.Source, 239node.AddDiagnostic(ComponentDiagnosticFactory.Create_TemplateInvalidLocation(template.Source));
Language\Components\ComponentFormNameLoweringPass.cs (5)
35node.AddDiagnostic(ComponentDiagnosticFactory.CreateFormName_NotAForm(node.Source)); 48Source = node.Source 58Source = node.Source, 65Source = node.Source, 75result.Source = child.Source;
Language\Components\ComponentGenericTypePass.cs (2)
254node.AddDiagnostic(ComponentDiagnosticFactory.Create_GenericComponentTypeInferenceUnderspecified(node.Source, node, node.Component.GetTypeParameters())); 313node.AddDiagnostic(ComponentDiagnosticFactory.Create_GenericComponentMissingTypeArgument(node.Source, node, missing));
Language\Components\ComponentInjectDirectivePass.cs (3)
35var typeSpan = hasType ? tokens[0].Source : directive.Source?.GetZeroWidthEndSpan(); 40var memberSpan = hasMemberName ? tokens[1].Source : null;
Language\Components\ComponentLayoutDirectivePass.cs (1)
39IntermediateNodeFactory.CSharpToken(token.Content, token.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)); 673Source = htmlValue.Source, 686Source = expressionValue.Source, 699Source = codeValue.Source, 745_component.AddDiagnostic(ComponentDiagnosticFactory.Create_ChildContentHasInvalidParameterOnComponent(node.Source, node.AttributeName, _component.TagName)); 796Source = node.Source, 833Source = content.Source,
Language\Components\ComponentMarkupDiagnosticPass.cs (8)
52otherAttribute.Source ?? node.Source)); 59otherAttribute.Source ?? node.Source)); 96other.node.Source ?? node.Source)); 103other.node.Source ?? node.Source));
Language\Components\ComponentNodeWriter.cs (10)
65context.AddDiagnostic(ComponentDiagnosticFactory.Create_CodeBlockInAttribute(node.Source, content)); 668if (node.Source is null && isWhitespaceStatement) 719using (context.BuildEnhancedLinePragma(firstCSharpChild?.Source, characterOffset)) 946if (node.Source is { FilePath: not null } sourceSpan) 1224WriteCSharpCode(context, new CSharpCodeIntermediateNode() { Source = renderMode.Source, Children = { renderMode.Children[0] } }); 1547Source = node.Source, 1641Source = node.Source, 1655Source = node.Source, 1868if (token.Source?.FilePath == null) 1874using (context.BuildEnhancedLinePragma(token.Source))
Language\Components\ComponentPageDirectivePass.cs (3)
36directive.Node.AddDiagnostic(ComponentDiagnosticFactory.CreatePageDirective_CannotBeImported(directive.Node.Source.GetValueOrDefault())); 59pageDirective.AddDiagnostic(ComponentDiagnosticFactory.CreatePageDirective_MustSpecifyRoute(pageDirective.Source)); 62@namespace.Children.Insert(index++, new RouteAttributeExtensionNode(routeToken.Content) { Source = routeToken.Source });
Language\Components\ComponentRenderModeDirectivePass.cs (2)
71Source = child.Source, 80? directiveToken.Source
Language\Components\ComponentRenderModeLoweringPass.cs (3)
33node.AddDiagnostic(ComponentDiagnosticFactory.CreateAttribute_ValidOnlyOnComponent(node.Source, node.OriginalAttributeName)); 43var renderModeNode = new RenderModeIntermediateNode() { Source = node.Source, Children = { expression } }; 49node.Source,
Language\Components\ComponentSplatLoweringPass.cs (1)
39Source = node.Source,
Language\Components\ComponentTemplateDiagnosticPass.cs (1)
37parent.AddDiagnostic(ComponentDiagnosticFactory.Create_TemplateInvalidLocation(node.Source));
Language\Components\ComponentTildePathPass.cs (1)
215ComponentDiagnosticFactory.CreateTildePath_MixedContent(token.Source, attributeName));
Language\Components\RouteAttributeExtensionNode.cs (1)
33using (context.BuildEnhancedLinePragma(Source))
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (15)
903if (node.Source is SourceSpan source) 1018.FirstOrDefault(child => child.Source != null) 1019?.Source; 1023var contentLength = node.Children.Sum(child => child.Source?.Length ?? 0); 1580if (existingHtmlContent.Source == null && source == null) 1587existingHtmlContent.Source != null && 1588existingHtmlContent.Source.Value.FilePath == source.Value.FilePath && 1589existingHtmlContent.Source.Value.AbsoluteIndex + existingHtmlContent.Source.Value.Length == source.Value.AbsoluteIndex) 1965if (existingHtmlContent.Source == null && source == null) 1972existingHtmlContent.Source != null && 1973existingHtmlContent.Source.Value.FilePath == source.Value.FilePath && 1974existingHtmlContent.Source.Value.AbsoluteIndex + existingHtmlContent.Source.Value.Length == source.Value.AbsoluteIndex) 2227ComponentDiagnosticFactory.Create_UnsupportedComponentImportContent(expressionNode.Source));
Language\DefaultTagHelperResolutionPhase.ComponentTagHelperResolver.cs (38)
36ComponentDiagnosticFactory.Create_UnexpectedMarkupElement(tagName, elementNode.StartTagSpan ?? elementNode.Source)); 60ComponentDiagnosticFactory.Create_UnexpectedMarkupElement(originalNode.TagName, originalNode.StartTagSpan ?? originalNode.Source)); 293?? (directiveNode.Children.Count > 0 ? directiveNode.Children[0].Source : null); 316expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : directiveNode.Source; 373prop.Source = unresolvedAttr.ValueSourceSpan ?? (prop.Children.Count > 0 ? prop.Children[0].Source : null); 457csharpExprAttrValue.Prefix + "@" + firstToken.Content, firstToken.Source); 464var expr = new CSharpExpressionIntermediateNode() { Source = csharpExprAttrValue.Source }; 471csharpExprAttrValue.Prefix + "@" + csharpToken.Content, csharpToken.Source)); 495var expr = new CSharpExpressionIntermediateNode() { Source = csharpExprAttrValue.Source }; 505var expr = new CSharpExpressionIntermediateNode() { Source = csharpCodeAttrValue.Source }; 512ConvertHtmlTokensToCSharp(child.Children, ref newChildren.AsRef(), child.Source, wrapLiteralsInCSharpExpression); 575if (csharpToken.Source is { } s) 588if (innerToken.Source is { } s) 658var mergedSource = ExtendSpanBackward(htmlToken.Source, prefix.Length); 667htmlContent.Source ??= valueChild.Source; 691expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : unresolvedExpr.Source; 697var htmlContent = new HtmlContentIntermediateNode() { Source = token.Source }; 766ConvertExpressionChildToCSharpExpression(node, i, csharpExprAttrValue.Prefix, csharpExprAttrValue.Children, csharpExprAttrValue.Source); 775ConvertExpressionChildToCSharpExpression(node, i, unresolvedExprAttrValue.Prefix, unresolvedExprAttrValue.Children, unresolvedExprAttrValue.Source); 790var mergedSource = ExtendSpanBackward(firstToken.Source, prefix.Length); 793htmlContent.Source = mergedSource ?? htmlAttrValue.Source; 802htmlContent.Source = htmlAttrValue.Source; 811var csharpCode = new CSharpCodeIntermediateNode() { Source = csharpCodeAttrValue.Source }; 813csharpCode.Source = csharpCode.Children.Count > 0 ? csharpCode.Children[0].Source : csharpCodeAttrValue.Source; 820var htmlContent = new HtmlContentIntermediateNode() { Source = markupBlock.Source }; 853expr.Source = expr.Children.Count > 0 ? expr.Children[0].Source : fallbackSource; 974Source = source.Source, 989var spanSource = firstValue.Source; 993var totalLength = source.Children[^1] is HtmlAttributeValueIntermediateNode lastValue && lastValue.Source is { } ls 1014Source = htmlValue.Source, 1035if (htmlAttr.Source is not SourceSpan attrSource) 1067if (htmlAttr.Children is [{ Source: SourceSpan childSource }, ..]) 1077if (lastChild.Source is SourceSpan lastSource) 1092if (htmlAttr.Source is not SourceSpan attrSource) 1155Source = elementNode.Source,
Language\DefaultTagHelperResolutionPhase.cs (30)
260Source = elementNode.Source, 389var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source; 409var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source; 426var diagSource = elementNode.StartTagNameSpan ?? elementNode.Source; 490if (current.Source is SourceSpan cs && next.Source is SourceSpan ns) 495else if (current.Source == null) 497current.Source = next.Source; 543elementNode.Source ?? SourceSpan.Undefined, 551elementNode.Source ?? SourceSpan.Undefined, 574child.Source ?? SourceSpan.Undefined, childTagName, parentTagName, allowedChildrenString)); 589child.Source ?? SourceSpan.Undefined, childTagName, parentTagName, allowedChildrenString)); 601child.Source ?? SourceSpan.Undefined, parentTagName, allowedChildrenString)); 610child.Source ?? SourceSpan.Undefined, parentTagName, allowedChildrenString)); 640htmlContent.Source ??= valueChild.Source; 648var firstSrc = htmlContent.Children[0].Source; 649var lastSrc = htmlContent.Children[^1].Source; 667Source = unresolvedLiteral.Source, 680Source = unresolvedExpr.Source, 685Source = unresolvedExpr.Source, 771target.Children.Add(new CSharpIntermediateToken(token.Content, token.Source)); 855if (token.Source is SourceSpan tokenSource) 861else if (child.Source is SourceSpan childSource) 1012var source = attrValue.Children.Count > 0 ? attrValue.Children[0].Source : attrValue.Source; 1023? IntermediateNodeFactory.CSharpToken(htmlToken, static t => t.Content, htmlToken.Source) 1024: new CSharpIntermediateToken(htmlToken.Content, htmlToken.Source); 1106if (htmlToken.Source is { } s) 1171var diagSource = elementNode.Source; 1228elementNode.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)
Language\Extensions\AttributeDirectivePass.cs (2)
32Source = token.Source 35node.Children.Add(IntermediateNodeFactory.CSharpToken(token.Content, token.Source));
Language\Extensions\DefaultTagHelperBodyIntermediateNode.cs (1)
25Source = bodyNode.Source;
Language\Extensions\DefaultTagHelperHtmlAttributeIntermediateNode.cs (1)
27Source = htmlAttributeNode.Source;
Language\Extensions\DefaultTagHelperPropertyIntermediateNode.cs (1)
29Source = propertyNode.Source;
Language\Extensions\DefaultTagHelperTargetExtension.cs (2)
346RenderTagHelperAttributeInline(context, node, node.Source); 439using (context.BuildEnhancedLinePragma(token.Source))
Language\Extensions\FunctionsDirectivePass.cs (2)
54return s_nullableIntComparer.Compare(n1.Node.Source?.AbsoluteIndex, n2.Node.Source?.AbsoluteIndex);
Language\Extensions\ImplementsDirectivePass.cs (1)
33interfaces.Add(IntermediateNodeFactory.CSharpToken(token.Content, token.Source));
Language\Extensions\InheritsDirectivePass.cs (1)
28@class.BaseType = new BaseTypeWithModel(token.Content, token.Source);
Language\Extensions\MetadataAttributeTargetExtension.cs (2)
62if (node.Source.HasValue) 70using (context.BuildEnhancedLinePragma(node.Source))
Language\Extensions\PreallocatedTagHelperHtmlAttributeValueIntermediateNode.cs (1)
25Source = htmlAttributeNode.Source;
Language\Extensions\PreallocatedTagHelperPropertyIntermediateNode.cs (1)
31Source = propertyNode.Source;
Language\Intermediate\ComponentAttributeIntermediateNode.cs (4)
67Source = attributeNode.Source; 91Source = propertyNode.Source; 109Source = node.Source; 129Source = node.Source;
Language\Intermediate\ComponentTypeArgumentIntermediateNode.cs (5)
24Source = node.Source; 38source: t.Source) 39: new CSharpIntermediateToken(t.Content, t.Source), 64mergedSpan = firstSpan ?? lastSpan ?? node.Source; 77if (token.Source is { } s)
Language\Intermediate\CSharpIntermediateToken.cs (1)
19=> new CSharpIntermediateToken(Content, Source)
Language\Intermediate\HtmlIntermediateToken.cs (1)
19=> new HtmlIntermediateToken(Content, Source)
Language\Intermediate\IntermediateNode.cs (1)
95clone.Source = Source;
Language\Intermediate\IntermediateNodeFormatter.cs (1)
106_builder.Append(node.Source?.ToString() ?? "(n/a)");
Language\Intermediate\ReferenceCaptureIntermediateNode.cs (1)
40Source = IdentifierToken.Source;
Language\Intermediate\SetKeyIntermediateNode.cs (1)
17Source = KeyValueToken.Source;
Language\MarkupSplitter.Slicing.cs (2)
36pieces[i] = new CSharpCodeIntermediateNode { Source = node.Source, IsImported = node.IsImported }; 115if (token.Source is not { } source)
Language\RazorCSharpDocumentWriter.cs (4)
66Source = node.Source, 77Source = node.Source, 92Source = node.Source, 177using (writer.BuildNamespace(node.Name, node.Source, _context))
Mvc.Version2_X\InstrumentationPass.cs (6)
80if (node.Source != null) 82Items.Add(new InstrumentationItem(node, Parent!, isLiteral: true, source: node.Source.Value)); 90if (node.Source != null) 92Items.Add(new InstrumentationItem(node, Parent!, isLiteral: false, source: node.Source.Value)); 100if (node.Source != null) 102Items.Add(new InstrumentationItem(node, Parent!, isLiteral: false, source: node.Source.Value));
Mvc.Version2_X\NamespaceDirective.cs (1)
85var directiveSource = NormalizeDirectory(directive.Source?.FilePath);
Mvc.Version2_X\RazorPageDocumentClassifierPass.cs (2)
117RazorExtensionsDiagnosticFactory.CreatePageDirective_CannotBeImported(pageDirective.DirectiveNode.Source.AssumeNotNull())); 133RazorExtensionsDiagnosticFactory.CreatePageDirective_MustExistAtTheTopOfFile(pageDirective.DirectiveNode.Source.AssumeNotNull()));
Mvc\InjectDirective.cs (3)
74var typeSpan = hasType ? tokens[0].Source : directive.Source?.GetZeroWidthEndSpan(); 79var memberSpan = hasMemberName ? tokens[1].Source : null;
Mvc\InjectTargetExtension.cs (2)
52if (node.Source.HasValue) 54using (context.BuildLinePragma(node.Source.Value))
Mvc\ModelDirective.cs (3)
59return IntermediateNodeFactory.CSharpToken(tokens[0].Content, tokens[0].Source); 105modelType.Source is SourceSpan modelSource && 106existingBaseType.BaseType.Source is not null)
Mvc\PageDirective.cs (1)
71sourceSpan = tokens[0].Source;
Mvc\RazorPageDocumentClassifierPass.cs (2)
136RazorExtensionsDiagnosticFactory.CreatePageDirective_CannotBeImported(pageDirective.DirectiveNode.Source.AssumeNotNull())); 152RazorExtensionsDiagnosticFactory.CreatePageDirective_MustExistAtTheTopOfFile(pageDirective.DirectiveNode.Source.AssumeNotNull()));