In Razor compilation, trim leading and trailing whitespace nodes (#586)
* In Razor compilation, trim leading and trailing whitespace * Update all unit tests to account for whitespace trimming * Recognize that TagHelperIntermediateNode produces output too * Skip TrimWhitespacePass during first phase of two-phase compile * Skip TrimWhitespacePass during design-time builds * Update baselines after rebase
This commit is contained in:
parent
c152ed9e2a
commit
60dcc6e568
|
|
@ -63,7 +63,14 @@ namespace Microsoft.AspNetCore.Blazor.Razor
|
|||
|
||||
builder.Features.Add(new ConfigureBlazorCodeGenerationOptions());
|
||||
|
||||
var isDeclarationOnlyCompile = builder.Configuration.ConfigurationName == DeclarationConfiguration.ConfigurationName;
|
||||
|
||||
// Blazor-specific passes, in order.
|
||||
if (!isDeclarationOnlyCompile)
|
||||
{
|
||||
// There's no benefit in this optimization during the declaration-only compile
|
||||
builder.Features.Add(new TrimWhitespacePass());
|
||||
}
|
||||
builder.Features.Add(new ComponentDocumentClassifierPass());
|
||||
builder.Features.Add(new ComplexAttributeContentPass());
|
||||
builder.Features.Add(new BindLoweringPass());
|
||||
|
|
@ -75,7 +82,7 @@ namespace Microsoft.AspNetCore.Blazor.Razor
|
|||
builder.Features.Add(new BindTagHelperDescriptorProvider());
|
||||
builder.Features.Add(new EventHandlerTagHelperDescriptorProvider());
|
||||
|
||||
if (builder.Configuration.ConfigurationName == DeclarationConfiguration.ConfigurationName)
|
||||
if (isDeclarationOnlyCompile)
|
||||
{
|
||||
// This is for 'declaration only' processing. We don't want to try and emit any method bodies during
|
||||
// the design time build because we can't do it correctly until the set of components is known.
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ namespace Microsoft.AspNetCore.Blazor.Razor
|
|||
/// </summary>
|
||||
public static readonly string ComponentDocumentKind = "Blazor.Component";
|
||||
|
||||
private static readonly object BuildRenderTreeBaseCallAnnotation = new object();
|
||||
|
||||
private static readonly char[] PathSeparators = new char[] { '/', '\\' };
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -42,6 +44,9 @@ namespace Microsoft.AspNetCore.Blazor.Razor
|
|||
/// </summary>
|
||||
public bool MangleClassNames { get; set; } = false;
|
||||
|
||||
internal static bool IsBuildRenderTreeBaseCall(CSharpCodeIntermediateNode node)
|
||||
=> node.Annotations[BuildRenderTreeBaseCallAnnotation] != null;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string DocumentKind => ComponentDocumentKind;
|
||||
|
||||
|
|
@ -98,6 +103,7 @@ namespace Microsoft.AspNetCore.Blazor.Razor
|
|||
|
||||
// We need to call the 'base' method as the first statement.
|
||||
var callBase = new CSharpCodeIntermediateNode();
|
||||
callBase.Annotations.Add(BuildRenderTreeBaseCallAnnotation, true);
|
||||
callBase.Children.Add(new IntermediateToken
|
||||
{
|
||||
Kind = TokenKind.CSharp,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,100 @@
|
|||
// 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 Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.Language.Intermediate;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Blazor.Razor
|
||||
{
|
||||
internal class TrimWhitespacePass : IntermediateNodePassBase, IRazorDirectiveClassifierPass
|
||||
{
|
||||
protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode)
|
||||
{
|
||||
if (codeDocument == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(codeDocument));
|
||||
}
|
||||
|
||||
if (documentNode == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(documentNode));
|
||||
}
|
||||
|
||||
// There's no benefit running the whitespace trimmer during design-time builds
|
||||
if (!documentNode.Options.DesignTime)
|
||||
{
|
||||
var method = documentNode.FindPrimaryMethod();
|
||||
if (method != null)
|
||||
{
|
||||
RemoveContiguousWhitespace(method.Children, TraversalDirection.Forwards);
|
||||
RemoveContiguousWhitespace(method.Children, TraversalDirection.Backwards);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void RemoveContiguousWhitespace(IntermediateNodeCollection nodes, TraversalDirection direction)
|
||||
{
|
||||
var position = direction == TraversalDirection.Forwards ? 0 : nodes.Count - 1;
|
||||
while (position >= 0 && position < nodes.Count)
|
||||
{
|
||||
var node = nodes[position];
|
||||
bool shouldRemoveNode;
|
||||
bool shouldContinueIteration;
|
||||
|
||||
switch (node)
|
||||
{
|
||||
case IntermediateToken intermediateToken:
|
||||
shouldRemoveNode = string.IsNullOrWhiteSpace(intermediateToken.Content);
|
||||
shouldContinueIteration = shouldRemoveNode;
|
||||
break;
|
||||
|
||||
case HtmlContentIntermediateNode htmlContentIntermediateNode:
|
||||
RemoveContiguousWhitespace(htmlContentIntermediateNode.Children, direction);
|
||||
shouldRemoveNode = htmlContentIntermediateNode.Children.Count == 0;
|
||||
shouldContinueIteration = shouldRemoveNode;
|
||||
break;
|
||||
|
||||
case CSharpExpressionIntermediateNode _:
|
||||
case TagHelperIntermediateNode _:
|
||||
// These node types may produce non-whitespace output at runtime
|
||||
shouldRemoveNode = false;
|
||||
shouldContinueIteration = false;
|
||||
break;
|
||||
|
||||
case CSharpCodeIntermediateNode codeIntermediateNode:
|
||||
shouldRemoveNode = false;
|
||||
shouldContinueIteration = ComponentDocumentClassifierPass.IsBuildRenderTreeBaseCall(codeIntermediateNode);
|
||||
break;
|
||||
|
||||
default:
|
||||
shouldRemoveNode = false;
|
||||
shouldContinueIteration = true; // Because other types of nodes don't produce output
|
||||
break;
|
||||
}
|
||||
|
||||
if (shouldRemoveNode)
|
||||
{
|
||||
nodes.RemoveAt(position);
|
||||
if (direction == TraversalDirection.Forwards)
|
||||
{
|
||||
position--;
|
||||
}
|
||||
}
|
||||
|
||||
position += direction == TraversalDirection.Forwards ? 1 : -1;
|
||||
|
||||
if (!shouldContinueIteration)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum TraversalDirection
|
||||
{
|
||||
Forwards,
|
||||
Backwards
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -45,8 +45,7 @@ namespace Test
|
|||
frames,
|
||||
frame => AssertFrame.Component(frame, "Test.MyComponent", 3, 0),
|
||||
frame => AssertFrame.Attribute(frame, "Value", 42, 1),
|
||||
frame => AssertFrame.Attribute(frame, "ValueChanged", typeof(Action<int>), 2),
|
||||
frame => AssertFrame.Whitespace(frame, 3));
|
||||
frame => AssertFrame.Attribute(frame, "ValueChanged", typeof(Action<int>), 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -82,8 +81,7 @@ namespace Test
|
|||
frames,
|
||||
frame => AssertFrame.Component(frame, "Test.MyComponent", 3, 0),
|
||||
frame => AssertFrame.Attribute(frame, "Value", 42, 1),
|
||||
frame => AssertFrame.Attribute(frame, "ValueChanged", typeof(UIEventHandler), 2),
|
||||
frame => AssertFrame.Whitespace(frame, 3));
|
||||
frame => AssertFrame.Attribute(frame, "ValueChanged", typeof(UIEventHandler), 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -119,8 +117,7 @@ namespace Test
|
|||
frames,
|
||||
frame => AssertFrame.Component(frame, "Test.MyComponent", 3, 0),
|
||||
frame => AssertFrame.Attribute(frame, "Value", 42, 1),
|
||||
frame => AssertFrame.Attribute(frame, "OnChanged", typeof(Action<int>), 2),
|
||||
frame => AssertFrame.Whitespace(frame, 3));
|
||||
frame => AssertFrame.Attribute(frame, "OnChanged", typeof(Action<int>), 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -156,8 +153,7 @@ namespace Test
|
|||
frames,
|
||||
frame => AssertFrame.Component(frame, "Test.MyComponent", 3, 0),
|
||||
frame => AssertFrame.Attribute(frame, "Value", 42, 1),
|
||||
frame => AssertFrame.Attribute(frame, "OnChanged", typeof(UIEventHandler), 2),
|
||||
frame => AssertFrame.Whitespace(frame, 3));
|
||||
frame => AssertFrame.Attribute(frame, "OnChanged", typeof(UIEventHandler), 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -191,8 +187,7 @@ namespace Test
|
|||
frames,
|
||||
frame => AssertFrame.Element(frame, "div", 3, 0),
|
||||
frame => AssertFrame.Attribute(frame, "myvalue", "hi", 1),
|
||||
frame => AssertFrame.Attribute(frame, "myevent", typeof(UIEventHandler), 2),
|
||||
frame => AssertFrame.Whitespace(frame, 3));
|
||||
frame => AssertFrame.Attribute(frame, "myevent", typeof(UIEventHandler), 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -226,8 +221,7 @@ namespace Test
|
|||
frames,
|
||||
frame => AssertFrame.Element(frame, "div", 3, 0),
|
||||
frame => AssertFrame.Attribute(frame, "myvalue", "hi", 1),
|
||||
frame => AssertFrame.Attribute(frame, "myevent", typeof(UIEventHandler), 2),
|
||||
frame => AssertFrame.Whitespace(frame, 3));
|
||||
frame => AssertFrame.Attribute(frame, "myevent", typeof(UIEventHandler), 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -284,8 +278,7 @@ namespace Test
|
|||
frames,
|
||||
frame => AssertFrame.Element(frame, "input", 3, 0),
|
||||
frame => AssertFrame.Attribute(frame, "value", "42", 1),
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 2),
|
||||
frame => AssertFrame.Whitespace(frame, 3));
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -308,8 +301,7 @@ namespace Test
|
|||
frame => AssertFrame.Element(frame, "input", 4, 0),
|
||||
frame => AssertFrame.Attribute(frame, "type", "text", 1),
|
||||
frame => AssertFrame.Attribute(frame, "value", new DateTime(2018, 1, 1).ToString("MM/dd/yyyy"), 2),
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3),
|
||||
frame => AssertFrame.Whitespace(frame, 4));
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -334,8 +326,7 @@ namespace Test
|
|||
frame => AssertFrame.Element(frame, "input", 4, 0),
|
||||
frame => AssertFrame.Attribute(frame, "type", "text", 1),
|
||||
frame => AssertFrame.Attribute(frame, "value", new DateTime(2018, 1, 1).ToString("MM/dd/yyyy"), 2),
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3),
|
||||
frame => AssertFrame.Whitespace(frame, 4));
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -358,8 +349,7 @@ namespace Test
|
|||
frame => AssertFrame.Element(frame, "input", 4, 0),
|
||||
frame => AssertFrame.Attribute(frame, "type", "text", 1),
|
||||
frame => AssertFrame.Attribute(frame, "value", "42", 2),
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3),
|
||||
frame => AssertFrame.Whitespace(frame, 4));
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -381,8 +371,7 @@ namespace Test
|
|||
frames,
|
||||
frame => AssertFrame.Element(frame, "input", 3, 0),
|
||||
frame => AssertFrame.Attribute(frame, "type", "checkbox", 1),
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3),
|
||||
frame => AssertFrame.Whitespace(frame, 4));
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -405,8 +394,7 @@ namespace Test
|
|||
frame => AssertFrame.Element(frame, "input", 4, 0),
|
||||
frame => AssertFrame.Attribute(frame, "type", "text", 1),
|
||||
frame => AssertFrame.Attribute(frame, "value", "42", 2),
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3),
|
||||
frame => AssertFrame.Whitespace(frame, 4));
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -429,8 +417,7 @@ namespace Test
|
|||
frame => AssertFrame.Element(frame, "input", 4, 0),
|
||||
frame => AssertFrame.Attribute(frame, "type", "text", 1),
|
||||
frame => AssertFrame.Attribute(frame, "value", new DateTime(2018, 1, 1).ToString("MM/dd"), 2),
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3),
|
||||
frame => AssertFrame.Whitespace(frame, 4));
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 3));
|
||||
}
|
||||
|
||||
[Fact] // Additional coverage of OrphanTagHelperLoweringPass
|
||||
|
|
@ -454,8 +441,7 @@ namespace Test
|
|||
frame => AssertFrame.Attribute(frame, "visible", 1), // This gets reordered in the node writer
|
||||
frame => AssertFrame.Attribute(frame, "type", "text", 2),
|
||||
frame => AssertFrame.Attribute(frame, "value", "42", 3),
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 4),
|
||||
frame => AssertFrame.Whitespace(frame, 5));
|
||||
frame => AssertFrame.Attribute(frame, "onchange", typeof(UIEventHandler), 4));
|
||||
}
|
||||
|
||||
[Fact] // Additional coverage of OrphanTagHelperLoweringPass
|
||||
|
|
@ -483,8 +469,7 @@ namespace Test
|
|||
frame => AssertFrame.Whitespace(frame, 3),
|
||||
frame => AssertFrame.Element(frame, "span", 2, 4),
|
||||
frame => AssertFrame.Text(frame, "42", 5),
|
||||
frame => AssertFrame.Whitespace(frame, 6),
|
||||
frame => AssertFrame.Whitespace(frame, 7));
|
||||
frame => AssertFrame.Whitespace(frame, 6));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
|
|
@ -205,8 +205,7 @@ namespace Test
|
|||
// The handler will have been assigned to a lambda
|
||||
var handler = Assert.IsType<UIMouseEventHandler>(frame.AttributeValue);
|
||||
Assert.Equal("Test.TestComponent", handler.Target.GetType().FullName);
|
||||
},
|
||||
frame => AssertFrame.Whitespace(frame, 2));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -254,8 +253,7 @@ namespace Test
|
|||
var handler = Assert.IsType<UIEventHandler>(frame.AttributeValue);
|
||||
Assert.Equal("Test.TestComponent", handler.Target.GetType().FullName);
|
||||
Assert.Equal("Increment", handler.Method.Name);
|
||||
},
|
||||
frame => AssertFrame.Whitespace(frame, 2));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
frame => AssertFrame.Whitespace(frame, 3),
|
||||
frame => AssertFrame.Text(frame, "123", 4),
|
||||
frame => AssertFrame.Whitespace(frame, 5),
|
||||
frame => AssertFrame.Text(frame, new object().ToString(), 6),
|
||||
frame => AssertFrame.Whitespace(frame, 7));
|
||||
frame => AssertFrame.Text(frame, new object().ToString(), 6));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -71,9 +70,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
Assert.Collection(frames,
|
||||
frame => AssertFrame.Text(frame, "First", 0),
|
||||
frame => AssertFrame.Text(frame, "Second", 0),
|
||||
frame => AssertFrame.Text(frame, "Third", 0),
|
||||
frame => AssertFrame.Whitespace(frame, 1),
|
||||
frame => AssertFrame.Whitespace(frame, 2));
|
||||
frame => AssertFrame.Text(frame, "Third", 0));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -311,8 +308,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
|
||||
((UIEventHandler)frame.AttributeValue)(null);
|
||||
Assert.True((bool)handlerWasCalledProperty.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Whitespace(frame, 2));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -326,8 +322,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
|
||||
// Assert
|
||||
Assert.Collection(frames,
|
||||
frame => AssertFrame.Whitespace(frame, 0),
|
||||
frame => AssertFrame.Text(frame, typeof(List<string>).FullName, 1));
|
||||
frame => AssertFrame.Text(frame, typeof(List<string>).FullName, 0));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -356,8 +351,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
Value = "Modified value"
|
||||
});
|
||||
Assert.Equal("Modified value", myValueProperty.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Text(frame, "\n", 3));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -386,8 +380,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
Value = "Modified value"
|
||||
});
|
||||
Assert.Equal("Modified value", myValueProperty.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Text(frame, "\n", 3));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -417,8 +410,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
Value = newDateValue.ToString()
|
||||
});
|
||||
Assert.Equal(newDateValue, myDateProperty.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Text(frame, "\n", 3));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -448,8 +440,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
Value = new DateTime(2018, 3, 5).ToString(testDateFormat)
|
||||
});
|
||||
Assert.Equal(new DateTime(2018, 3, 5), myDateProperty.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Text(frame, "\n", 3));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact] // In this case, onclick is just a normal HTML attribute
|
||||
|
|
@ -495,8 +486,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
|
||||
func(new UIMouseEventArgs());
|
||||
Assert.True((bool)clicked.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Whitespace(frame, 2));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -528,8 +518,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
|
||||
func(new UIMouseEventArgs());
|
||||
Assert.True((bool)clicked.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Whitespace(frame, 2));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -558,8 +547,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
Value = false
|
||||
});
|
||||
Assert.False((bool)myValueProperty.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Text(frame, "\n", 3));
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -589,8 +577,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
Value = MyEnum.SecondValue.ToString()
|
||||
});
|
||||
Assert.Equal(MyEnum.SecondValue, (MyEnum)myValueProperty.GetValue(component));
|
||||
},
|
||||
frame => AssertFrame.Text(frame, "\n", 3));
|
||||
});
|
||||
}
|
||||
|
||||
public enum MyEnum { FirstValue, SecondValue }
|
||||
|
|
|
|||
|
|
@ -377,6 +377,131 @@ namespace Test
|
|||
some more text
|
||||
</script>
|
||||
</div>
|
||||
");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LeadingWhiteSpace_WithDirective()
|
||||
{
|
||||
// Arrange/Act
|
||||
var generated = CompileToCSharp(@"
|
||||
|
||||
@using System
|
||||
|
||||
<h1>Hello</h1>");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LeadingWhiteSpace_WithCSharpExpression()
|
||||
{
|
||||
// Arrange/Act
|
||||
var generated = CompileToCSharp(@"
|
||||
|
||||
@(""My value"")
|
||||
|
||||
<h1>Hello</h1>");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LeadingWhiteSpace_WithComponent()
|
||||
{
|
||||
// Arrange
|
||||
AdditionalSyntaxTrees.Add(CSharpSyntaxTree.ParseText(@"
|
||||
using Microsoft.AspNetCore.Blazor.Components;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
public class SomeOtherComponent : BlazorComponent
|
||||
{
|
||||
}
|
||||
}
|
||||
"));
|
||||
|
||||
// Act
|
||||
var generated = CompileToCSharp(@"
|
||||
@addTagHelper *, TestAssembly
|
||||
|
||||
<SomeOtherComponent />
|
||||
|
||||
<h1>Hello</h1>");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TrailingWhiteSpace_WithDirective()
|
||||
{
|
||||
// Arrange/Act
|
||||
var generated = CompileToCSharp(@"
|
||||
<h1>Hello</h1>
|
||||
|
||||
@page ""/my/url""
|
||||
|
||||
");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TrailingWhiteSpace_WithCSharpExpression()
|
||||
{
|
||||
// Arrange/Act
|
||||
var generated = CompileToCSharp(@"
|
||||
<h1>Hello</h1>
|
||||
|
||||
@(""My value"")
|
||||
|
||||
");
|
||||
|
||||
// Assert
|
||||
AssertDocumentNodeMatchesBaseline(generated.CodeDocument);
|
||||
AssertCSharpDocumentMatchesBaseline(generated.CodeDocument);
|
||||
CompileToAssembly(generated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TrailingWhiteSpace_WithComponent()
|
||||
{
|
||||
// Arrange
|
||||
AdditionalSyntaxTrees.Add(CSharpSyntaxTree.ParseText(@"
|
||||
using Microsoft.AspNetCore.Blazor.Components;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
public class SomeOtherComponent : BlazorComponent
|
||||
{
|
||||
}
|
||||
}
|
||||
"));
|
||||
|
||||
// Act
|
||||
var generated = CompileToCSharp(@"
|
||||
@addTagHelper *, TestAssembly
|
||||
<h1>Hello</h1>
|
||||
|
||||
<SomeOtherComponent />
|
||||
|
||||
");
|
||||
|
||||
// Assert
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.AddAttribute(1, "Value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(2, "OnChanged", new System.Action<System.Int32>(__value => ParentValue = __value));
|
||||
builder.CloseComponent();
|
||||
builder.AddContent(3, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ Document -
|
|||
IntermediateToken - - CSharp - __value => ParentValue = __value
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
HtmlContent - (81:1,50 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (81:1,50 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (95:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (95:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (95:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
Generated Location: (999:23,12 [50] )
|
||||
Generated Location: (957:22,12 [50] )
|
||||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.AddAttribute(1, "Value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(2, "OnChanged", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue));
|
||||
builder.CloseComponent();
|
||||
builder.AddContent(3, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue)
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
HtmlContent - (81:1,50 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (81:1,50 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (95:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (95:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (95:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
Generated Location: (1047:23,12 [50] )
|
||||
Generated Location: (1005:22,12 [50] )
|
||||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.AddAttribute(1, "Value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(2, "ValueChanged", new System.Action<System.Int32>(__value => ParentValue = __value));
|
||||
builder.CloseComponent();
|
||||
builder.AddContent(3, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ Document -
|
|||
IntermediateToken - - CSharp - __value => ParentValue = __value
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
HtmlContent - (71:1,40 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (71:1,40 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (85:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (85:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (85:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
Generated Location: (1002:23,12 [50] )
|
||||
Generated Location: (960:22,12 [50] )
|
||||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.AddAttribute(1, "Value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(2, "ValueChanged", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue));
|
||||
builder.CloseComponent();
|
||||
builder.AddContent(3, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue)
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
HtmlContent - (71:1,40 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (71:1,40 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (85:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (85:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (85:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
Generated Location: (1050:23,12 [50] )
|
||||
Generated Location: (1008:22,12 [50] )
|
||||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ namespace Test
|
|||
builder.AddAttribute(2, "value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(CurrentDate, "MM/dd"));
|
||||
builder.AddAttribute(3, "onchange", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => CurrentDate = __value, CurrentDate, "MM/dd"));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(4, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => CurrentDate = __value, CurrentDate, "MM/dd")
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (108:1,77 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (108:1,77 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (122:2,12 [77] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (122:2,12 [77] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (122:2,12 [77] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
|
||||
|
|
||||
Generated Location: (1105:24,12 [77] )
|
||||
Generated Location: (1063:23,12 [77] )
|
||||
|
|
||||
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
|
||||
|
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ namespace Test
|
|||
builder.AddAttribute(2, "value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(3, "onchange", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(4, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue)
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (87:1,56 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (87:1,56 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (101:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (101:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (101:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
Generated Location: (1087:24,12 [50] )
|
||||
Generated Location: (1045:23,12 [50] )
|
||||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.AddAttribute(1, "myvalue", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(2, "myevent", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(3, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue)
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (64:1,33 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (64:1,33 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (78:2,12 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (78:2,12 [55] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public string ParentValue { get; set; } = "hi";\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (78:2,12 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public string ParentValue { get; set; } = "hi";
|
||||
|
|
||||
Generated Location: (1032:23,12 [55] )
|
||||
Generated Location: (990:22,12 [55] )
|
||||
|
|
||||
public string ParentValue { get; set; } = "hi";
|
||||
|
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.AddAttribute(1, "myvalue", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(2, "myevent", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(3, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue)
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (58:1,27 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (58:1,27 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (72:2,12 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (72:2,12 [55] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public string ParentValue { get; set; } = "hi";\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (72:2,12 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public string ParentValue { get; set; } = "hi";
|
||||
|
|
||||
Generated Location: (1032:23,12 [55] )
|
||||
Generated Location: (990:22,12 [55] )
|
||||
|
|
||||
public string ParentValue { get; set; } = "hi";
|
||||
|
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ namespace Test
|
|||
builder.AddAttribute(2, "value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(Enabled));
|
||||
builder.AddAttribute(3, "onchange", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => Enabled = __value, Enabled));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(4, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => Enabled = __value, Enabled)
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (72:1,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (72:1,41 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (86:2,12 [41] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (86:2,12 [41] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public bool Enabled { get; set; }\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (86:2,12 [41] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public bool Enabled { get; set; }
|
||||
|
|
||||
Generated Location: (1079:24,12 [41] )
|
||||
Generated Location: (1037:23,12 [41] )
|
||||
|
|
||||
public bool Enabled { get; set; }
|
||||
|
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ namespace Test
|
|||
builder.AddAttribute(2, "value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(CurrentDate, Format));
|
||||
builder.AddAttribute(3, "onchange", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => CurrentDate = __value, CurrentDate, Format));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(4, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => CurrentDate = __value, CurrentDate, Format)
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (94:1,63 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (94:1,63 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (108:2,12 [135] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (108:2,12 [135] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);\n\n public string Format { get; set; } = "MM/dd/yyyy";\n
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Source Location: (108:2,12 [135] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
||||
public string Format { get; set; } = "MM/dd/yyyy";
|
||||
|
|
||||
Generated Location: (1103:24,12 [135] )
|
||||
Generated Location: (1061:23,12 [135] )
|
||||
|
|
||||
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ namespace Test
|
|||
builder.AddAttribute(2, "value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(CurrentDate, "MM/dd/yyyy"));
|
||||
builder.AddAttribute(3, "onchange", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => CurrentDate = __value, CurrentDate, "MM/dd/yyyy"));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(4, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => CurrentDate = __value, CurrentDate, "MM/dd/yyyy")
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (97:1,66 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (97:1,66 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (111:2,12 [77] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (111:2,12 [77] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (111:2,12 [77] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
|
||||
|
|
||||
Generated Location: (1115:24,12 [77] )
|
||||
Generated Location: (1073:23,12 [77] )
|
||||
|
|
||||
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
|
||||
|
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ namespace Test
|
|||
builder.AddAttribute(2, "value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(3, "onchange", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(4, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue)
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (72:1,41 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (72:1,41 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (86:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (86:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (86:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
Generated Location: (1087:24,12 [50] )
|
||||
Generated Location: (1045:23,12 [50] )
|
||||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.AddAttribute(1, "value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue));
|
||||
builder.AddAttribute(2, "onchange", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(3, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => ParentValue = __value, ParentValue)
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (60:1,29 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (60:1,29 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (74:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (74:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (74:2,12 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
Generated Location: (1033:23,12 [50] )
|
||||
Generated Location: (991:22,12 [50] )
|
||||
|
|
||||
public int ParentValue { get; set; } = 42;
|
||||
|
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.OpenComponent<Test.MyComponent>(0);
|
||||
builder.AddAttribute(1, "OnClick", new Microsoft.AspNetCore.Blazor.UIEventHandler(Increment));
|
||||
builder.CloseComponent();
|
||||
builder.AddContent(2, "\n\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 5 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,5 @@ Document -
|
|||
IntermediateToken - (90:2,23 [9] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - Increment
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
HtmlContent - (102:2,35 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (102:2,35 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
CSharpCode - (118:4,12 [100] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (118:4,12 [100] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private int counter;\n private void Increment(UIEventArgs e) {\n counter++;\n }\n
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Source Location: (118:4,12 [100] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
counter++;
|
||||
}
|
||||
|
|
||||
Generated Location: (910:23,12 [100] )
|
||||
Generated Location: (866:22,12 [100] )
|
||||
|
|
||||
private int counter;
|
||||
private void Increment(UIEventArgs e) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ namespace Test
|
|||
builder.OpenComponent<Test.MyComponent>(0);
|
||||
builder.AddAttribute(1, "OnClick", new Microsoft.AspNetCore.Blazor.UIEventHandler(e => { Increment(); }));
|
||||
builder.CloseComponent();
|
||||
builder.AddContent(2, "\n\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 4 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,5 @@ Document -
|
|||
IntermediateToken - (55:1,24 [21] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - e => { Increment(); }
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
HtmlContent - (80:1,49 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (80:1,49 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
CSharpCode - (96:3,12 [87] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (96:3,12 [87] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private int counter;\n private void Increment() {\n counter++;\n }\n
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Source Location: (96:3,12 [87] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
counter++;
|
||||
}
|
||||
|
|
||||
Generated Location: (882:22,12 [87] )
|
||||
Generated Location: (838:21,12 [87] )
|
||||
|
|
||||
private int counter;
|
||||
private void Increment() {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.OpenElement(0, "input");
|
||||
builder.AddAttribute(1, "onclick", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue<Microsoft.AspNetCore.Blazor.UIMouseEventArgs>(OnClick));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(2, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,5 @@ Document -
|
|||
IntermediateToken - - CSharp - )
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (64:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (64:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (78:2,12 [44] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (78:2,12 [44] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n void OnClick(UIEventArgs e) {\n }\n
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Source Location: (78:2,12 [44] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
void OnClick(UIEventArgs e) {
|
||||
}
|
||||
|
|
||||
Generated Location: (964:23,12 [44] )
|
||||
Generated Location: (922:22,12 [44] )
|
||||
|
|
||||
void OnClick(UIEventArgs e) {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.OpenElement(0, "input");
|
||||
builder.AddAttribute(1, "onclick", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue<Microsoft.AspNetCore.Blazor.UIMouseEventArgs>(OnClick));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(2, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,5 @@ Document -
|
|||
IntermediateToken - - CSharp - )
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (64:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (64:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (78:2,12 [49] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (78:2,12 [49] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n void OnClick(UIMouseEventArgs e) {\n }\n
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Source Location: (78:2,12 [49] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
void OnClick(UIMouseEventArgs e) {
|
||||
}
|
||||
|
|
||||
Generated Location: (964:23,12 [49] )
|
||||
Generated Location: (922:22,12 [49] )
|
||||
|
|
||||
void OnClick(UIMouseEventArgs e) {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.OpenElement(0, "input");
|
||||
builder.AddAttribute(1, "onclick", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue<Microsoft.AspNetCore.Blazor.UIMouseEventArgs>(OnClick));
|
||||
builder.CloseElement();
|
||||
builder.AddContent(2, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,5 @@ Document -
|
|||
IntermediateToken - - CSharp - )
|
||||
HtmlContent -
|
||||
IntermediateToken - - Html - />
|
||||
HtmlContent - (64:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (64:1,28 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (78:2,12 [31] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (78:2,12 [31] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n void OnClick() {\n }\n
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Source Location: (78:2,12 [31] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
void OnClick() {
|
||||
}
|
||||
|
|
||||
Generated Location: (964:23,12 [31] )
|
||||
Generated Location: (922:22,12 [31] )
|
||||
|
|
||||
void OnClick() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
public class TestComponent : Microsoft.AspNetCore.Blazor.Components.BlazorComponent
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeBuilder builder)
|
||||
{
|
||||
base.BuildRenderTree(builder);
|
||||
builder.AddContent(0, "My value");
|
||||
builder.AddContent(1, "\n\n");
|
||||
builder.OpenElement(2, "h1");
|
||||
builder.AddContent(3, "Hello");
|
||||
builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
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
|
||||
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Blazor.Components.BlazorComponent -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - base.BuildRenderTree(builder);
|
||||
CSharpExpression - (2:0,2 [10] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (2:0,2 [10] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "My value"
|
||||
HtmlContent - (13:0,13 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (13:0,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
IntermediateToken - (17:2,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - <h1>
|
||||
IntermediateToken - (21:2,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
|
||||
IntermediateToken - (26:2,9 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - </h1>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
public class TestComponent : Microsoft.AspNetCore.Blazor.Components.BlazorComponent
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeBuilder builder)
|
||||
{
|
||||
base.BuildRenderTree(builder);
|
||||
builder.OpenComponent<Test.SomeOtherComponent>(0);
|
||||
builder.CloseComponent();
|
||||
builder.AddContent(1, "\n\n");
|
||||
builder.OpenElement(2, "h1");
|
||||
builder.AddContent(3, "Hello");
|
||||
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
|
||||
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Blazor.Components.BlazorComponent -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - base.BuildRenderTree(builder);
|
||||
TagHelper - (36:2,0 [22] x:\dir\subdir\Test\TestComponent.cshtml) - SomeOtherComponent - TagMode.SelfClosing
|
||||
ComponentOpenExtensionNode - - Test.SomeOtherComponent
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
HtmlContent - (58:2,22 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (58:2,22 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
IntermediateToken - (62:4,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - <h1>
|
||||
IntermediateToken - (66:4,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
|
||||
IntermediateToken - (71:4,9 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - </h1>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
public class TestComponent : Microsoft.AspNetCore.Blazor.Components.BlazorComponent
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeBuilder builder)
|
||||
{
|
||||
base.BuildRenderTree(builder);
|
||||
builder.OpenElement(0, "h1");
|
||||
builder.AddContent(1, "Hello");
|
||||
builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
Document -
|
||||
NamespaceDeclaration - - Test
|
||||
UsingDirective - (1:0,1 [14] x:\dir\subdir\Test\TestComponent.cshtml) - System
|
||||
UsingDirective - (18:2,1 [34] ) - System.Collections.Generic
|
||||
UsingDirective - (53:3,1 [19] ) - System.Linq
|
||||
UsingDirective - (73:4,1 [30] ) - System.Threading.Tasks
|
||||
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Blazor.Components.BlazorComponent -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - base.BuildRenderTree(builder);
|
||||
HtmlContent - (15:1,0 [16] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (17:2,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - <h1>
|
||||
IntermediateToken - (21:2,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
|
||||
IntermediateToken - (26:2,9 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - </h1>
|
||||
|
|
@ -17,7 +17,6 @@ namespace Test
|
|||
builder.AddAttribute(1, "v", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(y));
|
||||
builder.AddAttribute(2, "vChanged", Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => y = __value, y));
|
||||
builder.CloseComponent();
|
||||
builder.AddContent(3, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ Document -
|
|||
IntermediateToken - - CSharp - Microsoft.AspNetCore.Blazor.Components.BindMethods.SetValueHandler(__value => y = __value, y)
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
HtmlContent - (53:1,22 [2] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (53:1,22 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
CSharpCode - (67:2,12 [24] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (67:2,12 [24] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n string y = null;\n
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Source Location: (67:2,12 [24] x:\dir\subdir\Test\TestComponent.cshtml)
|
|||
|
|
||||
string y = null;
|
||||
|
|
||||
Generated Location: (1008:23,12 [24] )
|
||||
Generated Location: (966:22,12 [24] )
|
||||
|
|
||||
string y = null;
|
||||
|
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ namespace Test
|
|||
builder.CloseElement();
|
||||
builder.AddContent(6, "\n");
|
||||
builder.CloseElement();
|
||||
builder.AddContent(7, "\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,3 @@ Document -
|
|||
IntermediateToken - (127:4,4 [9] x:\dir\subdir\Test\TestComponent.cshtml) - Html - </script>
|
||||
IntermediateToken - (136:4,13 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
IntermediateToken - (138:5,0 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - </div>
|
||||
IntermediateToken - (144:5,6 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
public class TestComponent : Microsoft.AspNetCore.Blazor.Components.BlazorComponent
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeBuilder builder)
|
||||
{
|
||||
base.BuildRenderTree(builder);
|
||||
builder.OpenElement(0, "h1");
|
||||
builder.AddContent(1, "Hello");
|
||||
builder.CloseElement();
|
||||
builder.AddContent(2, "\n\n");
|
||||
builder.AddContent(3, "My value");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
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
|
||||
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Blazor.Components.BlazorComponent -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - base.BuildRenderTree(builder);
|
||||
HtmlContent - (0:0,0 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (0:0,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - <h1>
|
||||
IntermediateToken - (4:0,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
|
||||
IntermediateToken - (9:0,9 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - </h1>
|
||||
IntermediateToken - (14:0,14 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
CSharpExpression - (20:2,2 [10] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (20:2,2 [10] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - "My value"
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
public class TestComponent : Microsoft.AspNetCore.Blazor.Components.BlazorComponent
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeBuilder builder)
|
||||
{
|
||||
base.BuildRenderTree(builder);
|
||||
builder.OpenElement(0, "h1");
|
||||
builder.AddContent(1, "Hello");
|
||||
builder.CloseElement();
|
||||
builder.AddContent(2, "\n\n");
|
||||
builder.OpenComponent<Test.SomeOtherComponent>(3);
|
||||
builder.CloseComponent();
|
||||
}
|
||||
#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
|
||||
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Blazor.Components.BlazorComponent -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - base.BuildRenderTree(builder);
|
||||
HtmlContent - (31:1,0 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (31:1,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - <h1>
|
||||
IntermediateToken - (35:1,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
|
||||
IntermediateToken - (40:1,9 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - </h1>
|
||||
IntermediateToken - (45:1,14 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n
|
||||
TagHelper - (49:3,0 [22] x:\dir\subdir\Test\TestComponent.cshtml) - SomeOtherComponent - TagMode.SelfClosing
|
||||
ComponentOpenExtensionNode - - Test.SomeOtherComponent
|
||||
ComponentBodyExtensionNode -
|
||||
ComponentCloseExtensionNode -
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
namespace Test
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
[Microsoft.AspNetCore.Blazor.Components.RouteAttribute("/my/url")]
|
||||
public class TestComponent : Microsoft.AspNetCore.Blazor.Components.BlazorComponent
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeBuilder builder)
|
||||
{
|
||||
base.BuildRenderTree(builder);
|
||||
builder.OpenElement(0, "h1");
|
||||
builder.AddContent(1, "Hello");
|
||||
builder.CloseElement();
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
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
|
||||
RouteAttributeExtensionNode - - /my/url
|
||||
ClassDeclaration - - public - TestComponent - Microsoft.AspNetCore.Blazor.Components.BlazorComponent -
|
||||
MethodDeclaration - - protected override - void - BuildRenderTree
|
||||
CSharpCode -
|
||||
IntermediateToken - - CSharp - base.BuildRenderTree(builder);
|
||||
HtmlContent - (0:0,0 [18] x:\dir\subdir\Test\TestComponent.cshtml)
|
||||
IntermediateToken - (0:0,0 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - <h1>
|
||||
IntermediateToken - (4:0,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello
|
||||
IntermediateToken - (9:0,9 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - </h1>
|
||||
Loading…
Reference in New Issue