From ddbd603653b001fcd0985ccc4b166d013c7df854 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 10 Jun 2015 12:11:46 -0700 Subject: [PATCH] Enable instrumentation for TagHelpers. - Removed old code that disabled instrumentation for TagHelper bodies. Instrumentation will throw out sections for begin/end context that don't make it to the final output. - Added instrumentation around WriteTagHelperAsync. Any content inside of the TagHelper will get sub-mapped via begin/end context. - Hand verified BasicTagHelpers.cs begin/end context tests to ensure correctness. #172 --- .../CodeGenerators/CSharpCodeWriter.cs | 8 +-- .../CSharpTagHelperCodeRenderer.cs | 17 ++--- .../CSharpTagHelperRenderingUnitTest.cs | 9 +++ .../Output/AttributeTargetingTagHelpers.cs | 18 +++++ ...TagHelpers.CustomAttributeCodeGenerator.cs | 16 +++++ .../Output/BasicTagHelpers.Prefixed.cs | 8 +++ .../CodeGenerator/Output/BasicTagHelpers.cs | 16 +++++ .../CodeGenerator/Output/ComplexTagHelpers.cs | 68 +++++++++++++++++++ .../Output/DuplicateTargetTagHelper.cs | 2 + .../Output/EmptyAttributeTagHelpers.cs | 10 +++ .../CodeGenerator/Output/EscapedTagHelpers.cs | 2 + .../Output/MinimizedTagHelpers.cs | 20 ++++++ .../PrefixedAttributeTagHelpers.Reversed.cs | 8 +++ .../Output/PrefixedAttributeTagHelpers.cs | 8 +++ .../CodeGenerator/Output/SingleTagHelper.cs | 4 ++ .../Output/TagHelpersInSection.cs | 12 ++++ 16 files changed, 212 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.AspNet.Razor/CodeGenerators/CSharpCodeWriter.cs b/src/Microsoft.AspNet.Razor/CodeGenerators/CSharpCodeWriter.cs index 3782cff4de..44cd85e2f2 100644 --- a/src/Microsoft.AspNet.Razor/CodeGenerators/CSharpCodeWriter.cs +++ b/src/Microsoft.AspNet.Razor/CodeGenerators/CSharpCodeWriter.cs @@ -464,7 +464,7 @@ namespace Microsoft.AspNet.Razor.CodeGenerators Write("\""); } - public void WriteStartInstrumentationContext( + public CSharpCodeWriter WriteStartInstrumentationContext( ChunkGeneratorContext context, SyntaxTreeNode syntaxNode, bool isLiteral) @@ -475,12 +475,12 @@ namespace Microsoft.AspNet.Razor.CodeGenerators Write(syntaxNode.Length.ToString(CultureInfo.InvariantCulture)); WriteParameterSeparator(); Write(isLiteral ? "true" : "false"); - WriteEndMethodInvocation(); + return WriteEndMethodInvocation(); } - public void WriteEndInstrumentationContext(ChunkGeneratorContext context) + public CSharpCodeWriter WriteEndInstrumentationContext(ChunkGeneratorContext context) { - WriteMethodInvocation(context.Host.GeneratedClassContext.EndContextMethodName); + return WriteMethodInvocation(context.Host.GeneratedClassContext.EndContextMethodName); } } } diff --git a/src/Microsoft.AspNet.Razor/CodeGenerators/CSharpTagHelperCodeRenderer.cs b/src/Microsoft.AspNet.Razor/CodeGenerators/CSharpTagHelperCodeRenderer.cs index b8040cd794..4bf8acaedb 100644 --- a/src/Microsoft.AspNet.Razor/CodeGenerators/CSharpTagHelperCodeRenderer.cs +++ b/src/Microsoft.AspNet.Razor/CodeGenerators/CSharpTagHelperCodeRenderer.cs @@ -75,7 +75,7 @@ namespace Microsoft.AspNet.Razor.CodeGenerators if (!_designTimeMode) { RenderRunTagHelpers(); - RenderWriteTagHelperMethodCall(); + RenderWriteTagHelperMethodCall(chunk); RenderEndTagHelpersScope(); } } @@ -114,18 +114,12 @@ namespace Microsoft.AspNet.Razor.CodeGenerators var oldWriter = _context.TargetWriterName; _context.TargetWriterName = null; - // Disabling instrumentation inside TagHelper bodies since we never know if it's accurate - var oldInstrumentation = _context.Host.EnableInstrumentation; - _context.Host.EnableInstrumentation = false; - using (_writer.BuildAsyncLambda(endLine: false)) { // Render all of the tag helper children. _bodyVisitor.Accept(children); } - _context.Host.EnableInstrumentation = oldInstrumentation; - _context.TargetWriterName = oldWriter; _writer.WriteParameterSeparator() @@ -481,9 +475,11 @@ namespace Microsoft.AspNet.Razor.CodeGenerators _tagHelperContext.ScopeManagerEndMethodName); } - private void RenderWriteTagHelperMethodCall() + private void RenderWriteTagHelperMethodCall(TagHelperChunk chunk) { - _writer.Write("await "); + _writer + .WriteStartInstrumentationContext(_context, chunk.Association, isLiteral: false) + .Write("await "); if (!string.IsNullOrEmpty(_context.TargetWriterName)) { @@ -499,7 +495,8 @@ namespace Microsoft.AspNet.Razor.CodeGenerators _writer .Write(ExecutionContextVariableName) - .WriteEndMethodInvocation(); + .WriteEndMethodInvocation() + .WriteEndInstrumentationContext(_context); } private void RenderRunTagHelpers() diff --git a/test/Microsoft.AspNet.Razor.Test/CodeGenerators/CSharpTagHelperRenderingUnitTest.cs b/test/Microsoft.AspNet.Razor.Test/CodeGenerators/CSharpTagHelperRenderingUnitTest.cs index a4d051b7f2..6817d68861 100644 --- a/test/Microsoft.AspNet.Razor.Test/CodeGenerators/CSharpTagHelperRenderingUnitTest.cs +++ b/test/Microsoft.AspNet.Razor.Test/CodeGenerators/CSharpTagHelperRenderingUnitTest.cs @@ -1,8 +1,11 @@ using System.Collections.Generic; +using System.Linq; using Microsoft.AspNet.Razor.Chunks; using Microsoft.AspNet.Razor.Chunks.Generators; using Microsoft.AspNet.Razor.CodeGenerators; using Microsoft.AspNet.Razor.CodeGenerators.Visitors; +using Microsoft.AspNet.Razor.Parser.SyntaxTree; +using Microsoft.AspNet.Razor.Parser.TagHelpers; using Microsoft.AspNet.Razor.TagHelpers; using Xunit; @@ -170,6 +173,12 @@ namespace Microsoft.AspNet.Razor.Test.Generator attributes: new List>(), descriptors: tagHelperDescriptors) { + Association = new TagHelperBlock( + new TagHelperBlockBuilder( + tagName, + selfClosing: false, + attributes: new List>(), + children: Enumerable.Empty())), Children = new List(), }; } diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/AttributeTargetingTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/AttributeTargetingTagHelpers.cs index 4a26806d47..1773ee0c09 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/AttributeTargetingTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/AttributeTargetingTagHelpers.cs @@ -31,18 +31,26 @@ namespace TestOutput WriteLiteral("\r\n"); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(47, 9, true); WriteLiteral("\r\n

"); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("strong", false, "test", async() => { + Instrumentation.BeginContext(78, 5, true); WriteLiteral("Hello"); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute("catchAll", Html.Raw("hi")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(56, 36, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(92, 62, true); WriteLiteral("World

\r\n \r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -60,9 +68,13 @@ namespace TestOutput #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(154, 40, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(194, 6, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -83,16 +95,22 @@ namespace TestOutput __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute("catchAll", Html.Raw("hi")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(200, 54, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(254, 2, true); WriteLiteral("\r\n"); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw("btn")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(32, 228, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs index 314b84e2c2..b8b8a4409d 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs @@ -29,16 +29,22 @@ namespace TestOutput WriteLiteral("\r\n
\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(145, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(155, 7, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(162, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -60,9 +66,13 @@ Write(ViewBag.DefaultInterval); __tagHelperExecutionContext.AddTagHelperAttribute("type", __InputTagHelper.Type); __InputTagHelper2.Type = __InputTagHelper.Type; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(172, 73, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(245, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -80,9 +90,13 @@ Write(ViewBag.DefaultInterval); #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(255, 39, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(294, 6, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -90,7 +104,9 @@ Write(ViewBag.DefaultInterval); __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw("Hello World")); __tagHelperExecutionContext.AddHtmlAttribute("data-delay", Html.Raw("1000")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(104, 200, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(304, 8, true); WriteLiteral("\r\n
"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.Prefixed.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.Prefixed.cs index dc5b722366..19fe4135f4 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.Prefixed.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.Prefixed.cs @@ -30,7 +30,9 @@ namespace TestOutput WriteLiteral("\r\n\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(135, 58, true); WriteLiteral("\r\n

\r\n \r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -48,16 +50,22 @@ namespace TestOutput #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(193, 43, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(236, 6, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw("Hello World")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(109, 140, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(249, 11, true); WriteLiteral("\r\n
"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.cs index 86c96276f5..bad2b1ca59 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.cs @@ -30,16 +30,22 @@ namespace TestOutput WriteLiteral("\r\n
\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(145, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(155, 7, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(162, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -61,9 +67,13 @@ Write(ViewBag.DefaultInterval); __tagHelperExecutionContext.AddTagHelperAttribute("type", __InputTagHelper.Type); __InputTagHelper2.Type = __InputTagHelper.Type; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(172, 73, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(245, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -81,9 +91,13 @@ Write(ViewBag.DefaultInterval); #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(255, 39, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(294, 6, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -91,7 +105,9 @@ Write(ViewBag.DefaultInterval); __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw("Hello World")); __tagHelperExecutionContext.AddHtmlAttribute("data-delay", Html.Raw("1000")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(104, 200, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(304, 8, true); WriteLiteral("\r\n
"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/ComplexTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/ComplexTagHelpers.cs index 02b1d8ff0f..bc2d154ba0 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/ComplexTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/ComplexTagHelpers.cs @@ -42,7 +42,9 @@ namespace TestOutput WriteLiteral("
\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(177, 34, true); WriteLiteral("\r\n

Set Time:

\r\n"); + Instrumentation.EndContext(); #line 10 "ComplexTagHelpers.cshtml" @@ -56,9 +58,13 @@ namespace TestOutput #line default #line hidden + Instrumentation.BeginContext(251, 16, true); WriteLiteral(" "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(270, 10, true); WriteLiteral("New Time: "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -72,16 +78,22 @@ namespace TestOutput __tagHelperExecutionContext.AddHtmlAttribute("value", Html.Raw("")); __tagHelperExecutionContext.AddHtmlAttribute("placeholder", Html.Raw("Enter in a new time...")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(280, 66, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(267, 83, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(350, 2, true); WriteLiteral("\r\n"); + Instrumentation.EndContext(); #line 13 "ComplexTagHelpers.cshtml" } else @@ -90,9 +102,13 @@ namespace TestOutput #line default #line hidden + Instrumentation.BeginContext(400, 16, true); WriteLiteral(" "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(419, 14, true); WriteLiteral("Current Time: "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -117,16 +133,22 @@ WriteLiteral(checkbox); #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(433, 37, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(416, 58, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(474, 18, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -145,9 +167,13 @@ WriteLiteral(true ? "checkbox" : "anything"); __tagHelperExecutionContext.AddTagHelperAttribute("tYPe", __InputTagHelper.Type); __InputTagHelper2.Type = __InputTagHelper.Type; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(492, 50, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(542, 18, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -193,16 +219,22 @@ if(true) { __tagHelperExecutionContext.AddTagHelperAttribute("type", __InputTagHelper.Type); __InputTagHelper2.Type = __InputTagHelper.Type; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(560, 81, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(643, 2, true); WriteLiteral("\r\n"); + Instrumentation.EndContext(); #line 19 "ComplexTagHelpers.cshtml" } #line default #line hidden + Instrumentation.BeginContext(660, 8, true); WriteLiteral(" "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -217,13 +249,17 @@ Write(DateTime.Now); __tagHelperStringValueBuffer = EndTagHelperWritingScope(); __tagHelperExecutionContext.AddHtmlAttribute("time", Html.Raw(__tagHelperStringValueBuffer.ToString())); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(139, 531, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(672, 10, true); WriteLiteral("\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(769, 2, true); WriteLiteral("\r\n"); + Instrumentation.EndContext(); #line 22 "ComplexTagHelpers.cshtml" @@ -236,7 +272,9 @@ Write(DateTime.Now); #line default #line hidden + Instrumentation.BeginContext(807, 14, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -251,9 +289,13 @@ __InputTagHelper2.Checked = @object; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("ChecKED", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(821, 30, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(851, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -267,13 +309,17 @@ __InputTagHelper2.Checked = @object; __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); __tagHelperExecutionContext.AddHtmlAttribute("unbound", Html.Raw("second value")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(682, 183, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(865, 10, true); WriteLiteral("\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(917, 14, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -290,9 +336,13 @@ __InputTagHelper2.Checked = @object; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(931, 85, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(1016, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -304,13 +354,17 @@ __PTagHelper.Age = -1970 + DateTimeOffset.Now.Year; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(875, 155, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(1030, 10, true); WriteLiteral("\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(1080, 14, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -325,9 +379,13 @@ __InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(1094, 50, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(1144, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -339,13 +397,17 @@ __PTagHelper.Age = DateTimeOffset.Now.Year - 1970; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(1040, 118, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(1158, 10, true); WriteLiteral("\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(1210, 14, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -360,9 +422,13 @@ __InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014 ; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(1224, 63, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(1287, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -374,7 +440,9 @@ __PTagHelper.Age = "My age is this long.".Length; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(1168, 133, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(1301, 14, true); WriteLiteral("\r\n
\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateTargetTagHelper.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateTargetTagHelper.cs index efaddf38c5..0e3b9aab30 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateTargetTagHelper.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateTargetTagHelper.cs @@ -46,7 +46,9 @@ namespace TestOutput __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper.Checked); __CatchAllTagHelper.Checked = __InputTagHelper.Checked; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(35, 40, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/EmptyAttributeTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/EmptyAttributeTagHelpers.cs index 358d1df2e1..e5975a2ee5 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/EmptyAttributeTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/EmptyAttributeTagHelpers.cs @@ -47,13 +47,17 @@ __InputTagHelper2.Checked = ; __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw("")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(40, 34, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(74, 6, true); WriteLiteral("\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(90, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -72,9 +76,13 @@ __InputTagHelper2.Checked = ; __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw("")); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(100, 34, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(134, 6, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -86,7 +94,9 @@ __PTagHelper.Age = ; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(80, 64, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(144, 8, true); WriteLiteral("\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/EscapedTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/EscapedTagHelpers.cs index 518e08f95a..6888838494 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/EscapedTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/EscapedTagHelpers.cs @@ -62,7 +62,9 @@ WriteLiteral(DateTime.Now); #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(186, 45, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(231, 18, true); WriteLiteral("\r\n

\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/MinimizedTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/MinimizedTagHelpers.cs index 1556df3e6a..21397ffe04 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/MinimizedTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/MinimizedTagHelpers.cs @@ -29,7 +29,9 @@ namespace TestOutput WriteLiteral("\r\n"); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(64, 34, true); WriteLiteral("\r\n \r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -38,9 +40,13 @@ namespace TestOutput __tagHelperExecutionContext.AddHtmlAttribute("class", Html.Raw("btn")); __tagHelperExecutionContext.AddMinimizedHtmlAttribute("catchall-unbound-required"); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(98, 59, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(157, 6, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -54,9 +60,13 @@ namespace TestOutput __InputTagHelper.BoundRequiredString = "hello"; __tagHelperExecutionContext.AddTagHelperAttribute("input-bound-required-string", __InputTagHelper.BoundRequiredString); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(163, 119, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(282, 6, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -72,9 +82,13 @@ namespace TestOutput __InputTagHelper.BoundRequiredString = "hello2"; __tagHelperExecutionContext.AddTagHelperAttribute("input-bound-required-string", __InputTagHelper.BoundRequiredString); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(288, 176, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(464, 6, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { } , StartTagHelperWritingScope, EndTagHelperWritingScope); @@ -89,16 +103,22 @@ namespace TestOutput __InputTagHelper.BoundRequiredString = "world"; __tagHelperExecutionContext.AddTagHelperAttribute("input-bound-required-string", __InputTagHelper.BoundRequiredString); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(470, 206, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(676, 2, true); WriteLiteral("\r\n"); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__CatchAllTagHelper); __tagHelperExecutionContext.AddMinimizedHtmlAttribute("catchall-unbound-required"); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(35, 647, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.Reversed.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.Reversed.cs index 09df5c176b..f577815d69 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.Reversed.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.Reversed.cs @@ -69,7 +69,9 @@ namespace TestOutput __tagHelperExecutionContext.AddTagHelperAttribute("string-dictionary", __InputTagHelper2.StringDictionaryProperty); __InputTagHelper1.StringDictionaryProperty = __InputTagHelper2.StringDictionaryProperty; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(331, 92, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(423, 6, true); WriteLiteral("\r\n "); @@ -112,7 +114,9 @@ namespace TestOutput __tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-grabber", __InputTagHelper2.IntDictionaryProperty["grabber"]); __InputTagHelper1.IntProperty = __InputTagHelper2.IntDictionaryProperty["grabber"]; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(429, 103, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(532, 6, true); WriteLiteral("\r\n "); @@ -181,7 +185,9 @@ WriteLiteral(literate); __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-cumin", __InputTagHelper2.StringDictionaryProperty["cumin"]); __InputTagHelper1.StringDictionaryProperty["cumin"] = __InputTagHelper2.StringDictionaryProperty["cumin"]; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(538, 257, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(795, 6, true); WriteLiteral("\r\n "); @@ -220,7 +226,9 @@ __InputTagHelper2.IntDictionaryProperty["value"] = 37; __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-thyme", __InputTagHelper2.StringDictionaryProperty["thyme"]); __InputTagHelper1.StringDictionaryProperty["thyme"] = __InputTagHelper2.StringDictionaryProperty["thyme"]; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(801, 60, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(861, 8, true); WriteLiteral("\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.cs index 815eaae2e4..f0c9090e9a 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.cs @@ -69,7 +69,9 @@ namespace TestOutput __tagHelperExecutionContext.AddTagHelperAttribute("string-dictionary", __InputTagHelper1.StringDictionaryProperty); __InputTagHelper2.StringDictionaryProperty = __InputTagHelper1.StringDictionaryProperty; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(331, 92, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(423, 6, true); WriteLiteral("\r\n "); @@ -112,7 +114,9 @@ namespace TestOutput __tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-grabber", __InputTagHelper1.IntProperty); __InputTagHelper2.IntDictionaryProperty["grabber"] = __InputTagHelper1.IntProperty; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(429, 103, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(532, 6, true); WriteLiteral("\r\n "); @@ -181,7 +185,9 @@ WriteLiteral(literate); __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-cumin", __InputTagHelper1.StringDictionaryProperty["cumin"]); __InputTagHelper2.StringDictionaryProperty["cumin"] = __InputTagHelper1.StringDictionaryProperty["cumin"]; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(538, 257, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(795, 6, true); WriteLiteral("\r\n "); @@ -220,7 +226,9 @@ __InputTagHelper1.IntDictionaryProperty["value"] = 37; __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-thyme", __InputTagHelper1.StringDictionaryProperty["thyme"]); __InputTagHelper2.StringDictionaryProperty["thyme"] = __InputTagHelper1.StringDictionaryProperty["thyme"]; __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(801, 60, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(861, 8, true); WriteLiteral("\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelper.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelper.cs index 0fe4619c00..539a8138d4 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelper.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelper.cs @@ -28,7 +28,9 @@ namespace TestOutput WriteLiteral("\r\n"); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => { + Instrumentation.BeginContext(69, 11, true); WriteLiteral("Body of Tag"); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); @@ -41,7 +43,9 @@ namespace TestOutput #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(35, 49, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersInSection.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersInSection.cs index 76be5569e5..e23dab4f1f 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersInSection.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersInSection.cs @@ -43,22 +43,32 @@ namespace TestOutput WriteLiteralTo(__razor_template_writer, "\r\n
\r\n "); Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("mytaghelper", false, "test", async() => { + Instrumentation.BeginContext(217, 52, true); WriteLiteral("\r\n In None ContentBehavior.\r\n "); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("nestedtaghelper", false, "test", async() => { + Instrumentation.BeginContext(286, 26, true); WriteLiteral("Some buffered values with "); + Instrumentation.EndContext(); + Instrumentation.BeginContext(313, 4, false); #line 11 "TagHelpersInSection.cshtml" Write(code); #line default #line hidden + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __NestedTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__NestedTagHelper); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(269, 66, false); await WriteTagHelperAsync(__tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); + Instrumentation.BeginContext(335, 10, true); WriteLiteral("\r\n "); + Instrumentation.EndContext(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __MyTagHelper = CreateTagHelper(); @@ -83,7 +93,9 @@ Write(DateTime.Now); __tagHelperStringValueBuffer = EndTagHelperWritingScope(); __tagHelperExecutionContext.AddHtmlAttribute("unboundproperty", Html.Raw(__tagHelperStringValueBuffer.ToString())); __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + Instrumentation.BeginContext(114, 245, false); await WriteTagHelperToAsync(__razor_template_writer, __tagHelperExecutionContext); + Instrumentation.EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(359, 14, true); WriteLiteralTo(__razor_template_writer, "\r\n
\r\n");