diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorDesignTimeCSharpLoweringPhase.cs b/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorDesignTimeCSharpLoweringPhase.cs index 2406ba43ba..910ffef46b 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorDesignTimeCSharpLoweringPhase.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorDesignTimeCSharpLoweringPhase.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Linq; using Microsoft.AspNetCore.Razor.Evolution.Intermediate; using Microsoft.AspNetCore.Razor.Evolution.Legacy; @@ -29,6 +30,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution { GeneratedCode = renderingContext.Writer.GenerateCode(), LineMappings = renderingContext.LineMappings, + Diagnostics = renderingContext.ErrorSink.Errors }; codeDocument.SetCSharpDocument(csharpDocument); @@ -199,6 +201,131 @@ namespace Microsoft.AspNetCore.Razor.Evolution Context.Writer.WriteEndMethodInvocation(endLine: false); } + internal override void VisitTagHelper(TagHelperIRNode node) + { + var initialTagHelperRenderingContext = Context.TagHelperRenderingContext; + Context.TagHelperRenderingContext = new TagHelperRenderingContext(); + VisitDefault(node); + Context.TagHelperRenderingContext = initialTagHelperRenderingContext; + } + + internal override void VisitInitializeTagHelperStructure(InitializeTagHelperStructureIRNode node) + { + VisitDefault(node); + } + + internal override void VisitCreateTagHelper(CreateTagHelperIRNode node) + { + var tagHelperVariableName = GetTagHelperVariableName(node.TagHelperTypeName); + + Context.Writer + .WriteStartAssignment(tagHelperVariableName) + .WriteStartMethodInvocation( + "CreateTagHelper" /* ORIGINAL: CreateTagHelperMethodName */, + "global::" + node.TagHelperTypeName) + .WriteEndMethodInvocation(); + } + + internal override void VisitSetTagHelperProperty(SetTagHelperPropertyIRNode node) + { + var tagHelperVariableName = GetTagHelperVariableName(node.TagHelperTypeName); + var tagHelperRenderingContext = Context.TagHelperRenderingContext; + var propertyValueAccessor = GetTagHelperPropertyAccessor(tagHelperVariableName, node.AttributeName, node.Descriptor); + + string previousValueAccessor; + if (tagHelperRenderingContext.RenderedBoundAttributes.TryGetValue(node.AttributeName, out previousValueAccessor)) + { + Context.Writer + .WriteStartAssignment(propertyValueAccessor) + .Write(previousValueAccessor) + .WriteLine(";"); + + return; + } + else + { + tagHelperRenderingContext.RenderedBoundAttributes[node.AttributeName] = propertyValueAccessor; + } + + if (node.Descriptor.IsStringProperty) + { + VisitDefault(node); + + Context.Writer.WriteStartAssignment(propertyValueAccessor); + if (node.Children.Count == 1 && node.Children.First() is HtmlContentIRNode) + { + var htmlNode = node.Children.First() as HtmlContentIRNode; + if (htmlNode != null) + { + Context.Writer.WriteStringLiteral(htmlNode.Content); + } + } + else + { + Context.Writer.Write("string.Empty"); + } + Context.Writer.WriteLine(";"); + } + else + { + var firstMappedChild = node.Children.FirstOrDefault(child => child.SourceRange != null) as RazorIRNode; + var valueStart = firstMappedChild?.SourceRange; + + using (new LinePragmaWriter(Context.Writer, node.SourceRange)) + { + var assignmentPrefixLength = propertyValueAccessor.Length + " = ".Length; + if (node.Descriptor.IsEnum && + node.Children.Count == 1 && + node.Children.First() is HtmlContentIRNode) + { + assignmentPrefixLength += $"global::{node.Descriptor.TypeName}.".Length; + + if (valueStart != null) + { + var padding = BuildOffsetPadding(assignmentPrefixLength, node.SourceRange, Context); + + Context.Writer.Write(padding); + } + + Context.Writer + .WriteStartAssignment(propertyValueAccessor) + .Write("global::") + .Write(node.Descriptor.TypeName) + .Write("."); + } + else + { + if (valueStart != null) + { + var padding = BuildOffsetPadding(assignmentPrefixLength, node.SourceRange, Context); + + Context.Writer.Write(padding); + } + + Context.Writer.WriteStartAssignment(propertyValueAccessor); + } + + RenderTagHelperAttributeInline(node, node.SourceRange); + + Context.Writer.WriteLine(";"); + } + } + } + + internal override void VisitDeclareTagHelperFields(DeclareTagHelperFieldsIRNode node) + { + foreach (var tagHelperTypeName in node.UsedTagHelperTypeNames) + { + var tagHelperVariableName = GetTagHelperVariableName(tagHelperTypeName); + Context.Writer + .Write("private global::") + .WriteVariableDeclaration( + tagHelperTypeName, + tagHelperVariableName, + value: null); + } + } + private void AddLineMappingFor(RazorIRNode node) { var sourceLocation = node.SourceRange; @@ -207,6 +334,52 @@ namespace Microsoft.AspNetCore.Razor.Evolution Context.LineMappings.Add(lineMapping); } + + private void RenderTagHelperAttributeInline( + RazorIRNode node, + MappingLocation documentLocation) + { + if (node is SetTagHelperPropertyIRNode || node is CSharpExpressionIRNode) + { + for (var i = 0; i < node.Children.Count; i++) + { + RenderTagHelperAttributeInline(node.Children[i], documentLocation); + } + } + else if (node is HtmlContentIRNode) + { + if (node.SourceRange != null) + { + AddLineMappingFor(node); + } + + Context.Writer.Write(((HtmlContentIRNode)node).Content); + } + else if (node is CSharpTokenIRNode) + { + if (node.SourceRange != null) + { + AddLineMappingFor(node); + } + + Context.Writer.Write(((CSharpTokenIRNode)node).Content); + } + else if (node is CSharpStatementIRNode) + { + Context.ErrorSink.OnError( + new SourceLocation(documentLocation.AbsoluteIndex, documentLocation.CharacterIndex, documentLocation.ContentLength), + LegacyResources.TagHelpers_CodeBlocks_NotSupported_InAttributes, + documentLocation.ContentLength); + } + else if (node is TemplateIRNode) + { + var attributeValueNode = (SetTagHelperPropertyIRNode)node.Parent; + Context.ErrorSink.OnError( + new SourceLocation(documentLocation.AbsoluteIndex, documentLocation.CharacterIndex, documentLocation.ContentLength), + LegacyResources.FormatTagHelpers_InlineMarkupBlocks_NotSupported_InAttributes(attributeValueNode.Descriptor.TypeName), + documentLocation.ContentLength); + } + } } } } diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorRuntimeCSharpLoweringPhase.cs b/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorRuntimeCSharpLoweringPhase.cs index e3c2610e39..da3e577e57 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorRuntimeCSharpLoweringPhase.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/DefaultRazorRuntimeCSharpLoweringPhase.cs @@ -486,7 +486,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution .Write("."); } - RenderTagHelperAttributeInline(node, node.SourceRange, Context); + RenderTagHelperAttributeInline(node, node.SourceRange); Context.Writer.WriteLine(";"); } @@ -624,23 +624,41 @@ namespace Microsoft.AspNetCore.Razor.Evolution } } - private static string GetTagHelperPropertyAccessor( - string tagHelperVariableName, - string attributeName, - TagHelperAttributeDescriptor descriptor) + private void RenderTagHelperAttributeInline( + RazorIRNode node, + MappingLocation documentLocation) { - var propertyAccessor = $"{tagHelperVariableName}.{descriptor.PropertyName}"; - - if (descriptor.IsIndexer) + if (node is SetTagHelperPropertyIRNode || node is CSharpExpressionIRNode) { - var dictionaryKey = attributeName.Substring(descriptor.Name.Length); - propertyAccessor += $"[\"{dictionaryKey}\"]"; + for (var i = 0; i < node.Children.Count; i++) + { + RenderTagHelperAttributeInline(node.Children[i], documentLocation); + } + } + else if (node is HtmlContentIRNode) + { + Context.Writer.Write(((HtmlContentIRNode)node).Content); + } + else if (node is CSharpTokenIRNode) + { + Context.Writer.Write(((CSharpTokenIRNode)node).Content); + } + else if (node is CSharpStatementIRNode) + { + Context.ErrorSink.OnError( + new SourceLocation(documentLocation.AbsoluteIndex, documentLocation.CharacterIndex, documentLocation.ContentLength), + LegacyResources.TagHelpers_CodeBlocks_NotSupported_InAttributes, + documentLocation.ContentLength); + } + else if (node is TemplateIRNode) + { + var attributeValueNode = (SetTagHelperPropertyIRNode)node.Parent; + Context.ErrorSink.OnError( + new SourceLocation(documentLocation.AbsoluteIndex, documentLocation.CharacterIndex, documentLocation.ContentLength), + LegacyResources.FormatTagHelpers_InlineMarkupBlocks_NotSupported_InAttributes(attributeValueNode.Descriptor.TypeName), + documentLocation.ContentLength); } - - return propertyAccessor; } - - private static string GetTagHelperVariableName(string tagHelperTypeName) => "__" + tagHelperTypeName.Replace('.', '_'); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/RazorCSharpLoweringPhaseBase.cs b/src/Microsoft.AspNetCore.Razor.Evolution/RazorCSharpLoweringPhaseBase.cs index df5e3d6641..2cb21a697b 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/RazorCSharpLoweringPhaseBase.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/RazorCSharpLoweringPhaseBase.cs @@ -25,43 +25,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution } } - protected static void RenderTagHelperAttributeInline( - RazorIRNode node, - MappingLocation documentLocation, - CSharpRenderingContext context) - { - if (node is SetTagHelperPropertyIRNode || node is CSharpExpressionIRNode) - { - for (var i = 0; i < node.Children.Count; i++) - { - RenderTagHelperAttributeInline(node.Children[i], documentLocation, context); - } - } - else if (node is HtmlContentIRNode) - { - context.Writer.Write(((HtmlContentIRNode)node).Content); - } - else if (node is CSharpTokenIRNode) - { - context.Writer.Write(((CSharpTokenIRNode)node).Content); - } - else if (node is CSharpStatementIRNode) - { - context.ErrorSink.OnError( - new SourceLocation(documentLocation.AbsoluteIndex, documentLocation.CharacterIndex, documentLocation.ContentLength), - LegacyResources.TagHelpers_CodeBlocks_NotSupported_InAttributes, - documentLocation.ContentLength); - } - else if (node is TemplateIRNode) - { - var attributeValueNode = (SetTagHelperPropertyIRNode)node.Parent; - context.ErrorSink.OnError( - new SourceLocation(documentLocation.AbsoluteIndex, documentLocation.CharacterIndex, documentLocation.ContentLength), - LegacyResources.FormatTagHelpers_InlineMarkupBlocks_NotSupported_InAttributes(attributeValueNode.Descriptor.TypeName), - documentLocation.ContentLength); - } - } - protected static int CalculateExpressionPadding(MappingLocation sourceRange, CSharpRenderingContext context) { var spaceCount = 0; @@ -103,6 +66,24 @@ namespace Microsoft.AspNetCore.Razor.Evolution } } + protected static string GetTagHelperVariableName(string tagHelperTypeName) => "__" + tagHelperTypeName.Replace('.', '_'); + + protected static string GetTagHelperPropertyAccessor( + string tagHelperVariableName, + string attributeName, + TagHelperAttributeDescriptor descriptor) + { + var propertyAccessor = $"{tagHelperVariableName}.{descriptor.PropertyName}"; + + if (descriptor.IsIndexer) + { + var dictionaryKey = attributeName.Substring(descriptor.Name.Length); + propertyAccessor += $"[\"{dictionaryKey}\"]"; + } + + return propertyAccessor; + } + protected class LinePragmaWriter : IDisposable { private readonly CSharpCodeWriter _writer; diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/CodeGenerationIntegrationTest.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/CodeGenerationIntegrationTest.cs index f499476b34..bfc7389e00 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/CodeGenerationIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/CodeGenerationIntegrationTest.cs @@ -551,14 +551,14 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests public void SimpleTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); } [Fact] public void TagHelpersWithBoundAttributes_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); } [Fact] @@ -566,133 +566,133 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); } [Fact] public void SingleTagHelper_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void SingleTagHelperWithNewlineBeforeAttributes_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void TagHelpersWithWeirdlySpacedAttributes_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void IncompleteTagHelper_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void BasicTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void BasicTagHelpers_Prefixed_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.PrefixedPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.PrefixedPAndInputTagHelperDescriptors); } [Fact] public void ComplexTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void DuplicateTargetTagHelper_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DuplicateTargetTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DuplicateTargetTagHelperDescriptors); } [Fact] public void EmptyAttributeTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void EscapedTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void AttributeTargetingTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.AttributeTargetingTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.AttributeTargetingTagHelperDescriptors); } [Fact] public void PrefixedAttributeTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.PrefixedAttributeTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.PrefixedAttributeTagHelperDescriptors); } [Fact] public void DuplicateAttributeTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void DynamicAttributeTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DynamicAttributeTagHelpers_Descriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DynamicAttributeTagHelpers_Descriptors); } [Fact] public void TransitionsInTagHelperAttributes_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void NestedScriptTagTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); } [Fact] public void SymbolBoundAttributes_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.SymbolBoundTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.SymbolBoundTagHelperDescriptors); } [Fact] public void EnumTagHelpers_Runtime() { // Arrange, Act & Assert - RunTagHelpersTest(TestTagHelperDescriptors.EnumTagHelperDescriptors); + RunRuntimeTagHelpersTest(TestTagHelperDescriptors.EnumTagHelperDescriptors); } #endregion @@ -1242,6 +1242,154 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests // Assert AssertDesignTimeDocumentMatchBaseline(document); } + + [Fact] + public void SimpleTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); + } + + [Fact] + public void TagHelpersWithBoundAttributes_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); + } + + [Fact] + public void NestedTagHelpers_DesignTime() + { + + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.SimpleTagHelperDescriptors); + } + + [Fact] + public void SingleTagHelper_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void SingleTagHelperWithNewlineBeforeAttributes_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void TagHelpersWithWeirdlySpacedAttributes_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void IncompleteTagHelper_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void BasicTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void BasicTagHelpers_Prefixed_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.PrefixedPAndInputTagHelperDescriptors); + } + + [Fact] + public void ComplexTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void DuplicateTargetTagHelper_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DuplicateTargetTagHelperDescriptors); + } + + [Fact] + public void EmptyAttributeTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void EscapedTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void AttributeTargetingTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.AttributeTargetingTagHelperDescriptors); + } + + [Fact] + public void PrefixedAttributeTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.PrefixedAttributeTagHelperDescriptors); + } + + [Fact] + public void DuplicateAttributeTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void DynamicAttributeTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DynamicAttributeTagHelpers_Descriptors); + } + + [Fact] + public void TransitionsInTagHelperAttributes_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void NestedScriptTagTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.DefaultPAndInputTagHelperDescriptors); + } + + [Fact] + public void SymbolBoundAttributes_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.SymbolBoundTagHelperDescriptors); + } + + [Fact] + public void EnumTagHelpers_DesignTime() + { + // Arrange, Act & Assert + RunDesignTimeTagHelpersTest(TestTagHelperDescriptors.EnumTagHelperDescriptors); + } #endregion protected override RazorCodeDocument CreateCodeDocument() @@ -1263,7 +1411,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests return RazorCodeDocument.Create(TestRazorSourceDocument.CreateResource(sourceFilename)); } - private void RunTagHelpersTest(IEnumerable descriptors) + private void RunRuntimeTagHelpersTest(IEnumerable descriptors) { // Arrange var engine = RazorEngine.Create( @@ -1282,6 +1430,25 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument()); } + private void RunDesignTimeTagHelpersTest(IEnumerable descriptors) + { + // Arrange + var engine = RazorEngine.CreateDesignTime( + builder => + { + builder.Features.Add(new ApiSetsIRTestAdapter()); + builder.Features.Add(new TagHelperFeature(new TestTagHelperDescriptorResolver(descriptors))); + DefaultRazorRuntimeCSharpLoweringPhase.GenerateUniqueTagHelperId = "test"; + }); + var document = CreateCodeDocument(); + + // Act + engine.Process(document); + + // Assert + AssertDesignTimeDocumentMatchBaseline(document); + } + private class TestTagHelperDescriptorResolver : ITagHelperDescriptorResolver { private readonly IEnumerable _descriptors; diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/TestTagHelperDescriptors.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/TestTagHelperDescriptors.cs index d178035e87..ece8ceee6c 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/TestTagHelperDescriptors.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/IntegrationTests/TestTagHelperDescriptors.cs @@ -35,12 +35,21 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests { TagName = "input", TypeName = "InputTagHelper", - Attributes = new[] { new TagHelperAttributeDescriptor + Attributes = new[] { - Name = "value", - PropertyName = "FooProp", - TypeName = "System.String" - } } + new TagHelperAttributeDescriptor + { + Name = "value", + PropertyName = "FooProp", + TypeName = "System.String" + }, + new TagHelperAttributeDescriptor + { + Name = "bound", + PropertyName = "BoundProp", + TypeName = "System.String" + } + } } }; } diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..7ef2cef480 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,44 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "checkbox"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "checkbox"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..732ed9edf8 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,10 @@ +Source Location: (184:5,36 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml) +|true| +Generated Location: (1565:25,42 [4] ) +|true| + +Source Location: (230:6,36 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml) +|true| +Generated Location: (2218:35,42 [4] ) +|true| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..987bf1890b --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,42 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_PTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml" + __o = ViewBag.DefaultInterval; + +#line default +#line hidden + __TestNamespace_InputTagHelper.Type = "text"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "checkbox"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..acbadb8a2b --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,10 @@ +Source Location: (220:5,38 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml) +|ViewBag.DefaultInterval| +Generated Location: (1273:22,41 [23] ) +|ViewBag.DefaultInterval| + +Source Location: (303:6,40 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml) +|true| +Generated Location: (1971:33,42 [4] ) +|true| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.cs new file mode 100644 index 0000000000..4a052cf1be --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.cs @@ -0,0 +1,32 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "checkbox"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml" + __TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.mappings.txt new file mode 100644 index 0000000000..021a95c7fc --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (224:7,43 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml) +|true| +Generated Location: (1350:23,43 [4] ) +|true| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..1c72b2ec77 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,202 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + if (true) +{ + var checkbox = "checkbox"; + + + +#line default +#line hidden +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + if (false) + { + + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "text"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + + } + else + { + + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + __o = checkbox; + +#line default +#line hidden + __TestNamespace_InputTagHelper.Type = string.Empty; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + __TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + + + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + __o = true ? "checkbox" : "anything"; + +#line default +#line hidden + __TestNamespace_InputTagHelper.Type = string.Empty; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + + + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 18 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + if(true) { + +#line default +#line hidden +#line 18 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + } else { + +#line default +#line hidden +#line 18 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + } + +#line default +#line hidden + __TestNamespace_InputTagHelper.Type = string.Empty; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 18 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + + } + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + __o = DateTime.Now; + +#line default +#line hidden +#line 22 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + var @object = false; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 23 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = (@object); + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 21 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + __TestNamespace_PTagHelper.Age = DateTimeOffset.Now.Year - 1970; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 26 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + __TestNamespace_InputTagHelper2.Checked = (DateTimeOffset.Now.Year > 2014); + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 25 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" +__TestNamespace_PTagHelper.Age = -1970 + @DateTimeOffset.Now.Year; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 29 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 28 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" +__TestNamespace_PTagHelper.Age = DateTimeOffset.Now.Year - 1970; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 32 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = @( DateTimeOffset.Now.Year ) > 2014 ; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 31 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" +__TestNamespace_PTagHelper.Age = ("My age is this long.".Length); + +#line default +#line hidden +#line 34 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + __o = someMethod(item => new HelperResult(async(__razor_template_writer) => { + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 34 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + __TestNamespace_InputTagHelper2.Checked = checked; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 34 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" +__TestNamespace_PTagHelper.Age = 123; + +#line default +#line hidden +} +)); + +#line default +#line hidden +#line 35 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" + +} + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..f954d7a8b4 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,228 @@ +Source Location: (34:2,1 [52] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|if (true) +{ + var checkbox = "checkbox"; + + | +Generated Location: (934:19,1 [52] ) +|if (true) +{ + var checkbox = "checkbox"; + + | + +Source Location: (222:9,13 [43] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|if (false) + { + | +Generated Location: (1126:28,13 [43] ) +|if (false) + { + | + +Source Location: (348:11,99 [66] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| + } + else + { + | +Generated Location: (1846:40,99 [66] ) +| + } + else + { + | + +Source Location: (444:15,46 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|checkbox| +Generated Location: (2296:51,49 [8] ) +|checkbox| + +Source Location: (461:15,63 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|true| +Generated Location: (2649:58,63 [4] ) +|true| + +Source Location: (472:15,74 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| + | +Generated Location: (2950:64,74 [18] ) +| + | + +Source Location: (505:16,31 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|true ? "checkbox" : "anything"| +Generated Location: (3337:72,34 [30] ) +|true ? "checkbox" : "anything"| + +Source Location: (540:16,66 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| + | +Generated Location: (3715:79,66 [18] ) +| + | + +Source Location: (572:17,30 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|if(true) { | +Generated Location: (4098:87,30 [11] ) +|if(true) { | + +Source Location: (604:17,62 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| } else { | +Generated Location: (4298:92,62 [10] ) +| } else { | + +Source Location: (635:17,93 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| }| +Generated Location: (4528:97,93 [2] ) +| }| + +Source Location: (639:17,97 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| + }| +Generated Location: (4908:104,97 [15] ) +| + }| + +Source Location: (161:7,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|DateTime.Now| +Generated Location: (5179:111,35 [12] ) +|DateTime.Now| + +Source Location: (781:21,14 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| var @object = false;| +Generated Location: (5333:116,14 [21] ) +| var @object = false;| + +Source Location: (834:22,29 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|(| +Generated Location: (5731:123,42 [1] ) +|(| + +Source Location: (835:22,30 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|@object| +Generated Location: (5732:123,43 [7] ) +|@object| + +Source Location: (842:22,37 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|)| +Generated Location: (5739:123,50 [1] ) +|)| + +Source Location: (709:20,39 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|DateTimeOffset.Now.Year| +Generated Location: (6001:129,38 [23] ) +|DateTimeOffset.Now.Year| + +Source Location: (732:20,62 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| - 1970| +Generated Location: (6024:129,61 [7] ) +| - 1970| + +Source Location: (974:25,61 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|(| +Generated Location: (6427:136,60 [1] ) +|(| + +Source Location: (975:25,62 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|DateTimeOffset.Now.Year > 2014| +Generated Location: (6428:136,61 [30] ) +|DateTimeOffset.Now.Year > 2014| + +Source Location: (1005:25,92 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|)| +Generated Location: (6458:136,91 [1] ) +|)| + +Source Location: (877:24,16 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|-1970 + | +Generated Location: (6715:142,33 [8] ) +|-1970 + | + +Source Location: (885:24,24 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|@| +Generated Location: (6723:142,41 [1] ) +|@| + +Source Location: (886:24,25 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|DateTimeOffset.Now.Year| +Generated Location: (6724:142,42 [23] ) +|DateTimeOffset.Now.Year| + +Source Location: (1104:28,28 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|DateTimeOffset.Now.Year > 2014| +Generated Location: (7125:149,42 [30] ) +|DateTimeOffset.Now.Year > 2014| + +Source Location: (1042:27,16 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|DateTimeOffset.Now.Year - 1970| +Generated Location: (7411:155,33 [30] ) +|DateTimeOffset.Now.Year - 1970| + +Source Location: (1232:31,28 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| | +Generated Location: (7819:162,42 [3] ) +| | + +Source Location: (1235:31,31 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|@(| +Generated Location: (7822:162,45 [2] ) +|@(| + +Source Location: (1237:31,33 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| DateTimeOffset.Now.Year | +Generated Location: (7824:162,47 [27] ) +| DateTimeOffset.Now.Year | + +Source Location: (1264:31,60 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|)| +Generated Location: (7851:162,74 [1] ) +|)| + +Source Location: (1265:31,61 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| > 2014 | +Generated Location: (7852:162,75 [10] ) +| > 2014 | + +Source Location: (1169:30,17 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|(| +Generated Location: (8118:168,33 [1] ) +|(| + +Source Location: (1170:30,18 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|"My age is this long.".Length| +Generated Location: (8119:168,34 [29] ) +|"My age is this long.".Length| + +Source Location: (1199:30,47 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|)| +Generated Location: (8148:168,63 [1] ) +|)| + +Source Location: (1304:33,9 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|someMethod(| +Generated Location: (8289:173,12 [11] ) +|someMethod(| + +Source Location: (1359:33,64 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|checked| +Generated Location: (8711:177,63 [7] ) +|checked| + +Source Location: (1324:33,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|123| +Generated Location: (8966:183,33 [3] ) +|123| + +Source Location: (1373:33,78 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +|)| +Generated Location: (9007:188,1 [1] ) +|)| + +Source Location: (1386:34,10 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) +| +}| +Generated Location: (9146:193,10 [3] ) +| +}| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..0ee94c11fa --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,50 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "button"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "button"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "button"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml" +__TestNamespace_PTagHelper.Age = 3; + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..71fa77a4fa --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,15 @@ +Source Location: (144:4,34 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) +|true| +Generated Location: (1713:27,42 [4] ) +|true| + +Source Location: (220:5,34 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) +|true| +Generated Location: (2255:36,42 [4] ) +|true| + +Source Location: (41:2,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) +|3| +Generated Location: (2525:42,33 [1] ) +|3| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.cs new file mode 100644 index 0000000000..eea441ba7f --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.cs @@ -0,0 +1,37 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "checkbox"; + __TestNamespace_InputTagHelper.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_CatchAllTagHelper.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_CatchAllTagHelper.Type = __TestNamespace_InputTagHelper.Type; +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml" +__TestNamespace_InputTagHelper.Checked = true; + +#line default +#line hidden + __TestNamespace_InputTagHelper.Checked = __TestNamespace_InputTagHelper.Checked; + __TestNamespace_CatchAllTagHelper.Checked = __TestNamespace_InputTagHelper.Checked; + __TestNamespace_CatchAllTagHelper.Checked = __TestNamespace_InputTagHelper.Checked; + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.mappings.txt new file mode 100644 index 0000000000..f4186ede11 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (65:2,32 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml) +|true| +Generated Location: (1664:26,41 [4] ) +|true| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..68c9d1373c --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,178 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_InputTagHelper = CreateTagHelper(); +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = DateTime.Now; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + if (true) { + +#line default +#line hidden +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = string.Empty; + +#line default +#line hidden +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + } else { + +#line default +#line hidden +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = false; + +#line default +#line hidden +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + } + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); +#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = DateTime.Now; + +#line default +#line hidden + __TestNamespace_InputTagHelper.Bound = string.Empty; +#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = DateTime.Now; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = long.MinValue; + +#line default +#line hidden +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + if (true) { + +#line default +#line hidden +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = string.Empty; + +#line default +#line hidden +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + } else { + +#line default +#line hidden +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = false; + +#line default +#line hidden +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + } + +#line default +#line hidden +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = int.MaxValue; + +#line default +#line hidden + __TestNamespace_InputTagHelper.Bound = string.Empty; +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = long.MinValue; + +#line default +#line hidden +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + if (true) { + +#line default +#line hidden +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = string.Empty; + +#line default +#line hidden +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + } else { + +#line default +#line hidden +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = false; + +#line default +#line hidden +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + } + +#line default +#line hidden +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = int.MaxValue; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); +#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = long.MinValue; + +#line default +#line hidden +#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = DateTime.Now; + +#line default +#line hidden +#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = int.MaxValue; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); +#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + if (true) { + +#line default +#line hidden +#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = string.Empty; + +#line default +#line hidden +#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + } else { + +#line default +#line hidden +#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + __o = false; + +#line default +#line hidden +#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" + } + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..296bd9e8ba --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,150 @@ +Source Location: (57:2,24 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|DateTime.Now| +Generated Location: (901:18,27 [12] ) +|DateTime.Now| + +Source Location: (94:4,17 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|if (true) { | +Generated Location: (1169:24,17 [12] ) +|if (true) { | + +Source Location: (107:4,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|string.Empty| +Generated Location: (1349:29,33 [12] ) +|string.Empty| + +Source Location: (119:4,42 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +| } else { | +Generated Location: (1539:34,42 [10] ) +| } else { | + +Source Location: (130:4,53 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|false| +Generated Location: (1740:39,56 [5] ) +|false| + +Source Location: (135:4,58 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +| }| +Generated Location: (1939:44,58 [2] ) +| }| + +Source Location: (174:6,22 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|DateTime.Now| +Generated Location: (2204:50,25 [12] ) +|DateTime.Now| + +Source Location: (212:6,60 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|DateTime.Now| +Generated Location: (2481:56,63 [12] ) +|DateTime.Now| + +Source Location: (254:8,15 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|long.MinValue| +Generated Location: (2750:62,18 [13] ) +|long.MinValue| + +Source Location: (269:8,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|if (true) { | +Generated Location: (2929:67,30 [12] ) +|if (true) { | + +Source Location: (282:8,43 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|string.Empty| +Generated Location: (3122:72,46 [12] ) +|string.Empty| + +Source Location: (294:8,55 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +| } else { | +Generated Location: (3325:77,55 [10] ) +| } else { | + +Source Location: (305:8,66 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|false| +Generated Location: (3539:82,69 [5] ) +|false| + +Source Location: (310:8,71 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +| }| +Generated Location: (3751:87,71 [2] ) +| }| + +Source Location: (314:8,75 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|int.MaxValue| +Generated Location: (3966:92,78 [12] ) +|int.MaxValue| + +Source Location: (346:9,17 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|long.MinValue| +Generated Location: (4201:98,20 [13] ) +|long.MinValue| + +Source Location: (361:9,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|if (true) { | +Generated Location: (4383:103,32 [12] ) +|if (true) { | + +Source Location: (374:9,45 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|string.Empty| +Generated Location: (4579:108,48 [12] ) +|string.Empty| + +Source Location: (386:9,57 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +| } else { | +Generated Location: (4785:113,57 [10] ) +| } else { | + +Source Location: (397:9,68 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|false| +Generated Location: (5002:118,71 [5] ) +|false| + +Source Location: (402:9,73 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +| }| +Generated Location: (5217:123,73 [2] ) +| }| + +Source Location: (406:9,77 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|int.MaxValue| +Generated Location: (5435:128,80 [12] ) +|int.MaxValue| + +Source Location: (443:11,17 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|long.MinValue| +Generated Location: (5707:134,20 [13] ) +|long.MinValue| + +Source Location: (458:11,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|DateTime.Now| +Generated Location: (5892:139,35 [12] ) +|DateTime.Now| + +Source Location: (490:11,64 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|int.MaxValue| +Generated Location: (6108:144,67 [12] ) +|int.MaxValue| + +Source Location: (527:13,17 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|if (true) { | +Generated Location: (6377:150,17 [12] ) +|if (true) { | + +Source Location: (540:13,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|string.Empty| +Generated Location: (6558:155,33 [12] ) +|string.Empty| + +Source Location: (552:13,42 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +| } else { | +Generated Location: (6749:160,42 [10] ) +| } else { | + +Source Location: (563:13,53 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +|false| +Generated Location: (6951:165,56 [5] ) +|false| + +Source Location: (568:13,58 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) +| }| +Generated Location: (7151:170,58 [2] ) +| }| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..65998a7122 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,46 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = ""; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = ; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = ""; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper2.Checked = ; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml" +__TestNamespace_PTagHelper.Age = ; + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..c04eee4243 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,15 @@ +Source Location: (60:3,26 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) +|| +Generated Location: (1341:23,42 [0] ) +|| + +Source Location: (120:5,30 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) +|| +Generated Location: (1869:32,42 [0] ) +|| + +Source Location: (86:4,12 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) +|| +Generated Location: (2131:38,33 [0] ) +|| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..6fbde0c917 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,72 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" + + var enumValue = MyEnum.MyValue; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" +__TestNamespace_InputTagHelper.Value = MyEnum.MyValue; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" + __o = MyEnum.MySecondValue; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" +__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestTagHelperDescriptors+MyEnum.MyValue; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" +__TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestTagHelperDescriptors+MyEnum.MySecondValue; + +#line default +#line hidden +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" +__TestNamespace_CatchAllTagHelper.CatchAll = global::Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestTagHelperDescriptors+MyEnum.MyValue; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" +__TestNamespace_InputTagHelper.Value = enumValue; + +#line default +#line hidden +#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" +__TestNamespace_CatchAllTagHelper.CatchAll = enumValue; + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..3f10bd9085 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,44 @@ +Source Location: (35:2,2 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) +| + var enumValue = MyEnum.MyValue; +| +Generated Location: (848:18,2 [39] ) +| + var enumValue = MyEnum.MyValue; +| + +Source Location: (94:6,15 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) +|MyEnum.MyValue| +Generated Location: (1259:26,39 [14] ) +|MyEnum.MyValue| + +Source Location: (129:7,15 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) +|MyEnum.MySecondValue| +Generated Location: (1627:33,18 [20] ) +|MyEnum.MySecondValue| + +Source Location: (169:8,14 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) +|MyValue| +Generated Location: (2116:40,133 [7] ) +|MyValue| + +Source Location: (196:9,14 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) +|MySecondValue| +Generated Location: (2593:47,133 [13] ) +|MySecondValue| + +Source Location: (222:9,40 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) +|MyValue| +Generated Location: (2870:52,139 [7] ) +|MyValue| + +Source Location: (249:10,15 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) +|enumValue| +Generated Location: (3253:59,39 [9] ) +|enumValue| + +Source Location: (272:10,38 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) +|enumValue| +Generated Location: (3432:64,45 [9] ) +|enumValue| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..9c2274ad7d --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,40 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { +#line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml" + __o = DateTime.Now; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml" + __o = DateTime.Now; + +#line default +#line hidden + __TestNamespace_InputTagHelper.Type = string.Empty; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml" + __TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..a4b0c9c0d7 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,15 @@ +Source Location: (100:3,29 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) +|DateTime.Now| +Generated Location: (880:18,32 [12] ) +|DateTime.Now| + +Source Location: (198:5,51 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) +|DateTime.Now| +Generated Location: (1281:25,54 [12] ) +|DateTime.Now| + +Source Location: (221:5,74 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) +|true| +Generated Location: (1648:32,74 [4] ) +|true| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.cs new file mode 100644 index 0000000000..acc64fd6dd --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.cs @@ -0,0 +1,21 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_PTagHelper = CreateTagHelper(); + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.mappings.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..0ce346de35 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,49 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { +#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml" + for(var i = 0; i < 5; i++) { + + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml" + __o = ViewBag.DefaultInterval; + +#line default +#line hidden + __TestNamespace_InputTagHelper.Type = "text"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; +#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml" + __TestNamespace_InputTagHelper2.Checked = true; + +#line default +#line hidden +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml" + + } + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..af27fddc4e --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,24 @@ +Source Location: (193:5,13 [46] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) +|for(var i = 0; i < 5; i++) { + | +Generated Location: (962:19,13 [46] ) +|for(var i = 0; i < 5; i++) { + | + +Source Location: (337:7,50 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) +|ViewBag.DefaultInterval| +Generated Location: (1403:27,53 [23] ) +|ViewBag.DefaultInterval| + +Source Location: (387:7,100 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) +|true| +Generated Location: (1809:34,100 [4] ) +|true| + +Source Location: (420:8,25 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) +| + }| +Generated Location: (1973:39,25 [15] ) +| + }| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..82d84e1539 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,26 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::SpanTagHelper __SpanTagHelper = null; + private global::DivTagHelper __DivTagHelper = null; + private global::InputTagHelper __InputTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __SpanTagHelper = CreateTagHelper(); + __InputTagHelper = CreateTagHelper(); + __InputTagHelper.FooProp = "Hello"; + __DivTagHelper = CreateTagHelper(); + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..2e5b933ca0 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,110 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.InputTagHelper1 __TestNamespace_InputTagHelper1 = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" + + var literate = "or illiterate"; + var intDictionary = new Dictionary + { + { "three", 3 }, + }; + var stringDictionary = new SortedDictionary + { + { "name", "value" }, + }; + +#line default +#line hidden + __TestNamespace_InputTagHelper1 = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper1.IntDictionaryProperty = intDictionary; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.IntDictionaryProperty = __TestNamespace_InputTagHelper1.IntDictionaryProperty; +#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" + __TestNamespace_InputTagHelper1.StringDictionaryProperty = stringDictionary; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.StringDictionaryProperty = __TestNamespace_InputTagHelper1.StringDictionaryProperty; + __TestNamespace_InputTagHelper1 = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper1.IntDictionaryProperty = intDictionary; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.IntDictionaryProperty = __TestNamespace_InputTagHelper1.IntDictionaryProperty; +#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" + __TestNamespace_InputTagHelper1.IntDictionaryProperty["garlic"] = 37; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.IntDictionaryProperty["garlic"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["garlic"]; +#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" + __TestNamespace_InputTagHelper1.IntProperty = 42; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.IntDictionaryProperty["grabber"] = __TestNamespace_InputTagHelper1.IntProperty; + __TestNamespace_InputTagHelper1 = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper1.IntProperty = 42; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.IntDictionaryProperty["grabber"] = __TestNamespace_InputTagHelper1.IntProperty; +#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper1.IntDictionaryProperty["salt"] = 37; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.IntDictionaryProperty["salt"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["salt"]; +#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" + __TestNamespace_InputTagHelper1.IntDictionaryProperty["pepper"] = 98; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.IntDictionaryProperty["pepper"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["pepper"]; + __TestNamespace_InputTagHelper1.StringProperty = "string"; + __TestNamespace_InputTagHelper2.StringDictionaryProperty["grabber"] = __TestNamespace_InputTagHelper1.StringProperty; + __TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"] = "another string"; + __TestNamespace_InputTagHelper2.StringDictionaryProperty["paprika"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["paprika"]; +#line 21 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" + __o = literate; + +#line default +#line hidden + __TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"] = string.Empty; + __TestNamespace_InputTagHelper2.StringDictionaryProperty["cumin"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"]; + __TestNamespace_InputTagHelper1 = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); +#line 22 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" +__TestNamespace_InputTagHelper1.IntDictionaryProperty["value"] = 37; + +#line default +#line hidden + __TestNamespace_InputTagHelper2.IntDictionaryProperty["value"] = __TestNamespace_InputTagHelper1.IntDictionaryProperty["value"]; + __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"] = "string"; + __TestNamespace_InputTagHelper2.StringDictionaryProperty["thyme"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"]; + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..5b59f7ed99 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.mappings.txt @@ -0,0 +1,75 @@ +Source Location: (35:2,2 [242] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +| + var literate = "or illiterate"; + var intDictionary = new Dictionary + { + { "three", 3 }, + }; + var stringDictionary = new SortedDictionary + { + { "name", "value" }, + }; +| +Generated Location: (872:18,2 [242] ) +| + var literate = "or illiterate"; + var intDictionary = new Dictionary + { + { "three", 3 }, + }; + var stringDictionary = new SortedDictionary + { + { "name", "value" }, + }; +| + +Source Location: (368:15,43 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|intDictionary| +Generated Location: (1515:34,56 [13] ) +|intDictionary| + +Source Location: (402:15,77 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|stringDictionary| +Generated Location: (1867:40,77 [16] ) +|stringDictionary| + +Source Location: (466:16,43 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|intDictionary| +Generated Location: (2417:48,56 [13] ) +|intDictionary| + +Source Location: (500:16,77 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|37| +Generated Location: (2769:54,77 [2] ) +|37| + +Source Location: (524:16,101 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|42| +Generated Location: (3154:60,101 [2] ) +|42| + +Source Location: (588:18,31 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|42| +Generated Location: (3675:68,46 [2] ) +|42| + +Source Location: (609:18,52 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|37| +Generated Location: (4004:74,64 [2] ) +|37| + +Source Location: (632:18,75 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|98| +Generated Location: (4359:80,75 [2] ) +|98| + +Source Location: (781:20,42 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|literate| +Generated Location: (5144:90,45 [8] ) +|literate| + +Source Location: (824:21,29 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) +|37| +Generated Location: (5808:99,65 [2] ) +|37| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.codegen.cs new file mode 100644 index 0000000000..48804e06bb --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.codegen.cs @@ -0,0 +1,22 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::InputTagHelper __InputTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __InputTagHelper = CreateTagHelper(); + __InputTagHelper.FooProp = "Hello"; + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.mappings.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.codegen.cs new file mode 100644 index 0000000000..1786e340dd --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.codegen.cs @@ -0,0 +1,26 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml" +__TestNamespace_PTagHelper.Age = 1337; + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.mappings.txt new file mode 100644 index 0000000000..27e35058a8 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (65:3,28 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml) +|1337| +Generated Location: (923:18,33 [4] ) +|1337| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.codegen.cs new file mode 100644 index 0000000000..798fa9f6e8 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.codegen.cs @@ -0,0 +1,26 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml" +__TestNamespace_PTagHelper.Age = 1337; + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.mappings.txt new file mode 100644 index 0000000000..986623f046 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (61:2,28 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml) +|1337| +Generated Location: (869:18,33 [4] ) +|1337| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.codegen.cs new file mode 100644 index 0000000000..fc0ffa428b --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.codegen.cs @@ -0,0 +1,49 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml" +__TestNamespace_CatchAllTagHelper.ListItems = items; + +#line default +#line hidden + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml" +__TestNamespace_CatchAllTagHelper.ArrayItems = items; + +#line default +#line hidden + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml" +__TestNamespace_CatchAllTagHelper.Event1 = doSomething(); + +#line default +#line hidden + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); +#line 15 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml" +__TestNamespace_CatchAllTagHelper.Event2 = doSomething(); + +#line default +#line hidden + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper.StringProperty1 = "value"; + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper = CreateTagHelper(); + __TestNamespace_CatchAllTagHelper.StringProperty2 = "value"; + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.mappings.txt new file mode 100644 index 0000000000..f5a08848ae --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.mappings.txt @@ -0,0 +1,20 @@ +Source Location: (294:11,18 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) +|items| +Generated Location: (923:18,46 [5] ) +|items| + +Source Location: (343:12,20 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) +|items| +Generated Location: (1216:24,47 [5] ) +|items| + +Source Location: (397:13,23 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) +|doSomething()| +Generated Location: (1505:30,43 [13] ) +|doSomething()| + +Source Location: (479:14,24 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) +|doSomething()| +Generated Location: (1802:36,43 [13] ) +|doSomething()| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.codegen.cs new file mode 100644 index 0000000000..2aba9364ef --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.codegen.cs @@ -0,0 +1,27 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::InputTagHelper __InputTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __InputTagHelper = CreateTagHelper(); +#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml" + __o = Hello; + +#line default +#line hidden + __InputTagHelper.BoundProp = string.Empty; + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.mappings.txt new file mode 100644 index 0000000000..ce6ac25981 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (57:2,18 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml) +|Hello| +Generated Location: (845:18,21 [5] ) +|Hello| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs index f0c0418b3d..bcbab46182 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs @@ -34,13 +34,15 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles ); __InputTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__InputTagHelper); - BeginAddHtmlAttributeValues(__tagHelperExecutionContext, "bound", 1, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); + BeginWriteTagHelperAttribute(); #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml" -AddHtmlAttributeValue("", 56, Hello, 56, 6, false); + WriteLiteral(Hello); #line default #line hidden - EndAddHtmlAttributeValues(__tagHelperExecutionContext); + __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); + __InputTagHelper.BoundProp = __tagHelperStringValueBuffer; + __tagHelperExecutionContext.AddTagHelperAttribute("bound", __InputTagHelper.BoundProp, global::Microsoft.AspNetCore.Razor.Evolution.Legacy.HtmlAttributeValueStyle.DoubleQuotes); BeginWriteTagHelperAttribute(); WriteLiteral("text"); __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.codegen.cs new file mode 100644 index 0000000000..fda9909a60 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.codegen.cs @@ -0,0 +1,47 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper = null; + private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2 = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml" +__TestNamespace_PTagHelper.Age = 1337; + +#line default +#line hidden +#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml" + __o = true; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "text"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml" +__TestNamespace_PTagHelper.Age = 1234; + +#line default +#line hidden + __TestNamespace_InputTagHelper = CreateTagHelper(); + __TestNamespace_InputTagHelper2 = CreateTagHelper(); + __TestNamespace_InputTagHelper.Type = "password"; + __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.mappings.txt new file mode 100644 index 0000000000..d499cd0530 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.mappings.txt @@ -0,0 +1,15 @@ +Source Location: (72:5,21 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml) +|1337| +Generated Location: (1101:20,33 [4] ) +|1337| + +Source Location: (97:6,19 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml) +|true| +Generated Location: (1274:25,22 [4] ) +|true| + +Source Location: (184:10,11 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml) +|1234| +Generated Location: (1910:35,33 [4] ) +|1234| + diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.codegen.cs new file mode 100644 index 0000000000..0d82c76a00 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.codegen.cs @@ -0,0 +1,73 @@ +namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles +{ + #line hidden + using System; + using System.Threading.Tasks; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes_DesignTime + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + private static System.Object __o = null; + private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper = null; + #pragma warning disable 1998 + public async System.Threading.Tasks.Task ExecuteAsync() + { +#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" + + var @class = "container-fluid"; + var @int = 1; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" +__TestNamespace_PTagHelper.Age = 1337; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" + __o = @class; + +#line default +#line hidden +#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" +__TestNamespace_PTagHelper.Age = 42; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" +__TestNamespace_PTagHelper.Age = 42 + @int; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" +__TestNamespace_PTagHelper.Age = int; + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" +__TestNamespace_PTagHelper.Age = (@int); + +#line default +#line hidden + __TestNamespace_PTagHelper = CreateTagHelper(); +#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" + __o = @class; + +#line default +#line hidden +#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" +__TestNamespace_PTagHelper.Age = 4 * @(@int + 2); + +#line default +#line hidden + } + #pragma warning restore 1998 + } +} diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.mappings.txt new file mode 100644 index 0000000000..829fe8293b --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.mappings.txt @@ -0,0 +1,86 @@ +Source Location: (33:1,2 [59] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +| + var @class = "container-fluid"; + var @int = 1; +| +Generated Location: (777:17,2 [59] ) +| + var @class = "container-fluid"; + var @int = 1; +| + +Source Location: (120:6,23 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|1337| +Generated Location: (1103:25,33 [4] ) +|1337| + +Source Location: (155:7,12 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|@class| +Generated Location: (1359:31,15 [6] ) +|@class| + +Source Location: (169:7,26 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|42| +Generated Location: (1540:36,33 [2] ) +|42| + +Source Location: (200:8,21 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|42 + | +Generated Location: (1812:42,33 [5] ) +|42 + | + +Source Location: (205:8,26 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|@| +Generated Location: (1817:42,38 [1] ) +|@| + +Source Location: (206:8,27 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|int| +Generated Location: (1818:42,39 [3] ) +|int| + +Source Location: (239:9,22 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|int| +Generated Location: (2092:48,33 [3] ) +|int| + +Source Location: (272:10,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|(| +Generated Location: (2366:54,33 [1] ) +|(| + +Source Location: (273:10,23 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|@int| +Generated Location: (2367:54,34 [4] ) +|@int| + +Source Location: (277:10,27 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|)| +Generated Location: (2371:54,38 [1] ) +|)| + +Source Location: (305:11,19 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|@class| +Generated Location: (2632:60,22 [6] ) +|@class| + +Source Location: (319:11,33 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|4 * | +Generated Location: (2814:65,33 [4] ) +|4 * | + +Source Location: (323:11,37 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|@(| +Generated Location: (2818:65,37 [2] ) +|@(| + +Source Location: (325:11,39 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|@int + 2| +Generated Location: (2820:65,39 [8] ) +|@int + 2| + +Source Location: (333:11,47 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) +|)| +Generated Location: (2828:65,47 [1] ) +|)| +