diff --git a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorExtensionInitializer.cs b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorExtensionInitializer.cs index 0f9e77b7b8..b275f388a9 100644 --- a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorExtensionInitializer.cs +++ b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/BlazorExtensionInitializer.cs @@ -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. diff --git a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/ComponentDocumentClassifierPass.cs b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/ComponentDocumentClassifierPass.cs index f534f3af55..294a16fc44 100644 --- a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/ComponentDocumentClassifierPass.cs +++ b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/ComponentDocumentClassifierPass.cs @@ -21,6 +21,8 @@ namespace Microsoft.AspNetCore.Blazor.Razor /// public static readonly string ComponentDocumentKind = "Blazor.Component"; + private static readonly object BuildRenderTreeBaseCallAnnotation = new object(); + private static readonly char[] PathSeparators = new char[] { '/', '\\' }; /// @@ -42,6 +44,9 @@ namespace Microsoft.AspNetCore.Blazor.Razor /// public bool MangleClassNames { get; set; } = false; + internal static bool IsBuildRenderTreeBaseCall(CSharpCodeIntermediateNode node) + => node.Annotations[BuildRenderTreeBaseCallAnnotation] != null; + /// 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, diff --git a/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/TrimWhitespacePass.cs b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/TrimWhitespacePass.cs new file mode 100644 index 0000000000..6810e731d3 --- /dev/null +++ b/src/Microsoft.AspNetCore.Blazor.Razor.Extensions/TrimWhitespacePass.cs @@ -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 + } + } +} diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/BindRazorIntegrationTest.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/BindRazorIntegrationTest.cs index af4afc4f3c..a9de3736fd 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/BindRazorIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/BindRazorIntegrationTest.cs @@ -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), 2), - frame => AssertFrame.Whitespace(frame, 3)); + frame => AssertFrame.Attribute(frame, "ValueChanged", typeof(Action), 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), 2), - frame => AssertFrame.Whitespace(frame, 3)); + frame => AssertFrame.Attribute(frame, "OnChanged", typeof(Action), 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] diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/ComponentRenderingRazorIntegrationTest.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/ComponentRenderingRazorIntegrationTest.cs index cff219def8..0f31187e67 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/ComponentRenderingRazorIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/ComponentRenderingRazorIntegrationTest.cs @@ -205,8 +205,7 @@ namespace Test // The handler will have been assigned to a lambda var handler = Assert.IsType(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(frame.AttributeValue); Assert.Equal("Test.TestComponent", handler.Target.GetType().FullName); Assert.Equal("Increment", handler.Method.Name); - }, - frame => AssertFrame.Whitespace(frame, 2)); + }); } [Fact] diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/RenderingRazorIntegrationTest.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/RenderingRazorIntegrationTest.cs index 94c8375d9a..017b6777ca 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/RenderingRazorIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/RenderingRazorIntegrationTest.cs @@ -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).FullName, 1)); + frame => AssertFrame.Text(frame, typeof(List).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 } diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/RuntimeCodeGenerationTest.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/RuntimeCodeGenerationTest.cs index 3aaeb98141..bf6d0a7985 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/RuntimeCodeGenerationTest.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/RuntimeCodeGenerationTest.cs @@ -377,6 +377,131 @@ namespace Test some more text +"); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [Fact] + public void LeadingWhiteSpace_WithDirective() + { + // Arrange/Act + var generated = CompileToCSharp(@" + +@using System + +

Hello

"); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [Fact] + public void LeadingWhiteSpace_WithCSharpExpression() + { + // Arrange/Act + var generated = CompileToCSharp(@" + +@(""My value"") + +

Hello

"); + + // 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 + + + +

Hello

"); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [Fact] + public void TrailingWhiteSpace_WithDirective() + { + // Arrange/Act + var generated = CompileToCSharp(@" +

Hello

+ +@page ""/my/url"" + +"); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [Fact] + public void TrailingWhiteSpace_WithCSharpExpression() + { + // Arrange/Act + var generated = CompileToCSharp(@" +

Hello

+ +@(""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 +

Hello

+ + + "); // Assert diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs index d2a659ca18..dc848d7ae0 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs @@ -17,7 +17,6 @@ namespace Test builder.AddAttribute(1, "Value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue)); builder.AddAttribute(2, "OnChanged", new System.Action(__value => ParentValue = __value)); builder.CloseComponent(); - builder.AddContent(3, "\n"); } #pragma warning restore 1998 #line 3 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.ir.txt index 97a044da67..2386e00b37 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt index 9b500367a5..96bb287009 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt @@ -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; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.codegen.cs index 28750e660c..1b57477b9c 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.ir.txt index b49c376579..b75b72f6e3 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.mappings.txt index 870e309bab..52ae7a7ec8 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.mappings.txt @@ -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; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs index ff936ef9db..61b07954a3 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs @@ -17,7 +17,6 @@ namespace Test builder.AddAttribute(1, "Value", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetValue(ParentValue)); builder.AddAttribute(2, "ValueChanged", new System.Action(__value => ParentValue = __value)); builder.CloseComponent(); - builder.AddContent(3, "\n"); } #pragma warning restore 1998 #line 3 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt index 2feccb3d10..2161c8375c 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt index 8112126a12..aa682e3a59 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt @@ -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; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.codegen.cs index b487b66e0f..416482e68e 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.ir.txt index 37d39c5afa..95791cb92e 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.mappings.txt index aa54e6324c..b58c33dd1f 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.mappings.txt @@ -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; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.codegen.cs index e8b1ba194d..7220fcce15 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.ir.txt index 6efb57eb6b..2bf900cab7 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.mappings.txt index eaa3386f97..1d4616f30d 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.mappings.txt @@ -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); | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.codegen.cs index f461f20549..d7b9ed8230 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.ir.txt index f937d4f702..fe1cd5b8a7 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.mappings.txt index befb8a50b1..9942b57278 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.mappings.txt @@ -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; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.codegen.cs index afe7e6b088..0cc3f8784b 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.ir.txt index 1fc2989516..eeb0516017 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.mappings.txt index ca1f347d7b..e52ac5fe52 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.mappings.txt @@ -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"; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.codegen.cs index afe7e6b088..0cc3f8784b 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.ir.txt index cec63b08df..df3d5b3819 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.mappings.txt index aa2fcca03c..c71520ed4e 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.mappings.txt @@ -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"; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.codegen.cs index 9b880c8369..8ec4cc80a6 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.ir.txt index 5169234927..f447aab44b 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.mappings.txt index 2681e385f0..bac58d7ca5 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.mappings.txt @@ -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; } | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.codegen.cs index cc772fb22c..ca0b1cdc50 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.ir.txt index 8615991071..9768ca5b51 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.mappings.txt index 326e15c51b..60d0deced4 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.mappings.txt @@ -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); diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.codegen.cs index 44eab4d15f..bfc45fc0fb 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.ir.txt index 345a5f60e8..035df9ca9c 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.mappings.txt index c2975d17a1..9f021ae0f5 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.mappings.txt @@ -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); | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.codegen.cs index f461f20549..d7b9ed8230 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.ir.txt index 7bdf8ce4d9..7415fe6355 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.mappings.txt index c858cd3764..262f4359cb 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.mappings.txt @@ -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; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.codegen.cs index 7cb49ec340..82b4212810 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.ir.txt index 9227fdc080..c7896ff529 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.mappings.txt index 0151775d82..22cc5aeea7 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.mappings.txt @@ -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; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs index 3d589e708f..b009491066 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs @@ -17,7 +17,6 @@ namespace Test builder.OpenComponent(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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.ir.txt index 5eed086f14..fd99145674 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt index 71361f76cf..0093b90285 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt @@ -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) { diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs index 8ab6f931d3..9ea0711002 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs @@ -16,7 +16,6 @@ namespace Test builder.OpenComponent(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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.ir.txt index 3c8ad18a83..b3742e0590 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt index 3f897f640b..86eb1dc250 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt @@ -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() { diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.codegen.cs index ed8d9ff1f7..8acb8b7f64 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.codegen.cs @@ -17,7 +17,6 @@ namespace Test builder.OpenElement(0, "input"); builder.AddAttribute(1, "onclick", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue(OnClick)); builder.CloseElement(); - builder.AddContent(2, "\n"); } #pragma warning restore 1998 #line 3 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.ir.txt index b13779114e..f307c50a97 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.mappings.txt index 5675c45a76..34e41fe869 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.mappings.txt @@ -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) { } diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.codegen.cs index 4ee53cfc67..aa525ada20 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.codegen.cs @@ -17,7 +17,6 @@ namespace Test builder.OpenElement(0, "input"); builder.AddAttribute(1, "onclick", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue(OnClick)); builder.CloseElement(); - builder.AddContent(2, "\n"); } #pragma warning restore 1998 #line 3 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.ir.txt index ecf6331fca..4ae5eab06a 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.mappings.txt index b6dc8187c1..3e17f3045e 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.mappings.txt @@ -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) { } diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.codegen.cs index 8cacdce2d5..0670f8a1f0 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.codegen.cs @@ -17,7 +17,6 @@ namespace Test builder.OpenElement(0, "input"); builder.AddAttribute(1, "onclick", Microsoft.AspNetCore.Blazor.Components.BindMethods.GetEventHandlerValue(OnClick)); builder.CloseElement(); - builder.AddContent(2, "\n"); } #pragma warning restore 1998 #line 3 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.ir.txt index 834c9e596d..f330ea12ae 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.mappings.txt index 57d47f24f2..43d7e67232 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.mappings.txt @@ -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() { } diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.codegen.cs new file mode 100644 index 0000000000..5459d1f2af --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.codegen.cs @@ -0,0 +1,25 @@ +// +#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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt new file mode 100644 index 0000000000..ac4b40e3f2 --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt @@ -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 -

+ 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 -

diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.codegen.cs new file mode 100644 index 0000000000..32c8c14f0a --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.codegen.cs @@ -0,0 +1,26 @@ +// +#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(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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.ir.txt new file mode 100644 index 0000000000..c8e035b129 --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.ir.txt @@ -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 -

+ 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 -

diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs new file mode 100644 index 0000000000..eead6674a3 --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs @@ -0,0 +1,23 @@ +// +#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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.ir.txt new file mode 100644 index 0000000000..c74d756adb --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.ir.txt @@ -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 -

+ 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 -

diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.codegen.cs index 5070a79ce8..5e347a7efb 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.codegen.cs @@ -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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.ir.txt index e8498b9273..153dcf1d92 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.ir.txt @@ -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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.mappings.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.mappings.txt index a213dab598..8902d3d2cd 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.mappings.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/Regression_597/TestComponent.mappings.txt @@ -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; | diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ScriptTag_WithErrorSuppressed/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ScriptTag_WithErrorSuppressed/TestComponent.codegen.cs index 2364425c5c..5275cccf16 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ScriptTag_WithErrorSuppressed/TestComponent.codegen.cs +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ScriptTag_WithErrorSuppressed/TestComponent.codegen.cs @@ -22,7 +22,6 @@ namespace Test builder.CloseElement(); builder.AddContent(6, "\n"); builder.CloseElement(); - builder.AddContent(7, "\n"); } #pragma warning restore 1998 } diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ScriptTag_WithErrorSuppressed/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ScriptTag_WithErrorSuppressed/TestComponent.ir.txt index 9b293d963c..c55b7b87a5 100644 --- a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ScriptTag_WithErrorSuppressed/TestComponent.ir.txt +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/ScriptTag_WithErrorSuppressed/TestComponent.ir.txt @@ -20,4 +20,3 @@ Document - IntermediateToken - (127:4,4 [9] x:\dir\subdir\Test\TestComponent.cshtml) - Html - 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 - - IntermediateToken - (144:5,6 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.codegen.cs new file mode 100644 index 0000000000..f3d38c31fd --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.codegen.cs @@ -0,0 +1,25 @@ +// +#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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt new file mode 100644 index 0000000000..51819fa264 --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt @@ -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 -

+ 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 -

+ 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" diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.codegen.cs new file mode 100644 index 0000000000..58aa836299 --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.codegen.cs @@ -0,0 +1,26 @@ +// +#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(3); + builder.CloseComponent(); + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.ir.txt new file mode 100644 index 0000000000..e912a49e9f --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.ir.txt @@ -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 -

+ 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 -

+ 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 - diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.codegen.cs b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.codegen.cs new file mode 100644 index 0000000000..37d8090e48 --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.codegen.cs @@ -0,0 +1,24 @@ +// +#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 diff --git a/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.ir.txt b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.ir.txt new file mode 100644 index 0000000000..3feef6521b --- /dev/null +++ b/test/Microsoft.AspNetCore.Blazor.Build.Test/TestFiles/RuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.ir.txt @@ -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 -

+ 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 -