From 888e6bfc0009c0b2e75a31bd11d93875d0b6c2ff Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Mon, 14 Aug 2017 12:43:56 -0700 Subject: [PATCH] Fix ModelExpression's in section directive blocks. - Changed `SectionDirectivePass` to move non-token body nodes from the original `DirectiveIntermediateNode` to the `SectionIntermediateNode`. By doing this there's no longer dual references of `SectionIntermediateNode` bodies. - Added MVC tests for current and 1_X extensions. --- .../Extensions/SectionDirectivePass.cs | 4 +- .../CodeGenerationIntegrationTest.cs | 32 ++++++ .../Sections.cshtml | 14 +++ .../Sections_DesignTime.codegen.cs | 69 +++++++++++++ .../Sections_DesignTime.ir.txt | 75 ++++++++++++++ .../Sections_DesignTime.mappings.txt | 29 ++++++ .../Sections_Runtime.codegen.cs | 97 +++++++++++++++++++ .../Sections_Runtime.ir.txt | 75 ++++++++++++++ 8 files changed, 394 insertions(+), 1 deletion(-) create mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml create mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs create mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt create mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt create mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs create mode 100644 test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt diff --git a/src/Microsoft.AspNetCore.Razor.Language/Extensions/SectionDirectivePass.cs b/src/Microsoft.AspNetCore.Razor.Language/Extensions/SectionDirectivePass.cs index d0844d3ab..ea2ad395f 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Extensions/SectionDirectivePass.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Extensions/SectionDirectivePass.cs @@ -35,9 +35,11 @@ protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentInte } } - for (; i < directive.Node.Children.Count; i++) + while (i != directive.Node.Children.Count) { + // Move non-token children over to the section node so we don't have double references to children nodes. section.Children.Add(directive.Node.Children[i]); + directive.Node.Children.RemoveAt(i); } directive.InsertAfter(section); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs index ba22e8979..b6087062f 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs @@ -106,6 +106,20 @@ public void Basic_Runtime() RunRuntimeTest(references); } + [Fact] + public void Sections_Runtime() + { + var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@" +using Microsoft.AspNetCore.Mvc.ViewFeatures; + +public class InputTestTagHelper : {typeof(TagHelper).FullName} +{{ + public ModelExpression For {{ get; set; }} +}} +"); + RunRuntimeTest(references); + } + [Fact] public void _ViewImports_Runtime() { @@ -344,6 +358,24 @@ public void Basic_DesignTime() RunDesignTimeTest(references); } + [Fact] + public void Sections_DesignTime() + { + // This is a problem because we don't yet have multitargeting. + var error = "Delegate 'RenderAsyncDelegate' does not take 1 arguments"; + + var references = CreateCompilationReferences(CurrentMvcShim, appCode: $@" +using Microsoft.AspNetCore.Mvc.ViewFeatures; + +public class InputTestTagHelper : {typeof(TagHelper).FullName} +{{ + public ModelExpression For {{ get; set; }} +}} +"); + + RunDesignTimeTest(references, new[] { error }); + } + [Fact] public void _ViewImports_DesignTime() { diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml new file mode 100644 index 000000000..7438788ff --- /dev/null +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml @@ -0,0 +1,14 @@ +@model DateTime + +@addTagHelper "InputTestTagHelper, AppCode" + +@{ + Layout = "_SectionTestLayout.cshtml"; +} + +
Some body
+ +@section Section1 { +
This is in Section 1
+ +} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs new file mode 100644 index 000000000..fa72a1973 --- /dev/null +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs @@ -0,0 +1,69 @@ +// +#pragma warning disable 1591 +[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml))] +namespace AspNetCore +{ + #line hidden + using TModel = global::System.Object; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.AspNetCore.Mvc; + using Microsoft.AspNetCore.Mvc.Rendering; + using Microsoft.AspNetCore.Mvc.ViewFeatures; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + { + private global::InputTestTagHelper __InputTestTagHelper; + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((System.Action)(() => { +DateTime __typeHelper = default(DateTime); + } + ))(); + ((System.Action)(() => { +global::System.Object __typeHelper = "InputTestTagHelper, AppCode"; + } + ))(); + ((System.Action)(() => { +global::System.Object Section1 = null; + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static System.Object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + public async override global::System.Threading.Tasks.Task ExecuteAsync() + { +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" + + Layout = "_SectionTestLayout.cshtml"; + +#line default +#line hidden + DefineSection("Section1", async(__razor_section_writer) => { + __InputTestTagHelper = CreateTagHelper(); +#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" +__InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Date); + +#line default +#line hidden + } + ); + } + #pragma warning restore 1998 + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } + } +} +#pragma warning restore 1591 diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt new file mode 100644 index 000000000..195feca23 --- /dev/null +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt @@ -0,0 +1,75 @@ +Document - + CSharpCode - + IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml))] + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + DefaultTagHelperRuntime - + FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper + DesignTimeDirective - + DirectiveToken - (231:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (294:7,71 [4] ) - Html + DirectiveToken - (308:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (363:8,63 [4] ) - Json + DirectiveToken - (377:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (431:9,62 [9] ) - Component + DirectiveToken - (450:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (494:10,52 [3] ) - Url + DirectiveToken - (507:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (578:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (617:12,14 [96] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (729:13,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (832:14,14 [87] ) - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (7:0,7 [8] Sections.cshtml) - DateTime + DirectiveToken - (33:2,14 [29] Sections.cshtml) - "InputTestTagHelper, AppCode" + DirectiveToken - (152:10,9 [8] Sections.cshtml) - Section1 + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static System.Object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync + HtmlContent - (17:1,0 [2] Sections.cshtml) + IntermediateToken - (17:1,0 [2] Sections.cshtml) - Html - \n + HtmlContent - (62:2,43 [4] Sections.cshtml) + IntermediateToken - (62:2,43 [4] Sections.cshtml) - Html - \n\n + CSharpCode - (68:4,2 [46] Sections.cshtml) + IntermediateToken - (68:4,2 [46] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml";\n + HtmlContent - (117:7,0 [26] Sections.cshtml) + IntermediateToken - (117:7,0 [2] Sections.cshtml) - Html - \n + IntermediateToken - (119:8,0 [5] Sections.cshtml) - Html -
+ IntermediateToken - (124:8,5 [9] Sections.cshtml) - Html - Some body + IntermediateToken - (133:8,14 [6] Sections.cshtml) - Html -
+ IntermediateToken - (139:8,20 [4] Sections.cshtml) - Html - \n\n + Section - - Section1 + HtmlContent - (162:10,19 [43] Sections.cshtml) + IntermediateToken - (162:10,19 [6] Sections.cshtml) - Html - \n + IntermediateToken - (168:11,4 [5] Sections.cshtml) - Html -
+ IntermediateToken - (173:11,9 [20] Sections.cshtml) - Html - This is in Section 1 + IntermediateToken - (193:11,29 [6] Sections.cshtml) - Html -
+ IntermediateToken - (199:11,35 [6] Sections.cshtml) - Html - \n + TagHelper - (205:12,4 [25] Sections.cshtml) - input-test - TagMode.SelfClosing + DefaultTagHelperBody - + DefaultTagHelperCreate - - InputTestTagHelper + DefaultTagHelperProperty - (222:12,21 [4] Sections.cshtml) - for - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression InputTestTagHelper.For - HtmlAttributeValueStyle.DoubleQuotes + CSharpExpression - + IntermediateToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model => + IntermediateToken - - CSharp - __model. + IntermediateToken - (222:12,21 [4] Sections.cshtml) - CSharp - Date + IntermediateToken - - CSharp - ) + DefaultTagHelperExecute - + HtmlContent - (230:12,29 [2] Sections.cshtml) + IntermediateToken - (230:12,29 [2] Sections.cshtml) - Html - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt new file mode 100644 index 000000000..ac61f26cf --- /dev/null +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt @@ -0,0 +1,29 @@ +Source Location: (7:0,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) +|DateTime| +Generated Location: (923:20,0 [8] ) +|DateTime| + +Source Location: (33:2,14 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) +|"InputTestTagHelper, AppCode"| +Generated Location: (1064:24,37 [29] ) +|"InputTestTagHelper, AppCode"| + +Source Location: (152:10,9 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) +|Section1| +Generated Location: (1178:28,22 [8] ) +|Section1| + +Source Location: (68:4,2 [46] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) +| + Layout = "_SectionTestLayout.cshtml"; +| +Generated Location: (1613:40,2 [46] ) +| + Layout = "_SectionTestLayout.cshtml"; +| + +Source Location: (222:12,21 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) +|Date| +Generated Location: (2038:48,102 [4] ) +|Date| + diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs new file mode 100644 index 000000000..ba56f0430 --- /dev/null +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs @@ -0,0 +1,97 @@ +#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "dbec91fd88a09c6a2e35b5adedb3f8ab8e3ae486" +// +#pragma warning disable 1591 +[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml))] +namespace AspNetCore +{ + #line hidden + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.AspNetCore.Mvc; + using Microsoft.AspNetCore.Mvc.Rendering; + using Microsoft.AspNetCore.Mvc.ViewFeatures; + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + { + #line hidden + #pragma warning disable 0169 + private string __tagHelperStringValueBuffer; + #pragma warning restore 0169 + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext; + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null; + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager + { + get + { + if (__backed__tagHelperScopeManager == null) + { + __backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope); + } + return __backed__tagHelperScopeManager; + } + } + private global::InputTestTagHelper __InputTestTagHelper; + #pragma warning disable 1998 + public async override global::System.Threading.Tasks.Task ExecuteAsync() + { + BeginContext(17, 2, true); + WriteLiteral("\r\n"); + EndContext(); + BeginContext(64, 2, true); + WriteLiteral("\r\n"); + EndContext(); +#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" + + Layout = "_SectionTestLayout.cshtml"; + +#line default +#line hidden + BeginContext(117, 26, true); + WriteLiteral("\r\n
Some body
\r\n\r\n"); + EndContext(); + DefineSection("Section1", async() => { + BeginContext(162, 43, true); + WriteLiteral("\r\n
This is in Section 1
\r\n "); + EndContext(); + BeginContext(205, 25, false); + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + } + ); + __InputTestTagHelper = CreateTagHelper(); + __tagHelperExecutionContext.Add(__InputTestTagHelper); +#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" +__InputTestTagHelper.For = ModelExpressionProvider.CreateModelExpression(ViewData, __model => __model.Date); + +#line default +#line hidden + __tagHelperExecutionContext.AddTagHelperAttribute("for", __InputTestTagHelper.For, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + if (!__tagHelperExecutionContext.Output.IsContentModified) + { + await __tagHelperExecutionContext.SetOutputContentAsync(); + } + Write(__tagHelperExecutionContext.Output); + __tagHelperExecutionContext = __tagHelperScopeManager.End(); + EndContext(); + BeginContext(230, 2, true); + WriteLiteral("\r\n"); + EndContext(); + } + ); + } + #pragma warning restore 1998 + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } + } +} +#pragma warning restore 1591 diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt new file mode 100644 index 000000000..4a4f3ce12 --- /dev/null +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt @@ -0,0 +1,75 @@ +Document - + CSharpCode - + IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(null, typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml))] + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [14] ) - System + UsingDirective - (16:1,1 [34] ) - System.Collections.Generic + UsingDirective - (51:2,1 [19] ) - System.Linq + UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections_cshtml - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + DefaultTagHelperRuntime - + FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync + CSharpCode - + IntermediateToken - - CSharp - BeginContext(17, 2, true); + HtmlContent - (17:1,0 [2] Sections.cshtml) + IntermediateToken - (17:1,0 [2] Sections.cshtml) - Html - \n + CSharpCode - + IntermediateToken - - CSharp - EndContext(); + CSharpCode - + IntermediateToken - - CSharp - BeginContext(64, 2, true); + HtmlContent - (64:3,0 [2] Sections.cshtml) + IntermediateToken - (64:3,0 [2] Sections.cshtml) - Html - \n + CSharpCode - + IntermediateToken - - CSharp - EndContext(); + CSharpCode - (68:4,2 [46] Sections.cshtml) + IntermediateToken - (68:4,2 [46] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml";\n + CSharpCode - + IntermediateToken - - CSharp - BeginContext(117, 26, true); + HtmlContent - (117:7,0 [26] Sections.cshtml) + IntermediateToken - (117:7,0 [2] Sections.cshtml) - Html - \n + IntermediateToken - (119:8,0 [5] Sections.cshtml) - Html -
+ IntermediateToken - (124:8,5 [9] Sections.cshtml) - Html - Some body + IntermediateToken - (133:8,14 [6] Sections.cshtml) - Html -
+ IntermediateToken - (139:8,20 [4] Sections.cshtml) - Html - \n\n + CSharpCode - + IntermediateToken - - CSharp - EndContext(); + Section - - Section1 + CSharpCode - + IntermediateToken - - CSharp - BeginContext(162, 43, true); + HtmlContent - (162:10,19 [43] Sections.cshtml) + IntermediateToken - (162:10,19 [6] Sections.cshtml) - Html - \n + IntermediateToken - (168:11,4 [5] Sections.cshtml) - Html -
+ IntermediateToken - (173:11,9 [20] Sections.cshtml) - Html - This is in Section 1 + IntermediateToken - (193:11,29 [6] Sections.cshtml) - Html -
+ IntermediateToken - (199:11,35 [6] Sections.cshtml) - Html - \n + CSharpCode - + IntermediateToken - - CSharp - EndContext(); + CSharpCode - + IntermediateToken - - CSharp - BeginContext(205, 25, false); + TagHelper - (205:12,4 [25] Sections.cshtml) - input-test - TagMode.SelfClosing + DefaultTagHelperBody - + DefaultTagHelperCreate - - InputTestTagHelper + DefaultTagHelperProperty - (222:12,21 [4] Sections.cshtml) - for - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression InputTestTagHelper.For - HtmlAttributeValueStyle.DoubleQuotes + CSharpExpression - + IntermediateToken - - CSharp - ModelExpressionProvider.CreateModelExpression(ViewData, __model => + IntermediateToken - - CSharp - __model. + IntermediateToken - (222:12,21 [4] Sections.cshtml) - CSharp - Date + IntermediateToken - - CSharp - ) + DefaultTagHelperExecute - + CSharpCode - + IntermediateToken - - CSharp - EndContext(); + CSharpCode - + IntermediateToken - - CSharp - BeginContext(230, 2, true); + HtmlContent - (230:12,29 [2] Sections.cshtml) + IntermediateToken - (230:12,29 [2] Sections.cshtml) - Html - \n + CSharpCode - + IntermediateToken - - CSharp - EndContext(); + Inject - + Inject - + Inject - + Inject - + Inject -