diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/DefaultInstrumentationPass.cs b/src/Microsoft.AspNetCore.Razor.Evolution/DefaultInstrumentationPass.cs index fe6e253041..f08c8dd5a5 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/DefaultInstrumentationPass.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/DefaultInstrumentationPass.cs @@ -28,8 +28,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution private static void AddInstrumentation(InstrumentationItem item) { - var beginContextMethodName = "Instrumentation.BeginContext"; /* ORIGINAL: BeginContextMethodName */ - var endContextMethodName = "Instrumentation.EndContext"; /* ORIGINAL: EndContextMethodName */ + var beginContextMethodName = "BeginContext"; /* ORIGINAL: BeginContextMethodName */ + var endContextMethodName = "EndContext"; /* ORIGINAL: EndContextMethodName */ var beginNode = new CSharpStatementIRNode() { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/Intermediate/RazorIRAssert.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/Intermediate/RazorIRAssert.cs index fb2c3e4f47..2f92bb5ee5 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/Intermediate/RazorIRAssert.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/Intermediate/RazorIRAssert.cs @@ -219,7 +219,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate try { var beginNode = Assert.IsType(node); - Assert.Equal($"Instrumentation.BeginContext({expected});", beginNode.Content); + Assert.Equal($"BeginContext({expected});", beginNode.Content); } catch (XunitException e) { @@ -232,7 +232,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Intermediate try { var endNode = Assert.IsType(node); - Assert.Equal("Instrumentation.EndContext();", endNode.Content); + Assert.Equal("EndContext();", endNode.Content); } catch (XunitException e) { diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.codegen.cs index a465a9aad5..4f7957ce1d 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.codegen.cs @@ -32,23 +32,23 @@ namespace #pragma warning disable 1998 () { - Instrumentation.BeginContext(31, 28, true); + BeginContext(31, 28, true); WriteLiteral("Hola\r\n"); - Instrumentation.EndContext(); - Instrumentation.BeginContext(61, 7, false); + EndContext(); + BeginContext(61, 7, false); #line 3 "TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.cshtml" Write("Hello"); #line default #line hidden - Instrumentation.EndContext(); - Instrumentation.BeginContext(69, 2, true); + EndContext(); + BeginContext(69, 2, true); WriteLiteral("\r\n"); - Instrumentation.EndContext(); + EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { - Instrumentation.BeginContext(91, 6, true); + BeginContext(91, 6, true); WriteLiteral("\r\n "); - Instrumentation.EndContext(); + EndContext(); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { } ); @@ -57,7 +57,7 @@ Write("Hello"); __InputTagHelper.FooProp = (string)__tagHelperAttribute_0.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - Instrumentation.BeginContext(97, 33, false); + BeginContext(97, 33, false); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -65,16 +65,16 @@ Write("Hello"); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); - Instrumentation.EndContext(); - Instrumentation.BeginContext(130, 2, true); + EndContext(); + BeginContext(130, 2, true); WriteLiteral("\r\n"); - Instrumentation.EndContext(); + EndContext(); } ); __FormTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__FormTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); - Instrumentation.BeginContext(71, 68, false); + BeginContext(71, 68, false); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { @@ -82,7 +82,7 @@ Write("Hello"); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); - Instrumentation.EndContext(); + EndContext(); } #pragma warning restore 1998 } diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.ir.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.ir.txt index 83264b0150..125fcc7354 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.ir.txt +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.ir.txt @@ -9,34 +9,34 @@ Document - DeclarePreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 - unbound - foo - HtmlAttributeValueStyle.DoubleQuotes DeclareTagHelperFields - - FormTagHelper - InputTagHelper RazorMethodDeclaration - - - - - - CSharpStatement - - Instrumentation.BeginContext(31, 28, true); + CSharpStatement - - BeginContext(31, 28, true); HtmlContent - (31:1,0 [28] BasicTest.cshtml) - Hola\n - CSharpStatement - - Instrumentation.EndContext(); - CSharpStatement - - Instrumentation.BeginContext(61, 7, false); + CSharpStatement - - EndContext(); + CSharpStatement - - BeginContext(61, 7, false); CSharpExpression - (61:2,2 [7] BasicTest.cshtml) CSharpToken - (61:2,2 [7] BasicTest.cshtml) - "Hello" - CSharpStatement - - Instrumentation.EndContext(); - CSharpStatement - - Instrumentation.BeginContext(69, 2, true); + CSharpStatement - - EndContext(); + CSharpStatement - - BeginContext(69, 2, true); HtmlContent - (69:2,10 [2] BasicTest.cshtml) - \n - CSharpStatement - - Instrumentation.EndContext(); + CSharpStatement - - EndContext(); TagHelper - (71:3,0 [68] BasicTest.cshtml) InitializeTagHelperStructure - - form - TagMode.StartTagAndEndTag - CSharpStatement - - Instrumentation.BeginContext(91, 6, true); + CSharpStatement - - BeginContext(91, 6, true); HtmlContent - (91:3,20 [6] BasicTest.cshtml) - \n - CSharpStatement - - Instrumentation.EndContext(); + CSharpStatement - - EndContext(); TagHelper - (97:4,4 [33] BasicTest.cshtml) InitializeTagHelperStructure - - input - TagMode.SelfClosing CreateTagHelper - - InputTagHelper SetPreallocatedTagHelperProperty - - __tagHelperAttribute_0 - value - FooProp AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_1 - CSharpStatement - - Instrumentation.BeginContext(97, 33, false); + CSharpStatement - - BeginContext(97, 33, false); ExecuteTagHelpers - - CSharpStatement - - Instrumentation.EndContext(); - CSharpStatement - - Instrumentation.BeginContext(130, 2, true); + CSharpStatement - - EndContext(); + CSharpStatement - - BeginContext(130, 2, true); HtmlContent - (130:4,37 [2] BasicTest.cshtml) - \n - CSharpStatement - - Instrumentation.EndContext(); + CSharpStatement - - EndContext(); CreateTagHelper - - FormTagHelper AddPreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 - CSharpStatement - - Instrumentation.BeginContext(71, 68, false); + CSharpStatement - - BeginContext(71, 68, false); ExecuteTagHelpers - - CSharpStatement - - Instrumentation.EndContext(); + CSharpStatement - - EndContext();