From ff05e671ac721d60c471416da0fbc8684ff1735d Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Wed, 29 Mar 2017 12:19:16 -0700 Subject: [PATCH] Don't render directive token from imports in design time --- .../DesignTimeCSharpRenderer.cs | 8 +++- .../TestFiles/Output/DesignTime/Basic.cs | 44 ------------------- .../Output/DesignTime/Basic.mappings.txt | 4 +- .../TestFiles/Output/DesignTime/Inject.cs | 44 ------------------- .../Output/DesignTime/Inject.mappings.txt | 4 +- .../Output/DesignTime/InjectWithModel.cs | 44 ------------------- .../DesignTime/InjectWithModel.mappings.txt | 10 ++--- .../Output/DesignTime/InjectWithSemicolon.cs | 44 ------------------- .../InjectWithSemicolon.mappings.txt | 18 ++++---- .../TestFiles/Output/DesignTime/Model.cs | 44 ------------------- .../Output/DesignTime/Model.mappings.txt | 2 +- .../DesignTime/ModelExpressionTagHelper.cs | 44 ------------------- .../ModelExpressionTagHelper.mappings.txt | 8 ++-- .../Output/DesignTime/MultipleModels.cs | 44 ------------------- .../DesignTime/MultipleModels.mappings.txt | 4 +- .../Output/DesignTime/_ViewImports.cs | 44 ------------------- .../DesignTime/_ViewImports.mappings.txt | 4 +- .../TestFiles/DesignTime/Simple.txt | 4 -- .../BasicImports_DesignTime.codegen.cs | 4 -- 19 files changed, 34 insertions(+), 388 deletions(-) diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/DesignTimeCSharpRenderer.cs b/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/DesignTimeCSharpRenderer.cs index af82431e0..9647758ea 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/DesignTimeCSharpRenderer.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/DesignTimeCSharpRenderer.cs @@ -110,8 +110,14 @@ public override void VisitDirectiveToken(DirectiveTokenIRNode node) const string TypeHelper = "__typeHelper"; var tokenKind = node.Descriptor.Kind; - if (node.Source == null) + if (!node.Source.HasValue || + (Context.SourceDocument.FileName != null && + !string.Equals( + Context.SourceDocument.FileName, + node.Source.Value.FilePath, + StringComparison.OrdinalIgnoreCase))) { + // We don't want to handle directives from imports. return; } diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Basic.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Basic.cs index 81ec738f7..ad71ae86a 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Basic.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Basic.cs @@ -33,50 +33,6 @@ public class _TestFiles_Input_Basic_cshtml : global::Microsoft.AspNetCore.Mvc.Ra { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Json = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IViewComponentHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Component = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IUrlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Url = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object ModelExpressionProvider = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); } #pragma warning restore 219 private static System.Object __o = null; diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Basic.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Basic.mappings.txt index fbda2bb64..0c9b50dd6 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Basic.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Basic.mappings.txt @@ -1,10 +1,10 @@ Source Location: (13:0,13 [4] /TestFiles/Input/Basic.cshtml) |logo| -Generated Location: (2370:86,13 [4] ) +Generated Location: (1024:42,13 [4] ) |logo| Source Location: (43:2,5 [21] /TestFiles/Input/Basic.cshtml) |Html.Input("SomeKey")| -Generated Location: (2455:91,6 [21] ) +Generated Location: (1109:47,6 [21] ) |Html.Input("SomeKey")| diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Inject.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Inject.cs index ecf30b969..b0499f27c 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Inject.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Inject.cs @@ -39,50 +39,6 @@ public class _TestFiles_Input_Inject_cshtml : global::Microsoft.AspNetCore.Mvc.R #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Json = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IViewComponentHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Component = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IUrlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Url = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object ModelExpressionProvider = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { MyApp __typeHelper = null; } ))(); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Inject.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Inject.mappings.txt index 556a812ae..a33da933a 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Inject.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Inject.mappings.txt @@ -1,10 +1,10 @@ Source Location: (28:1,8 [5] /TestFiles/Input/Inject.cshtml) |MyApp| -Generated Location: (2215:85,0 [5] ) +Generated Location: (869:41,0 [5] ) |MyApp| Source Location: (34:1,14 [14] /TestFiles/Input/Inject.cshtml) |MyPropertyName| -Generated Location: (2317:89,14 [14] ) +Generated Location: (971:45,14 [14] ) |MyPropertyName| diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithModel.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithModel.cs index b1979dcad..d88bc1f10 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithModel.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithModel.cs @@ -34,50 +34,6 @@ public class _TestFiles_Input_InjectWithModel_cshtml : global::Microsoft.AspNetC #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Json = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IViewComponentHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Component = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IUrlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Url = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object ModelExpressionProvider = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { MyModel __typeHelper = null; } ))(); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithModel.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithModel.mappings.txt index b0f27acfc..c71e253e1 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithModel.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithModel.mappings.txt @@ -1,25 +1,25 @@ Source Location: (7:0,7 [7] /TestFiles/Input/InjectWithModel.cshtml) |MyModel| -Generated Location: (2117:80,0 [7] ) +Generated Location: (771:36,0 [7] ) |MyModel| Source Location: (24:1,8 [5] /TestFiles/Input/InjectWithModel.cshtml) |MyApp| -Generated Location: (2207:84,0 [5] ) +Generated Location: (861:40,0 [5] ) |MyApp| Source Location: (30:1,14 [14] /TestFiles/Input/InjectWithModel.cshtml) |MyPropertyName| -Generated Location: (2309:88,14 [14] ) +Generated Location: (963:44,14 [14] ) |MyPropertyName| Source Location: (54:2,8 [17] /TestFiles/Input/InjectWithModel.cshtml) |MyService| -Generated Location: (2393:92,0 [17] ) +Generated Location: (1047:48,0 [17] ) |MyService| Source Location: (72:2,26 [4] /TestFiles/Input/InjectWithModel.cshtml) |Html| -Generated Location: (2507:96,14 [4] ) +Generated Location: (1161:52,14 [4] ) |Html| diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs index d1ad58987..1418f3959 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs @@ -34,50 +34,6 @@ public class _TestFiles_Input_InjectWithSemicolon_cshtml : global::Microsoft.Asp #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Json = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IViewComponentHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Component = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IUrlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Url = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object ModelExpressionProvider = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { MyModel __typeHelper = null; } ))(); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.mappings.txt index 9736b49d9..4e2caf43c 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.mappings.txt @@ -1,45 +1,45 @@ Source Location: (7:0,7 [7] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyModel| -Generated Location: (2121:80,0 [7] ) +Generated Location: (775:36,0 [7] ) |MyModel| Source Location: (24:1,8 [5] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyApp| -Generated Location: (2211:84,0 [5] ) +Generated Location: (865:40,0 [5] ) |MyApp| Source Location: (30:1,14 [14] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyPropertyName| -Generated Location: (2313:88,14 [14] ) +Generated Location: (967:44,14 [14] ) |MyPropertyName| Source Location: (58:2,8 [17] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyService| -Generated Location: (2397:92,0 [17] ) +Generated Location: (1051:48,0 [17] ) |MyService| Source Location: (76:2,26 [4] /TestFiles/Input/InjectWithSemicolon.cshtml) |Html| -Generated Location: (2511:96,14 [4] ) +Generated Location: (1165:52,14 [4] ) |Html| Source Location: (93:3,8 [5] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyApp| -Generated Location: (2585:100,0 [5] ) +Generated Location: (1239:56,0 [5] ) |MyApp| Source Location: (99:3,14 [15] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyPropertyName2| -Generated Location: (2687:104,14 [15] ) +Generated Location: (1341:60,14 [15] ) |MyPropertyName2| Source Location: (129:4,8 [17] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyService| -Generated Location: (2772:108,0 [17] ) +Generated Location: (1426:64,0 [17] ) |MyService| Source Location: (147:4,26 [5] /TestFiles/Input/InjectWithSemicolon.cshtml) |Html2| -Generated Location: (2886:112,14 [5] ) +Generated Location: (1540:68,14 [5] ) |Html2| diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Model.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Model.cs index 3acdecfc5..7a1559406 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Model.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Model.cs @@ -34,50 +34,6 @@ public class _TestFiles_Input_Model_cshtml : global::Microsoft.AspNetCore.Mvc.Ra #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Json = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IViewComponentHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Component = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IUrlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Url = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object ModelExpressionProvider = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { System.Collections.IEnumerable __typeHelper = null; } ))(); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Model.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Model.mappings.txt index 518a4ebcc..5078bb289 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Model.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/Model.mappings.txt @@ -1,5 +1,5 @@ Source Location: (7:0,7 [30] /TestFiles/Input/Model.cshtml) |System.Collections.IEnumerable| -Generated Location: (2153:80,0 [30] ) +Generated Location: (807:36,0 [30] ) |System.Collections.IEnumerable| diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs index 0a8f518b4..5dd0c067f 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs @@ -34,50 +34,6 @@ public class _TestFiles_Input_ModelExpressionTagHelper_cshtml : global::Microsof #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Json = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IViewComponentHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Component = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IUrlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Url = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object ModelExpressionProvider = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { DateTime __typeHelper = null; } ))(); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.mappings.txt index 1b2e59d67..9d6d23bcd 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.mappings.txt @@ -1,20 +1,20 @@ Source Location: (7:0,7 [8] /TestFiles/Input/ModelExpressionTagHelper.cshtml) |DateTime| -Generated Location: (2128:80,0 [8] ) +Generated Location: (782:36,0 [8] ) |DateTime| Source Location: (33:2,14 [108] /TestFiles/Input/ModelExpressionTagHelper.cshtml) |Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Extensions.Test| -Generated Location: (2249:84,30 [108] ) +Generated Location: (903:40,30 [108] ) |Microsoft.AspNetCore.Mvc.Razor.Extensions.InputTestTagHelper, Microsoft.AspNetCore.Mvc.Razor.Extensions.Test| Source Location: (162:4,17 [3] /TestFiles/Input/ModelExpressionTagHelper.cshtml) |Now| -Generated Location: (3144:96,144 [3] ) +Generated Location: (1798:52,144 [3] ) |Now| Source Location: (189:5,18 [5] /TestFiles/Input/ModelExpressionTagHelper.cshtml) |Model| -Generated Location: (3545:102,136 [5] ) +Generated Location: (2199:58,136 [5] ) |Model| diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/MultipleModels.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/MultipleModels.cs index bd68ab404..0a5be0e64 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/MultipleModels.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/MultipleModels.cs @@ -34,50 +34,6 @@ public class _TestFiles_Input_MultipleModels_cshtml : global::Microsoft.AspNetCo #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Json = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IViewComponentHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Component = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IUrlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Url = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object ModelExpressionProvider = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { ThisShouldBeGenerated __typeHelper = null; } ))(); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/MultipleModels.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/MultipleModels.mappings.txt index 7a28c7cbc..912bec6f2 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/MultipleModels.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/MultipleModels.mappings.txt @@ -1,10 +1,10 @@ Source Location: (7:0,7 [21] /TestFiles/Input/MultipleModels.cshtml) |ThisShouldBeGenerated| -Generated Location: (2162:80,0 [21] ) +Generated Location: (816:36,0 [21] ) |ThisShouldBeGenerated| Source Location: (37:1,7 [30] /TestFiles/Input/MultipleModels.cshtml) |System.Collections.IEnumerable| -Generated Location: (2266:84,0 [30] ) +Generated Location: (920:40,0 [30] ) |System.Collections.IEnumerable| diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/_ViewImports.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/_ViewImports.cs index fd22e7601..fba392826 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/_ViewImports.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/_ViewImports.cs @@ -34,50 +34,6 @@ public class _TestFiles_Input__ViewImports_cshtml : global::Microsoft.AspNetCore #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Html = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Json = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IViewComponentHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Component = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.IUrlHelper __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object Url = null; - } - ))(); - ((System.Action)(() => { -global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider __typeHelper = null; - } - ))(); - ((System.Action)(() => { -System.Object ModelExpressionProvider = null; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { IHtmlHelper __typeHelper = null; } ))(); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/_ViewImports.mappings.txt b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/_ViewImports.mappings.txt index 040ad30dd..181989262 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/_ViewImports.mappings.txt +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/TestFiles/Output/DesignTime/_ViewImports.mappings.txt @@ -1,10 +1,10 @@ Source Location: (8:0,8 [19] /TestFiles/Input/_ViewImports.cshtml) |IHtmlHelper| -Generated Location: (2128:80,0 [19] ) +Generated Location: (782:36,0 [19] ) |IHtmlHelper| Source Location: (28:0,28 [5] /TestFiles/Input/_ViewImports.cshtml) |Model| -Generated Location: (2244:84,14 [5] ) +Generated Location: (898:40,14 [5] ) |Model| diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/DesignTime/Simple.txt b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/DesignTime/Simple.txt index f563a2f78..1819ec02a 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/DesignTime/Simple.txt +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/DesignTime/Simple.txt @@ -7,10 +7,6 @@ { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -System.Object __typeHelper = "*, Test"; - } - ))(); } #pragma warning restore 219 private static System.Object __o = null; diff --git a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicImports_DesignTime.codegen.cs b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicImports_DesignTime.codegen.cs index 1eb1023ee..e5dda75b4 100644 --- a/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicImports_DesignTime.codegen.cs +++ b/test/Microsoft.AspNetCore.Razor.Evolution.Test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicImports_DesignTime.codegen.cs @@ -22,10 +22,6 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicImpor { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { - ((System.Action)(() => { -Hello __typeHelper = null; - } - ))(); } #pragma warning restore 219 private static System.Object __o = null;