diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/CodeGenerationIntegrationTest.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/CodeGenerationIntegrationTest.cs index b154ab5ad1b..17c174ec994 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/CodeGenerationIntegrationTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/CodeGenerationIntegrationTest.cs @@ -7,20 +7,39 @@ using System.Collections.Immutable; using System.Linq; using System.Runtime.CompilerServices; -using Microsoft.AspNetCore.Razor.Language.Extensions; +using Microsoft.AspNetCore.Mvc.Razor.Extensions; using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis; using Roslyn.Test.Utilities; namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests; -public class CodeGenerationIntegrationTest(bool designTime = false) - : IntegrationTestBase(layer: TestProject.Layer.Compiler) +public class CodeGenerationIntegrationTest : IntegrationTestBase { + private readonly bool designTime; + + public CodeGenerationIntegrationTest(bool designTime = false) + : base(layer: TestProject.Layer.Compiler) + { + this.designTime = designTime; + BaseCompilation = BaseCompilation.AddReferences( + MetadataReference.CreateFromFile(typeof(TestTagHelperDescriptors).Assembly.Location)); + } + [IntegrationTestFact] public void SingleLineControlFlowStatements() => RunTest(); [IntegrationTestFact] - public void CSharp8() => RunTest(); + public void CSharp8() + { + // C# 8 features are not available in .NET Framework without polyfills + // so the C# diagnostics would be different between .NET Framework and .NET Core. + SkipVerifyingCSharpDiagnostics = ExecutionConditionUtil.IsDesktop; + + NullableEnable = true; + + RunTest(); + } [IntegrationTestFact] public void IncompleteDirectives() => RunTest(); @@ -245,7 +264,14 @@ public class CodeGenerationIntegrationTest(bool designTime = false) public void AttributeDirective() => RunTest(); [IntegrationTestFact] - public void SwitchExpression_RecursivePattern() => RunTest(); + public void SwitchExpression_RecursivePattern() + { + // System.Index is not available in .NET Framework without polyfills + // so the C# diagnostics would be different between .NET Framework and .NET Core. + SkipVerifyingCSharpDiagnostics = ExecutionConditionUtil.IsDesktop; + + RunTest(); + } [IntegrationTestFact] public new void DesignTime() => RunTest(); @@ -279,15 +305,7 @@ private void RunTest([CallerMemberName] string testName = "") private void DesignTimeTest(string testName) { // Arrange - var projectEngine = CreateProjectEngine(builder => - { - builder.ConfigureDocumentClassifier(GetTestFileName(testName)); - - // Some of these tests use templates - builder.AddTargetExtension(new TemplateTargetExtension()); - - SectionDirective.Register(builder); - }); + var projectEngine = CreateProjectEngine(RazorExtensions.Register); var projectItem = CreateProjectItemFromFile(testName: testName); @@ -301,20 +319,13 @@ private void DesignTimeTest(string testName) AssertSourceMappingsMatchBaseline(codeDocument, testName); AssertHtmlSourceMappingsMatchBaseline(codeDocument, testName); AssertLinePragmas(codeDocument, designTime: true); + AssertCSharpDiagnosticsMatchBaseline(codeDocument, testName); } private void RunTimeTest(string testName) { // Arrange - var projectEngine = CreateProjectEngine(builder => - { - builder.ConfigureDocumentClassifier(GetTestFileName(testName)); - - // Some of these tests use templates - builder.AddTargetExtension(new TemplateTargetExtension()); - - SectionDirective.Register(builder); - }); + var projectEngine = CreateProjectEngine(RazorExtensions.Register); var projectItem = CreateProjectItemFromFile(testName: testName); @@ -325,6 +336,7 @@ private void RunTimeTest(string testName) AssertDocumentNodeMatchesBaseline(codeDocument.GetDocumentIntermediateNode(), testName); AssertCSharpDocumentMatchesBaseline(codeDocument.GetCSharpDocument(), testName); AssertLinePragmas(codeDocument, designTime: false); + AssertCSharpDiagnosticsMatchBaseline(codeDocument, testName); } private void RunTagHelpersTest(IEnumerable descriptors, [CallerMemberName] string testName = "") @@ -342,43 +354,32 @@ private void RunTagHelpersTest(IEnumerable descriptors, [Ca private void RunRuntimeTagHelpersTest(IEnumerable descriptors, string testName) { // Arrange - var projectEngine = CreateProjectEngine(builder => - { - builder.ConfigureDocumentClassifier(GetTestFileName(testName)); - - // Some of these tests use templates - builder.AddTargetExtension(new TemplateTargetExtension()); - - SectionDirective.Register(builder); - }); + var projectEngine = CreateProjectEngine(RazorExtensions.Register); var projectItem = CreateProjectItemFromFile(testName: testName); var imports = GetImports(projectEngine, projectItem); + AddTagHelperStubs(descriptors); + // Act var codeDocument = projectEngine.Process(RazorSourceDocument.ReadFrom(projectItem), FileKinds.Legacy, imports, descriptors.ToList()); // Assert AssertDocumentNodeMatchesBaseline(codeDocument.GetDocumentIntermediateNode(), testName); AssertCSharpDocumentMatchesBaseline(codeDocument.GetCSharpDocument(), testName); + AssertCSharpDiagnosticsMatchBaseline(codeDocument, testName); } private void RunDesignTimeTagHelpersTest(IEnumerable descriptors, string testName) { // Arrange - var projectEngine = CreateProjectEngine(builder => - { - builder.ConfigureDocumentClassifier(GetTestFileName(testName)); - - // Some of these tests use templates - builder.AddTargetExtension(new TemplateTargetExtension()); - - SectionDirective.Register(builder); - }); + var projectEngine = CreateProjectEngine(RazorExtensions.Register); var projectItem = CreateProjectItemFromFile(testName: testName); var imports = GetImports(projectEngine, projectItem); + AddTagHelperStubs(descriptors); + // Act var codeDocument = projectEngine.ProcessDesignTime(RazorSourceDocument.ReadFrom(projectItem), FileKinds.Legacy, imports, descriptors.ToList()); @@ -388,6 +389,7 @@ private void RunDesignTimeTagHelpersTest(IEnumerable descri AssertHtmlDocumentMatchesBaseline(codeDocument.GetHtmlDocument(), testName); AssertHtmlSourceMappingsMatchBaseline(codeDocument, testName); AssertSourceMappingsMatchBaseline(codeDocument, testName); + AssertCSharpDiagnosticsMatchBaseline(codeDocument, testName); } private static ImmutableArray GetImports(RazorProjectEngine projectEngine, RazorProjectItem projectItem) @@ -401,4 +403,49 @@ private static ImmutableArray GetImports(RazorProjectEngine return importSourceDocuments; } + + private void AddTagHelperStubs(IEnumerable descriptors) + { + var tagHelperClasses = descriptors.Select(descriptor => + { + var typeName = descriptor.GetTypeName(); + var namespaceSeparatorIndex = typeName.LastIndexOf('.'); + if (namespaceSeparatorIndex >= 0) + { + var ns = typeName[..namespaceSeparatorIndex]; + var c = typeName[(namespaceSeparatorIndex + 1)..]; + + return $$""" + namespace {{ns}} + { + class {{c}} {{getTagHelperBody(descriptor)}} + } + """; + } + + return $$""" + class {{typeName}} {{getTagHelperBody(descriptor)}} + """; + + static string getTagHelperBody(TagHelperDescriptor descriptor) + { + var attributes = descriptor.BoundAttributes.Select(attribute => $$""" + public {{attribute.TypeName}} {{attribute.GetPropertyName()}} + { + get => throw new System.NotImplementedException(); + set { } + } + """); + + return $$""" + : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper + { + {{string.Join("\n", attributes)}} + } + """; + } + }); + + AddCSharpSyntaxTree(string.Join("\n", tagHelperClasses)); + } } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.codegen.cs index 18e36f8e731..6f587dfcbe1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -23,10 +37,30 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.ir.txt index 4dce3dd96c0..e071424669a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.ir.txt @@ -1,7 +1,30 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] AddTagHelperDirective.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -9,6 +32,11 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [2] AddTagHelperDirective.cshtml) LazyIntermediateToken - (31:0,31 [2] AddTagHelperDirective.cshtml) - Html - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.mappings.txt index 559bd96f67e..07c4a5e920b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml) |"*, TestAssembly"| -Generated Location: (551:12,37 [17] ) +Generated Location: (1253:26,37 [17] ) |"*, TestAssembly"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_Runtime.codegen.cs index 0a5d7693f94..d8ffd3b95f5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_Runtime.codegen.cs @@ -1,18 +1,51 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "acb2e9438f3250e99764ff47299ab6f5503f0ade0c3b94cd2fc81bc2e2506a59" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"acb2e9438f3250e99764ff47299ab6f5503f0ade0c3b94cd2fc81bc2e2506a59", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_Runtime.ir.txt index 183b6bc0234..405b5c6d5c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_Runtime.ir.txt @@ -1,6 +1,20 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.codegen.cs index 96698df8727..b75ad02d02d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.codegen.cs @@ -1,7 +1,17 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml" @@ -31,7 +41,11 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles #line default #line hidden #nullable disable - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -41,10 +55,30 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..204b5208c72 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.cs-diagnostics.txt @@ -0,0 +1,24 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(1,13): error CS0592: Attribute 'System.Runtime.InteropServices.DllImport' is not valid on this declaration type. It is only valid on 'method' declarations. +// [System.Runtime.InteropServices.DllImport("user32.dll")] +Diagnostic(ErrorCode.ERR_AttributeOnBadSymbolType, "System.Runtime.InteropServices.DllImport").WithArguments("System.Runtime.InteropServices.DllImport", "method").WithLocation(1, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(2,13): warning CS0657: 'assembly' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are 'type'. All attributes in this block will be ignored. +// [assembly: AssemblyTitleAttribute("Some assembly")] +Diagnostic(ErrorCode.WRN_AttributeLocationOnBadDeclaration, "assembly").WithArguments("assembly", "type").WithLocation(2, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(3,13): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?) +// [DllImport("user32.dll", SetLastError=false, ExactSpelling=false)] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "DllImport").WithArguments("DllImportAttribute").WithLocation(3, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(3,13): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) +// [DllImport("user32.dll", SetLastError=false, ExactSpelling=false)] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "DllImport").WithArguments("DllImport").WithLocation(3, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(4,13): error CS0246: The type or namespace name 'ConditionalAttribute' could not be found (are you missing a using directive or an assembly reference?) +// [Conditional("DEBUG"), Conditional("TEST1")] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Conditional").WithArguments("ConditionalAttribute").WithLocation(4, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(4,13): error CS0246: The type or namespace name 'Conditional' could not be found (are you missing a using directive or an assembly reference?) +// [Conditional("DEBUG"), Conditional("TEST1")] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Conditional").WithArguments("Conditional").WithLocation(4, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(4,35): error CS0246: The type or namespace name 'ConditionalAttribute' could not be found (are you missing a using directive or an assembly reference?) +// [Conditional("DEBUG"), Conditional("TEST1")] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Conditional").WithArguments("ConditionalAttribute").WithLocation(4, 35), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(4,35): error CS0246: The type or namespace name 'Conditional' could not be found (are you missing a using directive or an assembly reference?) +// [Conditional("DEBUG"), Conditional("TEST1")] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Conditional").WithArguments("Conditional").WithLocation(4, 35) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.ir.txt index f21ec33f9c4..bac57b386b6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.ir.txt @@ -1,5 +1,13 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures CSharpCode - (11:0,11 [56] AttributeDirective.cshtml) IntermediateToken - (11:0,11 [56] AttributeDirective.cshtml) - CSharp - [System.Runtime.InteropServices.DllImport("user32.dll")] CSharpCode - (80:1,11 [51] AttributeDirective.cshtml) @@ -8,8 +16,23 @@ IntermediateToken - (144:2,11 [66] AttributeDirective.cshtml) - CSharp - [DllImport("user32.dll", SetLastError=false, ExactSpelling=false)] CSharpCode - (223:3,11 [44] AttributeDirective.cshtml) IntermediateToken - (223:3,11 [44] AttributeDirective.cshtml) - CSharp - [Conditional("DEBUG"), Conditional("TEST1")] - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective_DesignTime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (11:0,11 [56] AttributeDirective.cshtml) - [System.Runtime.InteropServices.DllImport("user32.dll")] DirectiveToken - (80:1,11 [51] AttributeDirective.cshtml) - [assembly: AssemblyTitleAttribute("Some assembly")] DirectiveToken - (144:2,11 [66] AttributeDirective.cshtml) - [DllImport("user32.dll", SetLastError=false, ExactSpelling=false)] @@ -20,6 +43,11 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (269:4,0 [13] AttributeDirective.cshtml) LazyIntermediateToken - (269:4,0 [13] AttributeDirective.cshtml) - Html - \nHello World + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.mappings.txt index 5fa2575b1f1..006aec03078 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (11:0,11 [56] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml) |[System.Runtime.InteropServices.DllImport("user32.dll")]| -Generated Location: (271:7,11 [56] ) +Generated Location: (607:17,11 [56] ) |[System.Runtime.InteropServices.DllImport("user32.dll")]| Source Location: (80:1,11 [51] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml) |[assembly: AssemblyTitleAttribute("Some assembly")]| -Generated Location: (503:14,11 [51] ) +Generated Location: (839:24,11 [51] ) |[assembly: AssemblyTitleAttribute("Some assembly")]| Source Location: (144:2,11 [66] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml) |[DllImport("user32.dll", SetLastError=false, ExactSpelling=false)]| -Generated Location: (730:21,11 [66] ) +Generated Location: (1066:31,11 [66] ) |[DllImport("user32.dll", SetLastError=false, ExactSpelling=false)]| Source Location: (223:3,11 [44] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml) |[Conditional("DEBUG"), Conditional("TEST1")]| -Generated Location: (972:28,11 [44] ) +Generated Location: (1308:38,11 [44] ) |[Conditional("DEBUG"), Conditional("TEST1")]| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.codegen.cs index c94d7946e28..dc610f6d6d0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.codegen.cs @@ -1,9 +1,18 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "182a864a99c94c5a3bbb535723dfb08ad1a97865628ed562e8f2c949e7098074" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden #nullable restore #line (1,12)-(1,68) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml" @@ -38,14 +47,38 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles #nullable disable [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"182a864a99c94c5a3bbb535723dfb08ad1a97865628ed562e8f2c949e7098074", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\nHello World"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..0de61beaca1 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.cs-diagnostics.txt @@ -0,0 +1,24 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(1,13): error CS0592: Attribute 'System.Runtime.InteropServices.DllImport' is not valid on this declaration type. It is only valid on 'method' declarations. +// [System.Runtime.InteropServices.DllImport("user32.dll")] +Diagnostic(ErrorCode.ERR_AttributeOnBadSymbolType, "System.Runtime.InteropServices.DllImport").WithArguments("System.Runtime.InteropServices.DllImport", "method").WithLocation(1, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(2,13): warning CS0657: 'assembly' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are 'type'. All attributes in this block will be ignored. +// [assembly: AssemblyTitleAttribute("Some assembly")] +Diagnostic(ErrorCode.WRN_AttributeLocationOnBadDeclaration, "assembly").WithArguments("assembly", "type").WithLocation(2, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(3,13): error CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?) +// [DllImport("user32.dll", SetLastError=false, ExactSpelling=false)] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "DllImport").WithArguments("DllImportAttribute").WithLocation(3, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(3,13): error CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) +// [DllImport("user32.dll", SetLastError=false, ExactSpelling=false)] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "DllImport").WithArguments("DllImport").WithLocation(3, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(4,13): error CS0246: The type or namespace name 'ConditionalAttribute' could not be found (are you missing a using directive or an assembly reference?) +// [Conditional("DEBUG"), Conditional("TEST1")] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Conditional").WithArguments("ConditionalAttribute").WithLocation(4, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(4,13): error CS0246: The type or namespace name 'Conditional' could not be found (are you missing a using directive or an assembly reference?) +// [Conditional("DEBUG"), Conditional("TEST1")] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Conditional").WithArguments("Conditional").WithLocation(4, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(4,35): error CS0246: The type or namespace name 'ConditionalAttribute' could not be found (are you missing a using directive or an assembly reference?) +// [Conditional("DEBUG"), Conditional("TEST1")] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Conditional").WithArguments("ConditionalAttribute").WithLocation(4, 35), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml(4,35): error CS0246: The type or namespace name 'Conditional' could not be found (are you missing a using directive or an assembly reference?) +// [Conditional("DEBUG"), Conditional("TEST1")] +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Conditional").WithArguments("Conditional").WithLocation(4, 35) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.ir.txt index f7d402c697b..b6d17d80ca9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_Runtime.ir.txt @@ -1,6 +1,13 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures CSharpCode - (11:0,11 [56] AttributeDirective.cshtml) IntermediateToken - (11:0,11 [56] AttributeDirective.cshtml) - CSharp - [System.Runtime.InteropServices.DllImport("user32.dll")] CSharpCode - (80:1,11 [51] AttributeDirective.cshtml) @@ -10,7 +17,14 @@ CSharpCode - (223:3,11 [44] AttributeDirective.cshtml) IntermediateToken - (223:3,11 [44] AttributeDirective.cshtml) - CSharp - [Conditional("DEBUG"), Conditional("TEST1")] RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (269:4,0 [13] AttributeDirective.cshtml) LazyIntermediateToken - (269:4,0 [13] AttributeDirective.cshtml) - Html - \nHello World + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.cs index 35d6fff7230..ccb654f6366 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -32,7 +46,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_CatchAllTagHelper = CreateTagHelper(); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); @@ -65,6 +79,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.ir.txt index b9f8c5aef49..2242a48e869 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.ir.txt @@ -1,12 +1,35 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [15] AttributeTargetingTagHelpers.cshtml) - *, TestAssembly CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -14,7 +37,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (29:0,29 [4] AttributeTargetingTagHelpers.cshtml) LazyIntermediateToken - (29:0,29 [4] AttributeTargetingTagHelpers.cshtml) - Html - \n\n TagHelper - (33:2,0 [228] AttributeTargetingTagHelpers.cshtml) - p - TagMode.StartTagAndEndTag @@ -83,3 +106,8 @@ HtmlContent - (43:2,10 [3] AttributeTargetingTagHelpers.cshtml) LazyIntermediateToken - (43:2,10 [3] AttributeTargetingTagHelpers.cshtml) - Html - btn DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.mappings.txt index 877da16ebb9..3b747b7422b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.mappings.txt @@ -1,15 +1,15 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml) |*, TestAssembly| -Generated Location: (1318:21,38 [15] ) +Generated Location: (2027:35,38 [15] ) |*, TestAssembly| Source Location: (187:5,36 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml) |true| -Generated Location: (2404:44,42 [4] ) +Generated Location: (3130:58,42 [4] ) |true| Source Location: (233:6,36 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml) |true| -Generated Location: (3171:57,42 [4] ) +Generated Location: (3897:71,42 [4] ) |true| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.codegen.cs index b24ceb89737..d5cabab89c3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a43c77165a8cc48045af412fa05ad51a01a7ac7693152e08d46013b3fe119376" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"a43c77165a8cc48045af412fa05ad51a01a7ac7693152e08d46013b3fe119376", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("catchAll", new global::Microsoft.AspNetCore.Html.HtmlString("hi"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "checkbox", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); @@ -36,7 +49,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeT private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { @@ -131,6 +144,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.ir.txt index 605a3a5aac6..0add2b2b0b7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_Runtime.ir.txt @@ -1,8 +1,17 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - catchAll - hi - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_1 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - class - btn - HtmlAttributeValueStyle.DoubleQuotes @@ -11,7 +20,7 @@ FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:1,0 [2] AttributeTargetingTagHelpers.cshtml) LazyIntermediateToken - (31:1,0 [2] AttributeTargetingTagHelpers.cshtml) - Html - \n TagHelper - (33:2,0 [228] AttributeTargetingTagHelpers.cshtml) - p - TagMode.StartTagAndEndTag @@ -66,3 +75,8 @@ DefaultTagHelperCreate - - TestNamespace.PTagHelper PreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_2 DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.codegen.cs index 5ce8c2fee2f..5408bce08b8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml" @@ -140,6 +154,26 @@ public async Task Foo() #line default #line hidden #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..a513815d442 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.cs-diagnostics.txt @@ -0,0 +1,30 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(2,31): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. +// public async Task Foo() +Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo").WithLocation(2, 31), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(14,55): error CS1525: Invalid expression term ';' +// __o = await; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(14, 55), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(19,49): error CS1501: No overload for method 'Foo' takes 2 arguments +// __o = await Foo(1, 2); +Diagnostic(ErrorCode.ERR_BadArgCount, "Foo").WithArguments("Foo", "2").WithLocation(19, 49), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(20,58): error CS0119: 'TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await.Foo()' is a method, which is not valid in the given context +// __o = await Foo.Bar(1, 2); +Diagnostic(ErrorCode.ERR_BadSKunknown, "Foo").WithArguments("AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await.Foo()", "method").WithLocation(20, 58), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(21,48): error CS1501: No overload for method 'Foo' takes 2 arguments +// __o = await Foo("bob", true); +Diagnostic(ErrorCode.ERR_BadArgCount, "Foo").WithArguments("Foo", "2").WithLocation(21, 48), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(22,54): error CS0103: The name 'something' does not exist in the current context +// await Foo(something, hello: "world"); +Diagnostic(ErrorCode.ERR_NameNotInContext, "something").WithArguments("something").WithLocation(22, 54), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(23,59): error CS0119: 'TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await.Foo()' is a method, which is not valid in the given context +// await Foo.Bar(1, 2) +Diagnostic(ErrorCode.ERR_BadSKunknown, "Foo").WithArguments("AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await.Foo()", "method").WithLocation(23, 59), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(23,72): error CS1002: ; expected +// await Foo.Bar(1, 2) +Diagnostic(ErrorCode.ERR_SemicolonExpected, "").WithLocation(23, 72), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(24,65): error CS1739: The best overload for 'Foo' does not have a parameter named 'boolValue' +// __o = await Foo(boolValue: false); +Diagnostic(ErrorCode.ERR_BadNamedArgument, "boolValue").WithArguments("Foo", "boolValue").WithLocation(24, 65), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(25,53): error CS1061: 'string' does not contain a definition for 'GetAwaiter' and no accessible extension method 'GetAwaiter' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) +// __o = await ("wrrronggg"); +Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, @"await (""wrrronggg"")").WithArguments("string", "GetAwaiter").WithLocation(25, 53) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.ir.txt index 1d99ae74f96..bc12cfc2123 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (89:5,1 [102] Await.cshtml) LazyIntermediateToken - (89:5,1 [4] Await.cshtml) - Html - \n\n LazyIntermediateToken - (93:7,0 [8] Await.cshtml) - Html -
CSharpCode - (12:0,12 [76] Await.cshtml) LazyIntermediateToken - (12:0,12 [76] Await.cshtml) - CSharp - \n public async Task Foo()\n {\n return "Bar";\n }\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.mappings.txt index 7355edc7a29..f982a971eb6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.mappings.txt @@ -1,81 +1,81 @@ Source Location: (192:9,39 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo()| -Generated Location: (761:19,39 [11] ) +Generated Location: (1464:33,39 [11] ) |await Foo()| Source Location: (247:10,38 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo()| -Generated Location: (964:26,38 [11] ) +Generated Location: (1667:40,38 [11] ) |await Foo()| Source Location: (304:11,39 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | await Foo(); | -Generated Location: (1168:33,39 [14] ) +Generated Location: (1871:47,39 [14] ) | await Foo(); | Source Location: (371:12,46 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | | -Generated Location: (1381:40,46 [1] ) +Generated Location: (2084:54,46 [1] ) | | Source Location: (376:12,51 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo()| -Generated Location: (1586:47,51 [11] ) +Generated Location: (2289:61,51 [11] ) |await Foo()| Source Location: (391:12,66 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | | -Generated Location: (1817:54,66 [1] ) +Generated Location: (2520:68,66 [1] ) | | Source Location: (448:13,49 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await| -Generated Location: (2020:61,49 [5] ) +Generated Location: (2723:75,49 [5] ) |await| Source Location: (578:18,42 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo(1, 2)| -Generated Location: (2221:68,42 [15] ) +Generated Location: (2924:82,42 [15] ) |await Foo(1, 2)| Source Location: (650:19,51 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo.Bar(1, 2)| -Generated Location: (2441:75,51 [19] ) +Generated Location: (3144:89,51 [19] ) |await Foo.Bar(1, 2)| Source Location: (716:20,41 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo("bob", true)| -Generated Location: (2655:82,41 [22] ) +Generated Location: (3358:96,41 [22] ) |await Foo("bob", true)| Source Location: (787:21,42 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | await Foo(something, hello: "world"); | -Generated Location: (2873:89,42 [39] ) +Generated Location: (3576:103,42 [39] ) | await Foo(something, hello: "world"); | Source Location: (884:22,51 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | await Foo.Bar(1, 2) | -Generated Location: (3116:96,51 [21] ) +Generated Location: (3819:110,51 [21] ) | await Foo.Bar(1, 2) | Source Location: (961:23,49 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | | -Generated Location: (3339:103,49 [1] ) +Generated Location: (4042:117,49 [1] ) | | Source Location: (966:23,54 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo(boolValue: false)| -Generated Location: (3547:110,54 [27] ) +Generated Location: (4250:124,54 [27] ) |await Foo(boolValue: false)| Source Location: (997:23,85 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | | -Generated Location: (3813:117,85 [1] ) +Generated Location: (4516:131,85 [1] ) | | Source Location: (1057:24,52 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await ("wrrronggg")| -Generated Location: (4019:124,52 [19] ) +Generated Location: (4722:138,52 [19] ) |await ("wrrronggg")| Source Location: (12:0,12 [76] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) @@ -85,7 +85,7 @@ Source Location: (12:0,12 [76] TestFiles/IntegrationTests/CodeGenerationIntegrat return "Bar"; } | -Generated Location: (4252:133,12 [76] ) +Generated Location: (4955:147,12 [76] ) | public async Task Foo() { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.codegen.cs index a4d75d80f2c..b14ba777995 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "347cf5b257c3885845256697175dd94c0ef0bef29e4fca7e4ec1a009ff29d9a6" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"347cf5b257c3885845256697175dd94c0ef0bef29e4fca7e4ec1a009ff29d9a6", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n
\r\n

Basic Asynchronous Expression Test

\r\n

Basic Asynchronous Expression: "); Write( @@ -147,6 +160,26 @@ public async Task Foo() #line hidden #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..689f9027e75 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.cs-diagnostics.txt @@ -0,0 +1,30 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(2,31): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. +// public async Task Foo() +Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo").WithLocation(2, 31), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(14,55): error CS1525: Invalid expression term ')' +// await +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments(")").WithLocation(14, 55), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(19,49): error CS1501: No overload for method 'Foo' takes 2 arguments +// await Foo(1, 2) +Diagnostic(ErrorCode.ERR_BadArgCount, "Foo").WithArguments("Foo", "2").WithLocation(19, 49), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(20,58): error CS0119: 'TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await.Foo()' is a method, which is not valid in the given context +// await Foo.Bar(1, 2) +Diagnostic(ErrorCode.ERR_BadSKunknown, "Foo").WithArguments("AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await.Foo()", "method").WithLocation(20, 58), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(21,48): error CS1501: No overload for method 'Foo' takes 2 arguments +// await Foo("bob", true) +Diagnostic(ErrorCode.ERR_BadArgCount, "Foo").WithArguments("Foo", "2").WithLocation(21, 48), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(22,54): error CS0103: The name 'something' does not exist in the current context +// await Foo(something, hello: "world"); +Diagnostic(ErrorCode.ERR_NameNotInContext, "something").WithArguments("something").WithLocation(22, 54), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(23,59): error CS0119: 'TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await.Foo()' is a method, which is not valid in the given context +// await Foo.Bar(1, 2) +Diagnostic(ErrorCode.ERR_BadSKunknown, "Foo").WithArguments("AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await.Foo()", "method").WithLocation(23, 59), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(23,72): error CS1002: ; expected +// await Foo.Bar(1, 2) +Diagnostic(ErrorCode.ERR_SemicolonExpected, "").WithLocation(23, 72), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(24,65): error CS1739: The best overload for 'Foo' does not have a parameter named 'boolValue' +// await Foo(boolValue: false) +Diagnostic(ErrorCode.ERR_BadNamedArgument, "boolValue").WithArguments("Foo", "boolValue").WithLocation(24, 65), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml(25,53): error CS1061: 'string' does not contain a definition for 'GetAwaiter' and no accessible extension method 'GetAwaiter' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) +// await ("wrrronggg") +Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, @"await (""wrrronggg"")").WithArguments("string", "GetAwaiter").WithLocation(25, 53) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.ir.txt index c1e7fa61205..dc8a7217ddb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (91:6,0 [100] Await.cshtml) LazyIntermediateToken - (91:6,0 [2] Await.cshtml) - Html - \n LazyIntermediateToken - (93:7,0 [8] Await.cshtml) - Html -

CSharpCode - (12:0,12 [76] Await.cshtml) LazyIntermediateToken - (12:0,12 [76] Await.cshtml) - CSharp - \n public async Task Foo()\n {\n return "Bar";\n }\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.cs index 944e91d7add..813abd42c27 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -31,7 +45,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_PTagHelper = CreateTagHelper(); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); @@ -63,6 +77,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.ir.txt index 188c96fc52b..dd8c964d897 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.ir.txt @@ -1,11 +1,34 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] BasicTagHelpers.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -13,7 +36,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [73] BasicTagHelpers.cshtml) LazyIntermediateToken - (31:0,31 [4] BasicTagHelpers.cshtml) - Html - \n\n LazyIntermediateToken - (35:2,0 [4] BasicTagHelpers.cshtml) - Html -
+ Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.mappings.txt index 06e17b9b203..1e0fdaa5abf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.mappings.txt @@ -1,15 +1,15 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml) |"*, TestAssembly"| -Generated Location: (1199:20,37 [17] ) +Generated Location: (1895:34,37 [17] ) |"*, TestAssembly"| Source Location: (220:5,38 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml) |ViewBag.DefaultInterval| -Generated Location: (2103:41,38 [23] ) +Generated Location: (2816:55,38 [23] ) |ViewBag.DefaultInterval| Source Location: (303:6,40 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml) |true| -Generated Location: (2915:55,42 [4] ) +Generated Location: (3628:69,42 [4] ) |true| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.cs index 76e58c6e499..bce2a46e832 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -41,7 +55,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_InputTagHelper = CreateTagHelper(); __TestNamespace_InputTagHelper2 = CreateTagHelper(); @@ -59,6 +73,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.ir.txt index fc0e7db51cd..616179e17be 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.ir.txt @@ -1,11 +1,34 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (17:0,17 [5] BasicTagHelpers_Prefixed.cshtml) - "THS" DirectiveToken - (38:1,14 [17] BasicTagHelpers_Prefixed.cshtml) - "*, TestAssembly" CSharpCode - @@ -14,7 +37,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (22:0,22 [2] BasicTagHelpers_Prefixed.cshtml) LazyIntermediateToken - (22:0,22 [2] BasicTagHelpers_Prefixed.cshtml) - Html - \n HtmlContent - (55:1,31 [54] BasicTagHelpers_Prefixed.cshtml) @@ -58,3 +81,8 @@ HtmlContent - (245:8,11 [11] BasicTagHelpers_Prefixed.cshtml) LazyIntermediateToken - (245:8,11 [2] BasicTagHelpers_Prefixed.cshtml) - Html - \n LazyIntermediateToken - (247:9,0 [9] BasicTagHelpers_Prefixed.cshtml) - Html - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.mappings.txt index 877037aedcb..b31f7e030d7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.mappings.txt @@ -1,15 +1,15 @@ Source Location: (17:0,17 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml) |"THS"| -Generated Location: (1217:20,37 [5] ) +Generated Location: (1922:34,37 [5] ) |"THS"| Source Location: (38:1,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml) |"*, TestAssembly"| -Generated Location: (1499:30,37 [17] ) +Generated Location: (2204:44,37 [17] ) |"*, TestAssembly"| Source Location: (226:7,43 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml) |true| -Generated Location: (2398:51,43 [4] ) +Generated Location: (3120:65,43 [4] ) |true| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.codegen.cs index ddbd8897da5..0221050c13c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "e26ec84b1a01b76c3d10ce2cba2205ab75c8b761b2507c37a6efbfe65c779b33" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"e26ec84b1a01b76c3d10ce2cba2205ab75c8b761b2507c37a6efbfe65c779b33", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "checkbox", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); @@ -34,7 +47,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { @@ -83,6 +96,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("\r\n"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.ir.txt index 197771bd9db..5328116dfee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_Runtime.ir.txt @@ -1,15 +1,24 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - class - Hello World - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (57:2,0 [52] BasicTagHelpers_Prefixed.cshtml) LazyIntermediateToken - (57:2,0 [2] BasicTagHelpers_Prefixed.cshtml) - Html - \n LazyIntermediateToken - (59:3,0 [7] BasicTagHelpers_Prefixed.cshtml) - Html - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.codegen.cs index 0b9a959076b..567029faed2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -41,7 +55,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_PTagHelper = CreateTagHelper(); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); @@ -66,6 +80,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.ir.txt index 5c0930c9add..0b5c468e147 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.ir.txt @@ -1,11 +1,34 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] BasicTagHelpers_RemoveTagHelper.cshtml) - "*, TestAssembly" DirectiveToken - (50:1,17 [20] BasicTagHelpers_RemoveTagHelper.cshtml) - "doesntmatter, nice" CSharpCode - @@ -14,7 +37,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [2] BasicTagHelpers_RemoveTagHelper.cshtml) LazyIntermediateToken - (31:0,31 [2] BasicTagHelpers_RemoveTagHelper.cshtml) - Html - \n HtmlContent - (70:1,37 [51] BasicTagHelpers_RemoveTagHelper.cshtml) @@ -69,3 +92,8 @@ HtmlContent - (251:8,8 [8] BasicTagHelpers_RemoveTagHelper.cshtml) LazyIntermediateToken - (251:8,8 [2] BasicTagHelpers_RemoveTagHelper.cshtml) - Html - \n LazyIntermediateToken - (253:9,0 [6] BasicTagHelpers_RemoveTagHelper.cshtml) - Html -
+ Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.mappings.txt index dcfdc7f6546..293d9af037a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.mappings.txt @@ -1,15 +1,15 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml) |"*, TestAssembly"| -Generated Location: (1231:20,37 [17] ) +Generated Location: (1943:34,37 [17] ) |"*, TestAssembly"| Source Location: (50:1,17 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml) |"doesntmatter, nice"| -Generated Location: (1532:30,37 [20] ) +Generated Location: (2244:44,37 [20] ) |"doesntmatter, nice"| Source Location: (234:7,40 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml) |true| -Generated Location: (3043:58,42 [4] ) +Generated Location: (3772:72,42 [4] ) |true| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_Runtime.codegen.cs index fbdd70bdae3..1393a8a5025 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3c3f70086ebb07abc64ab51a5ec8d70be530fb87bb11790ef3989464e5532b55" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"3c3f70086ebb07abc64ab51a5ec8d70be530fb87bb11790ef3989464e5532b55", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "text", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "checkbox", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); @@ -35,7 +48,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n
\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { @@ -116,6 +129,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("\r\n
"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_Runtime.ir.txt index d5f8bfd81ab..786f4e2e2c1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_Runtime.ir.txt @@ -1,8 +1,17 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - type - text - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_1 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - class - Hello World - HtmlAttributeValueStyle.DoubleQuotes @@ -10,7 +19,7 @@ FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (72:2,0 [49] BasicTagHelpers_RemoveTagHelper.cshtml) LazyIntermediateToken - (72:2,0 [2] BasicTagHelpers_RemoveTagHelper.cshtml) - Html - \n LazyIntermediateToken - (74:3,0 [4] BasicTagHelpers_RemoveTagHelper.cshtml) - Html -
+ Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.codegen.cs index 6f98ab7bf7b..402316266c1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "c8793c171f4a151a33e212951ef178accfcfb85800b349fdef9ce896e61f314e" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"c8793c171f4a151a33e212951ef178accfcfb85800b349fdef9ce896e61f314e", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("data", new global::Microsoft.AspNetCore.Html.HtmlString("-delay1000"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "text", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); @@ -37,7 +50,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n
\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { @@ -134,6 +147,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("\r\n
"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.ir.txt index 7b29d3fa255..5285dd66289 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Runtime.ir.txt @@ -1,8 +1,17 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - data - -delay1000 - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_1 - type - text - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_2 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes @@ -12,7 +21,7 @@ FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [71] BasicTagHelpers.cshtml) LazyIntermediateToken - (33:1,0 [2] BasicTagHelpers.cshtml) - Html - \n LazyIntermediateToken - (35:2,0 [4] BasicTagHelpers.cshtml) - Html -
+ Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.codegen.cs index 4061741b158..a35459d6ee6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml" @@ -171,6 +185,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.ir.txt index 9beadaf44b4..1f837ad032c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [18] Blocks.cshtml) LazyIntermediateToken - (2:0,2 [18] Blocks.cshtml) - CSharp - \n int i = 1;\n HtmlContent - (23:3,0 [2] Blocks.cshtml) @@ -108,3 +131,8 @@ LazyIntermediateToken - (614:35,47 [4] Blocks.cshtml) - Html -

CSharpCode - (618:35,51 [3] Blocks.cshtml) LazyIntermediateToken - (618:35,51 [3] Blocks.cshtml) - CSharp - \n} + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.mappings.txt index 4bed590ba32..aaa647893d2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.mappings.txt @@ -2,7 +2,7 @@ | int i = 1; | -Generated Location: (725:19,2 [18] ) +Generated Location: (1429:33,2 [18] ) | int i = 1; | @@ -10,20 +10,20 @@ Generated Location: (725:19,2 [18] ) Source Location: (26:4,1 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |while(i <= 10) { | -Generated Location: (895:27,1 [22] ) +Generated Location: (1599:41,1 [22] ) |while(i <= 10) { | Source Location: (69:5,25 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |i| -Generated Location: (1095:35,25 [1] ) +Generated Location: (1799:49,25 [1] ) |i| Source Location: (75:5,31 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | i += 1; }| -Generated Location: (1281:42,31 [16] ) +Generated Location: (1985:56,31 [16] ) | i += 1; }| @@ -31,14 +31,14 @@ Generated Location: (1281:42,31 [16] ) Source Location: (96:9,1 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |if(i == 11) { | -Generated Location: (1452:51,1 [19] ) +Generated Location: (2156:65,1 [19] ) |if(i == 11) { | Source Location: (140:10,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | }| -Generated Location: (1654:59,29 [3] ) +Generated Location: (2358:73,29 [3] ) | }| @@ -46,7 +46,7 @@ Source Location: (148:13,1 [35] TestFiles/IntegrationTests/CodeGenerationIntegra |switch(i) { case 11: | -Generated Location: (1812:67,1 [35] ) +Generated Location: (2516:81,1 [35] ) |switch(i) { case 11: | @@ -56,7 +56,7 @@ Source Location: (219:15,44 [40] TestFiles/IntegrationTests/CodeGenerationIntegr break; default: | -Generated Location: (2045:76,44 [40] ) +Generated Location: (2749:90,44 [40] ) | break; default: @@ -66,7 +66,7 @@ Source Location: (288:18,37 [19] TestFiles/IntegrationTests/CodeGenerationIntegr | break; }| -Generated Location: (2276:86,37 [19] ) +Generated Location: (2980:100,37 [19] ) | break; }| @@ -74,26 +74,26 @@ Generated Location: (2276:86,37 [19] ) Source Location: (312:22,1 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |for(int j = 1; j <= 10; j += 2) { | -Generated Location: (2450:95,1 [39] ) +Generated Location: (3154:109,1 [39] ) |for(int j = 1; j <= 10; j += 2) { | Source Location: (378:23,31 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |j| -Generated Location: (2674:103,31 [1] ) +Generated Location: (3378:117,31 [1] ) |j| Source Location: (384:23,37 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | }| -Generated Location: (2867:110,37 [3] ) +Generated Location: (3571:124,37 [3] ) | }| Source Location: (392:26,1 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |try { | -Generated Location: (3025:118,1 [11] ) +Generated Location: (3729:132,1 [11] ) |try { | @@ -101,39 +101,39 @@ Source Location: (438:27,39 [31] TestFiles/IntegrationTests/CodeGenerationIntegr | } catch(Exception ex) { | -Generated Location: (3229:126,39 [31] ) +Generated Location: (3933:140,39 [31] ) | } catch(Exception ex) { | Source Location: (500:29,35 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |ex.Message| -Generated Location: (3449:135,35 [10] ) +Generated Location: (4153:149,35 [10] ) |ex.Message| Source Location: (515:29,50 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | }| -Generated Location: (3664:142,50 [3] ) +Generated Location: (4368:156,50 [3] ) | }| Source Location: (535:32,13 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |i| -Generated Location: (3834:150,13 [1] ) +Generated Location: (4538:164,13 [1] ) |i| Source Location: (545:34,1 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |lock(new object()) { | -Generated Location: (3991:157,1 [26] ) +Generated Location: (4695:171,1 [26] ) |lock(new object()) { | Source Location: (618:35,51 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | }| -Generated Location: (4222:165,51 [3] ) +Generated Location: (4926:179,51 [3] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_Runtime.codegen.cs index 39caeedb74a..4c9c14d6453 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7fc1108b4536c02783f218bd311d6a6202c6f3c6e438a6840e22e53a2efde68d" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"7fc1108b4536c02783f218bd311d6a6202c6f3c6e438a6840e22e53a2efde68d", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line (1,3)-(3,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml" @@ -192,6 +205,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_Runtime.ir.txt index f633e2209b9..229a4bc4796 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [18] Blocks.cshtml) LazyIntermediateToken - (2:0,2 [18] Blocks.cshtml) - CSharp - \n int i = 1;\n HtmlContent - (23:3,0 [2] Blocks.cshtml) @@ -119,3 +128,8 @@ LazyIntermediateToken - (618:35,51 [2] Blocks.cshtml) - Html - \n CSharpCode - (620:36,0 [1] Blocks.cshtml) LazyIntermediateToken - (620:36,0 [1] Blocks.cshtml) - CSharp - } + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.codegen.cs index 652c4946984..5a4a8bbb326 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml" @@ -88,6 +102,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..2ef936812ef --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.cs-diagnostics.txt @@ -0,0 +1,12 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml(10,13): warning CS0219: The variable 'Sixteen' is assigned but its value is never used +// int Sixteen = 0b0001_0000; +Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "Sixteen").WithArguments("Sixteen").WithLocation(10, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml(11,14): warning CS0219: The variable 'BillionsAndBillions' is assigned but its value is never used +// long BillionsAndBillions = 100_000_000_000; +Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "BillionsAndBillions").WithArguments("BillionsAndBillions").WithLocation(11, 14), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml(12,16): warning CS0219: The variable 'AvogadroConstant' is assigned but its value is never used +// double AvogadroConstant = 6.022_140_857_747_474e23; +Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "AvogadroConstant").WithArguments("AvogadroConstant").WithLocation(12, 16), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml(13,17): warning CS0219: The variable 'GoldenRatio' is assigned but its value is never used +// decimal GoldenRatio = 1.618_033_988_749_894_848_204_586_834_365_638_117_720_309_179M; +Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "GoldenRatio").WithArguments("GoldenRatio").WithLocation(13, 17) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.ir.txt index a525a3bf930..10c717eaf81 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [12] CSharp7.cshtml) LazyIntermediateToken - (0:0,0 [5] CSharp7.cshtml) - Html - @@ -48,3 +71,8 @@ HtmlContent - (1182:41,5 [9] CSharp7.cshtml) LazyIntermediateToken - (1182:41,5 [2] CSharp7.cshtml) - Html - \n LazyIntermediateToken - (1184:42,0 [7] CSharp7.cshtml) - Html - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.mappings.txt index ab991302ca8..3b1f9979512 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.mappings.txt @@ -6,7 +6,7 @@ }; | -Generated Location: (731:19,6 [187] ) +Generated Location: (1436:33,6 [187] ) | var nameLookup = new Dictionary() { @@ -23,7 +23,7 @@ Source Location: (246:7,53 [253] TestFiles/IntegrationTests/CodeGenerationIntegr double AvogadroConstant = 6.022_140_857_747_474e23; decimal GoldenRatio = 1.618_033_988_749_894_848_204_586_834_365_638_117_720_309_179M; | -Generated Location: (1125:32,53 [253] ) +Generated Location: (1830:46,53 [253] ) | int Sixteen = 0b0001_0000; @@ -40,7 +40,7 @@ Source Location: (509:15,5 [159] TestFiles/IntegrationTests/CodeGenerationIntegr // Do Something } }| -Generated Location: (1538:45,5 [159] ) +Generated Location: (2243:59,5 [159] ) |if (nameLookup.TryGetValue("John Doe", out var entry)) { if (entry.Extra is bool alive) @@ -51,12 +51,12 @@ Generated Location: (1538:45,5 [159] ) Source Location: (718:23,39 [62] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml) |1.618_033_988_749_894_848_204_586_834_365_638_117_720_309_179M| -Generated Location: (1891:58,39 [62] ) +Generated Location: (2596:72,39 [62] ) |1.618_033_988_749_894_848_204_586_834_365_638_117_720_309_179M| Source Location: (816:27,10 [34] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml) |(First: "John", Last: "Doe").First| -Generated Location: (2119:65,10 [34] ) +Generated Location: (2824:79,10 [34] ) |(First: "John", Last: "Doe").First| Source Location: (891:30,5 [291] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml) @@ -72,7 +72,7 @@ Source Location: (891:30,5 [291] TestFiles/IntegrationTests/CodeGenerationIntegr // Do even more of something break; }| -Generated Location: (2314:72,5 [291] ) +Generated Location: (3019:86,5 [291] ) |switch (entry.Extra) { case int age: diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.codegen.cs index 8f72e4e7363..382046f9735 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a2b132455b8159d1094743b389f41b79cabc421ed6d5972456b799596f28f035" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"a2b132455b8159d1094743b389f41b79cabc421ed6d5972456b799596f28f035", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); #nullable restore @@ -99,6 +112,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral(""); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..2ef936812ef --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.cs-diagnostics.txt @@ -0,0 +1,12 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml(10,13): warning CS0219: The variable 'Sixteen' is assigned but its value is never used +// int Sixteen = 0b0001_0000; +Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "Sixteen").WithArguments("Sixteen").WithLocation(10, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml(11,14): warning CS0219: The variable 'BillionsAndBillions' is assigned but its value is never used +// long BillionsAndBillions = 100_000_000_000; +Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "BillionsAndBillions").WithArguments("BillionsAndBillions").WithLocation(11, 14), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml(12,16): warning CS0219: The variable 'AvogadroConstant' is assigned but its value is never used +// double AvogadroConstant = 6.022_140_857_747_474e23; +Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "AvogadroConstant").WithArguments("AvogadroConstant").WithLocation(12, 16), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml(13,17): warning CS0219: The variable 'GoldenRatio' is assigned but its value is never used +// decimal GoldenRatio = 1.618_033_988_749_894_848_204_586_834_365_638_117_720_309_179M; +Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "GoldenRatio").WithArguments("GoldenRatio").WithLocation(13, 17) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.ir.txt index c6f23af206c..1e59713eb8b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [8] CSharp7.cshtml) LazyIntermediateToken - (0:0,0 [5] CSharp7.cshtml) - Html - @@ -49,3 +58,8 @@ LazyIntermediateToken - (891:30,5 [293] CSharp7.cshtml) - CSharp - switch (entry.Extra)\n {\n case int age:\n // Do something\n break;\n case IEnumerable childrenNames:\n // Do more something\n break;\n case null:\n // Do even more of something\n break;\n }\n HtmlContent - (1184:42,0 [7] CSharp7.cshtml) LazyIntermediateToken - (1184:42,0 [7] CSharp7.cshtml) - Html - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.codegen.cs index c040f0c6723..f969d0fd6c2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.codegen.cs @@ -1,8 +1,15 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { #line default + using TModel = global::System.Object; + using global::System; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml" using System.Collections.Generic; @@ -10,7 +17,11 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles #line default #line hidden #nullable disable - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -20,7 +31,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml" @@ -150,6 +161,26 @@ private class Human #line default #line hidden #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..bad228208e9 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml(6,16): warning CS8603: Possible null reference return. +// return null; +Diagnostic(ErrorCode.WRN_NullReferenceReturn, "null").WithLocation(6, 16) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.ir.txt index 9e6f606be8b..b373f7b031a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.ir.txt @@ -1,15 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures UsingDirective - (1:0,1 [32] CSharp8.cshtml) - System.Collections.Generic - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8_DesignTime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:0,33 [4] CSharp8.cshtml) LazyIntermediateToken - (33:0,33 [4] CSharp8.cshtml) - Html - \n\n CSharpCode - (39:2,2 [396] CSharp8.cshtml) @@ -50,3 +72,8 @@ LazyIntermediateToken - (730:41,22 [4] CSharp8.cshtml) - Html - \n\n CSharpCode - (746:43,12 [480] CSharp8.cshtml) LazyIntermediateToken - (746:43,12 [480] CSharp8.cshtml) - CSharp - \n enum TestEnum\n {\n First,\n Second\n }\n\n IDisposable GetLastDisposableInRange(Range range)\n {\n var disposables = (IDisposable[])ViewData["disposables"];\n return disposables[range][^1];\n }\n\n private Human? Person { get; set; }\n\n private Human?[]? People { get; set; }\n\n private Func? DoSomething { get; set; }\n\n private class Human\n {\n public string? Name { get; set; }\n }\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.mappings.txt index 4fc2bb897e4..4f44d6d810c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.mappings.txt @@ -1,6 +1,6 @@ Source Location: (1:0,1 [32] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |using System.Collections.Generic| -Generated Location: (250:7,0 [32] ) +Generated Location: (501:14,0 [32] ) |using System.Collections.Generic| Source Location: (39:2,2 [396] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) @@ -25,7 +25,7 @@ Source Location: (39:2,2 [396] TestFiles/IntegrationTests/CodeGenerationIntegrat return TestEnum.First; } | -Generated Location: (915:26,2 [396] ) +Generated Location: (1535:37,2 [396] ) | IAsyncEnumerable GetAsyncEnumerable() { @@ -50,12 +50,12 @@ Generated Location: (915:26,2 [396] ) Source Location: (441:24,1 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |words[1..2]| -Generated Location: (1470:52,6 [11] ) +Generated Location: (2090:63,6 [11] ) |words[1..2]| Source Location: (456:25,2 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |words[^2..^0]| -Generated Location: (1643:59,6 [13] ) +Generated Location: (2263:70,6 [13] ) |words[^2..^0]| Source Location: (476:27,2 [121] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) @@ -65,7 +65,7 @@ Source Location: (476:27,2 [121] TestFiles/IntegrationTests/CodeGenerationIntegr TestEnum.Second => "The Second!", _ => "The others", }| -Generated Location: (1818:66,6 [121] ) +Generated Location: (2438:77,6 [121] ) |testEnum switch { TestEnum.First => "The First!", @@ -77,36 +77,36 @@ Source Location: (603:34,1 [56] TestFiles/IntegrationTests/CodeGenerationIntegra |await foreach (var val in GetAsyncEnumerable()) { | -Generated Location: (2096:78,1 [56] ) +Generated Location: (2716:89,1 [56] ) |await foreach (var val in GetAsyncEnumerable()) { | Source Location: (660:36,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |val| -Generated Location: (2313:87,6 [3] ) +Generated Location: (2933:98,6 [3] ) |val| Source Location: (663:36,8 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) | }| -Generated Location: (2480:94,8 [3] ) +Generated Location: (3100:105,8 [3] ) | }| Source Location: (671:39,1 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |Person!.Name| -Generated Location: (2644:102,6 [12] ) +Generated Location: (3264:113,6 [12] ) |Person!.Name| Source Location: (686:40,1 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |People![0]!.Name![1]| -Generated Location: (2818:109,6 [20] ) +Generated Location: (3438:120,6 [20] ) |People![0]!.Name![1]| Source Location: (709:41,1 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |DoSomething!(Person!)| -Generated Location: (3000:116,6 [21] ) +Generated Location: (3620:127,6 [21] ) |DoSomething!(Person!)| Source Location: (746:43,12 [480] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) @@ -134,7 +134,7 @@ Source Location: (746:43,12 [480] TestFiles/IntegrationTests/CodeGenerationInteg public string? Name { get; set; } } | -Generated Location: (3238:125,12 [480] ) +Generated Location: (3858:136,12 [480] ) | enum TestEnum { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.codegen.cs index d330254eba4..f8268b0cd78 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.codegen.cs @@ -1,10 +1,16 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4c55c366b179d82f3d2800004985646e9bf0edbf993e2f4a94cbb70079823905" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml")] +namespace AspNetCore { #line default + using global::System; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore #line (1,2)-(2,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml" using System.Collections.Generic @@ -14,10 +20,14 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles #nullable disable ; [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"4c55c366b179d82f3d2800004985646e9bf0edbf993e2f4a94cbb70079823905", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); #nullable restore @@ -174,6 +184,26 @@ private class Human #line hidden #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..bad228208e9 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml(6,16): warning CS8603: Possible null reference return. +// return null; +Diagnostic(ErrorCode.WRN_NullReferenceReturn, "null").WithLocation(6, 16) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.ir.txt index 91da3ef53ba..07cef4d143d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_Runtime.ir.txt @@ -1,10 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures UsingDirective - (1:0,1 [34] CSharp8.cshtml) - System.Collections.Generic RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (35:1,0 [2] CSharp8.cshtml) LazyIntermediateToken - (35:1,0 [2] CSharp8.cshtml) - Html - \n CSharpCode - (39:2,2 [396] CSharp8.cshtml) @@ -45,3 +53,8 @@ LazyIntermediateToken - (730:41,22 [4] CSharp8.cshtml) - Html - \n\n CSharpCode - (746:43,12 [480] CSharp8.cshtml) LazyIntermediateToken - (746:43,12 [480] CSharp8.cshtml) - CSharp - \n enum TestEnum\n {\n First,\n Second\n }\n\n IDisposable GetLastDisposableInRange(Range range)\n {\n var disposables = (IDisposable[])ViewData["disposables"];\n return disposables[range][^1];\n }\n\n private Human? Person { get; set; }\n\n private Human?[]? People { get; set; }\n\n private Func? DoSomething { get; set; }\n\n private class Human\n {\n public string? Name { get; set; }\n }\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.codegen.cs index 33cc7b7caac..55930c96a43 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml" @@ -24,6 +38,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.ir.txt index 3ec65b89102..92a30b69fac 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.ir.txt @@ -1,13 +1,41 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [0] CodeBlockAtEOF.cshtml) LazyIntermediateToken - (2:0,2 [0] CodeBlockAtEOF.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.mappings.txt index 1e04ca5ef81..6e5397874cf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (2:0,2 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml) || -Generated Location: (741:19,2 [0] ) +Generated Location: (1453:33,2 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_Runtime.codegen.cs index 6e854768fe0..43761ebc530 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_Runtime.codegen.cs @@ -1,18 +1,51 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "f1213d84263417aa717c6a0a201077dbb0fede3e19230a7ca231bc16735c7119" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"f1213d84263417aa717c6a0a201077dbb0fede3e19230a7ca231bc16735c7119", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_Runtime.ir.txt index 501b1790bba..46ed83af606 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF_Runtime.ir.txt @@ -1,8 +1,22 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [0] CodeBlockAtEOF.cshtml) LazyIntermediateToken - (2:0,2 [0] CodeBlockAtEOF.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.codegen.cs index 5848cdd68d4..1dce3d1b292 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml" @@ -47,6 +61,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.ir.txt index 47696a6a272..0b3b55dff00 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [17] CodeBlockWithTextElement.cshtml) LazyIntermediateToken - (2:0,2 [17] CodeBlockWithTextElement.cshtml) - CSharp - \n var a = 1; HtmlContent - (25:1,21 [3] CodeBlockWithTextElement.cshtml) @@ -21,3 +44,8 @@ LazyIntermediateToken - (69:2,29 [3] CodeBlockWithTextElement.cshtml) - CSharp - a+b CSharpCode - (80:2,40 [2] CodeBlockWithTextElement.cshtml) LazyIntermediateToken - (80:2,40 [2] CodeBlockWithTextElement.cshtml) - CSharp - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.mappings.txt index ab29f83952e..3199ac454f0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.mappings.txt @@ -1,26 +1,26 @@ Source Location: (2:0,2 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml) | var a = 1; | -Generated Location: (761:19,2 [17] ) +Generated Location: (1483:33,2 [17] ) | var a = 1; | Source Location: (35:1,31 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml) | var b = 1; | -Generated Location: (980:27,31 [22] ) +Generated Location: (1702:41,31 [22] ) | var b = 1; | Source Location: (69:2,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml) |a+b| -Generated Location: (1202:35,29 [3] ) +Generated Location: (1924:49,29 [3] ) |a+b| Source Location: (80:2,40 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml) | | -Generated Location: (1417:42,40 [2] ) +Generated Location: (2139:56,40 [2] ) | | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_Runtime.codegen.cs index 6949122d39b..7f668787152 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "e8683fb69fb02cf452dac1db41d32e64f144a321993e7b85cd64971a7791cbc6" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"e8683fb69fb02cf452dac1db41d32e64f144a321993e7b85cd64971a7791cbc6", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line (1,3)-(2,16) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml" @@ -42,6 +55,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() ); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_Runtime.ir.txt index 2694763f8af..8f487442e4c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [17] CodeBlockWithTextElement.cshtml) LazyIntermediateToken - (2:0,2 [17] CodeBlockWithTextElement.cshtml) - CSharp - \n var a = 1; HtmlContent - (25:1,21 [3] CodeBlockWithTextElement.cshtml) @@ -16,3 +25,8 @@ LazyIntermediateToken - (69:2,29 [3] CodeBlockWithTextElement.cshtml) - CSharp - a+b CSharpCode - (80:2,40 [2] CodeBlockWithTextElement.cshtml) LazyIntermediateToken - (80:2,40 [2] CodeBlockWithTextElement.cshtml) - CSharp - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.codegen.cs index 0c28466b2ec..96aef18f567 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml" @@ -27,6 +41,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.ir.txt index 35c19758b90..288c22a3821 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.ir.txt @@ -1,13 +1,41 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [115] CodeBlock.cshtml) LazyIntermediateToken - (2:0,2 [115] CodeBlock.cshtml) - CSharp - \n for(int i = 1; i <= 10; i++) {\n Output.Write("

Hello from C#, #" + i.ToString() + "

");\n }\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.mappings.txt index d355d505fa9..3f70eea5943 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.mappings.txt @@ -4,7 +4,7 @@ Output.Write("

Hello from C#, #" + i.ToString() + "

"); } | -Generated Location: (731:19,2 [115] ) +Generated Location: (1438:33,2 [115] ) | for(int i = 1; i <= 10; i++) { Output.Write("

Hello from C#, #" + i.ToString() + "

"); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_Runtime.codegen.cs index fb1e6329f11..2ff6258f254 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "71c9e37483da0d198df8bd194ad927f8340b7cfe40ab63cf3ce1dcd9d2a2904d" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"71c9e37483da0d198df8bd194ad927f8340b7cfe40ab63cf3ce1dcd9d2a2904d", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line (1,3)-(5,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml" @@ -24,6 +37,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_Runtime.ir.txt index 1b4764c4d5c..863496486a1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_Runtime.ir.txt @@ -1,8 +1,22 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [115] CodeBlock.cshtml) LazyIntermediateToken - (2:0,2 [115] CodeBlock.cshtml) - CSharp - \n for(int i = 1; i <= 10; i++) {\n Output.Write("

Hello from C#, #" + i.ToString() + "

");\n }\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.cs index a3248276ead..0764134d992 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -31,7 +45,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" @@ -257,7 +271,7 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); #nullable restore #line 35 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" - __o = someMethod(item => new Template(async(__razor_template_writer) => { + __o = someMethod(item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { __TestNamespace_InputTagHelper = CreateTagHelper(); __TestNamespace_InputTagHelper2 = CreateTagHelper(); #nullable restore @@ -302,6 +316,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..1fd77eec400 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.cs-diagnostics.txt @@ -0,0 +1,42 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(8,34): error CS1525: Invalid expression term '' +// __TestNamespace_PTagHelper.Age = @@(1+2); +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "@@").WithArguments("").WithLocation(8, 34), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(8,34): error CS1002: ; expected +// __TestNamespace_PTagHelper.Age = @@(1+2); +Diagnostic(ErrorCode.ERR_SemicolonExpected, "@@").WithLocation(8, 34), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(8,34): error CS1646: Keyword, identifier, or string expected after verbatim specifier: @ +// __TestNamespace_PTagHelper.Age = @@(1+2); +Diagnostic(ErrorCode.ERR_ExpectedVerbatimLiteral, "").WithLocation(8, 34), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(8,36): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement +// __TestNamespace_PTagHelper.Age = @@(1+2); +Diagnostic(ErrorCode.ERR_IllegalStatement, "(1+2)").WithLocation(8, 36), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(33,46): error CS1525: Invalid expression term '' +// __TestNamespace_InputTagHelper2.Checked = @( DateTimeOffset.Now.Year ) > 2014 ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "@").WithArguments("").WithLocation(33, 46), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(33,46): error CS1002: ; expected +// __TestNamespace_InputTagHelper2.Checked = @( DateTimeOffset.Now.Year ) > 2014 ; +Diagnostic(ErrorCode.ERR_SemicolonExpected, "@").WithLocation(33, 46), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(33,46): error CS1646: Keyword, identifier, or string expected after verbatim specifier: @ +// __TestNamespace_InputTagHelper2.Checked = @( DateTimeOffset.Now.Year ) > 2014 ; +Diagnostic(ErrorCode.ERR_ExpectedVerbatimLiteral, "").WithLocation(33, 46), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(33,47): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement +// __TestNamespace_InputTagHelper2.Checked = @( DateTimeOffset.Now.Year ) > 2014 ; +Diagnostic(ErrorCode.ERR_IllegalStatement, "( DateTimeOffset.Now.Year ) > 2014").WithLocation(33, 47), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(35,10): error CS0103: The name 'someMethod' does not exist in the current context +// __o = someMethod(item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { +Diagnostic(ErrorCode.ERR_NameNotInContext, "someMethod").WithArguments("someMethod").WithLocation(35, 10), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(35,71): error CS1003: Syntax error, '(' expected +// __TestNamespace_InputTagHelper2.Checked = checked; +Diagnostic(ErrorCode.ERR_SyntaxError, ";").WithArguments("(").WithLocation(35, 71), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(35,71): error CS1525: Invalid expression term ';' +// __TestNamespace_InputTagHelper2.Checked = checked; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(35, 71), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(35,71): error CS1026: ) expected +// __TestNamespace_InputTagHelper2.Checked = checked; +Diagnostic(ErrorCode.ERR_CloseParenExpected, ";").WithLocation(35, 71), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(36,34): error CS1525: Invalid expression term ';' +// __TestNamespace_PTagHelper.Age = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(36, 34), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(79,13): warning CS0162: Unreachable code detected +// __TestNamespace_InputTagHelper = CreateTagHelper(); +Diagnostic(ErrorCode.WRN_UnreachableCode, "__TestNamespace_InputTagHelper").WithLocation(79, 13) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.ir.txt index 49ef9b53415..dc29f6d2905 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.ir.txt @@ -1,11 +1,34 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] ComplexTagHelpers.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -13,7 +36,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [4] ComplexTagHelpers.cshtml) LazyIntermediateToken - (31:0,31 [4] ComplexTagHelpers.cshtml) - Html - \n\n CSharpCode - (36:2,1 [52] ComplexTagHelpers.cshtml) @@ -305,3 +328,8 @@ LazyIntermediateToken - (1463:36,4 [6] ComplexTagHelpers.cshtml) - Html -
CSharpCode - (1469:36,10 [3] ComplexTagHelpers.cshtml) LazyIntermediateToken - (1469:36,10 [3] ComplexTagHelpers.cshtml) - CSharp - \n} + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.mappings.txt index 1753f191cb9..ad535a778ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.mappings.txt @@ -1,6 +1,6 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |"*, TestAssembly"| -Generated Location: (1203:20,37 [17] ) +Generated Location: (1901:34,37 [17] ) |"*, TestAssembly"| Source Location: (36:2,1 [52] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) @@ -9,7 +9,7 @@ Source Location: (36:2,1 [52] TestFiles/IntegrationTests/CodeGenerationIntegrati var checkbox = "checkbox"; | -Generated Location: (1693:37,1 [52] ) +Generated Location: (2408:51,1 [52] ) |if (true) { var checkbox = "checkbox"; @@ -18,39 +18,39 @@ Generated Location: (1693:37,1 [52] ) Source Location: (147:7,16 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |@| -Generated Location: (2037:49,33 [1] ) +Generated Location: (2752:63,33 [1] ) |@| Source Location: (149:7,18 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) || -Generated Location: (2038:49,34 [0] ) +Generated Location: (2753:63,34 [0] ) || Source Location: (149:7,18 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |@| -Generated Location: (2038:49,34 [1] ) +Generated Location: (2753:63,34 [1] ) |@| Source Location: (150:7,19 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (2039:49,35 [1] ) +Generated Location: (2754:63,35 [1] ) |(| Source Location: (151:7,20 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |1+2| -Generated Location: (2040:49,36 [3] ) +Generated Location: (2755:63,36 [3] ) |1+2| Source Location: (154:7,23 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (2043:49,39 [1] ) +Generated Location: (2758:63,39 [1] ) |)| Source Location: (273:10,13 [43] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |if (false) { | -Generated Location: (2299:57,13 [43] ) +Generated Location: (3014:71,13 [43] ) |if (false) { | @@ -61,7 +61,7 @@ Source Location: (399:12,99 [66] TestFiles/IntegrationTests/CodeGenerationIntegr else { | -Generated Location: (3209:73,99 [66] ) +Generated Location: (3924:87,99 [66] ) | } else @@ -70,219 +70,219 @@ Generated Location: (3209:73,99 [66] ) Source Location: (495:16,46 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |checkbox| -Generated Location: (3694:86,46 [8] ) +Generated Location: (4409:100,46 [8] ) |checkbox| Source Location: (512:16,63 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |true| -Generated Location: (4085:95,63 [4] ) +Generated Location: (4800:109,63 [4] ) |true| Source Location: (523:16,74 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | | -Generated Location: (4576:105,74 [18] ) +Generated Location: (5291:119,74 [18] ) | | Source Location: (556:17,31 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |true ? "checkbox" : "anything"| -Generated Location: (4998:115,31 [30] ) +Generated Location: (5713:129,31 [30] ) |true ? "checkbox" : "anything"| Source Location: (591:17,66 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | | -Generated Location: (5490:125,66 [18] ) +Generated Location: (6205:139,66 [18] ) | | Source Location: (623:18,30 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |if(true) { | -Generated Location: (5911:135,30 [11] ) +Generated Location: (6626:149,30 [11] ) |if(true) { | Source Location: (655:18,62 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | } else { | -Generated Location: (6149:142,62 [10] ) +Generated Location: (6864:156,62 [10] ) | } else { | Source Location: (686:18,93 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | }| -Generated Location: (6417:149,93 [2] ) +Generated Location: (7132:163,93 [2] ) | }| Source Location: (690:18,97 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | }| -Generated Location: (6911:159,97 [15] ) +Generated Location: (7626:173,97 [15] ) | }| Source Location: (212:8,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTime.Now| -Generated Location: (7217:168,32 [12] ) +Generated Location: (7932:182,32 [12] ) |DateTime.Now| Source Location: (832:22,14 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | var @object = false;| -Generated Location: (7485:176,14 [21] ) +Generated Location: (8200:190,14 [21] ) | var @object = false;| Source Location: (885:23,29 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (7921:185,42 [1] ) +Generated Location: (8636:199,42 [1] ) |(| Source Location: (886:23,30 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |@object| -Generated Location: (7922:185,43 [7] ) +Generated Location: (8637:199,43 [7] ) |@object| Source Location: (893:23,37 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (7929:185,50 [1] ) +Generated Location: (8644:199,50 [1] ) |)| Source Location: (760:21,39 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTimeOffset.Now.Year| -Generated Location: (8305:194,38 [23] ) +Generated Location: (9020:208,38 [23] ) |DateTimeOffset.Now.Year| Source Location: (783:21,62 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | -| -Generated Location: (8328:194,61 [2] ) +Generated Location: (9043:208,61 [2] ) | -| Source Location: (785:21,64 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | 1970| -Generated Location: (8330:194,63 [5] ) +Generated Location: (9045:208,63 [5] ) | 1970| Source Location: (1025:26,61 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (8845:204,60 [1] ) +Generated Location: (9560:218,60 [1] ) |(| Source Location: (1026:26,62 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTimeOffset.Now.Year > 2014| -Generated Location: (8846:204,61 [30] ) +Generated Location: (9561:218,61 [30] ) |DateTimeOffset.Now.Year > 2014| Source Location: (1056:26,92 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (8876:204,91 [1] ) +Generated Location: (9591:218,91 [1] ) |)| Source Location: (928:25,16 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |-1970| -Generated Location: (9247:213,33 [5] ) +Generated Location: (9962:227,33 [5] ) |-1970| Source Location: (933:25,21 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | +| -Generated Location: (9252:213,38 [2] ) +Generated Location: (9967:227,38 [2] ) | +| Source Location: (935:25,23 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | | -Generated Location: (9254:213,40 [1] ) +Generated Location: (9969:227,40 [1] ) | | Source Location: (936:25,24 [24] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |@DateTimeOffset.Now.Year| -Generated Location: (9255:213,41 [24] ) +Generated Location: (9970:227,41 [24] ) |@DateTimeOffset.Now.Year| Source Location: (1155:29,28 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTimeOffset.Now.Year > 2014| -Generated Location: (9771:223,42 [30] ) +Generated Location: (10486:237,42 [30] ) |DateTimeOffset.Now.Year > 2014| Source Location: (1093:28,16 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTimeOffset.Now.Year - 1970| -Generated Location: (10171:232,33 [30] ) +Generated Location: (10886:246,33 [30] ) |DateTimeOffset.Now.Year - 1970| Source Location: (1283:32,28 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | | -Generated Location: (10693:242,42 [3] ) +Generated Location: (11408:256,42 [3] ) | | Source Location: (1286:32,31 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |@| -Generated Location: (10696:242,45 [1] ) +Generated Location: (11411:256,45 [1] ) |@| Source Location: (1287:32,32 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (10697:242,46 [1] ) +Generated Location: (11412:256,46 [1] ) |(| Source Location: (1288:32,33 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | DateTimeOffset.Now.Year | -Generated Location: (10698:242,47 [27] ) +Generated Location: (11413:256,47 [27] ) | DateTimeOffset.Now.Year | Source Location: (1315:32,60 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (10725:242,74 [1] ) +Generated Location: (11440:256,74 [1] ) |)| Source Location: (1316:32,61 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | >| -Generated Location: (10726:242,75 [2] ) +Generated Location: (11441:256,75 [2] ) | >| Source Location: (1318:32,63 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | 2014| -Generated Location: (10728:242,77 [5] ) +Generated Location: (11443:256,77 [5] ) | 2014| Source Location: (1323:32,68 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | | -Generated Location: (10733:242,82 [3] ) +Generated Location: (11448:256,82 [3] ) | | Source Location: (1220:31,17 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (11106:251,33 [1] ) +Generated Location: (11821:265,33 [1] ) |(| Source Location: (1221:31,18 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |"My age is this long.".Length| -Generated Location: (11107:251,34 [29] ) +Generated Location: (11822:265,34 [29] ) |"My age is this long.".Length| Source Location: (1250:31,47 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (11136:251,63 [1] ) +Generated Location: (11851:265,63 [1] ) |)| Source Location: (1355:34,9 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |someMethod(| -Generated Location: (11388:259,9 [11] ) +Generated Location: (12103:273,9 [11] ) |someMethod(| Source Location: (1410:34,64 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |checked| -Generated Location: (11825:264,63 [7] ) +Generated Location: (12583:278,63 [7] ) |checked| Source Location: (1375:34,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |123| -Generated Location: (12186:273,33 [3] ) +Generated Location: (12944:287,33 [3] ) |123| Source Location: (1424:34,78 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (12314:280,1 [1] ) +Generated Location: (13072:294,1 [1] ) |)| Source Location: (1469:36,10 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | }| -Generated Location: (12861:296,10 [3] ) +Generated Location: (13619:310,10 [3] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.codegen.cs index 576e3cb9927..4beae046c68 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1f3b8300659fe8a9bf41b8b1b87fbc9ea296962d88df30817150779b3823b339" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"1f3b8300659fe8a9bf41b8b1b87fbc9ea296962d88df30817150779b3823b339", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "text", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("value", new global::Microsoft.AspNetCore.Html.HtmlString(""), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); @@ -40,7 +53,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); #nullable restore @@ -678,7 +691,7 @@ public async System.Threading.Tasks.Task ExecuteAsync() #line default #line hidden #nullable disable - item => new Template(async(__razor_template_writer) => { + item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { PushWriter(__razor_template_writer); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { @@ -764,6 +777,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..550439d6e9b --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.cs-diagnostics.txt @@ -0,0 +1,90 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(8,17): error CS1646: Keyword, identifier, or string expected after verbatim specifier: @ +// @ +Diagnostic(ErrorCode.ERR_ExpectedVerbatimLiteral, "").WithLocation(8, 17), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(8,19): error CS1646: Keyword, identifier, or string expected after verbatim specifier: @ +// @ +Diagnostic(ErrorCode.ERR_ExpectedVerbatimLiteral, "").WithLocation(8, 19), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(8,20): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement +// ( +Diagnostic(ErrorCode.ERR_IllegalStatement, @"( + +#line default +#line hidden +#nullable disable +#nullable restore +#line (8,21)-(8,24) ""TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"" +1+2 + +#line default +#line hidden +#nullable disable +#nullable restore +#line (8,24)-(8,25) ""TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"" +)").WithLocation(8, 20), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(33,32): error CS1646: Keyword, identifier, or string expected after verbatim specifier: @ +// @ +Diagnostic(ErrorCode.ERR_ExpectedVerbatimLiteral, "").WithLocation(33, 32), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(33,33): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement +// ( +Diagnostic(ErrorCode.ERR_IllegalStatement, @"( + +#line default +#line hidden +#nullable disable +#nullable restore +#line (33,34)-(33,61) ""TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"" + DateTimeOffset.Now.Year + +#line default +#line hidden +#nullable disable +#nullable restore +#line (33,61)-(33,62) ""TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"" +) + +#line default +#line hidden +#nullable disable +#nullable restore +#line (33,62)-(33,64) ""TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"" + > + +#line default +#line hidden +#nullable disable +#nullable restore +#line (33,64)-(33,69) ""TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"" + 2014").WithLocation(33, 33), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(35,10): error CS0103: The name 'someMethod' does not exist in the current context +// someMethod( +Diagnostic(ErrorCode.ERR_NameNotInContext, "someMethod").WithArguments("someMethod").WithLocation(35, 10), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(35,72): error CS1003: Syntax error, '(' expected +// checked +Diagnostic(ErrorCode.ERR_SyntaxError, "").WithArguments("(").WithLocation(35, 72), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(35,72): error CS1525: Invalid expression term ';' +// checked +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments(";").WithLocation(35, 72), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(35,72): error CS1026: ) expected +// checked +Diagnostic(ErrorCode.ERR_CloseParenExpected, "").WithLocation(35, 72), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(76,45): error CS1525: Invalid expression term '' +// __TestNamespace_PTagHelper.Age = +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments("").WithLocation(76, 45), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(76,45): error CS1002: ; expected +// __TestNamespace_PTagHelper.Age = +Diagnostic(ErrorCode.ERR_SemicolonExpected, "").WithLocation(76, 45), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(144,17): warning CS0162: Unreachable code detected +// WriteLiteral(" "); +Diagnostic(ErrorCode.WRN_UnreachableCode, "WriteLiteral").WithLocation(144, 17), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(296,17): warning CS0162: Unreachable code detected +// WriteLiteral("anything"); +Diagnostic(ErrorCode.WRN_UnreachableCode, "WriteLiteral").WithLocation(296, 17), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(583,58): error CS1525: Invalid expression term '' +// __TestNamespace_InputTagHelper2.Checked = +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments("").WithLocation(583, 58), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(583,58): error CS1002: ; expected +// __TestNamespace_InputTagHelper2.Checked = +Diagnostic(ErrorCode.ERR_SemicolonExpected, "").WithLocation(583, 58), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml(760,46): error CS1525: Invalid expression term ';' +// __TestNamespace_PTagHelper.Age = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(760, 46) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.ir.txt index 6ec69ab733c..953a32085cd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_Runtime.ir.txt @@ -1,8 +1,17 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - type - text - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - value - - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - placeholder - Enter in a new time... - HtmlAttributeValueStyle.DoubleQuotes @@ -15,7 +24,7 @@ FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [2] ComplexTagHelpers.cshtml) LazyIntermediateToken - (33:1,0 [2] ComplexTagHelpers.cshtml) - Html - \n CSharpCode - (36:2,1 [48] ComplexTagHelpers.cshtml) @@ -306,3 +315,8 @@ LazyIntermediateToken - (1469:36,10 [2] ComplexTagHelpers.cshtml) - Html - \n CSharpCode - (1471:37,0 [1] ComplexTagHelpers.cshtml) LazyIntermediateToken - (1471:37,0 [1] ComplexTagHelpers.cshtml) - CSharp - } + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.codegen.cs index 1629f1ede74..53a3a9f331c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml" @@ -184,6 +198,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.ir.txt index 293cc58ea4b..c1e3435fd47 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [48] ConditionalAttributes.cshtml) LazyIntermediateToken - (2:0,2 [48] ConditionalAttributes.cshtml) - CSharp - \n var ch = true;\n var cls = "bar";\n HtmlContent - (50:3,4 [16] ConditionalAttributes.cshtml) @@ -126,3 +149,8 @@ LazyIntermediateToken - (629:13,106 [9] ConditionalAttributes.cshtml) - Html - CSharpCode - (638:13,115 [2] ConditionalAttributes.cshtml) LazyIntermediateToken - (638:13,115 [2] ConditionalAttributes.cshtml) - CSharp - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.mappings.txt index 82ea1830964..636b3f8f46d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.mappings.txt @@ -3,7 +3,7 @@ var ch = true; var cls = "bar"; | -Generated Location: (755:19,2 [48] ) +Generated Location: (1474:33,2 [48] ) | var ch = true; var cls = "bar"; @@ -12,127 +12,127 @@ Generated Location: (755:19,2 [48] ) Source Location: (66:3,20 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (991:29,20 [6] ) +Generated Location: (1710:43,20 [6] ) | | Source Location: (83:4,15 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |cls| -Generated Location: (1180:37,15 [3] ) +Generated Location: (1899:51,15 [3] ) |cls| Source Location: (90:4,22 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (1374:44,22 [6] ) +Generated Location: (2093:58,22 [6] ) | | Source Location: (111:5,19 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |cls| -Generated Location: (1567:52,19 [3] ) +Generated Location: (2286:66,19 [3] ) |cls| Source Location: (118:5,26 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (1765:59,26 [6] ) +Generated Location: (2484:73,26 [6] ) | | Source Location: (135:6,15 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |cls| -Generated Location: (1954:67,15 [3] ) +Generated Location: (2673:81,15 [3] ) |cls| Source Location: (146:6,26 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (2152:74,26 [6] ) +Generated Location: (2871:88,26 [6] ) | | Source Location: (185:7,37 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |ch| -Generated Location: (2363:82,37 [2] ) +Generated Location: (3082:96,37 [2] ) |ch| Source Location: (191:7,43 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (2577:89,43 [6] ) +Generated Location: (3296:103,43 [6] ) | | Source Location: (234:8,41 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |ch| -Generated Location: (2792:97,41 [2] ) +Generated Location: (3511:111,41 [2] ) |ch| Source Location: (240:8,47 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (3010:104,47 [6] ) +Generated Location: (3729:118,47 [6] ) | | Source Location: (257:9,15 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |if(cls != null) { | -Generated Location: (3200:112,15 [18] ) +Generated Location: (3919:126,15 [18] ) |if(cls != null) { | Source Location: (276:9,34 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |cls| -Generated Location: (3421:119,34 [3] ) +Generated Location: (4140:133,34 [3] ) |cls| Source Location: (279:9,37 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | }| -Generated Location: (3631:126,37 [2] ) +Generated Location: (4350:140,37 [2] ) | }| Source Location: (285:9,43 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (3845:133,43 [6] ) +Generated Location: (4564:147,43 [6] ) | | Source Location: (309:10,22 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (4042:141,22 [6] ) +Generated Location: (4761:155,22 [6] ) | | Source Location: (329:11,18 [44] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |Url.Content("~/Scripts/jquery-1.6.2.min.js")| -Generated Location: (4235:149,18 [44] ) +Generated Location: (4954:163,18 [44] ) |Url.Content("~/Scripts/jquery-1.6.2.min.js")| Source Location: (407:11,96 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (4545:156,96 [6] ) +Generated Location: (5264:170,96 [6] ) | | Source Location: (427:12,18 [60] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")| -Generated Location: (4738:164,18 [60] ) +Generated Location: (5457:178,18 [60] ) |Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")| Source Location: (521:12,112 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (5080:171,112 [6] ) +Generated Location: (5799:185,112 [6] ) | | Source Location: (638:13,115 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (5370:179,115 [2] ) +Generated Location: (6089:193,115 [2] ) | | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_Runtime.codegen.cs index 6bf534648b6..995978b2a35 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "06e553c9dddd22392e81b4db3d16d097612b3552ffeaa58d015a2e3dedcf6c3a" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"06e553c9dddd22392e81b4db3d16d097612b3552ffeaa58d015a2e3dedcf6c3a", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line (1,3)-(4,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml" @@ -142,6 +155,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral(" type=\"text/javascript\">\r\n \r\n"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_Runtime.ir.txt index b566da76dcd..99b6757cd63 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [44] ConditionalAttributes.cshtml) LazyIntermediateToken - (2:0,2 [44] ConditionalAttributes.cshtml) - CSharp - \n var ch = true;\n var cls = "bar";\n HtmlContent - (46:3,0 [28] ConditionalAttributes.cshtml) @@ -113,3 +122,8 @@ LazyIntermediateToken - (638:13,115 [2] ConditionalAttributes.cshtml) - Html - \n CSharpCode - (640:14,0 [0] ConditionalAttributes.cshtml) LazyIntermediateToken - (640:14,0 [0] ConditionalAttributes.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.codegen.cs index 032564673c3..6b8b6332059 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -34,7 +48,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_ATagHelper = CreateTagHelper(); __TestNamespace_CatchAllTagHelper = CreateTagHelper(); @@ -90,6 +104,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.ir.txt index 4e7892abb84..d1e1b7b2bbb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.ir.txt @@ -1,6 +1,16 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.ATagHelper - __TestNamespace_ATagHelper FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper @@ -9,6 +19,19 @@ FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper2 - __TestNamespace_CatchAllTagHelper2 DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] CssSelectorTagHelperAttributes.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -16,7 +39,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [4] CssSelectorTagHelperAttributes.cshtml) LazyIntermediateToken - (31:0,31 [4] CssSelectorTagHelperAttributes.cshtml) - Html - \n\n TagHelper - (35:2,0 [30] CssSelectorTagHelperAttributes.cshtml) - a - TagMode.StartTagAndEndTag @@ -154,3 +177,8 @@ HtmlContent - (476:12,30 [11] CssSelectorTagHelperAttributes.cshtml) LazyIntermediateToken - (476:12,30 [11] CssSelectorTagHelperAttributes.cshtml) - Html - 2 TagHelper DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.mappings.txt index 43bfb4e94a4..c9ac98daec0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml) |"*, TestAssembly"| -Generated Location: (1527:23,37 [17] ) +Generated Location: (2238:37,37 [17] ) |"*, TestAssembly"| Source Location: (156:5,12 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml) |false| -Generated Location: (3058:50,12 [5] ) +Generated Location: (3786:64,12 [5] ) |false| Source Location: (237:7,11 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml) |false| -Generated Location: (3437:59,11 [5] ) +Generated Location: (4165:73,11 [5] ) |false| Source Location: (333:9,25 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml) |false| -Generated Location: (4016:70,25 [5] ) +Generated Location: (4744:84,25 [5] ) |false| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_Runtime.codegen.cs index 8e49f5998c1..42a9dffd1e3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "b0b4eb8b8ddbffa2284ca831845a2ffaacd3d0599bf4242794848b4210903a3b" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"b0b4eb8b8ddbffa2284ca831845a2ffaacd3d0599bf4242794848b4210903a3b", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("href", new global::Microsoft.AspNetCore.Html.HtmlString("~/hello"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); @@ -44,7 +57,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; private global::TestNamespace.CatchAllTagHelper2 __TestNamespace_CatchAllTagHelper2; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { @@ -251,6 +264,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_Runtime.ir.txt index 5a74f338ed6..3468d006363 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_Runtime.ir.txt @@ -1,8 +1,17 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - href - ~/ - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - href - ~/hello - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - href - ~/?hello=world - HtmlAttributeValueStyle.DoubleQuotes @@ -19,7 +28,7 @@ FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper2 - __TestNamespace_CatchAllTagHelper2 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [2] CssSelectorTagHelperAttributes.cshtml) LazyIntermediateToken - (33:1,0 [2] CssSelectorTagHelperAttributes.cshtml) - Html - \n TagHelper - (35:2,0 [30] CssSelectorTagHelperAttributes.cshtml) - a - TagMode.StartTagAndEndTag @@ -135,3 +144,8 @@ PreallocatedTagHelperProperty - (459:12,13 [8] CssSelectorTagHelperAttributes.cshtml) - __tagHelperAttribute_7 - type - Type PreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_8 DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.codegen.cs index a1c61ec7b89..0cee17ac0f8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -23,7 +37,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml" @@ -57,7 +71,7 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable #nullable restore #line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml" -__o = Foo(item => new Template(async(__razor_template_writer) => { +__o = Foo(item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { #nullable restore #line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml" __o = baz; @@ -83,6 +97,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() ); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..2acea3e9214 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.cs-diagnostics.txt @@ -0,0 +1,12 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml(8,7): error CS0103: The name 'Foo' does not exist in the current context +// __o = Foo(Bar.Baz); +Diagnostic(ErrorCode.ERR_NameNotInContext, "Foo").WithArguments("Foo").WithLocation(8, 7), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml(8,11): error CS0103: The name 'Bar' does not exist in the current context +// __o = Foo(Bar.Baz); +Diagnostic(ErrorCode.ERR_NameNotInContext, "Bar").WithArguments("Bar").WithLocation(8, 11), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml(9,7): error CS0103: The name 'Foo' does not exist in the current context +// __o = Foo(item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { +Diagnostic(ErrorCode.ERR_NameNotInContext, "Foo").WithArguments("Foo").WithLocation(9, 7), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml(14,7): error CS0103: The name 'bar' does not exist in the current context +// __o = bar; +Diagnostic(ErrorCode.ERR_NameNotInContext, "bar").WithArguments("bar").WithLocation(14, 7) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.ir.txt index 2c3101024cd..869b681ff3f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.ir.txt @@ -1,7 +1,30 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (173:11,9 [6] DesignTime.cshtml) - Footer CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -9,7 +32,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [19] DesignTime.cshtml) LazyIntermediateToken - (0:0,0 [4] DesignTime.cshtml) - Html -
@@ -66,3 +89,8 @@ LazyIntermediateToken - (204:13,5 [3] DesignTime.cshtml) - CSharp - bar HtmlContent - (207:13,8 [2] DesignTime.cshtml) LazyIntermediateToken - (207:13,8 [2] DesignTime.cshtml) - Html - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.mappings.txt index 333daa8c84f..90e59b7be2d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.mappings.txt @@ -1,49 +1,49 @@ Source Location: (173:11,9 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |Footer| -Generated Location: (515:12,22 [6] ) +Generated Location: (1206:26,22 [6] ) |Footer| Source Location: (20:1,13 [36] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |for(int i = 1; i <= 10; i++) { | -Generated Location: (1007:29,13 [36] ) +Generated Location: (1715:43,13 [36] ) |for(int i = 1; i <= 10; i++) { | Source Location: (74:2,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |i| -Generated Location: (1222:37,22 [1] ) +Generated Location: (1930:51,22 [1] ) |i| Source Location: (79:2,27 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) | }| -Generated Location: (1408:44,27 [15] ) +Generated Location: (2116:58,27 [15] ) | }| Source Location: (113:7,2 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |Foo(Bar.Baz)| -Generated Location: (1586:52,6 [12] ) +Generated Location: (2294:66,6 [12] ) |Foo(Bar.Baz)| Source Location: (129:8,1 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |Foo(| -Generated Location: (1762:59,6 [4] ) +Generated Location: (2470:73,6 [4] ) |Foo(| Source Location: (142:8,14 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |baz| -Generated Location: (1943:62,14 [3] ) +Generated Location: (2694:76,14 [3] ) |baz| Source Location: (153:8,25 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |)| -Generated Location: (2003:68,1 [1] ) +Generated Location: (2754:82,1 [1] ) |)| Source Location: (204:13,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |bar| -Generated Location: (2241:76,6 [3] ) +Generated Location: (2992:90,6 [3] ) |bar| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.codegen.cs index 3a8eeb2c968..3e4d5adae63 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "81bc9372da7d25ed6342dfd5b1067004013e6b4791921ce725e71f4c9eb90f85" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"81bc9372da7d25ed6342dfd5b1067004013e6b4791921ce725e71f4c9eb90f85", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("
\r\n"); #nullable restore @@ -58,7 +71,7 @@ public async System.Threading.Tasks.Task ExecuteAsync() #line default #line hidden #nullable disable - item => new Template(async(__razor_template_writer) => { + item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { PushWriter(__razor_template_writer); WriteLiteral("

Bar "); Write( @@ -99,6 +112,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() ); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..012db8c470c --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.cs-diagnostics.txt @@ -0,0 +1,12 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml(8,3): error CS0103: The name 'Foo' does not exist in the current context +// Foo(Bar.Baz) +Diagnostic(ErrorCode.ERR_NameNotInContext, "Foo").WithArguments("Foo").WithLocation(8, 3), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml(8,7): error CS0103: The name 'Bar' does not exist in the current context +// Foo(Bar.Baz) +Diagnostic(ErrorCode.ERR_NameNotInContext, "Bar").WithArguments("Bar").WithLocation(8, 7), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml(9,2): error CS0103: The name 'Foo' does not exist in the current context +// Foo( +Diagnostic(ErrorCode.ERR_NameNotInContext, "Foo").WithArguments("Foo").WithLocation(9, 2), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml(14,6): error CS0103: The name 'bar' does not exist in the current context +// bar +Diagnostic(ErrorCode.ERR_NameNotInContext, "bar").WithArguments("bar").WithLocation(14, 6) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.ir.txt index b67216163a8..bcade08ec7c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [7] DesignTime.cshtml) LazyIntermediateToken - (0:0,0 [4] DesignTime.cshtml) - Html -

@@ -64,3 +73,8 @@ LazyIntermediateToken - (204:13,5 [3] DesignTime.cshtml) - CSharp - bar HtmlContent - (207:13,8 [2] DesignTime.cshtml) LazyIntermediateToken - (207:13,8 [2] DesignTime.cshtml) - Html - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.cs index a172cb63a29..11e1dbc9017 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -31,7 +45,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_InputTagHelper = CreateTagHelper(); __TestNamespace_InputTagHelper2 = CreateTagHelper(); @@ -73,6 +87,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.ir.txt index b8e31bb32da..d9f2bbc2f60 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.ir.txt @@ -1,11 +1,34 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] DuplicateAttributeTagHelpers.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -13,7 +36,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [4] DuplicateAttributeTagHelpers.cshtml) LazyIntermediateToken - (31:0,31 [4] DuplicateAttributeTagHelpers.cshtml) - Html - \n\n TagHelper - (35:2,0 [259] DuplicateAttributeTagHelpers.cshtml) - p - TagMode.StartTagAndEndTag @@ -94,3 +117,8 @@ HtmlContent - (60:2,25 [3] DuplicateAttributeTagHelpers.cshtml) LazyIntermediateToken - (60:2,25 [3] DuplicateAttributeTagHelpers.cshtml) - Html - 500 DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.mappings.txt index d4ce9eac776..9fa8793cc23 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) |"*, TestAssembly"| -Generated Location: (1225:20,37 [17] ) +Generated Location: (1934:34,37 [17] ) |"*, TestAssembly"| Source Location: (146:4,34 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) |true| -Generated Location: (2559:46,42 [4] ) +Generated Location: (3285:60,42 [4] ) |true| Source Location: (222:5,34 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) |true| -Generated Location: (3215:58,42 [4] ) +Generated Location: (3941:72,42 [4] ) |true| Source Location: (43:2,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) |3| -Generated Location: (3599:67,33 [1] ) +Generated Location: (4325:81,33 [1] ) |3| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.codegen.cs index 68c0c28f281..02d1285c41e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "d45c3cbf5538f23158a297cf78d066fb3d191fc8c062d4e8879f387591564a6b" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"d45c3cbf5538f23158a297cf78d066fb3d191fc8c062d4e8879f387591564a6b", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "button", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("TYPE", new global::Microsoft.AspNetCore.Html.HtmlString("checkbox"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); @@ -41,7 +54,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateA private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { @@ -155,6 +168,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.ir.txt index e4c6238e33a..574b02ba84b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_Runtime.ir.txt @@ -1,8 +1,17 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - type - button - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - TYPE - checkbox - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes @@ -16,7 +25,7 @@ FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [2] DuplicateAttributeTagHelpers.cshtml) LazyIntermediateToken - (33:1,0 [2] DuplicateAttributeTagHelpers.cshtml) - Html - \n TagHelper - (35:2,0 [259] DuplicateAttributeTagHelpers.cshtml) - p - TagMode.StartTagAndEndTag @@ -67,3 +76,8 @@ PreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_7 PreallocatedTagHelperHtmlAttribute - - __tagHelperAttribute_8 DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.cs index b96c98f9ae1..a943f1ac1d7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -30,7 +44,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_InputTagHelper = CreateTagHelper(); __TestNamespace_CatchAllTagHelper = CreateTagHelper(); @@ -47,6 +61,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.ir.txt index ad0f5d57a55..c152eb2adf9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.ir.txt @@ -1,10 +1,33 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] DuplicateTargetTagHelper.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -12,7 +35,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [4] DuplicateTargetTagHelper.cshtml) LazyIntermediateToken - (31:0,31 [4] DuplicateTargetTagHelper.cshtml) - Html - \n\n TagHelper - (35:2,0 [40] DuplicateTargetTagHelper.cshtml) - input - TagMode.SelfClosing @@ -30,3 +53,8 @@ DefaultTagHelperProperty - (67:2,32 [4] DuplicateTargetTagHelper.cshtml) - checked - bool TestNamespace.CatchAllTagHelper.Checked - HtmlAttributeValueStyle.DoubleQuotes LazyIntermediateToken - (67:2,32 [4] DuplicateTargetTagHelper.cshtml) - CSharp - true DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.mappings.txt index 91da8b5cfff..484e1c1bd98 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml) |"*, TestAssembly"| -Generated Location: (1143:19,37 [17] ) +Generated Location: (1848:33,37 [17] ) |"*, TestAssembly"| Source Location: (67:2,32 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml) |true| -Generated Location: (2046:40,41 [4] ) +Generated Location: (2768:54,41 [4] ) |true| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.codegen.cs index 051359fd013..9187b068bd6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "739b3bb42f48ad64d3010068758f57fb6fd25db64a98ab4b4ebd02099e856a56" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"739b3bb42f48ad64d3010068758f57fb6fd25db64a98ab4b4ebd02099e856a56", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "checkbox", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); #line hidden @@ -32,7 +45,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateT private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { @@ -66,6 +79,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.ir.txt index e6d03759c72..4c64ca624b4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_Runtime.ir.txt @@ -1,13 +1,22 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [2] DuplicateTargetTagHelper.cshtml) LazyIntermediateToken - (33:1,0 [2] DuplicateTargetTagHelper.cshtml) - Html - \n TagHelper - (35:2,0 [40] DuplicateTargetTagHelper.cshtml) - input - TagMode.SelfClosing @@ -21,3 +30,8 @@ DefaultTagHelperProperty - (67:2,32 [4] DuplicateTargetTagHelper.cshtml) - checked - bool TestNamespace.CatchAllTagHelper.Checked - HtmlAttributeValueStyle.DoubleQuotes LazyIntermediateToken - (67:2,32 [4] DuplicateTargetTagHelper.cshtml) - CSharp - true DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.cs index 04fc423bdb5..ec0a31f34c0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -29,7 +43,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_InputTagHelper = CreateTagHelper(); #nullable restore @@ -257,6 +271,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..9a02acde74c --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.cs-diagnostics.txt @@ -0,0 +1,12 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml(5,48): warning CS0162: Unreachable code detected +// __o = false; +Diagnostic(ErrorCode.WRN_UnreachableCode, "__o").WithLocation(5, 48), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml(9,61): warning CS0162: Unreachable code detected +// __o = false; +Diagnostic(ErrorCode.WRN_UnreachableCode, "__o").WithLocation(9, 61), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml(10,63): warning CS0162: Unreachable code detected +// __o = false; +Diagnostic(ErrorCode.WRN_UnreachableCode, "__o").WithLocation(10, 63), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml(14,48): warning CS0162: Unreachable code detected +// __o = false; +Diagnostic(ErrorCode.WRN_UnreachableCode, "__o").WithLocation(14, 48) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.ir.txt index 263d99c9c6b..446cdaa397b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.ir.txt @@ -1,9 +1,32 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] DynamicAttributeTagHelpers.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -11,7 +34,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [4] DynamicAttributeTagHelpers.cshtml) LazyIntermediateToken - (31:0,31 [4] DynamicAttributeTagHelpers.cshtml) - Html - \n\n TagHelper - (35:2,0 [40] DynamicAttributeTagHelpers.cshtml) - input - TagMode.SelfClosing @@ -131,3 +154,8 @@ LazyIntermediateToken - (565:13,53 [5] DynamicAttributeTagHelpers.cshtml) - CSharp - false LazyIntermediateToken - (570:13,58 [2] DynamicAttributeTagHelpers.cshtml) - CSharp - } DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.mappings.txt index e7853f2e8b7..fbb4920baee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.mappings.txt @@ -1,155 +1,155 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |"*, TestAssembly"| -Generated Location: (1055:18,37 [17] ) +Generated Location: (1762:32,37 [17] ) |"*, TestAssembly"| Source Location: (59:2,24 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |DateTime.Now| -Generated Location: (1680:36,24 [12] ) +Generated Location: (2404:50,24 [12] ) |DateTime.Now| Source Location: (96:4,17 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |if (true) { | -Generated Location: (2062:45,17 [12] ) +Generated Location: (2786:59,17 [12] ) |if (true) { | Source Location: (109:4,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |string.Empty| -Generated Location: (2277:52,30 [12] ) +Generated Location: (3001:66,30 [12] ) |string.Empty| Source Location: (121:4,42 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | } else { | -Generated Location: (2505:59,42 [10] ) +Generated Location: (3229:73,42 [10] ) | } else { | Source Location: (132:4,53 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |false| -Generated Location: (2741:66,53 [5] ) +Generated Location: (3465:80,53 [5] ) |false| Source Location: (137:4,58 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | }| -Generated Location: (2978:73,58 [2] ) +Generated Location: (3702:87,58 [2] ) | }| Source Location: (176:6,22 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |DateTime.Now| -Generated Location: (3354:82,22 [12] ) +Generated Location: (4078:96,22 [12] ) |DateTime.Now| Source Location: (214:6,60 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |DateTime.Now| -Generated Location: (3666:90,60 [12] ) +Generated Location: (4390:104,60 [12] ) |DateTime.Now| Source Location: (256:8,15 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |long.MinValue| -Generated Location: (4046:99,15 [13] ) +Generated Location: (4770:113,15 [13] ) |long.MinValue| Source Location: (271:8,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |if (true) { | -Generated Location: (4263:106,30 [12] ) +Generated Location: (4987:120,30 [12] ) |if (true) { | Source Location: (284:8,43 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |string.Empty| -Generated Location: (4491:113,43 [12] ) +Generated Location: (5215:127,43 [12] ) |string.Empty| Source Location: (296:8,55 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | } else { | -Generated Location: (4732:120,55 [10] ) +Generated Location: (5456:134,55 [10] ) | } else { | Source Location: (307:8,66 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |false| -Generated Location: (4981:127,66 [5] ) +Generated Location: (5705:141,66 [5] ) |false| Source Location: (312:8,71 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | }| -Generated Location: (5231:134,71 [2] ) +Generated Location: (5955:148,71 [2] ) | }| Source Location: (316:8,75 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |int.MaxValue| -Generated Location: (5481:141,75 [12] ) +Generated Location: (6205:155,75 [12] ) |int.MaxValue| Source Location: (348:9,17 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |long.MinValue| -Generated Location: (5751:149,17 [13] ) +Generated Location: (6475:163,17 [13] ) |long.MinValue| Source Location: (363:9,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |if (true) { | -Generated Location: (5971:156,32 [12] ) +Generated Location: (6695:170,32 [12] ) |if (true) { | Source Location: (376:9,45 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |string.Empty| -Generated Location: (6202:163,45 [12] ) +Generated Location: (6926:177,45 [12] ) |string.Empty| Source Location: (388:9,57 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | } else { | -Generated Location: (6446:170,57 [10] ) +Generated Location: (7170:184,57 [10] ) | } else { | Source Location: (399:9,68 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |false| -Generated Location: (6698:177,68 [5] ) +Generated Location: (7422:191,68 [5] ) |false| Source Location: (404:9,73 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | }| -Generated Location: (6951:184,73 [2] ) +Generated Location: (7675:198,73 [2] ) | }| Source Location: (408:9,77 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |int.MaxValue| -Generated Location: (7204:191,77 [12] ) +Generated Location: (7928:205,77 [12] ) |int.MaxValue| Source Location: (445:11,17 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |long.MinValue| -Generated Location: (7587:200,17 [13] ) +Generated Location: (8311:214,17 [13] ) |long.MinValue| Source Location: (460:11,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |DateTime.Now| -Generated Location: (7807:207,32 [12] ) +Generated Location: (8531:221,32 [12] ) |DateTime.Now| Source Location: (492:11,64 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |int.MaxValue| -Generated Location: (8058:214,64 [12] ) +Generated Location: (8782:228,64 [12] ) |int.MaxValue| Source Location: (529:13,17 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |if (true) { | -Generated Location: (8441:223,17 [12] ) +Generated Location: (9165:237,17 [12] ) |if (true) { | Source Location: (542:13,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |string.Empty| -Generated Location: (8657:230,30 [12] ) +Generated Location: (9381:244,30 [12] ) |string.Empty| Source Location: (554:13,42 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | } else { | -Generated Location: (8886:237,42 [10] ) +Generated Location: (9610:251,42 [10] ) | } else { | Source Location: (565:13,53 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |false| -Generated Location: (9123:244,53 [5] ) +Generated Location: (9847:258,53 [5] ) |false| Source Location: (570:13,58 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | }| -Generated Location: (9361:251,58 [2] ) +Generated Location: (10085:265,58 [2] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.codegen.cs index 196f89dd651..151e828a910 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4c214203eb338caf0f877accd57cbda70c9002c9f35b3b48b9bdecc4811fdc6b" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"4c214203eb338caf0f877accd57cbda70c9002c9f35b3b48b9bdecc4811fdc6b", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -30,7 +43,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAtt } private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { @@ -406,6 +419,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..7b3a8d7328c --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.cs-diagnostics.txt @@ -0,0 +1,12 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml(105,17): warning CS0162: Unreachable code detected +// Write( +Diagnostic(ErrorCode.WRN_UnreachableCode, "Write").WithLocation(105, 17), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml(216,13): warning CS0162: Unreachable code detected +// WriteLiteral( +Diagnostic(ErrorCode.WRN_UnreachableCode, "WriteLiteral").WithLocation(216, 13), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml(281,17): warning CS0162: Unreachable code detected +// Write( +Diagnostic(ErrorCode.WRN_UnreachableCode, "Write").WithLocation(281, 17), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml(393,17): warning CS0162: Unreachable code detected +// Write( +Diagnostic(ErrorCode.WRN_UnreachableCode, "Write").WithLocation(393, 17) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.ir.txt index 0366afc293a..b7fcc6f58bf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_Runtime.ir.txt @@ -1,11 +1,20 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [2] DynamicAttributeTagHelpers.cshtml) LazyIntermediateToken - (33:1,0 [2] DynamicAttributeTagHelpers.cshtml) - Html - \n TagHelper - (35:2,0 [40] DynamicAttributeTagHelpers.cshtml) - input - TagMode.SelfClosing @@ -125,3 +134,8 @@ LazyIntermediateToken - (565:13,53 [5] DynamicAttributeTagHelpers.cshtml) - CSharp - false LazyIntermediateToken - (570:13,58 [2] DynamicAttributeTagHelpers.cshtml) - CSharp - } DefaultTagHelperExecute - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.cs index 413991e1802..226b64fc72f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -31,7 +45,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { __TestNamespace_InputTagHelper = CreateTagHelper(); __TestNamespace_InputTagHelper2 = CreateTagHelper(); @@ -68,6 +82,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..bc0e3c045b7 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.cs-diagnostics.txt @@ -0,0 +1,9 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml(4,43): error CS1525: Invalid expression term ';' +// __TestNamespace_InputTagHelper2.Checked = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(4, 43), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml(5,34): error CS1525: Invalid expression term ';' +// __TestNamespace_PTagHelper.Age = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(5, 34), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml(6,43): error CS1525: Invalid expression term ';' +// __TestNamespace_InputTagHelper2.Checked = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(6, 43) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.ir.txt index 5754e607d83..904b2f9d7c2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.ir.txt @@ -1,11 +1,34 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [15] EmptyAttributeTagHelpers.cshtml) - *, TestAssembly CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -13,7 +36,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (29:0,29 [15] EmptyAttributeTagHelpers.cshtml) LazyIntermediateToken - (29:0,29 [4] EmptyAttributeTagHelpers.cshtml) - Html - \n\n LazyIntermediateToken - (33:2,0 [4] EmptyAttributeTagHelpers.cshtml) - Html -
+ Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.mappings.txt index eca83a539cc..958efd00e64 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) |*, TestAssembly| -Generated Location: (1218:20,38 [15] ) +Generated Location: (1923:34,38 [15] ) |*, TestAssembly| Source Location: (66:3,26 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) || -Generated Location: (2107:41,42 [0] ) +Generated Location: (2829:55,42 [0] ) || Source Location: (126:5,30 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) || -Generated Location: (2749:53,42 [0] ) +Generated Location: (3471:67,42 [0] ) || Source Location: (92:4,12 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) || -Generated Location: (3125:62,33 [0] ) +Generated Location: (3847:76,33 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.codegen.cs index 2055013926e..172586535bc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "c4d761efb25f1145e3bafb0566e5b4889a0d28f01dcbeaa9f36bce4ee9cc026d" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"c4d761efb25f1145e3bafb0566e5b4889a0d28f01dcbeaa9f36bce4ee9cc026d", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("type", "", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString(""), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); @@ -34,7 +47,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttri private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; private global::TestNamespace.PTagHelper __TestNamespace_PTagHelper; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n
\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { @@ -120,6 +133,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("\r\n
"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..20c4ec2f79a --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.cs-diagnostics.txt @@ -0,0 +1,9 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml(64,54): error CS1525: Invalid expression term ';' +// __TestNamespace_InputTagHelper2.Checked = +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments(";").WithLocation(64, 54), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml(95,58): error CS1525: Invalid expression term ';' +// __TestNamespace_InputTagHelper2.Checked = +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments(";").WithLocation(95, 58), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml(117,45): error CS1525: Invalid expression term ';' +// __TestNamespace_PTagHelper.Age = +Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments(";").WithLocation(117, 45) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.ir.txt index ad1511ad119..8576c78b969 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_Runtime.ir.txt @@ -1,15 +1,24 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - type - - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - class - - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:1,0 [13] EmptyAttributeTagHelpers.cshtml) LazyIntermediateToken - (31:1,0 [2] EmptyAttributeTagHelpers.cshtml) - Html - \n LazyIntermediateToken - (33:2,0 [4] EmptyAttributeTagHelpers.cshtml) - Html -
+ Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.codegen.cs index 8b641d24917..5bea3a23350 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml" @@ -24,6 +38,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.ir.txt index d1f3ecb5cca..461556fa047 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.ir.txt @@ -1,15 +1,43 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] EmptyCodeBlock.cshtml) LazyIntermediateToken - (0:0,0 [18] EmptyCodeBlock.cshtml) - Html - This is markup\n\n CSharpCode - (20:2,2 [0] EmptyCodeBlock.cshtml) LazyIntermediateToken - (20:2,2 [0] EmptyCodeBlock.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.mappings.txt index 60658876cbd..e6735cb40f1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (20:2,2 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml) || -Generated Location: (741:19,2 [0] ) +Generated Location: (1453:33,2 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_Runtime.codegen.cs index 21ea8bed2c0..e4108a2bec7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_Runtime.codegen.cs @@ -1,19 +1,52 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "16b0a230405bddf39e1d1cb49449db91ec2b2ebc7f619f5f3ae013391cc2307f" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"16b0a230405bddf39e1d1cb49449db91ec2b2ebc7f619f5f3ae013391cc2307f", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("This is markup\r\n\r\n"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_Runtime.ir.txt index fd5cfeefc9a..01291b49098 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock_Runtime.ir.txt @@ -1,10 +1,24 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] EmptyCodeBlock.cshtml) LazyIntermediateToken - (0:0,0 [18] EmptyCodeBlock.cshtml) - Html - This is markup\n\n CSharpCode - (20:2,2 [0] EmptyCodeBlock.cshtml) LazyIntermediateToken - (20:2,2 [0] EmptyCodeBlock.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.codegen.cs index c4524b65b73..6cab863c365 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml" @@ -24,6 +38,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..f40060e6a30 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml(3,7): error CS1525: Invalid expression term ';' +// __o = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(3, 7) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.ir.txt index b35ed6145d6..8e71bfcab23 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.ir.txt @@ -1,15 +1,43 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] EmptyExplicitExpression.cshtml) LazyIntermediateToken - (0:0,0 [18] EmptyExplicitExpression.cshtml) - Html - This is markup\n\n CSharpExpression - (20:2,2 [0] EmptyExplicitExpression.cshtml) LazyIntermediateToken - (20:2,2 [0] EmptyExplicitExpression.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.mappings.txt index daaca4782bb..3819be7ae9e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (20:2,2 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml) || -Generated Location: (763:19,6 [0] ) +Generated Location: (1484:33,6 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.codegen.cs index b2107cbade2..3885320435c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "004fdbe7564de7fa0982c2502bef8fedcb3d887b445c425221784d3402ab9a19" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"004fdbe7564de7fa0982c2502bef8fedcb3d887b445c425221784d3402ab9a19", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("This is markup\r\n\r\n"); Write( @@ -22,6 +35,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() ); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..d0583c3bf66 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml(28,13): error CS7036: There is no argument given that corresponds to the required parameter 'value' of 'RazorPageBase.Write(object)' +// Write( +Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Write").WithArguments("value", "Microsoft.AspNetCore.Mvc.Razor.RazorPageBase.Write(object)").WithLocation(28, 13) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.ir.txt index 327c103bb7c..9f1792bdc67 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression_Runtime.ir.txt @@ -1,10 +1,24 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] EmptyExplicitExpression.cshtml) LazyIntermediateToken - (0:0,0 [18] EmptyExplicitExpression.cshtml) - Html - This is markup\n\n CSharpExpression - (20:2,2 [0] EmptyExplicitExpression.cshtml) LazyIntermediateToken - (20:2,2 [0] EmptyExplicitExpression.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.codegen.cs index a12af057203..54002fc43c8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml" @@ -39,6 +53,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..5aaeaf6e5b8 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml(2,7): error CS1525: Invalid expression term ';' +// __o = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(2, 7) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.ir.txt index 87b2374157c..5cd13e99059 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.ir.txt @@ -1,17 +1,45 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [6] EmptyImplicitExpressionInCode.cshtml) LazyIntermediateToken - (2:0,2 [6] EmptyImplicitExpressionInCode.cshtml) - CSharp - \n CSharpExpression - (9:1,5 [0] EmptyImplicitExpressionInCode.cshtml) LazyIntermediateToken - (9:1,5 [0] EmptyImplicitExpressionInCode.cshtml) - CSharp - CSharpCode - (9:1,5 [2] EmptyImplicitExpressionInCode.cshtml) LazyIntermediateToken - (9:1,5 [2] EmptyImplicitExpressionInCode.cshtml) - CSharp - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.mappings.txt index 0c7d025a8eb..9147bf1a63d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_DesignTime.mappings.txt @@ -1,19 +1,19 @@ Source Location: (2:0,2 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml) | | -Generated Location: (771:19,2 [6] ) +Generated Location: (1498:33,2 [6] ) | | Source Location: (9:1,5 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml) || -Generated Location: (959:27,6 [0] ) +Generated Location: (1686:41,6 [0] ) || Source Location: (9:1,5 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml) | | -Generated Location: (1141:34,5 [2] ) +Generated Location: (1868:48,5 [2] ) | | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.codegen.cs index 3b6328e873d..05789d9df8d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "af161186fc847e3b1cff0dd7b9c1f0535ff384409c6559dbf0799a8c3407d342" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"af161186fc847e3b1cff0dd7b9c1f0535ff384409c6559dbf0799a8c3407d342", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { Write( #nullable restore @@ -21,6 +34,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() ); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..4dd3a564b8e --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml(27,13): error CS7036: There is no argument given that corresponds to the required parameter 'value' of 'RazorPageBase.Write(object)' +// Write( +Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Write").WithArguments("value", "Microsoft.AspNetCore.Mvc.Razor.RazorPageBase.Write(object)").WithLocation(27, 13) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.ir.txt index ca7e1656220..0b72a52b1b2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode_Runtime.ir.txt @@ -1,12 +1,26 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [6] EmptyImplicitExpressionInCode.cshtml) LazyIntermediateToken - (2:0,2 [6] EmptyImplicitExpressionInCode.cshtml) - CSharp - \n CSharpExpression - (9:1,5 [0] EmptyImplicitExpressionInCode.cshtml) LazyIntermediateToken - (9:1,5 [0] EmptyImplicitExpressionInCode.cshtml) - CSharp - CSharpCode - (9:1,5 [2] EmptyImplicitExpressionInCode.cshtml) LazyIntermediateToken - (9:1,5 [2] EmptyImplicitExpressionInCode.cshtml) - CSharp - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.codegen.cs index 1978cd203b1..2d5fcca8d19 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml" @@ -24,6 +38,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..d25b4fd89e4 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml(3,7): error CS1525: Invalid expression term ';' +// __o = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(3, 7) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.ir.txt index 07208018718..d2e8477cebc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.ir.txt @@ -1,17 +1,45 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] EmptyImplicitExpression.cshtml) LazyIntermediateToken - (0:0,0 [18] EmptyImplicitExpression.cshtml) - Html - This is markup\n\n CSharpExpression - (19:2,1 [0] EmptyImplicitExpression.cshtml) LazyIntermediateToken - (19:2,1 [0] EmptyImplicitExpression.cshtml) - CSharp - HtmlContent - (19:2,1 [1] EmptyImplicitExpression.cshtml) LazyIntermediateToken - (19:2,1 [1] EmptyImplicitExpression.cshtml) - Html - ! + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.mappings.txt index 2766e438fa5..faf46353bbc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (19:2,1 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml) || -Generated Location: (763:19,6 [0] ) +Generated Location: (1484:33,6 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.codegen.cs index 74abbd02091..40120aee815 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9af7ee6893210f3b4ab21bd93a76eaed1540b45b34c6ccbef4c980fd5f3c9f8c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"9af7ee6893210f3b4ab21bd93a76eaed1540b45b34c6ccbef4c980fd5f3c9f8c", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("This is markup\r\n\r\n"); Write( @@ -23,6 +36,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("!"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..25e9b721a71 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml(28,13): error CS7036: There is no argument given that corresponds to the required parameter 'value' of 'RazorPageBase.Write(object)' +// Write( +Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Write").WithArguments("value", "Microsoft.AspNetCore.Mvc.Razor.RazorPageBase.Write(object)").WithLocation(28, 13) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.ir.txt index 073123d906e..35e11fc00c0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression_Runtime.ir.txt @@ -1,12 +1,26 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] EmptyImplicitExpression.cshtml) LazyIntermediateToken - (0:0,0 [18] EmptyImplicitExpression.cshtml) - Html - This is markup\n\n CSharpExpression - (19:2,1 [0] EmptyImplicitExpression.cshtml) LazyIntermediateToken - (19:2,1 [0] EmptyImplicitExpression.cshtml) - CSharp - HtmlContent - (19:2,1 [1] EmptyImplicitExpression.cshtml) LazyIntermediateToken - (19:2,1 [1] EmptyImplicitExpression.cshtml) - Html - ! + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.cs index e93521177b8..9e17c235572 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -30,7 +44,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" @@ -106,6 +120,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..7e4fb811927 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.cs-diagnostics.txt @@ -0,0 +1,9 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml(4,21): error CS0103: The name 'MyEnum' does not exist in the current context +// var enumValue = MyEnum.MyValue; +Diagnostic(ErrorCode.ERR_NameNotInContext, "MyEnum").WithArguments("MyEnum").WithLocation(4, 21), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml(7,40): error CS0103: The name 'MyEnum' does not exist in the current context +// __TestNamespace_InputTagHelper.Value = MyEnum.MyValue; +Diagnostic(ErrorCode.ERR_NameNotInContext, "MyEnum").WithArguments("MyEnum").WithLocation(7, 40), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml(8,16): error CS0103: The name 'MyEnum' does not exist in the current context +// __o = MyEnum.MySecondValue; +Diagnostic(ErrorCode.ERR_NameNotInContext, "MyEnum").WithArguments("MyEnum").WithLocation(8, 16) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.ir.txt index 316c3c4a46c..682576e5ec7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.ir.txt @@ -1,10 +1,33 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] EnumTagHelpers.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -12,7 +35,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [4] EnumTagHelpers.cshtml) LazyIntermediateToken - (31:0,31 [4] EnumTagHelpers.cshtml) - Html - \n\n CSharpCode - (37:2,2 [39] EnumTagHelpers.cshtml) @@ -72,3 +95,8 @@ DefaultTagHelperExecute - HtmlContent - (287:10,51 [2] EnumTagHelpers.cshtml) LazyIntermediateToken - (287:10,51 [2] EnumTagHelpers.cshtml) - Html - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.mappings.txt index 242d0fb70f3..6784cb1636d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.mappings.txt @@ -1,49 +1,49 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |"*, TestAssembly"| -Generated Location: (1123:19,37 [17] ) +Generated Location: (1818:33,37 [17] ) |"*, TestAssembly"| Source Location: (37:2,2 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) | var enumValue = MyEnum.MyValue; | -Generated Location: (1611:36,2 [39] ) +Generated Location: (2323:50,2 [39] ) | var enumValue = MyEnum.MyValue; | Source Location: (96:6,15 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MyEnum.MyValue| -Generated Location: (2060:46,39 [14] ) +Generated Location: (2772:60,39 [14] ) |MyEnum.MyValue| Source Location: (131:7,15 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MyEnum.MySecondValue| -Generated Location: (2539:56,15 [20] ) +Generated Location: (3251:70,15 [20] ) |MyEnum.MySecondValue| Source Location: (171:8,14 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MyValue| -Generated Location: (3141:66,132 [7] ) +Generated Location: (3853:80,132 [7] ) |MyValue| Source Location: (198:9,14 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MySecondValue| -Generated Location: (3731:76,132 [13] ) +Generated Location: (4443:90,132 [13] ) |MySecondValue| Source Location: (224:9,40 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MyValue| -Generated Location: (4045:83,138 [7] ) +Generated Location: (4757:97,138 [7] ) |MyValue| Source Location: (251:10,15 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |enumValue| -Generated Location: (4542:93,39 [9] ) +Generated Location: (5254:107,39 [9] ) |enumValue| Source Location: (274:10,38 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |enumValue| -Generated Location: (4759:100,45 [9] ) +Generated Location: (5471:114,45 [9] ) |enumValue| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.codegen.cs index af02ba610e1..34161e8ccd5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "77f2d2a6c05eb6fd6b50ca4e425c887ee527eddaca21ae01f7c0288ab53bff45" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"77f2d2a6c05eb6fd6b50ca4e425c887ee527eddaca21ae01f7c0288ab53bff45", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -31,7 +44,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHel private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.CatchAllTagHelper __TestNamespace_CatchAllTagHelper; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); #nullable restore @@ -192,6 +205,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("\r\n"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..46bf7931404 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.cs-diagnostics.txt @@ -0,0 +1,9 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml(4,21): error CS0103: The name 'MyEnum' does not exist in the current context +// var enumValue = MyEnum.MyValue; +Diagnostic(ErrorCode.ERR_NameNotInContext, "MyEnum").WithArguments("MyEnum").WithLocation(4, 21), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml(7,16): error CS0103: The name 'MyEnum' does not exist in the current context +// MyEnum.MyValue +Diagnostic(ErrorCode.ERR_NameNotInContext, "MyEnum").WithArguments("MyEnum").WithLocation(7, 16), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml(8,16): error CS0103: The name 'MyEnum' does not exist in the current context +// MyEnum.MySecondValue +Diagnostic(ErrorCode.ERR_NameNotInContext, "MyEnum").WithArguments("MyEnum").WithLocation(8, 16) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.ir.txt index ac9784d3b86..8a79d57bf54 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_Runtime.ir.txt @@ -1,12 +1,21 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [2] EnumTagHelpers.cshtml) LazyIntermediateToken - (33:1,0 [2] EnumTagHelpers.cshtml) - Html - \n CSharpCode - (37:2,2 [39] EnumTagHelpers.cshtml) @@ -66,3 +75,8 @@ DefaultTagHelperExecute - HtmlContent - (287:10,51 [2] EnumTagHelpers.cshtml) LazyIntermediateToken - (287:10,51 [2] EnumTagHelpers.cshtml) - Html - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.codegen.cs index 4ae6d9ea6bf..ba61d6f0311 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -29,7 +43,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml" @@ -50,6 +64,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.ir.txt index 67b3ed6b587..36f5cff0ad2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.ir.txt @@ -1,9 +1,32 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [17] EscapedIdentifier.cshtml) - "*, TestAssembly" CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -11,7 +34,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:0,31 [4] EscapedIdentifier.cshtml) LazyIntermediateToken - (31:0,31 [4] EscapedIdentifier.cshtml) - Html - \n\n CSharpCode - (37:2,2 [24] EscapedIdentifier.cshtml) @@ -27,3 +50,8 @@ DefaultTagHelperExecute - HtmlContent - (103:5,39 [2] EscapedIdentifier.cshtml) LazyIntermediateToken - (103:5,39 [2] EscapedIdentifier.cshtml) - Html - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.mappings.txt index 797b371ec92..cfd0f7bb0a6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.mappings.txt @@ -1,29 +1,29 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |"*, TestAssembly"| -Generated Location: (1009:18,37 [17] ) +Generated Location: (1707:32,37 [17] ) |"*, TestAssembly"| Source Location: (37:2,2 [24] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) | var count = "1"; | -Generated Location: (1500:35,2 [24] ) +Generated Location: (2215:49,2 [24] ) | var count = "1"; | Source Location: (76:5,12 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |Convert.ToInt32(| -Generated Location: (1788:44,27 [16] ) +Generated Location: (2503:58,27 [16] ) |Convert.ToInt32(| Source Location: (92:5,28 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |@count| -Generated Location: (1804:44,43 [6] ) +Generated Location: (2519:58,43 [6] ) |@count| Source Location: (98:5,34 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |)| -Generated Location: (1810:44,49 [1] ) +Generated Location: (2525:58,49 [1] ) |)| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_Runtime.codegen.cs index 2ff6d49f793..170aafc9ee1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "56fbfd01b420ab12628e8f5c23b2e88ef109db5398f18d87931cf424410b93c8" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"56fbfd01b420ab12628e8f5c23b2e88ef109db5398f18d87931cf424410b93c8", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -30,7 +43,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIde } private global::InputTagHelper __InputTagHelper; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); #nullable restore @@ -81,6 +94,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("\r\n"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_Runtime.ir.txt index 111d78acbd5..2ffb07acf1b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_Runtime.ir.txt @@ -1,11 +1,20 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [2] EscapedIdentifier.cshtml) LazyIntermediateToken - (33:1,0 [2] EscapedIdentifier.cshtml) - Html - \n CSharpCode - (37:2,2 [24] EscapedIdentifier.cshtml) @@ -21,3 +30,8 @@ DefaultTagHelperExecute - HtmlContent - (103:5,39 [2] EscapedIdentifier.cshtml) LazyIntermediateToken - (103:5,39 [2] EscapedIdentifier.cshtml) - Html - \n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.cs index d3ab343809d..c71d28813bd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -30,7 +44,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml" @@ -60,6 +74,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.ir.txt index 254fdab150a..81c25965b2f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.ir.txt @@ -1,10 +1,33 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor DirectiveToken - (14:0,14 [15] EscapedTagHelpers.cshtml) - *, TestAssembly CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 @@ -12,7 +35,7 @@ IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (29:0,29 [5] EscapedTagHelpers.cshtml) LazyIntermediateToken - (29:0,29 [4] EscapedTagHelpers.cshtml) - Html - \n\n LazyIntermediateToken - (33:2,0 [1] EscapedTagHelpers.cshtml) - Html - < @@ -69,3 +92,8 @@ LazyIntermediateToken - (248:7,0 [2] EscapedTagHelpers.cshtml) - Html - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.mappings.txt index a233d0d89c1..17ed97342eb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) |*, TestAssembly| -Generated Location: (1126:19,38 [15] ) +Generated Location: (1824:33,38 [15] ) |*, TestAssembly| Source Location: (106:3,29 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) |DateTime.Now| -Generated Location: (1643:36,29 [12] ) +Generated Location: (2358:50,29 [12] ) |DateTime.Now| Source Location: (204:5,51 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) |DateTime.Now| -Generated Location: (2079:45,51 [12] ) +Generated Location: (2794:59,51 [12] ) |DateTime.Now| Source Location: (227:5,74 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) |true| -Generated Location: (2484:54,74 [4] ) +Generated Location: (3199:68,74 [4] ) |true| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_Runtime.codegen.cs index 5fc26e239ce..e2a818c275d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_Runtime.codegen.cs @@ -1,12 +1,25 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "602b63a03b7490d9350a834c628e36b03134479ea417de4aca379f59b8089f35" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"602b63a03b7490d9350a834c628e36b03134479ea417de4aca379f59b8089f35", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #line hidden #pragma warning disable 0649 @@ -31,7 +44,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTag private global::TestNamespace.InputTagHelper __TestNamespace_InputTagHelper; private global::TestNamespace.InputTagHelper2 __TestNamespace_InputTagHelper2; #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n<"); WriteLiteral("div class=\"randomNonTagHelperAttribute\">\r\n <"); @@ -92,6 +105,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("div>"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_Runtime.ir.txt index 78bf863a3e3..340e6c5aae1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_Runtime.ir.txt @@ -1,12 +1,21 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers_Runtime - - + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (31:1,0 [3] EscapedTagHelpers.cshtml) LazyIntermediateToken - (31:1,0 [2] EscapedTagHelpers.cshtml) - Html - \n LazyIntermediateToken - (33:2,0 [1] EscapedTagHelpers.cshtml) - Html - < @@ -63,3 +72,8 @@ LazyIntermediateToken - (248:7,0 [2] EscapedTagHelpers.cshtml) - Html - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.codegen.cs index ee26774b9d9..414aec818d3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml" @@ -24,6 +38,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..ccd04519cb1 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml(3,7): error CS1525: Invalid expression term ';' +// __o = ; +Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(3, 7) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.ir.txt index 9021ee520cb..40a90bb5cdf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.ir.txt @@ -1,15 +1,43 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] ExplicitExpressionAtEOF.cshtml) LazyIntermediateToken - (0:0,0 [18] ExplicitExpressionAtEOF.cshtml) - Html - This is markup\n\n CSharpExpression - (20:2,2 [0] ExplicitExpressionAtEOF.cshtml) LazyIntermediateToken - (20:2,2 [0] ExplicitExpressionAtEOF.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.mappings.txt index 2f81d7ffdec..3e3ed234a2c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (20:2,2 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml) || -Generated Location: (763:19,6 [0] ) +Generated Location: (1484:33,6 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.codegen.cs index 873b1184ed1..c89b963cd18 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "32bee45d8028059ac44a7f812a2749196ee1be1683ed25d4e21d8d13f47da75c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"32bee45d8028059ac44a7f812a2749196ee1be1683ed25d4e21d8d13f47da75c", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("This is markup\r\n\r\n"); Write( @@ -22,6 +35,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() ); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..c16ac476584 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml(28,13): error CS7036: There is no argument given that corresponds to the required parameter 'value' of 'RazorPageBase.Write(object)' +// Write( +Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Write").WithArguments("value", "Microsoft.AspNetCore.Mvc.Razor.RazorPageBase.Write(object)").WithLocation(28, 13) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.ir.txt index 8c472eb18ef..3ec37e6097b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF_Runtime.ir.txt @@ -1,10 +1,24 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] ExplicitExpressionAtEOF.cshtml) LazyIntermediateToken - (0:0,0 [18] ExplicitExpressionAtEOF.cshtml) - Html - This is markup\n\n CSharpExpression - (20:2,2 [0] ExplicitExpressionAtEOF.cshtml) LazyIntermediateToken - (20:2,2 [0] ExplicitExpressionAtEOF.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.codegen.cs index 2da81315a3a..2ac3883efaa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,11 +27,11 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml" - __o = item => new Template(async(__razor_template_writer) => { + __o = item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { } ); @@ -26,6 +40,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..18eea18144a --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(1,14): error CS8917: The delegate type could not be inferred. +// __o = item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { +Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(1, 14) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.ir.txt index 413237cf732..374999b63c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [5] ExplicitExpressionWithMarkup.cshtml) LazyIntermediateToken - (0:0,0 [4] ExplicitExpressionWithMarkup.cshtml) - Html -
@@ -17,3 +40,8 @@ HtmlContent - (8:0,8 [6] ExplicitExpressionWithMarkup.cshtml) LazyIntermediateToken - (8:0,8 [6] ExplicitExpressionWithMarkup.cshtml) - Html -
LazyIntermediateToken - (14:0,14 [0] ExplicitExpressionWithMarkup.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.mappings.txt index fdb2af8cfa2..e571b69ca9f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (14:0,14 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml) || -Generated Location: (837:21,1 [0] ) +Generated Location: (1606:35,1 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.codegen.cs index ff6894e8f52..980633f89fd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.codegen.cs @@ -1,19 +1,32 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "d6b6b46422180a2d5485fc829481edf617295af5ea333631211aa0c2c472d178" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"d6b6b46422180a2d5485fc829481edf617295af5ea333631211aa0c2c472d178", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("
"); Write( - item => new Template(async(__razor_template_writer) => { + item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { PushWriter(__razor_template_writer); WriteLiteral("
"); PopWriter(); @@ -28,6 +41,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() ); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..94743ada2d2 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.cs-diagnostics.txt @@ -0,0 +1,3 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml(29,18): error CS8917: The delegate type could not be inferred. +// item => new global::Microsoft.AspNetCore.Mvc.Razor.HelperResult(async(__razor_template_writer) => { +Diagnostic(ErrorCode.ERR_CannotInferDelegateType, "=>").WithLocation(29, 18) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.ir.txt index 792c890c47f..c5be1147976 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [5] ExplicitExpressionWithMarkup.cshtml) LazyIntermediateToken - (0:0,0 [4] ExplicitExpressionWithMarkup.cshtml) - Html -
@@ -12,3 +21,8 @@ HtmlContent - (8:0,8 [6] ExplicitExpressionWithMarkup.cshtml) LazyIntermediateToken - (8:0,8 [6] ExplicitExpressionWithMarkup.cshtml) - Html -
LazyIntermediateToken - (14:0,14 [0] ExplicitExpressionWithMarkup.cshtml) - CSharp - + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.codegen.cs index 7907b366eab..b90d18d4839 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml" @@ -24,6 +38,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.ir.txt index 23be28cbd5b..ae7b489a819 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.ir.txt @@ -1,15 +1,43 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [8] ExplicitExpression.cshtml) LazyIntermediateToken - (0:0,0 [8] ExplicitExpression.cshtml) - Html - 1 + 1 = CSharpExpression - (10:0,10 [3] ExplicitExpression.cshtml) LazyIntermediateToken - (10:0,10 [3] ExplicitExpression.cshtml) - CSharp - 1+1 + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.mappings.txt index 9b8e6f74c5e..4a36f0b924f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (10:0,10 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml) |1+1| -Generated Location: (757:19,10 [3] ) +Generated Location: (1473:33,10 [3] ) |1+1| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_Runtime.codegen.cs index fee96bebbe3..d3b33f67196 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "127c2e4532452a01cb38d7d47d12b143d778f204179f089dd1851ea16c19af0a" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"127c2e4532452a01cb38d7d47d12b143d778f204179f089dd1851ea16c19af0a", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("1 + 1 = "); Write( @@ -23,6 +36,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() ); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_Runtime.ir.txt index b115897ec15..1eeaa7edc17 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_Runtime.ir.txt @@ -1,10 +1,24 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [8] ExplicitExpression.cshtml) LazyIntermediateToken - (0:0,0 [8] ExplicitExpression.cshtml) - Html - 1 + 1 = CSharpExpression - (10:0,10 [3] ExplicitExpression.cshtml) LazyIntermediateToken - (10:0,10 [3] ExplicitExpression.cshtml) - CSharp - 1+1 + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.codegen.cs index c437fdfc211..fd65c220d47 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml" @@ -81,6 +95,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.ir.txt index dc0be4f7955..2872b891b6e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [51] ExpressionsInCode.cshtml) LazyIntermediateToken - (2:0,2 [51] ExpressionsInCode.cshtml) - CSharp - \n object foo = null;\n string bar = "Foo";\n HtmlContent - (56:4,0 [2] ExpressionsInCode.cshtml) @@ -40,3 +63,8 @@ HtmlContent - (199:14,1 [6] ExpressionsInCode.cshtml) LazyIntermediateToken - (199:14,1 [2] ExpressionsInCode.cshtml) - Html - \n LazyIntermediateToken - (201:15,0 [4] ExpressionsInCode.cshtml) - Html -

+ Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.mappings.txt index 36ecafa46ef..844305443a9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.mappings.txt @@ -3,7 +3,7 @@ object foo = null; string bar = "Foo"; | -Generated Location: (747:19,2 [51] ) +Generated Location: (1462:33,2 [51] ) | object foo = null; string bar = "Foo"; @@ -12,20 +12,20 @@ Generated Location: (747:19,2 [51] ) Source Location: (59:5,1 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) |if(foo != null) { | -Generated Location: (961:28,1 [23] ) +Generated Location: (1676:42,1 [23] ) |if(foo != null) { | Source Location: (83:6,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) |foo| -Generated Location: (1154:36,6 [3] ) +Generated Location: (1869:50,6 [3] ) |foo| Source Location: (86:6,8 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) | } else { | -Generated Location: (1330:43,8 [16] ) +Generated Location: (2045:57,8 [16] ) | } else { | @@ -33,26 +33,26 @@ Generated Location: (1330:43,8 [16] ) Source Location: (121:8,23 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) | }| -Generated Location: (1533:52,23 [3] ) +Generated Location: (2248:66,23 [3] ) | }| Source Location: (134:12,1 [38] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) |if(!String.IsNullOrEmpty(bar)) { | -Generated Location: (1702:60,1 [38] ) +Generated Location: (2417:74,1 [38] ) |if(!String.IsNullOrEmpty(bar)) { | Source Location: (174:13,6 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) |bar.Replace("F", "B")| -Generated Location: (1911:68,6 [21] ) +Generated Location: (2626:82,6 [21] ) |bar.Replace("F", "B")| Source Location: (196:13,28 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) | }| -Generated Location: (2126:75,28 [3] ) +Generated Location: (2841:89,28 [3] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_Runtime.codegen.cs index 219dc3dc771..9ec272bb776 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "c9cc7d097735e4074bc4f71cd46101fc821fdb0592f90d491f09fdecddf3caf3" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"c9cc7d097735e4074bc4f71cd46101fc821fdb0592f90d491f09fdecddf3caf3", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line (1,3)-(4,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml" @@ -89,6 +102,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() WriteLiteral("

"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_Runtime.ir.txt index 680f38f1cb8..d5677645b4e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [51] ExpressionsInCode.cshtml) LazyIntermediateToken - (2:0,2 [51] ExpressionsInCode.cshtml) - CSharp - \n object foo = null;\n string bar = "Foo";\n HtmlContent - (56:4,0 [2] ExpressionsInCode.cshtml) @@ -36,3 +45,8 @@ LazyIntermediateToken - (196:13,28 [5] ExpressionsInCode.cshtml) - CSharp - \n}\n HtmlContent - (201:15,0 [4] ExpressionsInCode.cshtml) LazyIntermediateToken - (201:15,0 [4] ExpressionsInCode.cshtml) - Html -

+ Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.codegen.cs index 76d62a74e44..8c747a197f2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { } #pragma warning restore 1998 @@ -27,6 +41,26 @@ string foo(string input) { #line default #line hidden #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.ir.txt index 8049650134d..6c4a32046c5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.ir.txt @@ -1,15 +1,43 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [5] FunctionsBlockMinimal.cshtml) LazyIntermediateToken - (0:0,0 [5] FunctionsBlockMinimal.cshtml) - Html - \n\n CSharpCode - (16:2,12 [55] FunctionsBlockMinimal.cshtml) LazyIntermediateToken - (16:2,12 [55] FunctionsBlockMinimal.cshtml) - CSharp - \nstring foo(string input) {\n return input + "!";\n}\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.mappings.txt index 7758e2fb4fe..9c3dce835be 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.mappings.txt @@ -4,7 +4,7 @@ string foo(string input) { return input + "!"; } | -Generated Location: (814:21,12 [55] ) +Generated Location: (1533:35,12 [55] ) | string foo(string input) { return input + "!"; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_Runtime.codegen.cs index 301a4d2ddcc..f1d1aa5a210 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "efea5780300288b4c0a438cb8dbd885088680963b3e2ceab4416264993e99884" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"efea5780300288b4c0a438cb8dbd885088680963b3e2ceab4416264993e99884", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n\r\n"); } @@ -25,6 +38,26 @@ string foo(string input) { #line hidden #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_Runtime.ir.txt index 66be9d6a98b..67bc1c2d297 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_Runtime.ir.txt @@ -1,10 +1,24 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [4] FunctionsBlockMinimal.cshtml) LazyIntermediateToken - (0:0,0 [4] FunctionsBlockMinimal.cshtml) - Html - \n\n CSharpCode - (16:2,12 [55] FunctionsBlockMinimal.cshtml) LazyIntermediateToken - (16:2,12 [55] FunctionsBlockMinimal.cshtml) - CSharp - \nstring foo(string input) {\n return input + "!";\n}\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.codegen.cs index de93ed44686..ee2143678a2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml" @@ -43,6 +57,26 @@ private int RandomInt() { #line default #line hidden #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.ir.txt index da99a61a34a..3c830d841ec 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (17:2,1 [4] FunctionsBlock.cshtml) LazyIntermediateToken - (17:2,1 [4] FunctionsBlock.cshtml) - Html - \n\n HtmlContent - (138:9,1 [28] FunctionsBlock.cshtml) @@ -19,3 +42,8 @@ LazyIntermediateToken - (12:0,12 [4] FunctionsBlock.cshtml) - CSharp - \n\n CSharpCode - (33:4,12 [104] FunctionsBlock.cshtml) LazyIntermediateToken - (33:4,12 [104] FunctionsBlock.cshtml) - CSharp - \n Random _rand = new Random();\n private int RandomInt() {\n return _rand.Next();\n }\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.mappings.txt index 34cea958eb0..42c5eeb452c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.mappings.txt @@ -1,13 +1,13 @@ Source Location: (167:11,25 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml) |RandomInt()| -Generated Location: (765:19,25 [11] ) +Generated Location: (1477:33,25 [11] ) |RandomInt()| Source Location: (12:0,12 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml) | | -Generated Location: (999:28,12 [4] ) +Generated Location: (1711:42,12 [4] ) | | @@ -19,7 +19,7 @@ Source Location: (33:4,12 [104] TestFiles/IntegrationTests/CodeGenerationIntegra return _rand.Next(); } | -Generated Location: (1174:36,12 [104] ) +Generated Location: (1886:50,12 [104] ) | Random _rand = new Random(); private int RandomInt() { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_Runtime.codegen.cs index fe463f9b9e8..31228bf1917 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "87718d380117c487f66665bd4c191fcab3bbf6821e64caa809bf2fd1ad6af664" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"87718d380117c487f66665bd4c191fcab3bbf6821e64caa809bf2fd1ad6af664", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); WriteLiteral("\r\nHere\'s a random number: "); @@ -36,6 +49,26 @@ private int RandomInt() { #line hidden #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_Runtime.ir.txt index 0743a96fd5f..ec88a1948dd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (19:3,0 [2] FunctionsBlock.cshtml) LazyIntermediateToken - (19:3,0 [2] FunctionsBlock.cshtml) - Html - \n HtmlContent - (140:10,0 [26] FunctionsBlock.cshtml) @@ -14,3 +23,8 @@ LazyIntermediateToken - (12:0,12 [4] FunctionsBlock.cshtml) - CSharp - \n\n CSharpCode - (33:4,12 [104] FunctionsBlock.cshtml) LazyIntermediateToken - (33:4,12 [104] FunctionsBlock.cshtml) - CSharp - \n Random _rand = new Random();\n private int RandomInt() {\n return _rand.Next();\n }\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.codegen.cs index a892dcde62d..e82bc796b51 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,7 +27,7 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml" @@ -32,6 +46,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() #nullable disable } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.cs-diagnostics.txt new file mode 100644 index 00000000000..f2a9f261d1c --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.cs-diagnostics.txt @@ -0,0 +1,6 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml(2,6): error CS0103: The name 'Da' does not exist in the current context +// @Da +Diagnostic(ErrorCode.ERR_NameNotInContext, "@Da").WithArguments("Da").WithLocation(2, 6), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml(2,9): error CS1002: ; expected +// @Da +Diagnostic(ErrorCode.ERR_SemicolonExpected, "").WithLocation(2, 9) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.ir.txt index b045b12ccae..959e6765dd3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.ir.txt @@ -1,15 +1,43 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [6] HiddenSpansInCode.cshtml) LazyIntermediateToken - (2:0,2 [6] HiddenSpansInCode.cshtml) - CSharp - \n CSharpCode - (9:1,5 [5] HiddenSpansInCode.cshtml) LazyIntermediateToken - (9:1,5 [5] HiddenSpansInCode.cshtml) - CSharp - @Da\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.mappings.txt index 882a21c0382..6ef7c1f39ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.mappings.txt @@ -1,14 +1,14 @@ Source Location: (2:0,2 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml) | | -Generated Location: (747:19,2 [6] ) +Generated Location: (1462:33,2 [6] ) | | Source Location: (9:1,5 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml) |@Da | -Generated Location: (922:27,5 [5] ) +Generated Location: (1637:41,5 [5] ) |@Da | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.codegen.cs index e7b8003baf3..687f861d929 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.codegen.cs @@ -1,15 +1,28 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "f28b1d44c575d208cd85ccdfcbacce93cf352fed0b4626a5450b19c7aee40d04" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode_Runtime), @"default", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml")] -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml")] +namespace AspNetCore { + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"Sha256", @"f28b1d44c575d208cd85ccdfcbacce93cf352fed0b4626a5450b19c7aee40d04", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml")] - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode_Runtime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line (2,6)-(3,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml" @@ -21,6 +34,26 @@ public async System.Threading.Tasks.Task ExecuteAsync() } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.cs-diagnostics.txt new file mode 100644 index 00000000000..6f8587ec314 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.cs-diagnostics.txt @@ -0,0 +1,6 @@ +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml(2,6): error CS0103: The name 'Da' does not exist in the current context +// @Da +Diagnostic(ErrorCode.ERR_NameNotInContext, "@Da").WithArguments("Da").WithLocation(2, 6), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml(2,9): error CS1002: ; expected +// @Da +Diagnostic(ErrorCode.ERR_SemicolonExpected, "").WithLocation(2, 9) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.ir.txt index 4e336775058..263870234ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_Runtime.ir.txt @@ -1,10 +1,24 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [6] HiddenSpansInCode.cshtml) LazyIntermediateToken - (2:0,2 [6] HiddenSpansInCode.cshtml) - CSharp - \n CSharpCode - (9:1,5 [5] HiddenSpansInCode.cshtml) LazyIntermediateToken - (9:1,5 [5] HiddenSpansInCode.cshtml) - CSharp - @Da\n + Inject - + Inject - + Inject - + Inject - + Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_DesignTime.codegen.cs index 54b65559ecb..f29a7ad83cb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_DesignTime.codegen.cs @@ -1,9 +1,23 @@ // #pragma warning disable 1591 -namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles +namespace AspNetCore { + #line default + using TModel = global::System.Object; + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Mvc; + using global::Microsoft.AspNetCore.Mvc.Rendering; + using global::Microsoft.AspNetCore.Mvc.ViewFeatures; + #line default #line hidden - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double_DesignTime + [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double.cshtml")] + [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] + #nullable restore + public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + #nullable disable { #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { @@ -13,10 +27,30 @@ private void __RazorDirectiveTokenHelpers__() { private static object __o = null; #pragma warning restore 0414 #pragma warning disable 1998 - public async System.Threading.Tasks.Task ExecuteAsync() + public async override global::System.Threading.Tasks.Task ExecuteAsync() { } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_DesignTime.ir.txt index 186bfc54a8c..d3a856c277f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_DesignTime.ir.txt @@ -1,14 +1,37 @@ Document - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double_DesignTime - - + NamespaceDeclaration - - AspNetCore + UsingDirective - - TModel = global::System.Object + UsingDirective - (1:0,1 [20] ) - global::System + UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [25] ) - global::System.Linq + UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - + DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper + DirectiveToken - (350:7,71 [4] ) - Html + DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper + DirectiveToken - (419:8,63 [4] ) - Json + DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper + DirectiveToken - (487:9,62 [9] ) - Component + DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper + DirectiveToken - (550:10,52 [3] ) - Url + DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider + DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider + DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor + DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor CSharpCode - IntermediateToken - - CSharp - #pragma warning disable 0414 CSharpCode - IntermediateToken - - CSharp - private static object __o = null; CSharpCode - IntermediateToken - - CSharp - #pragma warning restore 0414 - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [45] HtmlCommentWithQuote_Double.cshtml) LazyIntermediateToken - (0:0,0 [4] HtmlCommentWithQuote_Double.cshtml) - Html - \r\n"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.ir.txt index 63b92176f1c..1d52732a56a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [45] HtmlCommentWithQuote_Double.cshtml) LazyIntermediateToken - (0:0,0 [4] HtmlCommentWithQuote_Double.cshtml) - Html - \r\n"); } #pragma warning restore 1998 + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } = default!; + #nullable disable + #nullable restore + [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] + public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; } = default!; + #nullable disable } } #pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.ir.txt index 69ca19347f1..98e53e2efd5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.ir.txt @@ -1,9 +1,18 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles + NamespaceDeclaration - - AspNetCore + UsingDirective - (1:0,1 [22] ) - global::System + UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic + UsingDirective - (67:2,1 [27] ) - global::System.Linq + UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (134:4,1 [40] ) - global::Microsoft.AspNetCore.Mvc + UsingDirective - (175:5,1 [50] ) - global::Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (226:6,1 [53] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single_Runtime - - - MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync + RazorCompiledItemMetadataAttribute - + CreateNewOnMetadataUpdateAttribute - + ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [45] HtmlCommentWithQuote_Single.cshtml) LazyIntermediateToken - (0:0,0 [4] HtmlCommentWithQuote_Single.cshtml) - Html - @@ -10,6 +10,7 @@ +