diff --git a/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/DesignTimeCSharpRenderer.cs b/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/DesignTimeCSharpRenderer.cs index af82431e0..06d913220 100644 --- a/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/DesignTimeCSharpRenderer.cs +++ b/src/Microsoft.AspNetCore.Razor.Evolution/CodeGeneration/DesignTimeCSharpRenderer.cs @@ -110,8 +110,13 @@ public override void VisitDirectiveToken(DirectiveTokenIRNode node) const string TypeHelper = "__typeHelper"; var tokenKind = node.Descriptor.Kind; - if (node.Source == null) + if (!node.Source.HasValue || + !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 ad4233a1c..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,58 +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"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, 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 0d6142981..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: (2732:94,13 [4] ) +Generated Location: (1024:42,13 [4] ) |logo| Source Location: (43:2,5 [21] /TestFiles/Input/Basic.cshtml) |Html.Input("SomeKey")| -Generated Location: (2817:99,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 30cf02bb6..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,58 +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)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, 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 70cd41702..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: (2577:93,0 [5] ) +Generated Location: (869:41,0 [5] ) |MyApp| Source Location: (34:1,14 [14] /TestFiles/Input/Inject.cshtml) |MyPropertyName| -Generated Location: (2679:97,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 8cf9cef0d..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,58 +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)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, 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 9965eae09..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: (2479:88,0 [7] ) +Generated Location: (771:36,0 [7] ) |MyModel| Source Location: (24:1,8 [5] /TestFiles/Input/InjectWithModel.cshtml) |MyApp| -Generated Location: (2569:92,0 [5] ) +Generated Location: (861:40,0 [5] ) |MyApp| Source Location: (30:1,14 [14] /TestFiles/Input/InjectWithModel.cshtml) |MyPropertyName| -Generated Location: (2671:96,14 [14] ) +Generated Location: (963:44,14 [14] ) |MyPropertyName| Source Location: (54:2,8 [17] /TestFiles/Input/InjectWithModel.cshtml) |MyService| -Generated Location: (2755:100,0 [17] ) +Generated Location: (1047:48,0 [17] ) |MyService| Source Location: (72:2,26 [4] /TestFiles/Input/InjectWithModel.cshtml) |Html| -Generated Location: (2869:104,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 c97250817..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,58 +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)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, 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 e9ac94c79..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: (2483:88,0 [7] ) +Generated Location: (775:36,0 [7] ) |MyModel| Source Location: (24:1,8 [5] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyApp| -Generated Location: (2573:92,0 [5] ) +Generated Location: (865:40,0 [5] ) |MyApp| Source Location: (30:1,14 [14] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyPropertyName| -Generated Location: (2675:96,14 [14] ) +Generated Location: (967:44,14 [14] ) |MyPropertyName| Source Location: (58:2,8 [17] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyService| -Generated Location: (2759:100,0 [17] ) +Generated Location: (1051:48,0 [17] ) |MyService| Source Location: (76:2,26 [4] /TestFiles/Input/InjectWithSemicolon.cshtml) |Html| -Generated Location: (2873:104,14 [4] ) +Generated Location: (1165:52,14 [4] ) |Html| Source Location: (93:3,8 [5] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyApp| -Generated Location: (2947:108,0 [5] ) +Generated Location: (1239:56,0 [5] ) |MyApp| Source Location: (99:3,14 [15] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyPropertyName2| -Generated Location: (3049:112,14 [15] ) +Generated Location: (1341:60,14 [15] ) |MyPropertyName2| Source Location: (129:4,8 [17] /TestFiles/Input/InjectWithSemicolon.cshtml) |MyService| -Generated Location: (3134:116,0 [17] ) +Generated Location: (1426:64,0 [17] ) |MyService| Source Location: (147:4,26 [5] /TestFiles/Input/InjectWithSemicolon.cshtml) |Html2| -Generated Location: (3248:120,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 23b712888..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,58 +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.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, 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 c411a2eb8..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: (2515:88,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 a8259774d..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,58 +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)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, 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 1e7f24d3c..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: (2490:88,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: (2611:92,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: (3506:104,144 [3] ) +Generated Location: (1798:52,144 [3] ) |Now| Source Location: (189:5,18 [5] /TestFiles/Input/ModelExpressionTagHelper.cshtml) |Model| -Generated Location: (3907:110,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 53ef20a41..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,58 +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)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, 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 a5c034f84..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: (2524:88,0 [21] ) +Generated Location: (816:36,0 [21] ) |ThisShouldBeGenerated| Source Location: (37:1,7 [30] /TestFiles/Input/MultipleModels.cshtml) |System.Collections.IEnumerable| -Generated Location: (2628:92,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 f70ebd307..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,58 +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)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor"; - } - ))(); - ((System.Action)(() => { -System.Object __typeHelper = "Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, 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 81b063889..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: (2490:88,0 [19] ) +Generated Location: (782:36,0 [19] ) |IHtmlHelper| Source Location: (28:0,28 [5] /TestFiles/Input/_ViewImports.cshtml) |Model| -Generated Location: (2606:92,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;