Strip insignificant whitespace at compile time (#23385)
* Define @preservewhitespace directive attribute * Have ComponentWhitespacePass respect preservewhitespace option * Tests for overriding the preservewhitespace option (and fix implementation) * Begin adding test infrastucture for ComponentWhitespacePass * Remove leading/trailing whitespace from markup elements recursively * Update baselines * Add test showing we don't remove whitespace between sibling elements * Remove whitespace before/after C# code statements (not expressions) * Update baselines * Slight improvements to test * Remove leading/trailing whitespace inside component child content * Update baselines * Fix Razor tests * Fix MVC test * Better fix for MVC test * CR: Make ComponentPreserveWhitespaceDirective conditional on langversion >= 5.0
This commit is contained in:
parent
126f14dbd2
commit
eb76931578
|
|
@ -1,6 +1,6 @@
|
|||
@using BasicWebSite.Services
|
||||
@inject WeatherForecastService ForecastService
|
||||
|
||||
@preservewhitespace true
|
||||
<h1>Weather forecast</h1>
|
||||
|
||||
<p>This component demonstrates fetching data from the server.</p>
|
||||
|
|
@ -34,7 +34,6 @@ else
|
|||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter] public DateTime StartDate { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ namespace __GeneratedComponent
|
|||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder.AddMarkupContent(4, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -16,7 +16,5 @@ Document -
|
|||
LazyIntermediateToken - (74:3,0 [4] BasicComponent.cshtml) - Html -
|
||||
CSharpExpression - (79:3,5 [29] BasicComponent.cshtml)
|
||||
LazyIntermediateToken - (79:3,5 [29] BasicComponent.cshtml) - CSharp - string.Format("{0}", "Hello")
|
||||
HtmlContent - (108:3,34 [2] BasicComponent.cshtml)
|
||||
LazyIntermediateToken - (108:3,34 [2] BasicComponent.cshtml) - Html - \n
|
||||
CSharpCode - (132:6,12 [37] BasicComponent.cshtml)
|
||||
LazyIntermediateToken - (132:6,12 [37] BasicComponent.cshtml) - CSharp - \n void IDisposable.Dispose(){ }\n
|
||||
|
|
|
|||
|
|
@ -201,6 +201,15 @@
|
|||
<data name="PageDirective_RouteToken_Name" xml:space="preserve">
|
||||
<value>route template</value>
|
||||
</data>
|
||||
<data name="PreserveWhitespaceDirective_BooleanToken_Description" xml:space="preserve">
|
||||
<value>True if whitespace should be preserved, otherwise false.</value>
|
||||
</data>
|
||||
<data name="PreserveWhitespaceDirective_BooleanToken_Name" xml:space="preserve">
|
||||
<value>Preserve</value>
|
||||
</data>
|
||||
<data name="PreserveWhitespaceDirective_Description" xml:space="preserve">
|
||||
<value>Specifies whether or not whitespace should be preserved exactly. Defaults to false for better performance.</value>
|
||||
</data>
|
||||
<data name="RefTagHelper_Documentation" xml:space="preserve">
|
||||
<value>Populates the specified field or property with a reference to the element or component.</value>
|
||||
</data>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Language.Components
|
||||
{
|
||||
internal static class ComponentPreserveWhitespaceDirective
|
||||
{
|
||||
public static readonly DirectiveDescriptor Directive = DirectiveDescriptor.CreateDirective(
|
||||
"preservewhitespace",
|
||||
DirectiveKind.SingleLine,
|
||||
builder =>
|
||||
{
|
||||
builder.AddBooleanToken(ComponentResources.PreserveWhitespaceDirective_BooleanToken_Name, ComponentResources.PreserveWhitespaceDirective_BooleanToken_Description);
|
||||
builder.Usage = DirectiveUsage.FileScopedMultipleOccurring;
|
||||
builder.Description = ComponentResources.PreserveWhitespaceDirective_Description;
|
||||
});
|
||||
|
||||
public static void Register(RazorProjectEngineBuilder builder)
|
||||
{
|
||||
if (builder == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(builder));
|
||||
}
|
||||
|
||||
builder.AddDirective(Directive, FileKinds.Component, FileKinds.ComponentImport);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Razor.Language.Intermediate;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Language.Components
|
||||
|
|
@ -38,17 +39,45 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
return;
|
||||
}
|
||||
|
||||
// Respect @preservewhitespace directives
|
||||
if (PreserveWhitespaceIsEnabled(documentNode))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var method = documentNode.FindPrimaryMethod();
|
||||
if (method != null)
|
||||
{
|
||||
RemoveContiguousWhitespace(method.Children, TraversalDirection.Forwards);
|
||||
RemoveContiguousWhitespace(method.Children, TraversalDirection.Backwards);
|
||||
|
||||
var visitor = new Visitor();
|
||||
visitor.Visit(method);
|
||||
}
|
||||
}
|
||||
|
||||
private static void RemoveContiguousWhitespace(IntermediateNodeCollection nodes, TraversalDirection direction)
|
||||
private static bool PreserveWhitespaceIsEnabled(DocumentIntermediateNode documentNode)
|
||||
{
|
||||
var position = direction == TraversalDirection.Forwards ? 0 : nodes.Count - 1;
|
||||
// If there's no @preservewhitespace attribute, the default is that we *don't* preserve whitespace
|
||||
var shouldPreserveWhitespace = false;
|
||||
|
||||
foreach (var preserveWhitespaceDirective in documentNode.FindDirectiveReferences(ComponentPreserveWhitespaceDirective.Directive))
|
||||
{
|
||||
var token = ((DirectiveIntermediateNode)preserveWhitespaceDirective.Node).Tokens.FirstOrDefault();
|
||||
var shouldPreserveWhitespaceContent = token?.Content;
|
||||
if (shouldPreserveWhitespaceContent != null)
|
||||
{
|
||||
shouldPreserveWhitespace = string.Equals(shouldPreserveWhitespaceContent, "true", StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
return shouldPreserveWhitespace;
|
||||
}
|
||||
|
||||
private static int RemoveContiguousWhitespace(IntermediateNodeCollection nodes, TraversalDirection direction, int? startIndex = null)
|
||||
{
|
||||
var position = startIndex.GetValueOrDefault(direction == TraversalDirection.Forwards ? 0 : nodes.Count - 1);
|
||||
var countRemoved = 0;
|
||||
while (position >= 0 && position < nodes.Count)
|
||||
{
|
||||
var node = nodes[position];
|
||||
|
|
@ -76,7 +105,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
shouldContinueIteration = false;
|
||||
break;
|
||||
|
||||
case CSharpCodeIntermediateNode codeIntermediateNode:
|
||||
case CSharpCodeIntermediateNode _:
|
||||
shouldRemoveNode = false;
|
||||
shouldContinueIteration = false;
|
||||
break;
|
||||
|
|
@ -90,6 +119,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
if (shouldRemoveNode)
|
||||
{
|
||||
nodes.RemoveAt(position);
|
||||
countRemoved++;
|
||||
if (direction == TraversalDirection.Forwards)
|
||||
{
|
||||
position--;
|
||||
|
|
@ -103,6 +133,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return countRemoved;
|
||||
}
|
||||
|
||||
enum TraversalDirection
|
||||
|
|
@ -110,5 +142,39 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
Forwards,
|
||||
Backwards
|
||||
}
|
||||
|
||||
class Visitor : IntermediateNodeWalker
|
||||
{
|
||||
public override void VisitMarkupElement(MarkupElementIntermediateNode node)
|
||||
{
|
||||
RemoveContiguousWhitespace(node.Children, TraversalDirection.Forwards);
|
||||
RemoveContiguousWhitespace(node.Children, TraversalDirection.Backwards);
|
||||
VisitDefault(node);
|
||||
}
|
||||
|
||||
public override void VisitTagHelperBody(TagHelperBodyIntermediateNode node)
|
||||
{
|
||||
// The goal here is to remove leading/trailing whitespace inside component child content. However,
|
||||
// at the time this whitespace pass runs, ComponentChildContent is still TagHelperBody in the tree.
|
||||
RemoveContiguousWhitespace(node.Children, TraversalDirection.Forwards);
|
||||
RemoveContiguousWhitespace(node.Children, TraversalDirection.Backwards);
|
||||
VisitDefault(node);
|
||||
}
|
||||
|
||||
public override void VisitDefault(IntermediateNode node)
|
||||
{
|
||||
// For any CSharpCodeIntermediateNode children, remove their preceding and trailing whitespace
|
||||
for (var childIndex = 0; childIndex < node.Children.Count; childIndex++)
|
||||
{
|
||||
if (node.Children[childIndex] is CSharpCodeIntermediateNode)
|
||||
{
|
||||
childIndex -= RemoveContiguousWhitespace(node.Children, TraversalDirection.Backwards, childIndex - 1);
|
||||
RemoveContiguousWhitespace(node.Children, TraversalDirection.Forwards, childIndex + 1);
|
||||
}
|
||||
}
|
||||
|
||||
base.VisitDefault(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,28 @@ namespace Microsoft.AspNetCore.Razor.Language
|
|||
return builder;
|
||||
}
|
||||
|
||||
public static IDirectiveDescriptorBuilder AddBooleanToken(this IDirectiveDescriptorBuilder builder)
|
||||
{
|
||||
return AddBooleanToken(builder, name: null, description: null);
|
||||
}
|
||||
|
||||
public static IDirectiveDescriptorBuilder AddBooleanToken(this IDirectiveDescriptorBuilder builder, string name, string description)
|
||||
{
|
||||
if (builder == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(builder));
|
||||
}
|
||||
|
||||
builder.Tokens.Add(
|
||||
DirectiveTokenDescriptor.CreateToken(
|
||||
DirectiveTokenKind.Boolean,
|
||||
optional: false,
|
||||
name: name,
|
||||
description: description));
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static IDirectiveDescriptorBuilder AddOptionalMemberToken(this IDirectiveDescriptorBuilder builder)
|
||||
{
|
||||
return AddOptionalMemberToken(builder, name: null, description: null);
|
||||
|
|
|
|||
|
|
@ -10,5 +10,6 @@ namespace Microsoft.AspNetCore.Razor.Language
|
|||
Member,
|
||||
String,
|
||||
Attribute,
|
||||
Boolean,
|
||||
}
|
||||
}
|
||||
|
|
@ -1322,7 +1322,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
|
|||
if (tokenDescriptor.Kind == DirectiveTokenKind.Member ||
|
||||
tokenDescriptor.Kind == DirectiveTokenKind.Namespace ||
|
||||
tokenDescriptor.Kind == DirectiveTokenKind.Type ||
|
||||
tokenDescriptor.Kind == DirectiveTokenKind.Attribute)
|
||||
tokenDescriptor.Kind == DirectiveTokenKind.Attribute ||
|
||||
tokenDescriptor.Kind == DirectiveTokenKind.Boolean)
|
||||
{
|
||||
SpanContext.ChunkGenerator = SpanChunkGenerator.Null;
|
||||
SpanContext.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.Whitespace;
|
||||
|
|
@ -1417,6 +1418,22 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
|
|||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case DirectiveTokenKind.Boolean:
|
||||
if (AtBooleanLiteral() && !CurrentToken.ContainsDiagnostics)
|
||||
{
|
||||
AcceptAndMoveNext();
|
||||
}
|
||||
else
|
||||
{
|
||||
Context.ErrorSink.OnError(
|
||||
RazorDiagnosticFactory.CreateParsing_DirectiveExpectsBooleanLiteral(
|
||||
new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive));
|
||||
builder.Add(BuildDirective());
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case DirectiveTokenKind.Attribute:
|
||||
if (At(SyntaxKind.LeftBracket))
|
||||
{
|
||||
|
|
@ -1699,6 +1716,12 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
|
|||
return false;
|
||||
}
|
||||
|
||||
private bool AtBooleanLiteral()
|
||||
{
|
||||
var result = CSharpTokenizer.GetTokenKeyword(CurrentToken);
|
||||
return result.HasValue && (result.Value == CSharpKeyword.True || result.Value == CSharpKeyword.False);
|
||||
}
|
||||
|
||||
private void SetupExpressionParsers()
|
||||
{
|
||||
MapExpressionKeyword(ParseAwaitExpression, CSharpKeyword.Await);
|
||||
|
|
|
|||
|
|
@ -426,6 +426,16 @@ namespace Microsoft.AspNetCore.Razor.Language
|
|||
{
|
||||
return RazorDiagnostic.Create(Parsing_DirectiveExpectsCSharpAttribute, location, directiveName);
|
||||
}
|
||||
|
||||
internal static readonly RazorDiagnosticDescriptor Parsing_DirectiveExpectsBooleanLiteral =
|
||||
new RazorDiagnosticDescriptor(
|
||||
$"{DiagnosticPrefix}1038",
|
||||
() => Resources.DirectiveExpectsBooleanLiteral,
|
||||
RazorDiagnosticSeverity.Error);
|
||||
public static RazorDiagnostic CreateParsing_DirectiveExpectsBooleanLiteral(SourceSpan location, string directiveName)
|
||||
{
|
||||
return RazorDiagnostic.Create(Parsing_DirectiveExpectsBooleanLiteral, location, directiveName);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Semantic Errors
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ namespace Microsoft.AspNetCore.Razor.Language
|
|||
NamespaceDirective.Register(builder);
|
||||
AttributeDirective.Register(builder);
|
||||
|
||||
AddComponentFeatures(builder);
|
||||
AddComponentFeatures(builder, configuration.LanguageVersion);
|
||||
}
|
||||
|
||||
LoadExtensions(builder, configuration.Extensions);
|
||||
|
|
@ -206,7 +206,7 @@ namespace Microsoft.AspNetCore.Razor.Language
|
|||
});
|
||||
}
|
||||
|
||||
private static void AddComponentFeatures(RazorProjectEngineBuilder builder)
|
||||
private static void AddComponentFeatures(RazorProjectEngineBuilder builder, RazorLanguageVersion razorLanguageVersion)
|
||||
{
|
||||
// Project Engine Features
|
||||
builder.Features.Add(new ComponentImportProjectFeature());
|
||||
|
|
@ -218,6 +218,11 @@ namespace Microsoft.AspNetCore.Razor.Language
|
|||
ComponentPageDirective.Register(builder);
|
||||
ComponentTypeParamDirective.Register(builder);
|
||||
|
||||
if (razorLanguageVersion.CompareTo(RazorLanguageVersion.Version_5_0) >= 0)
|
||||
{
|
||||
ComponentPreserveWhitespaceDirective.Register(builder);
|
||||
}
|
||||
|
||||
// Document Classifier
|
||||
builder.Features.Add(new ComponentDocumentClassifierPass());
|
||||
|
||||
|
|
|
|||
|
|
@ -559,4 +559,7 @@
|
|||
<data name="TagHelper_InvalidRequiredDirectiveAttributeName" xml:space="preserve">
|
||||
<value>Invalid tag helper required directive attribute '{0}'. The directive attribute '{1}' should start with a '@' character.</value>
|
||||
</data>
|
||||
<data name="DirectiveExpectsBooleanLiteral" xml:space="preserve">
|
||||
<value>The '{0}' directive expects a boolean literal.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
@ -47,11 +47,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
</html>");
|
||||
|
||||
var expected = NormalizeContent(@"
|
||||
<html>
|
||||
<head cool=""beans"">
|
||||
<html><head cool=""beans"">
|
||||
Hello, World!
|
||||
</head>
|
||||
</html>");
|
||||
</head></html>");
|
||||
|
||||
var documentNode = Lower(document);
|
||||
|
||||
|
|
@ -163,7 +161,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
</head>
|
||||
</html>");
|
||||
|
||||
var expected = NormalizeContent("<div>foo</div>\n ");
|
||||
var expected = NormalizeContent("<div>foo</div>");
|
||||
|
||||
var documentNode = Lower(document);
|
||||
|
||||
|
|
@ -349,11 +347,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Components
|
|||
</html>");
|
||||
|
||||
var expected = NormalizeContent(@"
|
||||
<head cool=""beans"">
|
||||
<option value=""1"">One</option>
|
||||
<option selected value=""2"">Two</option>
|
||||
</head>
|
||||
");
|
||||
<head cool=""beans""><option value=""1"">One</option>
|
||||
<option selected value=""2"">Two</option></head>");
|
||||
|
||||
var documentNode = Lower(document);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,183 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Razor.Language.Intermediate;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Language.Components
|
||||
{
|
||||
public class ComponentWhitespacePassTest
|
||||
{
|
||||
public ComponentWhitespacePassTest()
|
||||
{
|
||||
Pass = new ComponentWhitespacePass();
|
||||
ProjectEngine = (DefaultRazorProjectEngine)RazorProjectEngine.Create(
|
||||
RazorConfiguration.Default,
|
||||
RazorProjectFileSystem.Create(Environment.CurrentDirectory),
|
||||
b =>
|
||||
{
|
||||
if (b.Features.OfType<ComponentWhitespacePass>().Any())
|
||||
{
|
||||
b.Features.Remove(b.Features.OfType<ComponentWhitespacePass>().Single());
|
||||
}
|
||||
});
|
||||
Engine = ProjectEngine.Engine;
|
||||
|
||||
Pass.Engine = Engine;
|
||||
}
|
||||
|
||||
private DefaultRazorProjectEngine ProjectEngine { get; }
|
||||
|
||||
private RazorEngine Engine { get; }
|
||||
|
||||
private ComponentWhitespacePass Pass { get; }
|
||||
|
||||
[Fact]
|
||||
public void Execute_RemovesLeadingAndTrailingWhitespace()
|
||||
{
|
||||
// Arrange
|
||||
var document = CreateDocument(@"
|
||||
|
||||
<span>@(""Hello, world"")</span>
|
||||
|
||||
");
|
||||
|
||||
var documentNode = Lower(document);
|
||||
|
||||
// Act
|
||||
Pass.Execute(document, documentNode);
|
||||
|
||||
// Assert
|
||||
var method = documentNode.FindPrimaryMethod();
|
||||
var child = Assert.IsType<MarkupElementIntermediateNode>(Assert.Single(method.Children));
|
||||
Assert.Equal("span", child.TagName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_RemovesLeadingAndTrailingWhitespaceInsideElement()
|
||||
{
|
||||
// Arrange
|
||||
var document = CreateDocument(@"
|
||||
<parent>
|
||||
<child> Hello, @("" w o r l d "") </child>
|
||||
</parent>
|
||||
");
|
||||
|
||||
var documentNode = Lower(document);
|
||||
|
||||
// Act
|
||||
Pass.Execute(document, documentNode);
|
||||
|
||||
// Assert
|
||||
var parentElement = Assert.IsType<MarkupElementIntermediateNode>(Assert.Single(documentNode.FindPrimaryMethod().Children));
|
||||
var childElement = Assert.IsType<MarkupElementIntermediateNode>(Assert.Single(parentElement.Children));
|
||||
Assert.Equal("child", childElement.TagName);
|
||||
Assert.Collection(childElement.Children,
|
||||
node =>
|
||||
{
|
||||
var htmlNode = Assert.IsType<HtmlContentIntermediateNode>(node);
|
||||
Assert.Equal(" Hello, ", GetContent(htmlNode));
|
||||
},
|
||||
node =>
|
||||
{
|
||||
var csharpExpressionNode = Assert.IsType<CSharpExpressionIntermediateNode>(node);
|
||||
Assert.Equal(@""" w o r l d """, GetContent(csharpExpressionNode));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_LeavesWhitespaceBetweenSiblingElements()
|
||||
{
|
||||
// Arrange
|
||||
var document = CreateDocument(@" <elem attr=@expr /> <elem attr=@expr /> ");
|
||||
|
||||
var documentNode = Lower(document);
|
||||
|
||||
// Act
|
||||
Pass.Execute(document, documentNode);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(documentNode.FindPrimaryMethod().Children,
|
||||
node => Assert.IsType<MarkupElementIntermediateNode>(node),
|
||||
node => Assert.IsType<HtmlContentIntermediateNode>(node),
|
||||
node => Assert.IsType<MarkupElementIntermediateNode>(node));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Execute_RemovesWhitespacePrecedingAndTrailingCSharpCode()
|
||||
{
|
||||
// Arrange
|
||||
var document = CreateDocument(@"
|
||||
<parent>
|
||||
<child>@val1a @val1b</child>
|
||||
|
||||
@if(someExpression) { /* Do something */ }
|
||||
|
||||
<child>@val2a @val2b</child>
|
||||
</parent>
|
||||
");
|
||||
|
||||
var documentNode = Lower(document);
|
||||
|
||||
// Act
|
||||
Pass.Execute(document, documentNode);
|
||||
|
||||
// Assert
|
||||
var parentElement = Assert.IsType<MarkupElementIntermediateNode>(Assert.Single(documentNode.FindPrimaryMethod().Children));
|
||||
Assert.Collection(parentElement.Children,
|
||||
node =>
|
||||
{
|
||||
Assert.Equal("child", Assert.IsType<MarkupElementIntermediateNode>(node).TagName);
|
||||
Assert.Collection(node.Children,
|
||||
x => Assert.IsType<CSharpExpressionIntermediateNode>(x),
|
||||
x => Assert.IsType<HtmlContentIntermediateNode>(x), // We don't remove whitespace before/after C# expressions
|
||||
x => Assert.IsType<CSharpExpressionIntermediateNode>(x));
|
||||
},
|
||||
node => Assert.IsType<CSharpCodeIntermediateNode>(node),
|
||||
node =>
|
||||
{
|
||||
Assert.Equal("child", Assert.IsType<MarkupElementIntermediateNode>(node).TagName);
|
||||
Assert.Collection(node.Children,
|
||||
x => Assert.IsType<CSharpExpressionIntermediateNode>(x),
|
||||
x => Assert.IsType<HtmlContentIntermediateNode>(x), // We don't remove whitespace before/after C# expressions
|
||||
x => Assert.IsType<CSharpExpressionIntermediateNode>(x));
|
||||
});
|
||||
}
|
||||
|
||||
private RazorCodeDocument CreateDocument(string content)
|
||||
{
|
||||
var source = RazorSourceDocument.Create(content, "test.cshtml");
|
||||
return ProjectEngine.CreateCodeDocumentCore(source, FileKinds.Component);
|
||||
}
|
||||
|
||||
private DocumentIntermediateNode Lower(RazorCodeDocument codeDocument)
|
||||
{
|
||||
for (var i = 0; i < Engine.Phases.Count; i++)
|
||||
{
|
||||
var phase = Engine.Phases[i];
|
||||
if (phase is IRazorCSharpLoweringPhase)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
phase.Execute(codeDocument);
|
||||
}
|
||||
|
||||
return codeDocument.GetDocumentIntermediateNode();
|
||||
}
|
||||
|
||||
private static string GetContent(IntermediateNode node)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
var tokens = node.Children.OfType<IntermediateToken>();
|
||||
foreach (var token in tokens)
|
||||
{
|
||||
builder.Append(token.Content);
|
||||
}
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2081,6 +2081,69 @@ namespace AnotherTest
|
|||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Component_WithPreserveWhitespaceDirective_True()
|
||||
{
|
||||
// Arrange / Act
|
||||
var generated = CompileToCSharp(@"
|
||||
@preservewhitespace true
|
||||
|
||||
<ul>
|
||||
@foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
<li>
|
||||
@item
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Component_WithPreserveWhitespaceDirective_False()
|
||||
{
|
||||
// Arrange / Act
|
||||
var generated = CompileToCSharp(@"
|
||||
@preservewhitespace false
|
||||
|
||||
<ul>
|
||||
@foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
<li>
|
||||
@item
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Component_WithPreserveWhitespaceDirective_Invalid()
|
||||
{
|
||||
// Arrange / Act
|
||||
var generated = CompileToCSharp(@"
|
||||
@preservewhitespace someVariable
|
||||
@code {
|
||||
bool someVariable = false;
|
||||
}
|
||||
", throwOnFailure: false);
|
||||
|
||||
// Assert
|
||||
Assert.Collection(generated.Diagnostics, d => { Assert.Equal("RZ1038", d.Id); });
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region EventCallback
|
||||
|
|
@ -4506,13 +4569,17 @@ namespace Test
|
|||
{
|
||||
public class SomeOtherComponent : ComponentBase
|
||||
{
|
||||
[Parameter] public RenderFragment ChildContent { get; set; }
|
||||
}
|
||||
}
|
||||
"));
|
||||
|
||||
// Act
|
||||
var generated = CompileToCSharp(@"
|
||||
<SomeOtherComponent />
|
||||
<SomeOtherComponent>
|
||||
<h1>Child content at @DateTime.Now</h1>
|
||||
<p>Very @(""good"")</p>
|
||||
</SomeOtherComponent>
|
||||
|
||||
<h1>Hello</h1>");
|
||||
|
||||
|
|
@ -4618,6 +4685,32 @@ namespace Test
|
|||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhiteSpace_WithPreserveWhitespace()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
// Act
|
||||
var generated = CompileToCSharp(@"
|
||||
|
||||
@preservewhitespace true
|
||||
|
||||
<elem attr=@Foo>
|
||||
<child />
|
||||
</elem>
|
||||
|
||||
@code {
|
||||
int Foo = 18;
|
||||
}
|
||||
|
||||
");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Imports
|
||||
|
|
@ -4753,6 +4846,58 @@ namespace New.Test
|
|||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Component_PreserveWhitespaceDirective_InImports()
|
||||
{
|
||||
// Arrange
|
||||
var importContent = @"
|
||||
@preservewhitespace true
|
||||
";
|
||||
var importItem = CreateProjectItem("_Imports.razor", importContent, FileKinds.ComponentImport);
|
||||
ImportItems.Add(importItem);
|
||||
|
||||
// Act
|
||||
var generated = CompileToCSharp(@"
|
||||
|
||||
<parent>
|
||||
<child> @DateTime.Now </child>
|
||||
</parent>
|
||||
|
||||
");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Component_PreserveWhitespaceDirective_OverrideImports()
|
||||
{
|
||||
// Arrange
|
||||
var importContent = @"
|
||||
@preservewhitespace true
|
||||
";
|
||||
var importItem = CreateProjectItem("_Imports.razor", importContent, FileKinds.ComponentImport);
|
||||
ImportItems.Add(importItem);
|
||||
|
||||
// Act
|
||||
var generated = CompileToCSharp(@"
|
||||
@preservewhitespace false
|
||||
|
||||
<parent>
|
||||
<child> @DateTime.Now </child>
|
||||
</parent>
|
||||
|
||||
");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Misc
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
#pragma warning disable 0414
|
||||
private static System.Object __o = null;
|
||||
#pragma warning restore 0414
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
__o = DateTime.Now;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [12] ) - System
|
||||
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [17] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (20:0,20 [4] x:\dir\subdir\Test\_Imports.razor) - true
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning disable 0414
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - private static System.Object __o = null;
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning restore 0414
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (0:0,0 [55] x:\dir\subdir\Test\TestComponent.cshtml) - parent
|
||||
HtmlContent - (8:0,8 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (8:0,8 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (14:1,4 [30] x:\dir\subdir\Test\TestComponent.cshtml) - child
|
||||
HtmlContent - (21:1,11 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (21:1,11 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
CSharpExpression - (23:1,13 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (23:1,13 [12] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - DateTime.Now
|
||||
HtmlContent - (35:1,25 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (35:1,25 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
HtmlContent - (44:1,34 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (44:1,34 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
HtmlContent - (55:2,9 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (55:2,9 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Source Location: (23:1,13 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|DateTime.Now|
|
||||
Generated Location: (865:24,13 [12] )
|
||||
|DateTime.Now|
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
#pragma warning disable 0414
|
||||
private static System.Object __o = null;
|
||||
#pragma warning restore 0414
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
__o = DateTime.Now;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [12] ) - System
|
||||
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [17] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (20:0,20 [4] x:\dir\subdir\Test\_Imports.razor) - true
|
||||
DirectiveToken - (20:0,20 [5] x:\dir\subdir\Test\TestComponent.cshtml) - false
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning disable 0414
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - private static System.Object __o = null;
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning restore 0414
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
HtmlContent - (27:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (27:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (29:2,0 [55] x:\dir\subdir\Test\TestComponent.cshtml) - parent
|
||||
HtmlContent - (37:2,8 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (37:2,8 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (43:3,4 [30] x:\dir\subdir\Test\TestComponent.cshtml) - child
|
||||
HtmlContent - (50:3,11 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (50:3,11 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
CSharpExpression - (52:3,13 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (52:3,13 [12] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - DateTime.Now
|
||||
HtmlContent - (64:3,25 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (64:3,25 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
HtmlContent - (73:3,34 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (73:3,34 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
HtmlContent - (84:4,9 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (84:4,9 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Source Location: (52:3,13 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|DateTime.Now|
|
||||
Generated Location: (925:27,13 [12] )
|
||||
|DateTime.Now|
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
#pragma warning disable 0414
|
||||
private static System.Object __o = null;
|
||||
#pragma warning restore 0414
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 7 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
__o = item;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 8 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [12] ) - System
|
||||
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [17] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (20:0,20 [5] x:\dir\subdir\Test\TestComponent.cshtml) - false
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning disable 0414
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - private static System.Object __o = null;
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning restore 0414
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
HtmlContent - (27:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (27:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (29:2,0 [126] x:\dir\subdir\Test\TestComponent.cshtml) - ul
|
||||
HtmlContent - (33:2,4 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (33:2,4 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (40:3,5 [63] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (40:3,5 [63] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item in Enumerable.Range(1, 100))\n {\n
|
||||
MarkupElement - (103:5,8 [38] x:\dir\subdir\Test\TestComponent.cshtml) - li
|
||||
HtmlContent - (107:5,12 [14] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (107:5,12 [14] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpExpression - (122:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (122:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - item
|
||||
HtmlContent - (126:6,17 [10] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (126:6,17 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (141:7,13 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (141:7,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n }
|
||||
HtmlContent - (148:8,5 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (148:8,5 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
HtmlContent - (155:9,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (155:9,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
Source Location: (40:3,5 [63] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
|
||||
Generated Location: (917:27,5 [63] )
|
||||
|foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
|
||||
|
||||
Source Location: (122:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|item|
|
||||
Generated Location: (1115:36,13 [4] )
|
||||
|item|
|
||||
|
||||
Source Location: (141:7,13 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (1255:43,13 [7] )
|
||||
|
|
||||
}|
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
#pragma warning disable 0414
|
||||
private static System.Object __o = null;
|
||||
#pragma warning restore 0414
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
#nullable restore
|
||||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
__o = preservewhitespace;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
||||
bool someVariable = false;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [12] ) - System
|
||||
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [17] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
DesignTimeDirective -
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning disable 0414
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - private static System.Object __o = null;
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning restore 0414
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
CSharpExpression - (1:0,1 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (1:0,1 [18] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - preservewhitespace
|
||||
HtmlContent - (19:0,19 [15] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (19:0,19 [15] x:\dir\subdir\Test\TestComponent.cshtml) - Html - someVariable\n
|
||||
HtmlContent - (76:3,1 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (76:3,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (41:1,7 [34] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (41:1,7 [34] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n bool someVariable = false;\n
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
Source Location: (1:0,1 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|preservewhitespace|
|
||||
Generated Location: (858:24,6 [18] )
|
||||
|preservewhitespace|
|
||||
|
||||
Source Location: (41:1,7 [34] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|
|
||||
bool someVariable = false;
|
||||
|
|
||||
Generated Location: (1055:33,7 [34] )
|
||||
|
|
||||
bool someVariable = false;
|
||||
|
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
#pragma warning disable 0414
|
||||
private static System.Object __o = null;
|
||||
#pragma warning restore 0414
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 7 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
__o = item;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 8 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [12] ) - System
|
||||
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [17] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (20:0,20 [4] x:\dir\subdir\Test\TestComponent.cshtml) - true
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning disable 0414
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - private static System.Object __o = null;
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning restore 0414
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
HtmlContent - (26:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (26:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (28:2,0 [126] x:\dir\subdir\Test\TestComponent.cshtml) - ul
|
||||
HtmlContent - (32:2,4 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (32:2,4 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (39:3,5 [63] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (39:3,5 [63] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item in Enumerable.Range(1, 100))\n {\n
|
||||
MarkupElement - (102:5,8 [38] x:\dir\subdir\Test\TestComponent.cshtml) - li
|
||||
HtmlContent - (106:5,12 [14] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (106:5,12 [14] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpExpression - (121:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (121:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - item
|
||||
HtmlContent - (125:6,17 [10] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (125:6,17 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (140:7,13 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (140:7,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n }
|
||||
HtmlContent - (147:8,5 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (147:8,5 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
HtmlContent - (154:9,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (154:9,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
Source Location: (39:3,5 [63] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
|
||||
Generated Location: (917:27,5 [63] )
|
||||
|foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
|
||||
|
||||
Source Location: (121:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|item|
|
||||
Generated Location: (1115:36,13 [4] )
|
||||
|item|
|
||||
|
||||
Source Location: (140:7,13 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (1255:43,13 [7] )
|
||||
|
|
||||
}|
|
||||
|
||||
|
|
@ -21,6 +21,20 @@ namespace Test
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.AddAttribute(-1, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => {
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
__o = DateTime.Now;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
__o = "good";
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
}
|
||||
));
|
||||
#nullable restore
|
||||
|
|
|
|||
|
|
@ -14,9 +14,26 @@ Document -
|
|||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning restore 0414
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
Component - (0:0,0 [22] x:\dir\subdir\Test\TestComponent.cshtml) - SomeOtherComponent
|
||||
HtmlContent - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
MarkupElement - (26:2,0 [14] x:\dir\subdir\Test\TestComponent.cshtml) - h1
|
||||
HtmlContent - (30:2,4 [5] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (30:2,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
|
||||
Component - (0:0,0 [115] x:\dir\subdir\Test\TestComponent.cshtml) - SomeOtherComponent
|
||||
ComponentChildContent - - ChildContent - context
|
||||
HtmlContent - (20:0,20 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (20:0,20 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (26:1,4 [39] x:\dir\subdir\Test\TestComponent.cshtml) - h1
|
||||
HtmlContent - (30:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (30:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Child content at
|
||||
CSharpExpression - (48:1,26 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (48:1,26 [12] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - DateTime.Now
|
||||
HtmlContent - (65:1,43 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (65:1,43 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (71:2,4 [21] x:\dir\subdir\Test\TestComponent.cshtml) - p
|
||||
HtmlContent - (74:2,7 [5] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (74:2,7 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Very
|
||||
CSharpExpression - (81:2,14 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (81:2,14 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "good"
|
||||
HtmlContent - (92:2,25 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (92:2,25 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
HtmlContent - (115:3,21 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (115:3,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
MarkupElement - (119:5,0 [14] x:\dir\subdir\Test\TestComponent.cshtml) - h1
|
||||
HtmlContent - (123:5,4 [5] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (123:5,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
Source Location: (48:1,26 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|DateTime.Now|
|
||||
Generated Location: (1001:25,26 [12] )
|
||||
|DateTime.Now|
|
||||
|
||||
Source Location: (81:2,14 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|"good"|
|
||||
Generated Location: (1150:32,14 [6] )
|
||||
|"good"|
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
#pragma warning disable 0414
|
||||
private static System.Object __o = null;
|
||||
#pragma warning restore 0414
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__o =
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
Foo
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
;
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#nullable restore
|
||||
#line 7 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
||||
int Foo = 18;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [12] ) - System
|
||||
UsingDirective - (18:2,1 [32] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [17] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [28] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [37] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
DesignTimeDirective -
|
||||
DirectiveToken - (20:0,20 [4] x:\dir\subdir\Test\TestComponent.cshtml) - true
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning disable 0414
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - private static System.Object __o = null;
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - #pragma warning restore 0414
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
HtmlContent - (26:1,0 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (26:1,0 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (32:2,4 [48] x:\dir\subdir\Test\TestComponent.cshtml) - elem
|
||||
HtmlAttribute - (37:2,9 [10] x:\dir\subdir\Test\TestComponent.cshtml) - attr= -
|
||||
CSharpExpressionAttributeValue - (43:2,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) -
|
||||
LazyIntermediateToken - (44:2,16 [3] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - Foo
|
||||
HtmlContent - (48:2,20 [10] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (48:2,20 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (58:3,8 [9] x:\dir\subdir\Test\TestComponent.cshtml) - child
|
||||
HtmlContent - (67:3,17 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (67:3,17 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
HtmlContent - (80:4,11 [8] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (80:4,11 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
HtmlContent - (125:8,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (125:8,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
CSharpCode - (95:6,11 [29] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (95:6,11 [29] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n int Foo = 18;\n
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
Source Location: (44:2,16 [3] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|Foo|
|
||||
Generated Location: (948:28,16 [3] )
|
||||
|Foo|
|
||||
|
||||
Source Location: (95:6,11 [29] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|
|
||||
int Foo = 18;
|
||||
|
|
||||
Generated Location: (1148:38,11 [29] )
|
||||
|
|
||||
int Foo = 18;
|
||||
|
|
||||
|
||||
|
|
@ -14,9 +14,8 @@ namespace Test
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "input");
|
||||
__builder.AddAttribute(3, "@bind",
|
||||
__builder.OpenElement(1, "input");
|
||||
__builder.AddAttribute(2, "@bind",
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
ParentValue
|
||||
|
|
@ -26,7 +25,6 @@ namespace Test
|
|||
#nullable disable
|
||||
);
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(4, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -8,13 +8,9 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (9:1,2 [28] x:\dir\subdir\Test\TestComponent.cshtml) - input
|
||||
HtmlAttribute - (15:1,8 [21] x:\dir\subdir\Test\TestComponent.cshtml) - @bind=" - "
|
||||
CSharpExpressionAttributeValue - (23:1,16 [12] x:\dir\subdir\Test\TestComponent.cshtml) -
|
||||
LazyIntermediateToken - (24:1,17 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue
|
||||
HtmlContent - (37:1,30 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (37:1,30 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (54:3,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (54:3,7 [55] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public string ParentValue { get; set; } = "hi";\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (54:3,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public string ParentValue { get; set; } = "hi";
|
||||
|
|
||||
Generated Location: (1133:34,7 [55] )
|
||||
Generated Location: (1027:32,7 [55] )
|
||||
|
|
||||
public string ParentValue { get; set; } = "hi";
|
||||
|
|
||||
|
|
|
|||
|
|
@ -24,9 +24,8 @@ namespace Test
|
|||
#nullable disable
|
||||
));
|
||||
__builder.AddAttribute(2, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment<string>)((context) => (__builder2) => {
|
||||
__builder2.AddMarkupContent(3, "\r\n ");
|
||||
__builder2.OpenElement(4, "div");
|
||||
__builder2.AddContent(5,
|
||||
__builder2.OpenElement(3, "div");
|
||||
__builder2.AddContent(4,
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
context.ToLower()
|
||||
|
|
@ -36,7 +35,6 @@ namespace Test
|
|||
#nullable disable
|
||||
);
|
||||
__builder2.CloseElement();
|
||||
__builder2.AddMarkupContent(6, "\r\n");
|
||||
}
|
||||
));
|
||||
__builder.CloseComponent();
|
||||
|
|
|
|||
|
|
@ -9,13 +9,9 @@ Document -
|
|||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
Component - (0:0,0 [90] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
|
||||
ComponentChildContent - - ChildContent - context
|
||||
HtmlContent - (41:0,41 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (41:0,41 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (45:1,2 [29] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
CSharpExpression - (51:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (51:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context.ToLower()
|
||||
HtmlContent - (74:1,31 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (74:1,31 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
ComponentTypeArgument - (19:0,19 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem
|
||||
LazyIntermediateToken - (19:0,19 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - string
|
||||
ComponentAttribute - (32:0,32 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Item - Item - AttributeStructure.DoubleQuotes
|
||||
|
|
|
|||
|
|
@ -22,9 +22,8 @@ namespace Test
|
|||
#line hidden
|
||||
#nullable disable
|
||||
, 2, (context) => (__builder2) => {
|
||||
__builder2.AddMarkupContent(3, "\r\n ");
|
||||
__builder2.OpenElement(4, "div");
|
||||
__builder2.AddContent(5,
|
||||
__builder2.OpenElement(3, "div");
|
||||
__builder2.AddContent(4,
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
context.ToLower()
|
||||
|
|
@ -34,7 +33,6 @@ namespace Test
|
|||
#nullable disable
|
||||
);
|
||||
__builder2.CloseElement();
|
||||
__builder2.AddMarkupContent(6, "\r\n");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,13 +9,9 @@ Document -
|
|||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
Component - (0:0,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
|
||||
ComponentChildContent - - ChildContent - context
|
||||
HtmlContent - (28:0,28 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (28:0,28 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (32:1,2 [29] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
CSharpExpression - (38:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (38:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context.ToLower()
|
||||
HtmlContent - (61:1,31 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (61:1,31 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
ComponentAttribute - (19:0,19 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Item - Item - AttributeStructure.DoubleQuotes
|
||||
CSharpExpression - (20:0,20 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "hi"
|
||||
|
|
|
|||
|
|
@ -29,10 +29,8 @@ using Microsoft.AspNetCore.Components.RenderTree;
|
|||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
__builder.AddContent(0, " ");
|
||||
__builder.OpenComponent<Test.MyComponent>(1);
|
||||
__builder.OpenComponent<Test.MyComponent>(0);
|
||||
__builder.CloseComponent();
|
||||
__builder.AddMarkupContent(2, "\r\n");
|
||||
#nullable restore
|
||||
#line 6 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
}
|
||||
|
|
@ -40,7 +38,6 @@ using Microsoft.AspNetCore.Components.RenderTree;
|
|||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
__builder.AddMarkupContent(3, "\r\n");
|
||||
#nullable restore
|
||||
#line 9 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
RenderChildComponent();
|
||||
|
|
|
|||
|
|
@ -10,14 +10,8 @@ Document -
|
|||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
CSharpCode - (54:1,2 [42] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (54:1,2 [42] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n void RenderChildComponent()\n {\n
|
||||
HtmlContent - (96:4,0 [8] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (96:4,0 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
Component - (104:4,8 [15] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
|
||||
HtmlContent - (119:4,23 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (119:4,23 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (121:5,0 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (121:5,0 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - }\n
|
||||
HtmlContent - (131:7,0 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (131:7,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (135:8,2 [25] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (135:8,2 [25] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - RenderChildComponent();
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ Generated Location: (757:24,2 [42] )
|
|||
Source Location: (121:5,0 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
| }
|
||||
|
|
||||
Generated Location: (1121:37,0 [7] )
|
||||
Generated Location: (1019:35,0 [7] )
|
||||
| }
|
||||
|
|
||||
|
||||
Source Location: (135:8,2 [25] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
| RenderChildComponent(); |
|
||||
Generated Location: (1302:45,2 [25] )
|
||||
Generated Location: (1148:42,2 [25] )
|
||||
| RenderChildComponent(); |
|
||||
|
||||
|
|
|
|||
|
|
@ -38,8 +38,7 @@ namespace Test
|
|||
}
|
||||
));
|
||||
__builder.AddAttribute(5, "AnotherChildContent", (Microsoft.AspNetCore.Components.RenderFragment<Test.MyComponent<string, int>.Context>)((item) => (__builder2) => {
|
||||
__builder2.AddMarkupContent(6, "\r\n ");
|
||||
__builder2.AddContent(7,
|
||||
__builder2.AddContent(6,
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
System.Math.Max(0, item.Item)
|
||||
|
|
@ -48,7 +47,7 @@ namespace Test
|
|||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder2.AddMarkupContent(8, ";\r\n");
|
||||
__builder2.AddMarkupContent(7, ";\r\n");
|
||||
}
|
||||
));
|
||||
__builder.CloseComponent();
|
||||
|
|
|
|||
|
|
@ -13,9 +13,6 @@ Document -
|
|||
CSharpExpression - (77:1,22 [17] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (77:1,22 [17] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context.ToLower()
|
||||
ComponentChildContent - (117:2,0 [95] x:\dir\subdir\Test\TestComponent.cshtml) - AnotherChildContent - item
|
||||
HtmlContent - (153:2,36 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (153:2,36 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
LazyIntermediateToken - (155:3,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
CSharpExpression - (158:3,3 [29] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (158:3,3 [29] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - System.Math.Max(0, item.Item)
|
||||
HtmlContent - (187:3,32 [3] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@ namespace Test
|
|||
__builder2.CloseElement();
|
||||
}
|
||||
, 6, (item) => (__builder2) => {
|
||||
__builder2.AddMarkupContent(7, "\r\n ");
|
||||
__builder2.AddContent(8,
|
||||
__builder2.AddContent(7,
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
System.Math.Max(0, item.Item)
|
||||
|
|
@ -53,7 +52,7 @@ namespace Test
|
|||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder2.AddMarkupContent(9, ";\r\n");
|
||||
__builder2.AddMarkupContent(8, ";\r\n");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,6 @@ Document -
|
|||
CSharpExpression - (78:1,22 [17] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (78:1,22 [17] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context.ToLower()
|
||||
ComponentChildContent - (118:2,0 [95] x:\dir\subdir\Test\TestComponent.cshtml) - AnotherChildContent - item
|
||||
HtmlContent - (154:2,36 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (154:2,36 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
LazyIntermediateToken - (156:3,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
CSharpExpression - (159:3,3 [29] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (159:3,3 [29] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - System.Math.Max(0, item.Item)
|
||||
HtmlContent - (188:3,32 [3] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ namespace Test
|
|||
#nullable disable
|
||||
);
|
||||
__builder2.CloseElement();
|
||||
__builder2.AddMarkupContent(7, "\r\n ");
|
||||
}
|
||||
));
|
||||
__builder.CloseComponent();
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ Document -
|
|||
LazyIntermediateToken - (89:2,28 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html - 1
|
||||
CSharpExpression - (93:2,32 [23] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (93:2,32 [23] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - item.ToLowerInvariant()
|
||||
HtmlContent - (129:2,68 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (129:2,68 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
ComponentAttribute - (21:0,21 [3] x:\dir\subdir\Test\TestComponent.cshtml) - MyAttr - MyAttr - AttributeStructure.DoubleQuotes
|
||||
HtmlContent - (21:0,21 [3] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (21:0,21 [3] x:\dir\subdir\Test\TestComponent.cshtml) - Html - abc
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ namespace Test
|
|||
#nullable disable
|
||||
);
|
||||
__builder2.CloseElement();
|
||||
__builder2.AddMarkupContent(7, "\r\n ");
|
||||
}
|
||||
));
|
||||
__builder.CloseComponent();
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ Document -
|
|||
LazyIntermediateToken - (89:2,28 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html - 1
|
||||
CSharpExpression - (93:2,32 [23] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (93:2,32 [23] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - item.ToLowerInvariant()
|
||||
HtmlContent - (129:2,68 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (129:2,68 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
ComponentAttribute - (21:0,21 [3] x:\dir\subdir\Test\TestComponent.cshtml) - MyAttr - MyAttr - AttributeStructure.DoubleQuotes
|
||||
HtmlContent - (21:0,21 [3] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (21:0,21 [3] x:\dir\subdir\Test\TestComponent.cshtml) - Html - abc
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ using Microsoft.AspNetCore.Components;
|
|||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.AddMarkupContent(0, "<h1>Item1</h1>\r\n");
|
||||
__builder.AddMarkupContent(0, "<h1>Item1</h1>");
|
||||
#nullable restore
|
||||
#line 6 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
foreach (var item2 in Items2)
|
||||
|
|
@ -28,10 +28,8 @@ using Microsoft.AspNetCore.Components;
|
|||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
__builder.AddContent(1, " ");
|
||||
__builder.OpenElement(2, "p");
|
||||
__builder.AddMarkupContent(3, "\r\n ");
|
||||
__builder.AddContent(4,
|
||||
__builder.OpenElement(1, "p");
|
||||
__builder.AddContent(2,
|
||||
#nullable restore
|
||||
#line 9 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
ChildContent(item2)
|
||||
|
|
@ -40,9 +38,8 @@ using Microsoft.AspNetCore.Components;
|
|||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder.AddMarkupContent(5, ";\r\n ");
|
||||
__builder.AddMarkupContent(3, ";\r\n ");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(6, "\r\n");
|
||||
#nullable restore
|
||||
#line 11 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,21 +7,14 @@ Document -
|
|||
UsingDirective - (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase - - TItem1, TItem2
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupBlock - - <h1>Item1</h1>\n
|
||||
MarkupBlock - - <h1>Item1</h1>
|
||||
CSharpCode - (98:5,1 [34] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (98:5,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item2 in Items2)\n{\n
|
||||
HtmlContent - (132:7,0 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (132:7,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
MarkupElement - (136:7,4 [40] x:\dir\subdir\Test\TestComponent.cshtml) - p
|
||||
HtmlContent - (139:7,7 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (139:7,7 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
LazyIntermediateToken - (141:8,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
CSharpExpression - (146:8,5 [19] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (146:8,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ChildContent(item2)
|
||||
HtmlContent - (165:8,24 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (165:8,24 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Html - ;\n
|
||||
HtmlContent - (176:9,8 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (176:9,8 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (178:10,0 [3] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (178:10,0 [3] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - }\n
|
||||
CSharpCode - (188:11,7 [185] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (98:5,1 [34] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|foreach (var item2 in Items2)
|
||||
{
|
||||
|
|
||||
Generated Location: (783:26,1 [34] )
|
||||
Generated Location: (779:24,1 [34] )
|
||||
|foreach (var item2 in Items2)
|
||||
{
|
||||
|
|
||||
|
|
@ -10,7 +10,7 @@ Generated Location: (783:26,1 [34] )
|
|||
Source Location: (178:10,0 [3] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|}
|
||||
|
|
||||
Generated Location: (1432:51,0 [3] )
|
||||
Generated Location: (1274:46,0 [3] )
|
||||
|}
|
||||
|
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ Source Location: (188:11,7 [185] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
[Parameter] public List<TItem2> Items2 { get; set; }
|
||||
[Parameter] public RenderFragment<TItem2> ChildContent { get; set; }
|
||||
|
|
||||
Generated Location: (1612:60,7 [185] )
|
||||
Generated Location: (1454:55,7 [185] )
|
||||
|
|
||||
[Parameter] public TItem1 Item1 { get; set; }
|
||||
[Parameter] public List<TItem2> Items2 { get; set; }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "parent");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "child");
|
||||
__builder.AddContent(3, " ");
|
||||
__builder.AddContent(4,
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
DateTime.Now
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder.AddContent(5, " ");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(6, "\r\n");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(7, "\r\n\r\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [14] ) - System
|
||||
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [19] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (0:0,0 [55] x:\dir\subdir\Test\TestComponent.cshtml) - parent
|
||||
HtmlContent - (8:0,8 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (8:0,8 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (14:1,4 [30] x:\dir\subdir\Test\TestComponent.cshtml) - child
|
||||
HtmlContent - (21:1,11 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (21:1,11 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
CSharpExpression - (23:1,13 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (23:1,13 [12] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - DateTime.Now
|
||||
HtmlContent - (35:1,25 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (35:1,25 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
HtmlContent - (44:1,34 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (44:1,34 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
HtmlContent - (55:2,9 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (55:2,9 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "parent");
|
||||
__builder.OpenElement(1, "child");
|
||||
__builder.AddContent(2,
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
DateTime.Now
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder.CloseElement();
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [14] ) - System
|
||||
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [19] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (29:2,0 [55] x:\dir\subdir\Test\TestComponent.cshtml) - parent
|
||||
MarkupElement - (43:3,4 [30] x:\dir\subdir\Test\TestComponent.cshtml) - child
|
||||
CSharpExpression - (52:3,13 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (52:3,13 [12] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - DateTime.Now
|
||||
|
|
@ -15,7 +15,6 @@ namespace Test
|
|||
{
|
||||
__builder.OpenComponent<Test.Counter>(0);
|
||||
__builder.CloseComponent();
|
||||
__builder.AddMarkupContent(1, "\r\n");
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
if (true)
|
||||
|
|
@ -25,7 +24,7 @@ namespace Test
|
|||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
__builder.AddContent(2, "This text is rendered");
|
||||
__builder.AddContent(1, "This text is rendered");
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
Component - (0:0,0 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Counter
|
||||
HtmlContent - (11:0,11 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (11:0,11 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (14:1,1 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (14:1,1 [18] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - if (true)\n{\n
|
||||
HtmlContent - (38:3,10 [21] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (14:1,1 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|if (true)
|
||||
{
|
||||
|
|
||||
Generated Location: (733:20,1 [18] )
|
||||
Generated Location: (681:19,1 [18] )
|
||||
|if (true)
|
||||
{
|
||||
|
|
||||
|
|
@ -11,7 +11,7 @@ Source Location: (66:3,38 [5] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
}
|
||||
|
|
||||
Generated Location: (974:30,38 [5] )
|
||||
Generated Location: (922:29,38 [5] )
|
||||
|
|
||||
}
|
||||
|
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ namespace Test
|
|||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.AddMarkupContent(0, "<!DOCTYPE html>\r\n");
|
||||
__builder.AddMarkupContent(1, "<div>\r\n</div>");
|
||||
__builder.AddMarkupContent(0, "<!DOCTYPE html>\r\n<div></div>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,4 @@ Document -
|
|||
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
HtmlContent - (0:0,0 [17] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (0:0,0 [17] x:\dir\subdir\Test\TestComponent.cshtml) - Html - <!DOCTYPE html>\n
|
||||
MarkupBlock - - <div>\n</div>
|
||||
MarkupBlock - - <!DOCTYPE html>\n<div></div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "ul");
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
__builder.OpenElement(1, "li");
|
||||
__builder.AddContent(2,
|
||||
#nullable restore
|
||||
#line 7 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
item
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder.CloseElement();
|
||||
#nullable restore
|
||||
#line 9 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [14] ) - System
|
||||
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [19] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (29:2,0 [126] x:\dir\subdir\Test\TestComponent.cshtml) - ul
|
||||
CSharpCode - (35:3,0 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (35:3,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp -
|
||||
CSharpCode - (40:3,5 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (40:3,5 [55] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item in Enumerable.Range(1, 100))\n {\n
|
||||
MarkupElement - (103:5,8 [38] x:\dir\subdir\Test\TestComponent.cshtml) - li
|
||||
CSharpExpression - (122:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (122:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - item
|
||||
CSharpCode - (143:8,0 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (143:8,0 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - }\n
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
Source Location: (40:3,5 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
|
||||
Generated Location: (634:18,5 [55] )
|
||||
|foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
|
||||
|
||||
Source Location: (143:8,0 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
| }
|
||||
|
|
||||
Generated Location: (1086:37,0 [7] )
|
||||
| }
|
||||
|
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
public partial class TestComponent : Microsoft.AspNetCore.Components.ComponentBase
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.AddMarkupContent(0, "\r\n");
|
||||
__builder.OpenElement(1, "ul");
|
||||
__builder.AddMarkupContent(2, "\r\n");
|
||||
#nullable restore
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
__builder.AddContent(3, " ");
|
||||
__builder.OpenElement(4, "li");
|
||||
__builder.AddMarkupContent(5, "\r\n ");
|
||||
__builder.AddContent(6,
|
||||
#nullable restore
|
||||
#line 7 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
item
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder.AddMarkupContent(7, "\r\n ");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(8, "\r\n");
|
||||
#nullable restore
|
||||
#line 9 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(9, "\r\n\r\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (3:1,1 [14] ) - System
|
||||
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [19] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
|
||||
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
HtmlContent - (26:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (26:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (28:2,0 [126] x:\dir\subdir\Test\TestComponent.cshtml) - ul
|
||||
HtmlContent - (32:2,4 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (32:2,4 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (34:3,0 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (34:3,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp -
|
||||
CSharpCode - (39:3,5 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (39:3,5 [55] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item in Enumerable.Range(1, 100))\n {\n
|
||||
HtmlContent - (94:5,0 [8] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (94:5,0 [8] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
MarkupElement - (102:5,8 [38] x:\dir\subdir\Test\TestComponent.cshtml) - li
|
||||
HtmlContent - (106:5,12 [14] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (106:5,12 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
LazyIntermediateToken - (108:6,0 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Html -
|
||||
CSharpExpression - (121:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (121:6,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - item
|
||||
HtmlContent - (125:6,17 [10] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (125:6,17 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
HtmlContent - (140:7,13 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (140:7,13 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (142:8,0 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (142:8,0 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - }\n
|
||||
HtmlContent - (154:9,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (154:9,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
Source Location: (39:3,5 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
|foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
|
||||
Generated Location: (738:20,5 [55] )
|
||||
|foreach (var item in Enumerable.Range(1, 100))
|
||||
{
|
||||
|
|
||||
|
||||
Source Location: (142:8,0 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
| }
|
||||
|
|
||||
Generated Location: (1416:43,0 [7] )
|
||||
| }
|
||||
|
|
||||
|
||||
|
|
@ -21,11 +21,10 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "input");
|
||||
__builder.AddAttribute(3, "type", "text");
|
||||
__builder.AddAttribute(4, "Value", "17");
|
||||
__builder.AddAttribute(5, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
|
||||
__builder.OpenElement(1, "input");
|
||||
__builder.AddAttribute(2, "type", "text");
|
||||
__builder.AddAttribute(3, "Value", "17");
|
||||
__builder.AddAttribute(4, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
text
|
||||
|
|
@ -34,10 +33,9 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
#line hidden
|
||||
#nullable disable
|
||||
));
|
||||
__builder.AddAttribute(6, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text));
|
||||
__builder.AddAttribute(5, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text));
|
||||
__builder.SetUpdatesAttributeName("value");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(7, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (44:1,0 [69] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
HtmlContent - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (53:2,2 [52] x:\dir\subdir\Test\TestComponent.cshtml) - input
|
||||
HtmlAttribute - - type=" - "
|
||||
HtmlAttributeValue - (66:2,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) -
|
||||
|
|
@ -28,7 +26,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value,
|
||||
IntermediateToken - - CSharp - text
|
||||
IntermediateToken - - CSharp - )
|
||||
HtmlContent - (105:2,54 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (105:2,54 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (127:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (127:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private string text = "hi";\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (127:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
private string text = "hi";
|
||||
|
|
||||
Generated Location: (1704:45,12 [35] )
|
||||
Generated Location: (1598:43,12 [35] )
|
||||
|
|
||||
private string text = "hi";
|
||||
|
|
||||
|
|
|
|||
|
|
@ -14,15 +14,13 @@ namespace Test
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "a");
|
||||
__builder.AddAttribute(3, "href", "/cool-url");
|
||||
__builder.AddAttribute(4, "style", true);
|
||||
__builder.AddAttribute(5, "disabled", true);
|
||||
__builder.AddAttribute(6, "href", "/even-cooler-url");
|
||||
__builder.AddContent(7, "Learn the ten cool tricks your compiler author will hate!");
|
||||
__builder.OpenElement(1, "a");
|
||||
__builder.AddAttribute(2, "href", "/cool-url");
|
||||
__builder.AddAttribute(3, "style", true);
|
||||
__builder.AddAttribute(4, "disabled", true);
|
||||
__builder.AddAttribute(5, "href", "/even-cooler-url");
|
||||
__builder.AddContent(6, "Learn the ten cool tricks your compiler author will hate!");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(8, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (0:0,0 [140] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (9:1,2 [123] x:\dir\subdir\Test\TestComponent.cshtml) - a
|
||||
HtmlAttribute - (11:1,4 [17] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
|
||||
HtmlAttributeValue - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) -
|
||||
|
|
@ -21,5 +19,3 @@ Document -
|
|||
LazyIntermediateToken - (53:1,46 [16] x:\dir\subdir\Test\TestComponent.cshtml) - Html - /even-cooler-url
|
||||
HtmlContent - (71:1,64 [57] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (71:1,64 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
|
||||
HtmlContent - (132:1,125 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (132:1,125 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "input");
|
||||
__builder.AddAttribute(3, "type", "text");
|
||||
__builder.AddAttribute(4, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this,
|
||||
__builder.OpenElement(1, "input");
|
||||
__builder.AddAttribute(2, "type", "text");
|
||||
__builder.AddAttribute(3, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.ChangeEventArgs>(this,
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
() => {}
|
||||
|
|
@ -33,7 +32,7 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
#line hidden
|
||||
#nullable disable
|
||||
));
|
||||
__builder.AddAttribute(5, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
|
||||
__builder.AddAttribute(4, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
text
|
||||
|
|
@ -42,10 +41,9 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
#line hidden
|
||||
#nullable disable
|
||||
));
|
||||
__builder.AddAttribute(6, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text));
|
||||
__builder.AddAttribute(5, "oninput", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text));
|
||||
__builder.SetUpdatesAttributeName("value");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(7, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (44:1,0 [112] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
HtmlContent - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (53:2,2 [95] x:\dir\subdir\Test\TestComponent.cshtml) - input
|
||||
HtmlAttribute - - type=" - "
|
||||
HtmlAttributeValue - (66:2,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) -
|
||||
|
|
@ -30,7 +28,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value,
|
||||
IntermediateToken - - CSharp - text
|
||||
IntermediateToken - - CSharp - )
|
||||
HtmlContent - (148:2,97 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (148:2,97 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (170:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (170:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private string text = "hi";\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (170:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
private string text = "hi";
|
||||
|
|
||||
Generated Location: (2036:53,12 [35] )
|
||||
Generated Location: (1930:51,12 [35] )
|
||||
|
|
||||
private string text = "hi";
|
||||
|
|
||||
|
|
|
|||
|
|
@ -21,11 +21,10 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "input");
|
||||
__builder.AddAttribute(3, "type", "text");
|
||||
__builder.AddAttribute(4, "value", "17");
|
||||
__builder.AddAttribute(5, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
|
||||
__builder.OpenElement(1, "input");
|
||||
__builder.AddAttribute(2, "type", "text");
|
||||
__builder.AddAttribute(3, "value", "17");
|
||||
__builder.AddAttribute(4, "value", Microsoft.AspNetCore.Components.BindConverter.FormatValue(
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
text
|
||||
|
|
@ -34,10 +33,9 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
#line hidden
|
||||
#nullable disable
|
||||
));
|
||||
__builder.AddAttribute(6, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text));
|
||||
__builder.AddAttribute(5, "onchange", Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value, text));
|
||||
__builder.SetUpdatesAttributeName("value");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(7, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (44:1,0 [69] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
HtmlContent - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (53:2,2 [52] x:\dir\subdir\Test\TestComponent.cshtml) - input
|
||||
HtmlAttribute - - type=" - "
|
||||
HtmlAttributeValue - (66:2,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) -
|
||||
|
|
@ -28,7 +26,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.CreateBinder(this, __value => text = __value,
|
||||
IntermediateToken - - CSharp - text
|
||||
IntermediateToken - - CSharp - )
|
||||
HtmlContent - (105:2,54 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (105:2,54 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (127:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (127:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private string text = "hi";\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (127:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
private string text = "hi";
|
||||
|
|
||||
Generated Location: (1704:45,12 [35] )
|
||||
Generated Location: (1598:43,12 [35] )
|
||||
|
|
||||
private string text = "hi";
|
||||
|
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "a");
|
||||
__builder.AddAttribute(3, "onclick", "test()");
|
||||
__builder.AddAttribute(4, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
|
||||
__builder.OpenElement(1, "a");
|
||||
__builder.AddAttribute(2, "onclick", "test()");
|
||||
__builder.AddAttribute(3, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
() => {}
|
||||
|
|
@ -33,9 +32,8 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
#line hidden
|
||||
#nullable disable
|
||||
));
|
||||
__builder.AddContent(5, "Learn the ten cool tricks your compiler author will hate!");
|
||||
__builder.AddContent(4, "Learn the ten cool tricks your compiler author will hate!");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(6, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (44:1,0 [118] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
HtmlContent - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (53:2,2 [101] x:\dir\subdir\Test\TestComponent.cshtml) - a
|
||||
HtmlContent - (93:2,42 [57] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (93:2,42 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
|
||||
|
|
@ -22,5 +20,3 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
|
||||
LazyIntermediateToken - (83:2,32 [8] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - () => {}
|
||||
IntermediateToken - - CSharp - )
|
||||
HtmlContent - (154:2,103 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (154:2,103 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
|
|
|
|||
|
|
@ -14,16 +14,14 @@ namespace Test
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "a");
|
||||
__builder.AddAttribute(3, "href", "/cool-url");
|
||||
__builder.AddAttribute(4, "style", true);
|
||||
__builder.AddAttribute(5, "disabled", true);
|
||||
__builder.AddAttribute(6, "href", "/even-cooler-url");
|
||||
__builder.AddAttribute(7, "href", true);
|
||||
__builder.AddContent(8, "Learn the ten cool tricks your compiler author will hate!");
|
||||
__builder.OpenElement(1, "a");
|
||||
__builder.AddAttribute(2, "href", "/cool-url");
|
||||
__builder.AddAttribute(3, "style", true);
|
||||
__builder.AddAttribute(4, "disabled", true);
|
||||
__builder.AddAttribute(5, "href", "/even-cooler-url");
|
||||
__builder.AddAttribute(6, "href", true);
|
||||
__builder.AddContent(7, "Learn the ten cool tricks your compiler author will hate!");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(9, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (0:0,0 [145] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
HtmlContent - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (5:0,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (9:1,2 [128] x:\dir\subdir\Test\TestComponent.cshtml) - a
|
||||
HtmlAttribute - (11:1,4 [17] x:\dir\subdir\Test\TestComponent.cshtml) - href=" - "
|
||||
HtmlAttributeValue - (18:1,11 [9] x:\dir\subdir\Test\TestComponent.cshtml) -
|
||||
|
|
@ -22,5 +20,3 @@ Document -
|
|||
HtmlAttribute - (70:1,63 [5] x:\dir\subdir\Test\TestComponent.cshtml) - href -
|
||||
HtmlContent - (76:1,69 [57] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (76:1,69 [57] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Learn the ten cool tricks your compiler author will hate!
|
||||
HtmlContent - (137:1,130 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (137:1,130 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
|
|
|
|||
|
|
@ -21,9 +21,8 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "input");
|
||||
__builder.AddAttribute(3, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
|
||||
__builder.OpenElement(1, "input");
|
||||
__builder.AddAttribute(2, "onclick", Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
OnClick
|
||||
|
|
@ -33,7 +32,6 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
#nullable disable
|
||||
));
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(4, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -9,15 +9,11 @@ Document -
|
|||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
MarkupElement - (44:1,0 [43] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
HtmlContent - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (49:1,5 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (53:2,2 [26] x:\dir\subdir\Test\TestComponent.cshtml) - input
|
||||
HtmlAttribute - (70:2,19 [7] x:\dir\subdir\Test\TestComponent.cshtml) - onclick=" - "
|
||||
CSharpExpressionAttributeValue - -
|
||||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Components.EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this,
|
||||
LazyIntermediateToken - (70:2,19 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - OnClick
|
||||
IntermediateToken - - CSharp - )
|
||||
HtmlContent - (79:2,28 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (79:2,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (96:4,7 [31] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (96:4,7 [31] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n void OnClick() {\n }\n
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Source Location: (96:4,7 [31] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
void OnClick() {
|
||||
}
|
||||
|
|
||||
Generated Location: (1417:41,7 [31] )
|
||||
Generated Location: (1311:39,7 [31] )
|
||||
|
|
||||
void OnClick() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,8 @@ namespace Test
|
|||
#line hidden
|
||||
#nullable disable
|
||||
, 2, (context) => (__builder2) => {
|
||||
__builder2.AddMarkupContent(3, "\r\n ");
|
||||
__builder2.OpenElement(4, "div");
|
||||
__builder2.AddContent(5,
|
||||
__builder2.OpenElement(3, "div");
|
||||
__builder2.AddContent(4,
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
context.ToLower()
|
||||
|
|
@ -34,7 +33,6 @@ namespace Test
|
|||
#nullable disable
|
||||
);
|
||||
__builder2.CloseElement();
|
||||
__builder2.AddMarkupContent(6, "\r\n");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,13 +9,9 @@ Document -
|
|||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
Component - (0:0,0 [87] x:\dir\subdir\Test\TestComponent.cshtml) - Test.MyComponent
|
||||
ComponentChildContent - - ChildContent - context
|
||||
HtmlContent - (33:0,33 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (33:0,33 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (37:1,2 [29] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
CSharpExpression - (43:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (43:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - context.ToLower()
|
||||
HtmlContent - (66:1,31 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (66:1,31 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
ComponentAttribute - (24:0,24 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Item - Item - AttributeStructure.DoubleQuotes
|
||||
CSharpExpression - (25:0,25 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (26:0,26 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "hi"
|
||||
|
|
|
|||
|
|
@ -14,9 +14,37 @@ namespace Test
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenComponent<Test.SomeOtherComponent>(0);
|
||||
__builder.AddAttribute(1, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => {
|
||||
__builder2.OpenElement(2, "h1");
|
||||
__builder2.AddContent(3, "Child content at ");
|
||||
__builder2.AddContent(4,
|
||||
#nullable restore
|
||||
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
DateTime.Now
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder2.CloseElement();
|
||||
__builder2.AddMarkupContent(5, "\r\n ");
|
||||
__builder2.OpenElement(6, "p");
|
||||
__builder2.AddContent(7, "Very ");
|
||||
__builder2.AddContent(8,
|
||||
#nullable restore
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
"good"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder2.CloseElement();
|
||||
}
|
||||
));
|
||||
__builder.CloseComponent();
|
||||
__builder.AddMarkupContent(1, "\r\n\r\n");
|
||||
__builder.AddMarkupContent(2, "<h1>Hello</h1>");
|
||||
__builder.AddMarkupContent(9, "\r\n\r\n");
|
||||
__builder.AddMarkupContent(10, "<h1>Hello</h1>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,20 @@ Document -
|
|||
UsingDirective - (104:5,1 [39] ) - Microsoft.AspNetCore.Components
|
||||
ClassDeclaration - - public partial - TestComponent - Microsoft.AspNetCore.Components.ComponentBase -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
Component - (0:0,0 [22] x:\dir\subdir\Test\TestComponent.cshtml) - SomeOtherComponent
|
||||
HtmlContent - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (22:0,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
Component - (0:0,0 [115] x:\dir\subdir\Test\TestComponent.cshtml) - SomeOtherComponent
|
||||
ComponentChildContent - - ChildContent - context
|
||||
MarkupElement - (26:1,4 [39] x:\dir\subdir\Test\TestComponent.cshtml) - h1
|
||||
HtmlContent - (30:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (30:1,8 [17] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Child content at
|
||||
CSharpExpression - (48:1,26 [12] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (48:1,26 [12] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - DateTime.Now
|
||||
HtmlContent - (65:1,43 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (65:1,43 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
MarkupElement - (71:2,4 [21] x:\dir\subdir\Test\TestComponent.cshtml) - p
|
||||
HtmlContent - (74:2,7 [5] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (74:2,7 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Very
|
||||
CSharpExpression - (81:2,14 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (81:2,14 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "good"
|
||||
HtmlContent - (115:3,21 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (115:3,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
MarkupBlock - - <h1>Hello</h1>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ namespace Test
|
|||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder.AddMarkupContent(2, " ");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
|
|
@ -12,4 +12,3 @@ Document -
|
|||
MarkupElement - (44:3,0 [38] x:\dir\subdir\Test\TestComponent.cshtml) - div
|
||||
CSharpExpression - (50:3,6 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (50:3,6 [7] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - myValue
|
||||
MarkupBlock - -
|
||||
|
|
|
|||
|
|
@ -45,8 +45,7 @@ namespace Test
|
|||
#nullable disable
|
||||
__builder.OpenComponent<Test.MyComponent>(3);
|
||||
__builder.AddAttribute(4, "ChildContent", (Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => {
|
||||
__builder2.AddMarkupContent(5, "\r\n");
|
||||
__builder2.AddContent(6,
|
||||
__builder2.AddContent(5,
|
||||
#nullable restore
|
||||
#line 5 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
"hello, world!"
|
||||
|
|
@ -55,7 +54,6 @@ namespace Test
|
|||
#line hidden
|
||||
#nullable disable
|
||||
);
|
||||
__builder2.AddMarkupContent(7, "\r\n");
|
||||
}
|
||||
));
|
||||
__builder.CloseComponent();
|
||||
|
|
|
|||
|
|
@ -19,11 +19,7 @@ Document -
|
|||
LazyIntermediateToken - (93:1,89 [3] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ;\n
|
||||
Component - (99:3,0 [49] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent
|
||||
ComponentChildContent - - ChildContent - context
|
||||
HtmlContent - (112:3,13 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (112:3,13 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpExpression - (116:4,2 [15] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (116:4,2 [15] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "hello, world!"
|
||||
HtmlContent - (132:4,18 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (132:4,18 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (159:7,7 [76] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
LazyIntermediateToken - (159:7,7 [76] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n class Person\n {\n public string Name { get; set; }\n }\n
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Source Location: (159:7,7 [76] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
public string Name { get; set; }
|
||||
}
|
||||
|
|
||||
Generated Location: (2207:65,7 [76] )
|
||||
Generated Location: (2093:63,7 [76] )
|
||||
|
|
||||
class Person
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,13 +14,11 @@ namespace Test
|
|||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
__builder.OpenElement(0, "div");
|
||||
__builder.AddMarkupContent(1, "\r\n ");
|
||||
__builder.OpenElement(2, "script");
|
||||
__builder.AddAttribute(3, "src", "some/url.js");
|
||||
__builder.AddAttribute(4, "anotherattribute", true);
|
||||
__builder.AddMarkupContent(5, "\r\n some text\r\n some more text\r\n ");
|
||||
__builder.OpenElement(1, "script");
|
||||
__builder.AddAttribute(2, "src", "some/url.js");
|
||||
__builder.AddAttribute(3, "anotherattribute", true);
|
||||
__builder.AddMarkupContent(4, "\r\n some text\r\n some more text\r\n ");
|
||||
__builder.CloseElement();
|
||||
__builder.AddMarkupContent(6, "\r\n");
|
||||
__builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue