From b62de079998227cd5d89fbcdd002511532f7280a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 27 Jun 2024 10:09:04 +0000 Subject: [PATCH 001/386] Update dependencies from https://github.com/dotnet/arcade build 20240624.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24324.7 --- eng/Version.Details.xml | 8 +++--- eng/Versions.props | 2 +- eng/common/post-build/publish-using-darc.ps1 | 15 +++++----- .../job/publish-build-assets.yml | 12 ++++---- .../post-build/post-build.yml | 8 ++++-- .../templates/job/publish-build-assets.yml | 12 ++++---- .../templates/post-build/post-build.yml | 8 ++++-- .../post-build/setup-maestro-vars.yml | 28 +++++++++---------- global.json | 2 +- 9 files changed, 51 insertions(+), 44 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 37f2a7fd3f3..1bf15110933 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d diff --git a/eng/Versions.props b/eng/Versions.props index 74476828edc..bfbe0526427 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24321.3 + 8.0.0-beta.24324.7 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 5a3a32ea8d7..238945cb5ab 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -2,7 +2,6 @@ param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, [Parameter(Mandatory=$true)][string] $AzdoToken, - [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, @@ -31,13 +30,13 @@ try { } & $darc add-build-to-channel ` - --id $buildId ` - --publishing-infra-version $PublishingInfraVersion ` - --default-channels ` - --source-branch main ` - --azdev-pat $AzdoToken ` - --bar-uri $MaestroApiEndPoint ` - --password $MaestroToken ` + --id $buildId ` + --publishing-infra-version $PublishingInfraVersion ` + --default-channels ` + --source-branch main ` + --azdev-pat "$AzdoToken" ` + --bar-uri "$MaestroApiEndPoint" ` + --ci ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index 589ac80a18b..d01739c1285 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -76,13 +76,16 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 + arguments: > + -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -144,7 +147,6 @@ jobs: arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates-official/post-build/post-build.yml b/eng/common/templates-official/post-build/post-build.yml index da1f40958b4..0dfa387e7b7 100644 --- a/eng/common/templates-official/post-build/post-build.yml +++ b/eng/common/templates-official/post-build/post-build.yml @@ -272,14 +272,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 8ec0151def2..9fd69fa7c9b 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -74,13 +74,16 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 + arguments: > + -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro.dot.net /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -140,7 +143,6 @@ jobs: arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index aba44a25a33..2db4933468f 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -268,14 +268,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index 0c87f149a4a..64b9abc6850 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -11,13 +11,14 @@ steps: artifactName: ReleaseConfigs checkDownloadedFiles: true - - task: PowerShell@2 + - task: AzureCLI@2 name: setReleaseVars displayName: Set Release Configs Vars inputs: - targetType: inline - pwsh: true - script: | + azureSubscription: "Darc: Maestro Production" + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | try { if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt @@ -31,15 +32,16 @@ steps: $AzureDevOpsBuildId = $Env:Build_BuildId } else { - $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}" + . $(Build.SourcesDirectory)\eng\common\tools.ps1 + $darc = Get-Darc + $buildInfo = & $darc get-build ` + --id ${{ parameters.BARBuildId }} ` + --extended ` + --output-format json ` + --ci ` + | convertFrom-Json - $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $apiHeaders.Add('Accept', 'application/json') - $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") - - $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - - $BarId = $Env:BARBuildId + $BarId = ${{ parameters.BARBuildId }} $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" $Channels = "[$Channels]" @@ -65,6 +67,4 @@ steps: exit 1 } env: - MAESTRO_API_TOKEN: $(MaestroApiAccessToken) - BARBuildId: ${{ parameters.BARBuildId }} PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/global.json b/global.json index cff8214f13a..f06ea153cbc 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24321.3", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24324.7", "Microsoft.Build.NoTargets": "3.7.0" } } From 26fefec976564b1e84976e32498fa7d425c990e1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 27 Jun 2024 13:19:47 +0000 Subject: [PATCH 002/386] Update dependencies from https://github.com/dotnet/arcade build 20240624.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24324.7 From 924c61ee9c20b7fdd098e2ba2b69490f9d3a82d7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 28 Jun 2024 13:10:39 +0000 Subject: [PATCH 003/386] Update dependencies from https://github.com/dotnet/arcade build 20240624.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24324.7 From 64797b3f0ecddebac9b71c9ba0c2bf435e0ff553 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 29 Jun 2024 13:01:48 +0000 Subject: [PATCH 004/386] Update dependencies from https://github.com/dotnet/arcade build 20240626.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24326.4 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1bf15110933..82e92edd6b1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e diff --git a/eng/Versions.props b/eng/Versions.props index bfbe0526427..bf4b5059817 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24324.7 + 8.0.0-beta.24326.4 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index f06ea153cbc..e0305aff4ff 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24324.7", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24326.4", "Microsoft.Build.NoTargets": "3.7.0" } } From f74d573585dce238b868d2598686a9401d135c2f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 30 Jun 2024 12:57:48 +0000 Subject: [PATCH 005/386] Update dependencies from https://github.com/dotnet/arcade build 20240626.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24326.4 From a2c71e33fe29a41be1da331366f9cacd97cf2d96 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 1 Jul 2024 12:58:15 +0000 Subject: [PATCH 006/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240627.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24304.1 -> To Version 9.0.0-alpha.1.24327.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 37f2a7fd3f3..2dc462465d6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - 9ae78a4e6412926d19ba97cfed159bf9de70b538 + 0b53e839fa2f09a5994cc6006533dcc3d45a4226 diff --git a/eng/Versions.props b/eng/Versions.props index 00160ae657e..eebf197540e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 9.0.0-alpha.1.24304.1 + 9.0.0-alpha.1.24327.1 8.0.0-beta.24321.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From 3c5c32c199a451142d2339e3524658185e449a31 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 1 Jul 2024 12:58:22 +0000 Subject: [PATCH 007/386] Update dependencies from https://github.com/dotnet/arcade build 20240628.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24328.2 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 82e92edd6b1..7d7df016bd3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - bee35f3044609d08c40566f8a008baa4d0451a9e + 761c516b64fee3941d8909d24205ced835eed83e - + https://github.com/dotnet/arcade - bee35f3044609d08c40566f8a008baa4d0451a9e + 761c516b64fee3941d8909d24205ced835eed83e diff --git a/eng/Versions.props b/eng/Versions.props index bf4b5059817..499a20ab32d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24326.4 + 8.0.0-beta.24328.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index e0305aff4ff..f9090403576 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24326.4", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24328.2", "Microsoft.Build.NoTargets": "3.7.0" } } From 5c55c198ac490545ecf22a2819c1e48c7799de04 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 2 Jul 2024 13:12:44 +0000 Subject: [PATCH 008/386] Update dependencies from https://github.com/dotnet/arcade build 20240628.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24328.2 From dbd10ce67ba57a9daf01666f25bf5c2b17dde82e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 3 Jul 2024 13:09:14 +0000 Subject: [PATCH 009/386] Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7d7df016bd3..20c270a335e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 761c516b64fee3941d8909d24205ced835eed83e + 8b879da4e449c48d99f3f642fc429379a64e8fe8 - + https://github.com/dotnet/arcade - 761c516b64fee3941d8909d24205ced835eed83e + 8b879da4e449c48d99f3f642fc429379a64e8fe8 diff --git a/eng/Versions.props b/eng/Versions.props index 499a20ab32d..c9011b45633 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24328.2 + 8.0.0-beta.24352.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index f9090403576..84da89a24e8 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24328.2", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24352.1", "Microsoft.Build.NoTargets": "3.7.0" } } From c32fa83f99b89fe7de847777c02aedf9cb748f82 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 4 Jul 2024 12:49:30 +0000 Subject: [PATCH 010/386] Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 From d38b2e0ffc220c6eed679db0110715e38c2d6907 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 5 Jul 2024 12:49:44 +0000 Subject: [PATCH 011/386] Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 From 5b7918d5d436e8c54dcbd0c1726a5a74e2a9598e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 6 Jul 2024 12:46:40 +0000 Subject: [PATCH 012/386] Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 From 79ee27e081b650da8df83d4f3b6519577c607a80 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 7 Jul 2024 12:45:48 +0000 Subject: [PATCH 013/386] Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 From 01b3f2e192c077de3f7a49596d6c960ac96b70f5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 8 Jul 2024 12:51:16 +0000 Subject: [PATCH 014/386] Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 From 3c00a23f885a83ae18be3bec62bf985f93cad154 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 8 Jul 2024 12:58:48 +0000 Subject: [PATCH 015/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240702.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24304.1 -> To Version 9.0.0-alpha.1.24352.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2dc462465d6..87626e9d8a8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - 0b53e839fa2f09a5994cc6006533dcc3d45a4226 + cc732c57199f725857c201da146525e3be6bc504 diff --git a/eng/Versions.props b/eng/Versions.props index eebf197540e..6677d2d020d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 9.0.0-alpha.1.24327.1 + 9.0.0-alpha.1.24352.1 8.0.0-beta.24321.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From 957031b568441307574ee1e0ceda1320f6cf7594 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 9 Jul 2024 12:42:52 +0000 Subject: [PATCH 016/386] Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 From d3f595d7ea49c15e964e3387bdb98edd23868ef1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 10 Jul 2024 12:52:24 +0000 Subject: [PATCH 017/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24360.1 --- eng/Version.Details.xml | 8 +++--- eng/Versions.props | 2 +- .../job/publish-build-assets.yml | 27 +++---------------- global.json | 2 +- 4 files changed, 10 insertions(+), 29 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a0f6047e63c..9fd33272d5c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 4a7d983f833d6b86365ea1b2b4d6ee72fbdbf944 + f20056daa31b4a08f2ce379cfe4610042c3bc26c - + https://github.com/dotnet/arcade - 4a7d983f833d6b86365ea1b2b4d6ee72fbdbf944 + f20056daa31b4a08f2ce379cfe4610042c3bc26c diff --git a/eng/Versions.props b/eng/Versions.props index ab3d814a8d8..75411b90f1c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24352.2 + 9.0.0-beta.24360.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index d99a1a3b284..ec3cd14191a 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -113,38 +113,19 @@ jobs: Add-Content -Path $filePath -Value "$(DefaultChannels)" Add-Content -Path $filePath -Value $(IsStableBuild) - - template: /eng/common/core-templates/steps/publish-build-artifacts.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - args: - displayName: Publish ReleaseConfigs Artifact - pathToPublish: '$(Build.StagingDirectory)/ReleaseConfigs' - publishLocation: Container - artifactName: ReleaseConfigs - - - task: powershell@2 - displayName: Check if SymbolPublishingExclusionsFile.txt exists - inputs: - targetType: inline - script: | $symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt" - if(Test-Path -Path $symbolExclusionfile) + if (Test-Path -Path $symbolExclusionfile) { Write-Host "SymbolExclusionFile exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true" - } - else{ - Write-Host "Symbols Exclusion file does not exist" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false" + Copy-Item -Path $symbolExclusionfile -Destination "$(Build.StagingDirectory)/ReleaseConfigs" } - template: /eng/common/core-templates/steps/publish-build-artifacts.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} args: - displayName: Publish SymbolPublishingExclusionsFile Artifact - condition: eq(variables['SymbolExclusionFile'], 'true') - pathToPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' + displayName: Publish ReleaseConfigs Artifact + pathToPublish: '$(Build.StagingDirectory)/ReleaseConfigs' publishLocation: Container artifactName: ReleaseConfigs diff --git a/global.json b/global.json index 9af5736134a..c9f2e26ce61 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24352.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24360.1", "Microsoft.Build.NoTargets": "3.7.0" } } From dc5f56743c2fc29d153aeb912a260d9009623013 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 10 Jul 2024 13:17:17 +0000 Subject: [PATCH 018/386] Update dependencies from https://github.com/dotnet/arcade build 20240709.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24359.3 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- .../templates-official/job/publish-build-assets.yml | 9 ++++++--- eng/common/templates/job/publish-build-assets.yml | 9 ++++++--- global.json | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 20c270a335e..09713863985 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 8b879da4e449c48d99f3f642fc429379a64e8fe8 + db87887481d4110c09a1004191002482fdd7e4f2 - + https://github.com/dotnet/arcade - 8b879da4e449c48d99f3f642fc429379a64e8fe8 + db87887481d4110c09a1004191002482fdd7e4f2 diff --git a/eng/Versions.props b/eng/Versions.props index c9011b45633..14ce4360c4f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24352.1 + 8.0.0-beta.24359.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index d01739c1285..ba3e7df8158 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -140,11 +140,14 @@ jobs: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' -WaitPublishingFinish true diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 9fd69fa7c9b..57a41f0a3e1 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -136,11 +136,14 @@ jobs: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' -WaitPublishingFinish true diff --git a/global.json b/global.json index 84da89a24e8..85e70f443a3 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24352.1", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24359.3", "Microsoft.Build.NoTargets": "3.7.0" } } From b06864f10b3cc1aeb1aeba65c3548627e9efe4e9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 11 Jul 2024 12:51:05 +0000 Subject: [PATCH 019/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24360.4 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- eng/common/cross/build-rootfs.sh | 2 +- global.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9fd33272d5c..3fa5b3420f1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - f20056daa31b4a08f2ce379cfe4610042c3bc26c + 731d793be2d0a66bafc96b1a79dc96b4d1f0301b - + https://github.com/dotnet/arcade - f20056daa31b4a08f2ce379cfe4610042c3bc26c + 731d793be2d0a66bafc96b1a79dc96b4d1f0301b diff --git a/eng/Versions.props b/eng/Versions.props index 75411b90f1c..f95bd0f7a1c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24360.1 + 9.0.0-beta.24360.4 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index eb1a9080464..6d99d1263c0 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -72,7 +72,7 @@ __AlpinePackages+=" krb5-dev" __AlpinePackages+=" openssl-dev" __AlpinePackages+=" zlib-dev" -__FreeBSDBase="13.2-RELEASE" +__FreeBSDBase="13.3-RELEASE" __FreeBSDPkg="1.17.0" __FreeBSDABI="13" __FreeBSDPackages="libunwind" diff --git a/global.json b/global.json index c9f2e26ce61..364cf58b9bd 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24360.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24360.4", "Microsoft.Build.NoTargets": "3.7.0" } } From a8e68455a9fb988345531078b5d182153284745c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 11 Jul 2024 13:18:41 +0000 Subject: [PATCH 020/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 09713863985..9e5c4be91a0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - db87887481d4110c09a1004191002482fdd7e4f2 + c9efa535175049eb9cba06cae1f8c3d5dbe768a9 - + https://github.com/dotnet/arcade - db87887481d4110c09a1004191002482fdd7e4f2 + c9efa535175049eb9cba06cae1f8c3d5dbe768a9 diff --git a/eng/Versions.props b/eng/Versions.props index 14ce4360c4f..75cdb2720dc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24359.3 + 8.0.0-beta.24360.5 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index 85e70f443a3..60227c0154b 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24359.3", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24360.5", "Microsoft.Build.NoTargets": "3.7.0" } } From 7f06c7a7f6b74ab8dc4e6cba211b13ad0946720c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 11 Jul 2024 16:53:25 +0000 Subject: [PATCH 021/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 From d098532b0c33086e3b69adc48c75c271b1f0451c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 12 Jul 2024 12:30:03 +0000 Subject: [PATCH 022/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24360.4 From f7808e965791787bae0a58aed1b4f4db3c1e2d7c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 12 Jul 2024 12:41:25 +0000 Subject: [PATCH 023/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 From fa8dd7ce1f480963f0f56c8e4091d84ecd052972 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 13 Jul 2024 12:33:49 +0000 Subject: [PATCH 024/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24360.4 From cb6e9fd60523abe18ef34c55aea31508a637cd8f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 13 Jul 2024 12:46:45 +0000 Subject: [PATCH 025/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 From 3e7a827e10e61527179cf462c261c47015912800 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 14 Jul 2024 12:32:52 +0000 Subject: [PATCH 026/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24360.4 From 4139db6172f73c3443f5099fab4d37a65709d35a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 14 Jul 2024 12:44:37 +0000 Subject: [PATCH 027/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 From 9e91fac6229596b87de0a84c3d66b049e21e73fe Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 15 Jul 2024 12:31:28 +0000 Subject: [PATCH 028/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24360.4 From 4905457e5bfe6b28140f3a0b25388d681c07647f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 15 Jul 2024 12:43:05 +0000 Subject: [PATCH 029/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 From 1233d15ad18eb6f6ae749b3fd0eadd6f29a89449 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 15 Jul 2024 12:55:34 +0000 Subject: [PATCH 030/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240712.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24304.1 -> To Version 9.0.0-alpha.1.24362.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 87626e9d8a8..89bac7398c3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - cc732c57199f725857c201da146525e3be6bc504 + 2fa4c4f8c0b17b48d2f37839563d6862d1974736 diff --git a/eng/Versions.props b/eng/Versions.props index 6677d2d020d..fd5e1c05bd8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 9.0.0-alpha.1.24352.1 + 9.0.0-alpha.1.24362.1 8.0.0-beta.24321.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From 441b820ed256815765375fd0aa81cf6b2ab4faf9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 16 Jul 2024 12:38:37 +0000 Subject: [PATCH 031/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24360.4 From 833e6d2d8ff9a38db9b3264e96dd40bc8531e784 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 16 Jul 2024 12:55:33 +0000 Subject: [PATCH 032/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 From 5aee3c7a2595336dfb124e3812ca68d1be97d604 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 17 Jul 2024 12:39:16 +0000 Subject: [PATCH 033/386] Update dependencies from https://github.com/dotnet/arcade build 20240710.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24360.4 From f74dda325d001f71a5b4c397dc754c9dc0332d82 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 17 Jul 2024 13:04:22 +0000 Subject: [PATCH 034/386] Update dependencies from https://github.com/dotnet/arcade build 20240716.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24366.7 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- eng/common/sdl/NuGet.config | 4 ++-- eng/common/sdl/sdl.ps1 | 4 +++- .../templates-official/steps/execute-sdl.yml | 2 -- .../steps/get-federated-access-token.yml | 14 +++++++++++++- eng/common/templates/steps/execute-sdl.yml | 2 -- .../templates/steps/get-federated-access-token.yml | 14 +++++++++++++- global.json | 6 +++--- 9 files changed, 39 insertions(+), 17 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9e5c4be91a0..00530113aa1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - c9efa535175049eb9cba06cae1f8c3d5dbe768a9 + 94d461b3cffed34241b7be548b6983ec8506bfc3 - + https://github.com/dotnet/arcade - c9efa535175049eb9cba06cae1f8c3d5dbe768a9 + 94d461b3cffed34241b7be548b6983ec8506bfc3 diff --git a/eng/Versions.props b/eng/Versions.props index 75cdb2720dc..bccd1d6d967 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24360.5 + 8.0.0-beta.24366.7 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/sdl/NuGet.config b/eng/common/sdl/NuGet.config index 3849bdb3cf5..5bfbb02ef04 100644 --- a/eng/common/sdl/NuGet.config +++ b/eng/common/sdl/NuGet.config @@ -5,11 +5,11 @@ - + - + diff --git a/eng/common/sdl/sdl.ps1 b/eng/common/sdl/sdl.ps1 index 648c5068d7d..7fe603fe995 100644 --- a/eng/common/sdl/sdl.ps1 +++ b/eng/common/sdl/sdl.ps1 @@ -4,6 +4,8 @@ function Install-Gdn { [Parameter(Mandatory=$true)] [string]$Path, + [string]$Source = "https://pkgs.dev.azure.com/dnceng/_packaging/Guardian1ESPTUpstreamOrgFeed/nuget/v3/index.json", + # If omitted, install the latest version of Guardian, otherwise install that specific version. [string]$Version ) @@ -19,7 +21,7 @@ function Install-Gdn { $ci = $true . $PSScriptRoot\..\tools.ps1 - $argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache") + $argumentList = @("install", "Microsoft.Guardian.Cli.win-x64", "-Source $Source", "-OutputDirectory $Path", "-NonInteractive", "-NoCache") if ($Version) { $argumentList += "-Version $Version" diff --git a/eng/common/templates-official/steps/execute-sdl.yml b/eng/common/templates-official/steps/execute-sdl.yml index 07426fde05d..301d5c591eb 100644 --- a/eng/common/templates-official/steps/execute-sdl.yml +++ b/eng/common/templates-official/steps/execute-sdl.yml @@ -9,8 +9,6 @@ parameters: steps: - task: NuGetAuthenticate@1 - inputs: - nuGetServiceConnections: GuardianConnect - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' diff --git a/eng/common/templates-official/steps/get-federated-access-token.yml b/eng/common/templates-official/steps/get-federated-access-token.yml index e3786cef6df..55e33bd38f7 100644 --- a/eng/common/templates-official/steps/get-federated-access-token.yml +++ b/eng/common/templates-official/steps/get-federated-access-token.yml @@ -3,6 +3,12 @@ parameters: type: string - name: outputVariableName type: string +- name: stepName + type: string + default: 'getFederatedAccessToken' +- name: condition + type: string + default: '' # Resource to get a token for. Common values include: # - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps # - 'https://storage.azure.com/' for storage @@ -10,10 +16,16 @@ parameters: - name: resource type: string default: '499b84ac-1321-427f-aa17-267ca6975798' +- name: isStepOutputVariable + type: boolean + default: false steps: - task: AzureCLI@2 displayName: 'Getting federated access token for feeds' + name: ${{ parameters.stepName }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} inputs: azureSubscription: ${{ parameters.federatedServiceConnection }} scriptType: 'pscore' @@ -25,4 +37,4 @@ steps: exit 1 } Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" \ No newline at end of file diff --git a/eng/common/templates/steps/execute-sdl.yml b/eng/common/templates/steps/execute-sdl.yml index 07426fde05d..301d5c591eb 100644 --- a/eng/common/templates/steps/execute-sdl.yml +++ b/eng/common/templates/steps/execute-sdl.yml @@ -9,8 +9,6 @@ parameters: steps: - task: NuGetAuthenticate@1 - inputs: - nuGetServiceConnections: GuardianConnect - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' diff --git a/eng/common/templates/steps/get-federated-access-token.yml b/eng/common/templates/steps/get-federated-access-token.yml index c8c49cc0e8f..55e33bd38f7 100644 --- a/eng/common/templates/steps/get-federated-access-token.yml +++ b/eng/common/templates/steps/get-federated-access-token.yml @@ -3,6 +3,12 @@ parameters: type: string - name: outputVariableName type: string +- name: stepName + type: string + default: 'getFederatedAccessToken' +- name: condition + type: string + default: '' # Resource to get a token for. Common values include: # - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps # - 'https://storage.azure.com/' for storage @@ -10,10 +16,16 @@ parameters: - name: resource type: string default: '499b84ac-1321-427f-aa17-267ca6975798' +- name: isStepOutputVariable + type: boolean + default: false steps: - task: AzureCLI@2 displayName: 'Getting federated access token for feeds' + name: ${{ parameters.stepName }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} inputs: azureSubscription: ${{ parameters.federatedServiceConnection }} scriptType: 'pscore' @@ -25,4 +37,4 @@ steps: exit 1 } Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" \ No newline at end of file + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" \ No newline at end of file diff --git a/global.json b/global.json index 60227c0154b..f32532eddbb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "8.0.101", + "dotnet": "8.0.107", "runtimes": { "dotnet": [ "2.1.30", @@ -16,12 +16,12 @@ } }, "sdk": { - "version": "8.0.101", + "version": "8.0.107", "allowPrerelease": false, "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24360.5", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24366.7", "Microsoft.Build.NoTargets": "3.7.0" } } From e45bbc798743adb93a6288de0e016f30ccba1240 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 18 Jul 2024 12:47:09 +0000 Subject: [PATCH 035/386] Update dependencies from https://github.com/dotnet/arcade build 20240717.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24367.4 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- .../steps/get-federated-access-token.yml | 16 +++++++++++++++- global.json | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3fa5b3420f1..a51522f831a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 731d793be2d0a66bafc96b1a79dc96b4d1f0301b + 9711d78c7efe6f542b764ef961697474043899e5 - + https://github.com/dotnet/arcade - 731d793be2d0a66bafc96b1a79dc96b4d1f0301b + 9711d78c7efe6f542b764ef961697474043899e5 diff --git a/eng/Versions.props b/eng/Versions.props index f95bd0f7a1c..e68742ca527 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24360.4 + 9.0.0-beta.24367.4 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/core-templates/steps/get-federated-access-token.yml b/eng/common/core-templates/steps/get-federated-access-token.yml index c8c49cc0e8f..3a4d4410c48 100644 --- a/eng/common/core-templates/steps/get-federated-access-token.yml +++ b/eng/common/core-templates/steps/get-federated-access-token.yml @@ -3,6 +3,14 @@ parameters: type: string - name: outputVariableName type: string +- name: is1ESPipeline + type: boolean +- name: stepName + type: string + default: 'getFederatedAccessToken' +- name: condition + type: string + default: '' # Resource to get a token for. Common values include: # - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps # - 'https://storage.azure.com/' for storage @@ -10,10 +18,16 @@ parameters: - name: resource type: string default: '499b84ac-1321-427f-aa17-267ca6975798' +- name: isStepOutputVariable + type: boolean + default: false steps: - task: AzureCLI@2 displayName: 'Getting federated access token for feeds' + name: ${{ parameters.stepName }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} inputs: azureSubscription: ${{ parameters.federatedServiceConnection }} scriptType: 'pscore' @@ -25,4 +39,4 @@ steps: exit 1 } Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" \ No newline at end of file + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" \ No newline at end of file diff --git a/global.json b/global.json index 364cf58b9bd..c6ad6203bcb 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24360.4", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24367.4", "Microsoft.Build.NoTargets": "3.7.0" } } From 4d773effe24f5ce8e401ecfdef2e25f2f8149fa9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 18 Jul 2024 13:10:50 +0000 Subject: [PATCH 036/386] Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- eng/common/sdl/execute-all-sdl-tools.ps1 | 4 +--- eng/common/sdl/init-sdl.ps1 | 8 -------- eng/common/templates/steps/execute-sdl.yml | 5 ++++- global.json | 2 +- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 00530113aa1..607308df457 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 94d461b3cffed34241b7be548b6983ec8506bfc3 + fa3d544b066661522f1ec5d5e8cfd461a29b0f8a - + https://github.com/dotnet/arcade - 94d461b3cffed34241b7be548b6983ec8506bfc3 + fa3d544b066661522f1ec5d5e8cfd461a29b0f8a diff --git a/eng/Versions.props b/eng/Versions.props index bccd1d6d967..f111cfbb3b1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24366.7 + 8.0.0-beta.24367.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/sdl/execute-all-sdl-tools.ps1 b/eng/common/sdl/execute-all-sdl-tools.ps1 index 4715d75e974..81ded5b7f47 100644 --- a/eng/common/sdl/execute-all-sdl-tools.ps1 +++ b/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -6,7 +6,6 @@ Param( [string] $BranchName=$env:BUILD_SOURCEBRANCH, # Optional: name of branch or version of gdn settings; defaults to master [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, # Required: the directory where source files are located [string] $ArtifactsDirectory = (Join-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY ('artifacts')), # Required: the directory where build artifacts are located - [string] $AzureDevOpsAccessToken, # Required: access token for dnceng; should be provided via KeyVault # Optional: list of SDL tools to run on source code. See 'configure-sdl-tool.ps1' for tools list # format. @@ -75,7 +74,7 @@ try { } Exec-BlockVerbosely { - & $(Join-Path $PSScriptRoot 'init-sdl.ps1') -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel + & $(Join-Path $PSScriptRoot 'init-sdl.ps1') -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -GuardianLoggerLevel $GuardianLoggerLevel } $gdnFolder = Join-Path $workingDirectory '.gdn' @@ -104,7 +103,6 @@ try { -TargetDirectory $targetDirectory ` -GdnFolder $gdnFolder ` -ToolsList $tools ` - -AzureDevOpsAccessToken $AzureDevOpsAccessToken ` -GuardianLoggerLevel $GuardianLoggerLevel ` -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams ` -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams ` diff --git a/eng/common/sdl/init-sdl.ps1 b/eng/common/sdl/init-sdl.ps1 index 3ac1d92b370..588ff8e22fb 100644 --- a/eng/common/sdl/init-sdl.ps1 +++ b/eng/common/sdl/init-sdl.ps1 @@ -3,7 +3,6 @@ Param( [string] $Repository, [string] $BranchName='master', [string] $WorkingDirectory, - [string] $AzureDevOpsAccessToken, [string] $GuardianLoggerLevel='Standard' ) @@ -21,14 +20,7 @@ $ci = $true # Don't display the console progress UI - it's a huge perf hit $ProgressPreference = 'SilentlyContinue' -# Construct basic auth from AzDO access token; construct URI to the repository's gdn folder stored in that repository; construct location of zip file -$encodedPat = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$AzureDevOpsAccessToken")) -$escapedRepository = [Uri]::EscapeDataString("/$Repository/$BranchName/.gdn") -$uri = "https://dev.azure.com/dnceng/internal/_apis/git/repositories/sdl-tool-cfg/Items?path=$escapedRepository&versionDescriptor[versionOptions]=0&`$format=zip&api-version=5.0" -$zipFile = "$WorkingDirectory/gdn.zip" - Add-Type -AssemblyName System.IO.Compression.FileSystem -$gdnFolder = (Join-Path $WorkingDirectory '.gdn') try { # if the folder does not exist, we'll do a guardian init and push it to the remote repository diff --git a/eng/common/templates/steps/execute-sdl.yml b/eng/common/templates/steps/execute-sdl.yml index 301d5c591eb..fe0ebf8c904 100644 --- a/eng/common/templates/steps/execute-sdl.yml +++ b/eng/common/templates/steps/execute-sdl.yml @@ -34,16 +34,19 @@ steps: displayName: Execute SDL (Overridden) continueOnError: ${{ parameters.sdlContinueOnError }} condition: ${{ parameters.condition }} + env: + GUARDIAN_DEFAULT_PACKAGE_SOURCE_SECRET: $(System.AccessToken) - ${{ if eq(parameters.overrideParameters, '') }}: - powershell: ${{ parameters.executeAllSdlToolsScript }} -GuardianCliLocation $(GuardianCliLocation) -NugetPackageDirectory $(Build.SourcesDirectory)\.packages - -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) ${{ parameters.additionalParameters }} displayName: Execute SDL continueOnError: ${{ parameters.sdlContinueOnError }} condition: ${{ parameters.condition }} + env: + GUARDIAN_DEFAULT_PACKAGE_SOURCE_SECRET: $(System.AccessToken) - ${{ if ne(parameters.publishGuardianDirectoryToPipeline, 'false') }}: # We want to publish the Guardian results and configuration for easy diagnosis. However, the diff --git a/global.json b/global.json index f32532eddbb..32983b1cbad 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24366.7", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24367.1", "Microsoft.Build.NoTargets": "3.7.0" } } From 017716c19babc4574333b01af49cb1796c5559e5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 19 Jul 2024 13:03:47 +0000 Subject: [PATCH 037/386] Update dependencies from https://github.com/dotnet/arcade build 20240718.9 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24368.9 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- eng/common/core-templates/job/publish-build-assets.yml | 5 +++-- eng/common/core-templates/post-build/post-build.yml | 5 +++-- eng/common/core-templates/steps/publish-logs.yml | 1 - eng/common/post-build/publish-using-darc.ps1 | 1 + global.json | 2 +- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a51522f831a..b9a101af661 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 9711d78c7efe6f542b764ef961697474043899e5 + b4e499d1f6e6b3a981feabfed290d99261762382 - + https://github.com/dotnet/arcade - 9711d78c7efe6f542b764ef961697474043899e5 + b4e499d1f6e6b3a981feabfed290d99261762382 diff --git a/eng/Versions.props b/eng/Versions.props index e68742ca527..e601f15b24b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24367.4 + 9.0.0-beta.24368.9 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index ec3cd14191a..3d3356e3196 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -143,9 +143,10 @@ jobs: scriptType: ps scriptLocation: scriptPath scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) + arguments: > + -BuildId $(BARBuildId) -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index 20924366b8a..454fd75c7af 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -307,9 +307,10 @@ stages: scriptType: ps scriptLocation: scriptPath scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) + arguments: > + -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml index 8c5ea77b586..80788c52319 100644 --- a/eng/common/core-templates/steps/publish-logs.yml +++ b/eng/common/core-templates/steps/publish-logs.yml @@ -32,7 +32,6 @@ steps: '$(MaestroAccessToken)' '$(dn-bot-all-orgs-artifact-feeds-rw)' '$(akams-client-id)' - '$(akams-client-secret)' '$(microsoft-symbol-server-pat)' '$(symweb-symbol-server-pat)' '$(dn-bot-all-orgs-build-rw-code-rw)' diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 4ff587ca46a..90b58e32a87 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -42,6 +42,7 @@ try { --azdev-pat "$AzdoToken" ` --bar-uri "$MaestroApiEndPoint" ` --ci ` + --verbose ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/global.json b/global.json index c6ad6203bcb..6ae7e94c30d 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24367.4", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24368.9", "Microsoft.Build.NoTargets": "3.7.0" } } From bb866ebc67b88040809dbb375d2bfbd8fa0f1120 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 19 Jul 2024 13:25:59 +0000 Subject: [PATCH 038/386] Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 From 90fa5ce2eb48479f6c8d7ac5272d17d39a69b929 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 20 Jul 2024 12:50:48 +0000 Subject: [PATCH 039/386] Update dependencies from https://github.com/dotnet/arcade build 20240718.9 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24368.9 From 30dc292cb1d321070282e27478b73adda1cbf194 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 20 Jul 2024 13:11:13 +0000 Subject: [PATCH 040/386] Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 From 812363b1639a0c8abbef7aaf62d2aeda9f53e7d2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 21 Jul 2024 12:43:47 +0000 Subject: [PATCH 041/386] Update dependencies from https://github.com/dotnet/arcade build 20240718.9 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24368.9 From 0c8a3f22fa1b06ac7546efb2d15c68c0ebcde7c5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 21 Jul 2024 13:04:12 +0000 Subject: [PATCH 042/386] Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 From d7ae07d7db1d58ef2920f4d84c2db6128eb3e494 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 22 Jul 2024 12:43:56 +0000 Subject: [PATCH 043/386] Update dependencies from https://github.com/dotnet/arcade build 20240718.9 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24368.9 From 1b961c6604eb7ac8dd6e2787dd33bd1b2e22de13 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 22 Jul 2024 13:00:41 +0000 Subject: [PATCH 044/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240715.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24304.1 -> To Version 9.0.0-alpha.1.24365.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 89bac7398c3..cec4a3272eb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - 2fa4c4f8c0b17b48d2f37839563d6862d1974736 + 4d5ba7206ed1d56612b36560334494652ed486b2 diff --git a/eng/Versions.props b/eng/Versions.props index fd5e1c05bd8..2322c2e95e2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 9.0.0-alpha.1.24362.1 + 9.0.0-alpha.1.24365.1 8.0.0-beta.24321.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From 495ffdbd8074c478b3ffb7a65b004474fcc569c9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 22 Jul 2024 13:04:53 +0000 Subject: [PATCH 045/386] Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 From f8f4793d836e76ff4384921bb2066c34fdf0de02 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 23 Jul 2024 13:00:19 +0000 Subject: [PATCH 046/386] Update dependencies from https://github.com/dotnet/arcade build 20240722.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24372.7 --- eng/Version.Details.xml | 8 +-- eng/Versions.props | 2 +- .../job/source-index-stage1.yml | 6 +- eng/common/native/init-compiler.sh | 56 +++++++------------ global.json | 2 +- 5 files changed, 30 insertions(+), 44 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b9a101af661..ffa8331348e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - b4e499d1f6e6b3a981feabfed290d99261762382 + 4dc25182f9153b892628ef0d4e98663774ad2f01 - + https://github.com/dotnet/arcade - b4e499d1f6e6b3a981feabfed290d99261762382 + 4dc25182f9153b892628ef0d4e98663774ad2f01 diff --git a/eng/Versions.props b/eng/Versions.props index e601f15b24b..e94cbe5844d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24368.9 + 9.0.0-beta.24372.7 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/core-templates/job/source-index-stage1.yml b/eng/common/core-templates/job/source-index-stage1.yml index 945c1c19e82..205fb5b3a39 100644 --- a/eng/common/core-templates/job/source-index-stage1.yml +++ b/eng/common/core-templates/job/source-index-stage1.yml @@ -34,10 +34,12 @@ jobs: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - image: windows.vs2022.amd64.open + image: 1es-windows-2022-open + os: windows ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) - image: windows.vs2022.amd64 + image: 1es-windows-2022 + os: windows steps: - ${{ if eq(parameters.is1ESPipeline, '') }}: diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 62900e12b21..14175343cc6 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -19,11 +19,9 @@ case "$compiler" in # clangx.y or clang-x.y version="$(echo "$compiler" | tr -d '[:alpha:]-=')" majorVersion="${version%%.*}" - [ -z "${version##*.*}" ] && minorVersion="${version#*.}" - if [ -z "$minorVersion" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -le 6 ]; then - minorVersion=0; - fi + # LLVM based on v18 released in early 2024, with two releases per year + maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 6)))" compiler=clang ;; @@ -31,7 +29,9 @@ case "$compiler" in # gccx.y or gcc-x.y version="$(echo "$compiler" | tr -d '[:alpha:]-=')" majorVersion="${version%%.*}" - [ -z "${version##*.*}" ] && minorVersion="${version#*.}" + + # GCC based on v14 released in early 2024, with one release per year + maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 12)))" compiler=gcc ;; esac @@ -49,12 +49,10 @@ check_version_exists() { desired_version=-1 # Set up the environment to be used for building with the desired compiler. - if command -v "$compiler-$1.$2" > /dev/null; then - desired_version="-$1.$2" - elif command -v "$compiler$1$2" > /dev/null; then - desired_version="$1$2" - elif command -v "$compiler-$1$2" > /dev/null; then - desired_version="-$1$2" + if command -v "$compiler-$1" > /dev/null; then + desired_version="-$1" + elif command -v "$compiler$1" > /dev/null; then + desired_version="$1" fi echo "$desired_version" @@ -75,7 +73,7 @@ set_compiler_version_from_CC() { fi # gcc and clang often display 3 part versions. However, gcc can show only 1 part in some environments. - IFS=. read -r majorVersion minorVersion _ < /dev/null; then - echo "Error: No usable version of $compiler found." + echo "Error: No compatible version of $compiler was found within the range of $minVersion to $maxVersion. Please upgrade your toolchain or specify the compiler explicitly using CLR_CC and CLR_CXX environment variables." exit 1 fi CC="$(command -v "$compiler" 2> /dev/null)" CXX="$(command -v "$cxxCompiler" 2> /dev/null)" set_compiler_version_from_CC - else - if [ "$compiler" = "clang" ] && [ "$majorVersion" -lt 5 ] && { [ "$build_arch" = "arm" ] || [ "$build_arch" = "armel" ]; }; then - # If a major version was provided explicitly, and it was too old, find a newer compiler instead - if ! command -v "$compiler" > /dev/null; then - echo "Error: Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH." - exit 1 - fi - - CC="$(command -v "$compiler" 2> /dev/null)" - CXX="$(command -v "$cxxCompiler" 2> /dev/null)" - set_compiler_version_from_CC - fi fi else - desired_version="$(check_version_exists "$majorVersion" "$minorVersion")" + desired_version="$(check_version_exists "$majorVersion")" if [ "$desired_version" = "-1" ]; then - echo "Error: Could not find specific version of $compiler: $majorVersion $minorVersion." + echo "Error: Could not find specific version of $compiler: $majorVersion." exit 1 fi fi diff --git a/global.json b/global.json index 6ae7e94c30d..9a6fc526323 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24368.9", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24372.7", "Microsoft.Build.NoTargets": "3.7.0" } } From 0024af68be4d3c0720c5e284f138c7c423d672ab Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 23 Jul 2024 13:30:30 +0000 Subject: [PATCH 047/386] Update dependencies from https://github.com/dotnet/arcade build 20240722.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24372.3 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- .../templates-official/job/publish-build-assets.yml | 2 +- eng/common/templates-official/post-build/post-build.yml | 2 +- eng/common/templates/job/publish-build-assets.yml | 2 +- eng/common/templates/post-build/post-build.yml | 2 +- global.json | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 607308df457..9f27b13e25d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - fa3d544b066661522f1ec5d5e8cfd461a29b0f8a + 48c3fe3df7c28caa8d5e3122195125b55b4a0c26 - + https://github.com/dotnet/arcade - fa3d544b066661522f1ec5d5e8cfd461a29b0f8a + 48c3fe3df7c28caa8d5e3122195125b55b4a0c26 diff --git a/eng/Versions.props b/eng/Versions.props index f111cfbb3b1..a98bc80b298 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24367.1 + 8.0.0-beta.24372.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index ba3e7df8158..0117328800c 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -149,7 +149,7 @@ jobs: scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates-official/post-build/post-build.yml b/eng/common/templates-official/post-build/post-build.yml index 0dfa387e7b7..b81b8770b34 100644 --- a/eng/common/templates-official/post-build/post-build.yml +++ b/eng/common/templates-official/post-build/post-build.yml @@ -281,7 +281,7 @@ stages: scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 57a41f0a3e1..cc2b346ba8b 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -145,7 +145,7 @@ jobs: scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 2db4933468f..c3b6a3012fe 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -277,7 +277,7 @@ stages: scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/global.json b/global.json index 32983b1cbad..85afe21d327 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24367.1", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24372.3", "Microsoft.Build.NoTargets": "3.7.0" } } From 97abe5ff81038e893ec449a70a0c45a88b53795b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 24 Jul 2024 12:47:39 +0000 Subject: [PATCH 048/386] Update dependencies from https://github.com/dotnet/arcade build 20240722.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24372.7 From e932e4806e11fb30427385f67b7666107138e6c1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 24 Jul 2024 13:16:13 +0000 Subject: [PATCH 049/386] Update dependencies from https://github.com/dotnet/arcade build 20240722.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24372.3 From d64490ab4036fcdd5042606649a176bc965cfe5c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 25 Jul 2024 12:59:56 +0000 Subject: [PATCH 050/386] Update dependencies from https://github.com/dotnet/arcade build 20240724.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24374.3 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ffa8331348e..8db15c878e8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 4dc25182f9153b892628ef0d4e98663774ad2f01 + c45d41114722ff910cde462f4be003b1d7fde58f - + https://github.com/dotnet/arcade - 4dc25182f9153b892628ef0d4e98663774ad2f01 + c45d41114722ff910cde462f4be003b1d7fde58f diff --git a/eng/Versions.props b/eng/Versions.props index e94cbe5844d..08404edeefa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24372.7 + 9.0.0-beta.24374.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index 9a6fc526323..324acd3bc71 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24372.7", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24374.3", "Microsoft.Build.NoTargets": "3.7.0" } } From ccac853bc3720bbd489d17975824e5578087abca Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 25 Jul 2024 13:30:01 +0000 Subject: [PATCH 051/386] Update dependencies from https://github.com/dotnet/arcade build 20240722.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24372.3 From a13e9ad4e463aa84cfa700938f66520086a815f1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 26 Jul 2024 13:03:06 +0000 Subject: [PATCH 052/386] Update dependencies from https://github.com/dotnet/arcade build 20240725.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24375.3 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- eng/common/cross/build-rootfs.sh | 14 +++++++------- global.json | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8db15c878e8..5cae588cefc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - c45d41114722ff910cde462f4be003b1d7fde58f + 3e18bd4f62388b829d0b9dcd1ee131431674aa5f - + https://github.com/dotnet/arcade - c45d41114722ff910cde462f4be003b1d7fde58f + 3e18bd4f62388b829d0b9dcd1ee131431674aa5f diff --git a/eng/Versions.props b/eng/Versions.props index 08404edeefa..cfceb37a632 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24374.3 + 9.0.0-beta.24375.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 6d99d1263c0..4b5e8d7166b 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -605,18 +605,18 @@ elif [[ "$__CodeName" == "illumos" ]]; then fi echo "Building binutils. Please wait.." if [[ "$__hasWget" == 1 ]]; then - wget -O- https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf - + wget -O- https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz | tar -xJf - else - curl -SL https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf - + curl -SL https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz | tar -xJf - fi mkdir build-binutils && cd build-binutils - ../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" + ../binutils-2.42/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.11" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" make -j "$JOBS" && make install && cd .. echo "Building gcc. Please wait.." if [[ "$__hasWget" == 1 ]]; then - wget -O- https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf - + wget -O- https://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz | tar -xJf - else - curl -SL https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf - + curl -SL https://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz | tar -xJf - fi CFLAGS="-fPIC" CXXFLAGS="-fPIC" @@ -624,7 +624,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then CFLAGS_FOR_TARGET="-fPIC" export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET mkdir build-gcc && cd build-gcc - ../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ + ../gcc-13.3.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.11" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ --with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \ --disable-libquadmath-support --disable-shared --enable-tls make -j "$JOBS" && make install && cd .. @@ -632,7 +632,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then if [[ "$__UseMirror" == 1 ]]; then BaseUrl=https://pkgsrc.smartos.skylime.net fi - BaseUrl="$BaseUrl/packages/SmartOS/trunk/${__illumosArch}/All" + BaseUrl="$BaseUrl/packages/SmartOS/2019Q4/${__illumosArch}/All" echo "Downloading manifest" if [[ "$__hasWget" == 1 ]]; then wget "$BaseUrl" diff --git a/global.json b/global.json index 324acd3bc71..4de5fa72419 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24374.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24375.3", "Microsoft.Build.NoTargets": "3.7.0" } } From bb46e7919fc2e3708d47eea058bd708539c9373b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 26 Jul 2024 13:33:28 +0000 Subject: [PATCH 053/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9f27b13e25d..c82d3837f10 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 48c3fe3df7c28caa8d5e3122195125b55b4a0c26 + 1e2be7464703499cf98e20536fb4da4218c8fce1 - + https://github.com/dotnet/arcade - 48c3fe3df7c28caa8d5e3122195125b55b4a0c26 + 1e2be7464703499cf98e20536fb4da4218c8fce1 diff --git a/eng/Versions.props b/eng/Versions.props index a98bc80b298..3cb51b4a92b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24372.3 + 8.0.0-beta.24376.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index 85afe21d327..d2da2009ac8 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24372.3", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24376.1", "Microsoft.Build.NoTargets": "3.7.0" } } From cd11f74af8b02c1446481fdc77a02250a77a5c63 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 27 Jul 2024 12:51:10 +0000 Subject: [PATCH 054/386] Update dependencies from https://github.com/dotnet/arcade build 20240725.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24375.3 From cfb4682d3cf1f8edcacb5f4ea251ce982b287426 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 27 Jul 2024 13:19:13 +0000 Subject: [PATCH 055/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From f4875da87ac75ce80f5843664e2a874b97f0569c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 28 Jul 2024 12:51:18 +0000 Subject: [PATCH 056/386] Update dependencies from https://github.com/dotnet/arcade build 20240725.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24375.3 From 2d8f6a49f48a031669ba0b4f8c48efd53e2c7bfb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 28 Jul 2024 13:19:59 +0000 Subject: [PATCH 057/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From 28b80013caf9a599d8b919a3ea93b9f850f5b9c1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 29 Jul 2024 12:50:09 +0000 Subject: [PATCH 058/386] Update dependencies from https://github.com/dotnet/arcade build 20240725.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24375.3 From c666f0f1847cb4a855504e739864fec9fe4c5d3a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 29 Jul 2024 13:09:27 +0000 Subject: [PATCH 059/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240724.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24304.1 -> To Version 9.0.0-alpha.1.24374.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cec4a3272eb..b5503df4168 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - 4d5ba7206ed1d56612b36560334494652ed486b2 + 26ae006620fb4518276b494efac55dbcd8f80224 diff --git a/eng/Versions.props b/eng/Versions.props index 2322c2e95e2..0dcfbf24b28 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 9.0.0-alpha.1.24365.1 + 9.0.0-alpha.1.24374.1 8.0.0-beta.24321.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From a14113629d2a784438d93dc0d8047e2ad9d635de Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 29 Jul 2024 13:20:31 +0000 Subject: [PATCH 060/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From 8cf7cef8abae0657c3efb34750a271f15179291d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 30 Jul 2024 13:00:07 +0000 Subject: [PATCH 061/386] Update dependencies from https://github.com/dotnet/arcade build 20240729.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24379.1 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5cae588cefc..ef8fdd56bdd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 3e18bd4f62388b829d0b9dcd1ee131431674aa5f + 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 - + https://github.com/dotnet/arcade - 3e18bd4f62388b829d0b9dcd1ee131431674aa5f + 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 diff --git a/eng/Versions.props b/eng/Versions.props index cfceb37a632..e1767dcaa60 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24375.3 + 9.0.0-beta.24379.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index 4de5fa72419..ca4ef98acc8 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24375.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24379.1", "Microsoft.Build.NoTargets": "3.7.0" } } From 4ef57e50aa9e25ab7dcaa0d8df57a729a2721871 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 30 Jul 2024 13:28:52 +0000 Subject: [PATCH 062/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From 8f5597823409c36efc0821c807b2d7587be87c97 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 31 Jul 2024 12:46:05 +0000 Subject: [PATCH 063/386] Update dependencies from https://github.com/dotnet/arcade build 20240729.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24379.1 From beeba173e47ad3fb4af6fa6c3bc449f211437322 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 31 Jul 2024 13:14:25 +0000 Subject: [PATCH 064/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From cdc027116b294ec53e1d3fe64bb96a66180d8c26 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 1 Aug 2024 12:34:58 +0000 Subject: [PATCH 065/386] Update dependencies from https://github.com/dotnet/arcade build 20240801.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24401.1 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- eng/common/native/init-compiler.sh | 4 ++-- global.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ef8fdd56bdd..25a1c8dd400 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 + a3dae8d4fd5a17c147cbecfd31e61463731ac0cc - + https://github.com/dotnet/arcade - 4f5a4ad88d27b56ceeaa43ced670999c33bd2598 + a3dae8d4fd5a17c147cbecfd31e61463731ac0cc diff --git a/eng/Versions.props b/eng/Versions.props index e1767dcaa60..e009d75c859 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24379.1 + 9.0.0-beta.24401.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 14175343cc6..9a0e1f2b456 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -21,7 +21,7 @@ case "$compiler" in majorVersion="${version%%.*}" # LLVM based on v18 released in early 2024, with two releases per year - maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 6)))" + maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 6)))" compiler=clang ;; @@ -31,7 +31,7 @@ case "$compiler" in majorVersion="${version%%.*}" # GCC based on v14 released in early 2024, with one release per year - maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%m) - 3) / 12)))" + maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 12)))" compiler=gcc ;; esac diff --git a/global.json b/global.json index ca4ef98acc8..717c46b0b60 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24379.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24401.1", "Microsoft.Build.NoTargets": "3.7.0" } } From 31d17321d6b67ffb2603ef334db3ffa4907c408a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 1 Aug 2024 13:04:15 +0000 Subject: [PATCH 066/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From 8efa78569501862944b4585bdd43a9eb3fcb6c6f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 2 Aug 2024 12:50:46 +0000 Subject: [PATCH 067/386] Update dependencies from https://github.com/dotnet/arcade build 20240801.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24401.1 From 60562e8b00110dfa2e8af8edbe12aa87fdafd11d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 2 Aug 2024 13:18:25 +0000 Subject: [PATCH 068/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From 683db2afa8e6413c62b70abb4fa99262a57cd6e4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 3 Aug 2024 12:39:36 +0000 Subject: [PATCH 069/386] Update dependencies from https://github.com/dotnet/arcade build 20240801.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24401.1 From caef67c59631a4d1b8e4717be669b122dbeb5504 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 3 Aug 2024 13:06:45 +0000 Subject: [PATCH 070/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From 799fadca41aba69c556683355f9aa4f78b144a88 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 4 Aug 2024 12:48:58 +0000 Subject: [PATCH 071/386] Update dependencies from https://github.com/dotnet/arcade build 20240801.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24401.1 From f0a3b5a074cc78304db078f89f0242bee1a3b0ed Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 4 Aug 2024 13:18:37 +0000 Subject: [PATCH 072/386] Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 From 44eec4620f10dedb60e3721dc3d7ac3edd5c8bed Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 5 Aug 2024 12:39:24 +0000 Subject: [PATCH 073/386] Update dependencies from https://github.com/dotnet/arcade build 20240801.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24352.2 -> To Version 9.0.0-beta.24401.1 From b169e89f1fbf7d13e69f151445f329064ecf2293 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 7 Aug 2024 12:49:54 +0000 Subject: [PATCH 074/386] Update dependencies from https://github.com/dotnet/arcade build 20240805.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24401.1 -> To Version 9.0.0-beta.24405.1 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 25a1c8dd400..b699a487db3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - a3dae8d4fd5a17c147cbecfd31e61463731ac0cc + 2c829550b968e29389ce8392244da2b006d71301 - + https://github.com/dotnet/arcade - a3dae8d4fd5a17c147cbecfd31e61463731ac0cc + 2c829550b968e29389ce8392244da2b006d71301 diff --git a/eng/Versions.props b/eng/Versions.props index e009d75c859..9fca6f7c09c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24401.1 + 9.0.0-beta.24405.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index 717c46b0b60..f27b05b47b1 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24401.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24405.1", "Microsoft.Build.NoTargets": "3.7.0" } } From 60926b85aa5fe15254564a09ca354b2213236762 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 8 Aug 2024 12:47:14 +0000 Subject: [PATCH 075/386] Update dependencies from https://github.com/dotnet/arcade build 20240808.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24405.1 -> To Version 9.0.0-beta.24408.1 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b699a487db3..a13abc14ba8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 2c829550b968e29389ce8392244da2b006d71301 + 610e251fc34686333b98188320ca1eecd7e6af6c - + https://github.com/dotnet/arcade - 2c829550b968e29389ce8392244da2b006d71301 + 610e251fc34686333b98188320ca1eecd7e6af6c diff --git a/eng/Versions.props b/eng/Versions.props index 9fca6f7c09c..be059735f7f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24405.1 + 9.0.0-beta.24408.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index f27b05b47b1..55a3fefbfb5 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24405.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.1", "Microsoft.Build.NoTargets": "3.7.0" } } From a8ead7168525b779b048734c7692e1beddc531c6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 9 Aug 2024 12:42:08 +0000 Subject: [PATCH 076/386] Update dependencies from https://github.com/dotnet/arcade build 20240808.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24408.1 -> To Version 9.0.0-beta.24408.2 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- eng/common/darc-init.ps1 | 2 +- eng/common/darc-init.sh | 2 +- global.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a13abc14ba8..76f9e043b17 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 610e251fc34686333b98188320ca1eecd7e6af6c + 60ae233c3d77f11c5fdb53e570b64d503b13ba59 - + https://github.com/dotnet/arcade - 610e251fc34686333b98188320ca1eecd7e6af6c + 60ae233c3d77f11c5fdb53e570b64d503b13ba59 diff --git a/eng/Versions.props b/eng/Versions.props index be059735f7f..bb76ebd6c09 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24408.1 + 9.0.0-beta.24408.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1 index 8fda30bdce2..e3374310563 100644 --- a/eng/common/darc-init.ps1 +++ b/eng/common/darc-init.ps1 @@ -1,6 +1,6 @@ param ( $darcVersion = $null, - $versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16', + $versionEndpoint = 'https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20', $verbosity = 'minimal', $toolpath = $null ) diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index c305ae6bd77..36dbd45e1ce 100755 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -2,7 +2,7 @@ source="${BASH_SOURCE[0]}" darcVersion='' -versionEndpoint='https://maestro.dot.net/api/assets/darc-version?api-version=2019-01-16' +versionEndpoint='https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20' verbosity='minimal' while [[ $# > 0 ]]; do diff --git a/global.json b/global.json index 55a3fefbfb5..4c7a8f700f4 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.2", "Microsoft.Build.NoTargets": "3.7.0" } } From ae5c378660837808a0ca3116966ed408239ecb04 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 10 Aug 2024 12:07:16 +0000 Subject: [PATCH 077/386] Failed to perform coherency update for one or more dependencies. From 204efc45d257a7e8d6bbaa1244666954945dae1a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 12 Aug 2024 12:42:48 +0000 Subject: [PATCH 078/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240805.2 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24374.1 -> To Version 9.0.0-alpha.1.24405.2 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b5503df4168..b9901fbfdc4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - 26ae006620fb4518276b494efac55dbcd8f80224 + 0d066e61a30c2599d0ced871ea45acf0e10571af diff --git a/eng/Versions.props b/eng/Versions.props index 0dcfbf24b28..ffa20a9acee 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 9.0.0-alpha.1.24374.1 + 9.0.0-alpha.1.24405.2 8.0.0-beta.24321.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From aedbb64730f1925956361f9d16a5adf7312a4245 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 12 Aug 2024 10:44:02 -0700 Subject: [PATCH 079/386] Add CopyTo(Span) extension methods to Utilities.Shared --- .../EnumerableExtensionsTests.cs | 143 ++++++++++++++++++ .../HashSetExtensionsTests.cs | 41 +++++ .../ListExtensionsTests.cs | 40 +++++ ...ions.cs => ReadOnlyListExtensionsTests.cs} | 94 ++++++++++++ .../ArgHelper.cs | 9 ++ .../EnumerableExtensions.cs | 55 +++++++ .../HashSetExtensions.cs | 26 ++++ .../ListExtensions.cs | 30 ++++ .../ReadOnlyListExtensions.cs | 43 ++++++ 9 files changed, 481 insertions(+) create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/HashSetExtensionsTests.cs create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ListExtensionsTests.cs rename src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/{ReadOnlyListExtensions.cs => ReadOnlyListExtensionsTests.cs} (70%) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs new file mode 100644 index 00000000000..a549039b2b9 --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs @@ -0,0 +1,143 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Runtime.CompilerServices; +using Xunit; +using SR = Microsoft.AspNetCore.Razor.Utilities.Shared.Resources.SR; + +namespace Microsoft.AspNetCore.Razor.Utilities.Shared.Test; + +public class EnumerableExtensionsTests +{ + [Fact] + public void CopyTo_ImmutableArray() + { + Span source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var immutableArray = ImmutableArray.Create(source); + + AssertCopyToCore(immutableArray, immutableArray.Length); + } + + [Fact] + public void CopyTo_ImmutableArrayBuilder() + { + Span source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var builder = ImmutableArray.CreateBuilder(); + builder.AddRange(source); + + AssertCopyToCore(builder, builder.Count); + } + + [Fact] + public void CopyTo_List() + { + IEnumerable source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var list = new List(source); + + AssertCopyToCore(list, list.Count); + } + + [Fact] + public void CopyTo_HashSet() + { + IEnumerable source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var set = new HashSet(source); + + AssertCopyToCore(set, set.Count); + } + + [Fact] + public void CopyTo_Array() + { + int[] array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + + AssertCopyToCore(array, array.Length); + } + + [Fact] + public void CopyTo_CustomEnumerable() + { + CustomEnumerable custom = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + + AssertCopyToCore(custom, 10); + } + + [Fact] + public void CopyTo_CustomReadOnlyCollection() + { + CustomReadOnlyCollection custom = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + + AssertCopyToCore(custom, 10); + } + + private static void AssertCopyToCore(IEnumerable sequence, int count) + { + var destination1 = new int[count - 1]; + var exception = Assert.Throws(() => sequence.CopyTo(destination1.AsSpan())); + Assert.StartsWith(SR.Destination_is_too_short, exception.Message); + + Span destination2 = stackalloc int[count]; + sequence.CopyTo(destination2); + AssertElementsEqual(sequence, destination2); + + Span destination3 = stackalloc int[count + 1]; + sequence.CopyTo(destination3); + AssertElementsEqual(sequence, destination3); + + static void AssertElementsEqual(IEnumerable sequence, ReadOnlySpan span) + { + var index = 0; + + foreach (var item in sequence) + { + Assert.Equal(item, span[index++]); + } + } + } + + [CollectionBuilder(typeof(CustomEnumerable), "Create")] + private sealed class CustomEnumerable(params ReadOnlySpan values) : IEnumerable + { + private readonly int[] _values = values.ToArray(); + + public IEnumerator GetEnumerator() + { + foreach (var value in _values) + { + yield return value; + } + } + + IEnumerator IEnumerable.GetEnumerator() + => GetEnumerator(); + + public static CustomEnumerable Create(ReadOnlySpan span) + => new(span); + } + + [CollectionBuilder(typeof(CustomReadOnlyCollection), "Create")] + private sealed class CustomReadOnlyCollection(params ReadOnlySpan values) : IReadOnlyCollection + { + private readonly int[] _values = values.ToArray(); + + public int Count => _values.Length; + + public IEnumerator GetEnumerator() + { + foreach (var value in _values) + { + yield return value; + } + } + + IEnumerator IEnumerable.GetEnumerator() + => GetEnumerator(); + + public static CustomReadOnlyCollection Create(ReadOnlySpan span) + => new(span); + } +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/HashSetExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/HashSetExtensionsTests.cs new file mode 100644 index 00000000000..3e7e050a6a6 --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/HashSetExtensionsTests.cs @@ -0,0 +1,41 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System; +using Xunit; +using SR = Microsoft.AspNetCore.Razor.Utilities.Shared.Resources.SR; + +namespace Microsoft.AspNetCore.Razor.Utilities.Shared.Test; + +public class HashSetExtensionsTests +{ + [Fact] + public void CopyTo() + { + IEnumerable source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var set = new HashSet(source); + + var destination1 = new int[set.Count - 1]; + var exception = Assert.Throws(() => set.CopyTo(destination1.AsSpan())); + Assert.StartsWith(SR.Destination_is_too_short, exception.Message); + + Span destination2 = stackalloc int[set.Count]; + set.CopyTo(destination2); + AssertElementsEqual(set, destination2); + + Span destination3 = stackalloc int[set.Count + 1]; + set.CopyTo(destination3); + AssertElementsEqual(set, destination3); + + static void AssertElementsEqual(HashSet set, ReadOnlySpan span) + { + var index = 0; + + foreach (var item in set) + { + Assert.Equal(item, span[index++]); + } + } + } +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ListExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ListExtensionsTests.cs new file mode 100644 index 00000000000..58eced7fbce --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ListExtensionsTests.cs @@ -0,0 +1,40 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Xunit; +using SR = Microsoft.AspNetCore.Razor.Utilities.Shared.Resources.SR; + +namespace Microsoft.AspNetCore.Razor.Utilities.Shared.Test; + +public class ListExtensionsTests +{ + [Fact] + public void CopyTo() + { + IEnumerable source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var list = new List(source); + + var destination1 = new int[list.Count - 1]; + var exception = Assert.Throws(() => list.CopyTo(destination1.AsSpan())); + Assert.StartsWith(SR.Destination_is_too_short, exception.Message); + + Span destination2 = stackalloc int[list.Count]; + list.CopyTo(destination2); + AssertElementsEqual(list, destination2); + + Span destination3 = stackalloc int[list.Count + 1]; + list.CopyTo(destination3); + AssertElementsEqual(list, destination3); + + static void AssertElementsEqual(List list, ReadOnlySpan span) + { + var count = list.Count; + for (var i = 0; i < count; i++) + { + Assert.Equal(list[i], span[i]); + } + } + } +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs similarity index 70% rename from src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensions.cs rename to src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs index 29aabbf892f..c889d2ece2c 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs @@ -2,7 +2,10 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; +using System.Collections; using System.Collections.Generic; +using System.Collections.Immutable; +using System.Runtime.CompilerServices; using Xunit; using SR = Microsoft.AspNetCore.Razor.Utilities.Shared.Resources.SR; @@ -183,4 +186,95 @@ public void SingleWithPredicate() Assert.Equal(42, readOnlyList.Single(IsEven)); Assert.Equal(42, readOnlyList.SingleOrDefault(IsEven)); } + + [Fact] + public void CopyTo_ImmutableArray() + { + Span source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var immutableArray = ImmutableArray.Create(source); + + AssertCopyToCore(immutableArray); + } + + [Fact] + public void CopyTo_ImmutableArrayBuilder() + { + Span source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var builder = ImmutableArray.CreateBuilder(); + builder.AddRange(source); + + AssertCopyToCore(builder); + } + + [Fact] + public void CopyTo_List() + { + IEnumerable source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + var list = new List(source); + + AssertCopyToCore(list); + } + + [Fact] + public void CopyTo_Array() + { + int[] array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + + AssertCopyToCore(array); + } + + [Fact] + public void CopyTo_CustomReadOnlyList() + { + CustomReadOnlyList custom = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + + AssertCopyToCore(custom); + } + + private static void AssertCopyToCore(IReadOnlyList list) + { + var destination1 = new int[list.Count - 1]; + var exception = Assert.Throws(() => list.CopyTo(destination1.AsSpan())); + Assert.StartsWith(SR.Destination_is_too_short, exception.Message); + + Span destination2 = stackalloc int[list.Count]; + list.CopyTo(destination2); + AssertElementsEqual(list, destination2); + + Span destination3 = stackalloc int[list.Count + 1]; + list.CopyTo(destination3); + AssertElementsEqual(list, destination3); + + static void AssertElementsEqual(IReadOnlyList list, ReadOnlySpan span) + { + var count = list.Count; + for (var i = 0; i < count; i++) + { + Assert.Equal(list[i], span[i]); + } + } + } + + [CollectionBuilder(typeof(CustomReadOnlyList), "Create")] + private sealed class CustomReadOnlyList(params ReadOnlySpan values) : IReadOnlyList + { + private readonly int[] _values = values.ToArray(); + + public int this[int index] => _values[index]; + public int Count => _values.Length; + + public IEnumerator GetEnumerator() + { + foreach (var value in _values) + { + yield return value; + } + } + + IEnumerator IEnumerable.GetEnumerator() + => GetEnumerator(); + + public static CustomReadOnlyList Create(ReadOnlySpan span) + => new(span); + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ArgHelper.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ArgHelper.cs index 3e7b9982f1d..ea2e73adcc9 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ArgHelper.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ArgHelper.cs @@ -176,4 +176,13 @@ public static void ThrowIfLessThanOrEqual(T value, T other, [CallerArgumentEx } #endif } + + public static void ThrowIfDestinationTooShort( + Span destination, int expectedLength, [CallerArgumentExpression(nameof(destination))] string? paramName = null) + { + if (destination.Length < expectedLength) + { + ThrowHelper.ThrowArgumentException(paramName, SR.Destination_is_too_short); + } + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs index 2fe19c1ddf1..98c42a4adac 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Collections.Immutable; +using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.PooledObjects; namespace System.Collections.Generic; @@ -59,4 +60,58 @@ public static bool TryGetCount(this IEnumerable sequence, out int count) count = 0; return false; } + + /// + /// Copies the contents of the sequence to a destination . + /// + /// The type of elements in the sequence. + /// The sequence to copy items from. + /// The span to copy items into. + /// + /// The destination span is shorter than the source sequence. + /// + public static void CopyTo(this IEnumerable sequence, Span destination) + { + // Check a couple of common cases. + switch (sequence) + { + // We specifically test ImmutableArray to avoid boxing it as an IReadOnlyList. + case ImmutableArray array: + ArgHelper.ThrowIfDestinationTooShort(destination, array.Length); + array.CopyTo(destination); + break; + + // HashSet has special enumerator and doesn't implement IReadOnlyList + case HashSet set: + set.CopyTo(destination); + break; + + case IReadOnlyList list: + list.CopyTo(destination); + break; + } + + if (sequence.TryGetCount(out var count)) + { + ArgHelper.ThrowIfDestinationTooShort(destination, count); + + var index = 0; + + foreach (var item in sequence) + { + destination[index++] = item; + } + } + else + { + var index = 0; + + foreach (var item in sequence) + { + ArgHelper.ThrowIfDestinationTooShort(destination, index + 1); + + destination[index++] = item; + } + } + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/HashSetExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/HashSetExtensions.cs index 7d1d85bfc56..fe3f75da3a6 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/HashSetExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/HashSetExtensions.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using Microsoft.AspNetCore.Razor; namespace System.Collections.Generic; @@ -23,4 +24,29 @@ public static void AddRange(this HashSet set, ImmutableArray array) set.Add(item); } } + + /// + /// Copies the contents of the set to a destination . + /// + /// The type of elements in the set. + /// The set to copy items from. + /// The span to copy items into. + /// + /// The is . + /// + /// + /// The destination span is shorter than the source set. + /// + public static void CopyTo(this HashSet set, Span destination) + { + ArgHelper.ThrowIfNull(set); + ArgHelper.ThrowIfDestinationTooShort(destination, set.Count); + + var index = 0; + + foreach (var item in set) + { + destination[index++] = item; + } + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ListExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ListExtensions.cs index d1a07f223c0..98cd48863fa 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ListExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ListExtensions.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; using System.Collections.Generic; namespace Microsoft.AspNetCore.Razor; @@ -33,4 +34,33 @@ public static T[] ToArrayOrEmpty(this List? list) public static bool Any(this List list) => list.Count > 0; + + /// + /// Copies the contents of the list to a destination . + /// + /// The type of elements in the list. + /// The list to copy items from. + /// The span to copy items into. + /// + /// The is . + /// + /// + /// The destination span is shorter than the source list. + /// + public static void CopyTo(this List list, Span destination) + { +#if NET8_0_OR_GREATER + CollectionExtensions.CopyTo(list, destination); +#else + ArgHelper.ThrowIfNull(list); + ArgHelper.ThrowIfDestinationTooShort(destination, list.Count); + + var index = 0; + + foreach (var item in list) + { + destination[index++] = item; + } +#endif + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs index a62950ce924..821c74b710d 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs @@ -952,4 +952,47 @@ public void Reset() _current = default!; } } + + /// + /// Copies the contents of the list to a destination . + /// + /// The type of elements in the list. + /// The list to copy items from. + /// The span to copy items into. + /// + /// The destination span is shorter than the source list. + /// + public static void CopyTo(this IReadOnlyList list, Span destination) + { + ArgHelper.ThrowIfDestinationTooShort(destination, list.Count); + + switch (list) + { + case ImmutableArray array: + array.CopyTo(destination); + break; + + case ImmutableArray.Builder builder: + builder.CopyTo(destination); + break; + + case List listOfT: + ListExtensions.CopyTo(listOfT, destination); + break; + + case T[] array: + MemoryExtensions.CopyTo(array, destination); + break; + + default: + var count = list.Count; + + for (var i = 0; i < count; i++) + { + destination[i] = list[i]; + } + + break; + } + } } From 027dd045a1bb49f4328615df45f1e8d8ed188e83 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 12 Aug 2024 10:52:39 -0700 Subject: [PATCH 080/386] Add XML doc comments to ImmutableArray Order extensions --- .../ImmutableArrayExtensions.cs | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index 3107a833101..ecbb2b38ebb 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -175,42 +175,104 @@ public static int BinarySearchBy(this ImmutableArray array, TArg arg return ~min; } + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An array to ordered. + /// + /// Returns a new whose elements are sorted in ascending order. + /// public static ImmutableArray OrderAsArray(this ImmutableArray array) { var compareHelper = new CompareHelper(comparer: null, descending: false); return array.OrderAsArrayCore(in compareHelper); } + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An array to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in ascending order. + /// public static ImmutableArray OrderAsArray(this ImmutableArray array, IComparer comparer) { var compareHelper = new CompareHelper(comparer, descending: false); return array.OrderAsArrayCore(in compareHelper); } + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An array to ordered. + /// A to compare elements. + /// + /// Returns a new whose elements are sorted in ascending order. + /// public static ImmutableArray OrderAsArray(this ImmutableArray array, Comparison comparison) { var compareHelper = new CompareHelper(comparison, descending: false); return array.OrderAsArrayCore(in compareHelper); } + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An array to ordered. + /// + /// Returns a new whose elements are sorted in descending order. + /// public static ImmutableArray OrderDescendingAsArray(this ImmutableArray array) { var compareHelper = new CompareHelper(comparer: null, descending: true); return array.OrderAsArrayCore(in compareHelper); } + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An array to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in descending order. + /// public static ImmutableArray OrderDescendingAsArray(this ImmutableArray array, IComparer comparer) { var compareHelper = new CompareHelper(comparer, descending: true); return array.OrderAsArrayCore(in compareHelper); } + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An array to ordered. + /// A to compare elements. + /// + /// Returns a new whose elements are sorted in descending order. + /// public static ImmutableArray OrderDescendingAsArray(this ImmutableArray array, Comparison comparison) { var compareHelper = new CompareHelper(comparison, descending: true); return array.OrderAsArrayCore(in compareHelper); } + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An array to ordered. + /// A function to extract a key from an element. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// public static ImmutableArray OrderByAsArray( this ImmutableArray array, Func keySelector) { @@ -218,6 +280,17 @@ public static ImmutableArray OrderByAsArray( return array.OrderByAsArrayCore(keySelector, in compareHelper); } + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An array to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// public static ImmutableArray OrderByAsArray( this ImmutableArray array, Func keySelector, IComparer comparer) { @@ -225,6 +298,17 @@ public static ImmutableArray OrderByAsArray( return array.OrderByAsArrayCore(keySelector, in compareHelper); } + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An array to ordered. + /// A function to extract a key from an element. + /// A to compare keys. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// public static ImmutableArray OrderByAsArray( this ImmutableArray array, Func keySelector, Comparison comparison) { @@ -232,6 +316,16 @@ public static ImmutableArray OrderByAsArray( return array.OrderByAsArrayCore(keySelector, in compareHelper); } + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An array to ordered. + /// A function to extract a key from an element. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// public static ImmutableArray OrderByDescendingAsArray( this ImmutableArray array, Func keySelector) { @@ -239,6 +333,17 @@ public static ImmutableArray OrderByDescendingAsArray( return array.OrderByAsArrayCore(keySelector, in compareHelper); } + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An array to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// public static ImmutableArray OrderByDescendingAsArray( this ImmutableArray array, Func keySelector, IComparer comparer) { @@ -246,6 +351,17 @@ public static ImmutableArray OrderByDescendingAsArray( return array.OrderByAsArrayCore(keySelector, in compareHelper); } + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An array to ordered. + /// A function to extract a key from an element. + /// A to compare keys. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// public static ImmutableArray OrderByDescendingAsArray( this ImmutableArray array, Func keySelector, Comparison comparison) { From 45e64fbcba38d067f30e4b4f6aabc689e0466d3f Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 12 Aug 2024 11:40:44 -0700 Subject: [PATCH 081/386] Add ImmutableArray.Unsafe() extension with in-place order methods --- .../ImmutableArrayExtensionsTests.cs | 222 ++++++++++++------ .../BufferExtensions.cs | 39 ++- .../ImmutableArrayExtensions.cs | 8 +- .../ImmutableArrayExtensions_Unsafe.cs | 210 +++++++++++++++++ 4 files changed, 402 insertions(+), 77 deletions(-) create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs index 7a04d9083b4..adb827f4ac2 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs @@ -46,7 +46,13 @@ private static Comparison OddBeforeEven _ => x.CompareTo(y) }; - public static TheoryData, ImmutableArray> OrderAsArrayData + public readonly record struct ValueHolder(int Value) + { + public static implicit operator ValueHolder(int value) + => new(value); + } + + public static TheoryData, ImmutableArray> OrderTestData => new() { { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, @@ -56,15 +62,7 @@ public static TheoryData, ImmutableArray> OrderAsArrayD { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, }; - [Theory] - [MemberData(nameof(OrderAsArrayData))] - public void OrderAsArray(ImmutableArray data, ImmutableArray expected) - { - var sorted = data.OrderAsArray(); - Assert.Equal(expected, sorted); - } - - public static TheoryData, ImmutableArray> OrderAsArray_OddBeforeEvenData + public static TheoryData, ImmutableArray> OrderTestData_OddBeforeEven => new() { { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, @@ -74,15 +72,7 @@ public static TheoryData, ImmutableArray> OrderAsArray_ { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, }; - [Theory] - [MemberData(nameof(OrderAsArray_OddBeforeEvenData))] - public void OrderAsArray_OddBeforeEven(ImmutableArray data, ImmutableArray expected) - { - var sorted = data.OrderAsArray(OddBeforeEven); - Assert.Equal(expected, sorted); - } - - public static TheoryData, ImmutableArray> OrderDescendingAsArrayData + public static TheoryData, ImmutableArray> OrderDescendingTestData => new() { { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, @@ -92,15 +82,7 @@ public static TheoryData, ImmutableArray> OrderDescendi { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, }; - [Theory] - [MemberData(nameof(OrderAsArrayData))] - public void OrderDescendingAsArray(ImmutableArray data, ImmutableArray expected) - { - var sorted = data.OrderAsArray(); - Assert.Equal(expected, sorted); - } - - public static TheoryData, ImmutableArray> OrderDescendingAsArray_OddBeforeEvenData + public static TheoryData, ImmutableArray> OrderDescendingTestData_OddBeforeEven => new() { { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, @@ -110,21 +92,7 @@ public static TheoryData, ImmutableArray> OrderDescendi { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, }; - [Theory] - [MemberData(nameof(OrderDescendingAsArray_OddBeforeEvenData))] - public void OrderDescendingAsArray_OddBeforeEven(ImmutableArray data, ImmutableArray expected) - { - var sorted = data.OrderDescendingAsArray(OddBeforeEven); - Assert.Equal(expected, sorted); - } - - public readonly record struct ValueHolder(int Value) - { - public static implicit operator ValueHolder(int value) - => new(value); - } - - public static TheoryData, ImmutableArray> OrderByAsArrayData + public static TheoryData, ImmutableArray> OrderByTestData => new() { { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, @@ -134,15 +102,7 @@ public static TheoryData, ImmutableArray data, ImmutableArray expected) - { - var sorted = data.OrderByAsArray(static x => x.Value); - Assert.Equal(expected, sorted); - } - - public static TheoryData, ImmutableArray> OrderByAsArray_OddBeforeEvenData + public static TheoryData, ImmutableArray> OrderByTestData_OddBeforeEven => new() { { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, @@ -152,15 +112,7 @@ public static TheoryData, ImmutableArray data, ImmutableArray expected) - { - var sorted = data.OrderByAsArray(static x => x.Value, OddBeforeEven); - Assert.Equal(expected, sorted); - } - - public static TheoryData, ImmutableArray> OrderByDescendingAsArrayData + public static TheoryData, ImmutableArray> OrderByDescendingTestData => new() { { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, @@ -170,15 +122,7 @@ public static TheoryData, ImmutableArray data, ImmutableArray expected) - { - var sorted = data.OrderByDescendingAsArray(static x => x.Value); - Assert.Equal(expected, sorted); - } - - public static TheoryData, ImmutableArray> OrderByDescendingAsArray_OddBeforeEvenData + public static TheoryData, ImmutableArray> OrderByDescendingTestData_OddBeforeEven => new() { { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, @@ -189,7 +133,63 @@ public static TheoryData, ImmutableArray data, ImmutableArray expected) + { + var sorted = data.OrderAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void OrderAsArray_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var sorted = data.OrderAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void OrderDescendingAsArray(ImmutableArray data, ImmutableArray expected) + { + var sorted = data.OrderDescendingAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void OrderDescendingAsArray_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var sorted = data.OrderDescendingAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void OrderByAsArray(ImmutableArray data, ImmutableArray expected) + { + var sorted = data.OrderByAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void OrderByAsArray_OddBeforeEvent(ImmutableArray data, ImmutableArray expected) + { + var sorted = data.OrderByAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void OrderByDescendingAsArray(ImmutableArray data, ImmutableArray expected) + { + var sorted = data.OrderByDescendingAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] public void OrderByDescendingAsArray_OddBeforeEven(ImmutableArray data, ImmutableArray expected) { var sorted = data.OrderByDescendingAsArray(static x => x.Value, OddBeforeEven); @@ -315,4 +315,84 @@ public void OrderByDescendingAsArray_SortedArrayReturnsSameArray() presortedArray = presortedArray.OrderByDescendingAsArray(static x => x.Value); Assert.Same(values, ImmutableCollectionsMarshal.AsArray(presortedArray)); } + + [Theory] + [MemberData(nameof(OrderTestData))] + public void UnsafeOrder(ImmutableArray data, ImmutableArray expected) + { + // Clone array, since we're modifying it in-place. + var sorted = ImmutableArray.Create(data.AsSpan()); + sorted.Unsafe().Order(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void UnsafeOrder_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + // Clone array, since we're modifying it in-place. + var sorted = ImmutableArray.Create(data.AsSpan()); + sorted.Unsafe().Order(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void UnsafeOrderDescending(ImmutableArray data, ImmutableArray expected) + { + // Clone array, since we're modifying it in-place. + var sorted = ImmutableArray.Create(data.AsSpan()); + sorted.Unsafe().OrderDescending(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void UnsafeOrderDescending_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + // Clone array, since we're modifying it in-place. + var sorted = ImmutableArray.Create(data.AsSpan()); + sorted.Unsafe().OrderDescending(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void UnsafeOrderBy(ImmutableArray data, ImmutableArray expected) + { + // Clone array, since we're modifying it in-place. + var sorted = ImmutableArray.Create(data.AsSpan()); + sorted.Unsafe().OrderBy(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void UnsafeOrderBy_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + // Clone array, since we're modifying it in-place. + var sorted = ImmutableArray.Create(data.AsSpan()); + sorted.Unsafe().OrderBy(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void UnsafeOrderByDescending(ImmutableArray data, ImmutableArray expected) + { + // Clone array, since we're modifying it in-place. + var sorted = ImmutableArray.Create(data.AsSpan()); + sorted.Unsafe().OrderByDescending(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] + public void UnsafeOrderByDescending_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + // Clone array, since we're modifying it in-place. + var sorted = ImmutableArray.Create(data.AsSpan()); + sorted.Unsafe().OrderByDescending(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/BufferExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/BufferExtensions.cs index b3b1f58d087..0916d756f0e 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/BufferExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/BufferExtensions.cs @@ -7,6 +7,41 @@ namespace System.Buffers; internal static class BufferExtensions { + /// + /// Rents an array of the given minimum length from the specified . + /// + /// + /// The to use. + /// + /// + /// The minimum length of the array. + /// + /// + /// The array is guaranteed to be at least in length. However, + /// it will likely be larger. + /// + public static PooledArray GetPooledArray(this ArrayPool pool, int minimumLength) + => pool.GetPooledArray(minimumLength, clearOnReturn: false); + + /// + /// Rents an array of the given minimum length from the specified . + /// + /// + /// The to use. + /// + /// + /// The minimum length of the array. + /// + /// + /// Indicates whether the contents of the array should be cleared before it is returned to the pool. + /// + /// + /// The array is guaranteed to be at least in length. However, + /// it will likely be larger. + /// + public static PooledArray GetPooledArray(this ArrayPool pool, int minimumLength, bool clearOnReturn) + => new(pool, minimumLength, clearOnReturn); + /// /// Rents an array of the given minimum length from the specified . /// @@ -47,7 +82,7 @@ public static PooledArray GetPooledArray(this ArrayPool pool, int minim /// public static PooledArray GetPooledArray(this ArrayPool pool, int minimumLength, bool clearOnReturn, out T[] array) { - var result = new PooledArray(pool, minimumLength, clearOnReturn); + var result = pool.GetPooledArray(minimumLength, clearOnReturn); array = result.Array; return result; } @@ -88,7 +123,7 @@ public static PooledArray GetPooledArraySpan(this ArrayPool pool, int m /// public static PooledArray GetPooledArraySpan(this ArrayPool pool, int minimumLength, bool clearOnReturn, out Span span) { - var result = new PooledArray(pool, minimumLength, clearOnReturn); + var result = pool.GetPooledArray(minimumLength, clearOnReturn); span = result.Span; return result; } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index ecbb2b38ebb..adb6487cff8 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -11,7 +11,7 @@ namespace System.Collections.Immutable; /// /// extension methods /// -internal static class ImmutableArrayExtensions +internal static partial class ImmutableArrayExtensions { /// /// Returns an empty array if the input array is null (default) @@ -403,9 +403,9 @@ private static ImmutableArray OrderByAsArrayCore( var items = array.AsSpan(); var length = items.Length; - using var _ = ArrayPool.Shared.GetPooledArray(minimumLength: length, out var keys); + using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); - if (SelectKeys(items, keySelector, compareHelper, keys.AsSpan(0, length))) + if (SelectKeys(items, keySelector, compareHelper, keys.Span)) { // No need to sort - keys are already ordered. return array; @@ -416,7 +416,7 @@ private static ImmutableArray OrderByAsArrayCore( var comparer = compareHelper.GetOrCreateComparer(); - Array.Sort(keys, newArray, 0, length, comparer); + Array.Sort(keys.Array, newArray, 0, length, comparer); return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs new file mode 100644 index 00000000000..5114b45c680 --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs @@ -0,0 +1,210 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Buffers; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace System.Collections.Immutable; + +internal static partial class ImmutableArrayExtensions +{ + /// + /// Provides a set of unsafe operations that can be performed on an . + /// + /// The type of the elements in . + /// The array that unsafe operations will target. + /// + /// Returns a struct that provides access to unsafe operations to perform on the + /// . These operations mutate the internal array + /// of the and should be only be used in + /// performance-critical code. + /// + public static UnsafeOperations Unsafe(this ImmutableArray array) + => new(array); + + public readonly ref struct UnsafeOperations(ImmutableArray array) + { + /// + /// Sorts the elements of this in ascending order. + /// + public void Order() + { + var compareHelper = new CompareHelper(comparer: null, descending: false); + array.UnsafeOrderCore(in compareHelper); + } + + /// + /// Sorts the elements of this in ascending order. + /// + /// An to compare elements. + public void Order(IComparer comparer) + { + var compareHelper = new CompareHelper(comparer, descending: false); + array.UnsafeOrderCore(in compareHelper); + } + + /// + /// Sorts the elements of this in ascending order. + /// + /// A to compare elements. + public void Order(Comparison comparison) + { + var compareHelper = new CompareHelper(comparison, descending: false); + array.UnsafeOrderCore(in compareHelper); + } + + /// + /// Sorts the elements of this in descending order. + /// + public void OrderDescending() + { + var compareHelper = new CompareHelper(comparer: null, descending: true); + array.UnsafeOrderCore(in compareHelper); + } + + /// + /// Sorts the elements of this in descending order. + /// + /// An to compare elements. + public void OrderDescending(IComparer comparer) + { + var compareHelper = new CompareHelper(comparer, descending: true); + array.UnsafeOrderCore(in compareHelper); + } + + /// + /// Sorts the elements of this in descending order. + /// + /// A to compare elements. + public void OrderDescending(Comparison comparison) + { + var compareHelper = new CompareHelper(comparison, descending: true); + array.UnsafeOrderCore(in compareHelper); + } + + /// + /// Sorts the elements of this in ascending order according to a key. + /// + /// The type of key returned by . + /// A function to extract a key from an element. + public void OrderBy(Func keySelector) + { + var compareHelper = new CompareHelper(comparer: null, descending: false); + array.UnsafeOrderByCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of this in ascending order according to a key. + /// + /// The type of key returned by . + /// A function to extract a key from an element. + /// An to compare elements. + public void OrderBy(Func keySelector, IComparer comparer) + { + var compareHelper = new CompareHelper(comparer, descending: false); + array.UnsafeOrderByCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of this in ascending order according to a key. + /// + /// The type of key returned by . + /// A function to extract a key from an element. + /// An to compare elements. + public void OrderBy(Func keySelector, Comparison comparison) + { + var compareHelper = new CompareHelper(comparison, descending: false); + array.UnsafeOrderByCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of this in descending order according to a key. + /// + /// The type of key returned by . + /// A function to extract a key from an element. + public void OrderByDescending(Func keySelector) + { + var compareHelper = new CompareHelper(comparer: null, descending: true); + array.UnsafeOrderByCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of this in descending order according to a key. + /// + /// The type of key returned by . + /// A function to extract a key from an element. + /// An to compare elements. + public void OrderByDescending(Func keySelector, IComparer comparer) + { + var compareHelper = new CompareHelper(comparer, descending: true); + array.UnsafeOrderByCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of this in descending order according to a key. + /// + /// The type of key returned by . + /// A function to extract a key from an element. + /// An to compare elements. + public void OrderByDescending(Func keySelector, Comparison comparison) + { + var compareHelper = new CompareHelper(comparison, descending: true); + array.UnsafeOrderByCore(keySelector, in compareHelper); + } + } + + private static ImmutableArray UnsafeOrderCore(this ImmutableArray array, ref readonly CompareHelper compareHelper) + { + // Note: Checking the length will throw if array.IsDefault returns true. + // So, we can assume that the inner array below is non-null. + if (array.Length <= 1) + { + return array; + } + + var innerArray = ImmutableCollectionsMarshal.AsArray(array)!; + var items = innerArray.AsSpan(); + + if (AreOrdered(items, in compareHelper)) + { + // No need to sort - items are already ordered. + return array; + } + + var comparer = compareHelper.GetOrCreateComparer(); + + Array.Sort(innerArray, comparer); + + return array; + } + + private static ImmutableArray UnsafeOrderByCore( + this ImmutableArray array, Func keySelector, ref readonly CompareHelper compareHelper) + { + // Note: Checking the length will throw if array.IsDefault returns true. + // So, we can assume that the inner array below is non-null. + if (array.Length <= 1) + { + return array; + } + + var innerArray = ImmutableCollectionsMarshal.AsArray(array)!; + var items = innerArray.AsSpan(); + var length = items.Length; + + using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + + if (SelectKeys(items, keySelector, compareHelper, keys.Span)) + { + // No need to sort - keys are already ordered. + return array; + } + + var comparer = compareHelper.GetOrCreateComparer(); + + Array.Sort(keys.Array, innerArray, 0, length, comparer); + + return array; + } +} From 4c0c2795deefad7caf6abff17a23e61bba7d6260 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 12 Aug 2024 11:45:40 -0700 Subject: [PATCH 082/386] Un-nest ComparerHelper and DescendingComparer --- .../ImmutableArrayExtensions.cs | 96 +------------------ .../ImmutableArrayExtensions_Unsafe.cs | 3 +- .../Utilities/CompareHelper`1.cs | 71 ++++++++++++++ .../Utilities/DescendingComparer`1.cs | 34 +++++++ 4 files changed, 110 insertions(+), 94 deletions(-) create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/DescendingComparer`1.cs diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index adb6487cff8..d317fd2b0f0 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.AspNetCore.Razor.Utilities; namespace System.Collections.Immutable; @@ -405,7 +406,7 @@ private static ImmutableArray OrderByAsArrayCore( using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); - if (SelectKeys(items, keySelector, compareHelper, keys.Span)) + if (SelectKeys(items, keySelector, in compareHelper, keys.Span)) { // No need to sort - keys are already ordered. return array; @@ -462,7 +463,7 @@ private static bool AreOrdered(ReadOnlySpan items, ref readonly CompareHel /// When the keys are already ordered, there's no need to perform a sort. /// private static bool SelectKeys( - ReadOnlySpan items, Func keySelector, CompareHelper compareHelper, Span keys) + ReadOnlySpan items, Func keySelector, ref readonly CompareHelper compareHelper, Span keys) { var isOutOfOrder = false; @@ -482,95 +483,4 @@ private static bool SelectKeys( return !isOutOfOrder; } - - /// - /// Helper that avoids creating an until its needed. - /// - private readonly ref struct CompareHelper - { - private readonly IComparer _comparer; - private readonly Comparison _comparison; - private readonly bool _comparerSpecified; - private readonly bool _useComparer; - private readonly bool _descending; - - public CompareHelper(IComparer? comparer, bool descending) - { - _comparerSpecified = comparer is not null; - _comparer = comparer ?? Comparer.Default; - _useComparer = true; - _descending = descending; - _comparison = null!; - } - - public CompareHelper(Comparison comparison, bool descending) - { - _comparison = comparison; - _useComparer = false; - _descending = descending; - _comparer = null!; - } - - public bool InSortedOrder(T? x, T? y) - { - // We assume that x and y are in sorted order if x is > y. - // We don't consider x == y to be sorted because the actual sor - // might not be stable, depending on T. - - return _useComparer - ? !_descending ? _comparer.Compare(x!, y!) > 0 : _comparer.Compare(y!, x!) > 0 - : !_descending ? _comparison(x!, y!) > 0 : _comparison(y!, x!) > 0; - } - - public IComparer GetOrCreateComparer() - // There are six cases to consider. - => (_useComparer, _comparerSpecified, _descending) switch - { - // Provided a comparer and the results are in ascending order. - (true, true, false) => _comparer, - - // Provided a comparer and the results are in descending order. - (true, true, true) => DescendingComparer.Create(_comparer), - - // Not provided a comparer and the results are in ascending order. - // In this case, _comparer was already set to Comparer.Default. - (true, false, false) => _comparer, - - // Not provided a comparer and the results are in descending order. - (true, false, true) => DescendingComparer.Default, - - // Provided a comparison delegate and the results are in ascending order. - (false, _, false) => Comparer.Create(_comparison), - - // Provided a comparison delegate and the results are in descending order. - (false, _, true) => DescendingComparer.Create(_comparison) - }; - } - - private abstract class DescendingComparer : IComparer - { - private static IComparer? s_default; - - public static IComparer Default => s_default ??= new ReversedComparer(Comparer.Default); - - public static IComparer Create(IComparer comparer) - => new ReversedComparer(comparer); - - public static IComparer Create(Comparison comparison) - => new ReversedComparison(comparison); - - public abstract int Compare(T? x, T? y); - - private sealed class ReversedComparer(IComparer comparer) : DescendingComparer - { - public override int Compare(T? x, T? y) - => comparer.Compare(y!, x!); - } - - private sealed class ReversedComparison(Comparison comparison) : DescendingComparer - { - public override int Compare(T? x, T? y) - => comparison(y!, x!); - } - } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs index 5114b45c680..817b33a89c7 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs @@ -4,6 +4,7 @@ using System.Buffers; using System.Collections.Generic; using System.Runtime.InteropServices; +using Microsoft.AspNetCore.Razor.Utilities; namespace System.Collections.Immutable; @@ -195,7 +196,7 @@ private static ImmutableArray UnsafeOrderByCore( using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); - if (SelectKeys(items, keySelector, compareHelper, keys.Span)) + if (SelectKeys(items, keySelector, in compareHelper, keys.Span)) { // No need to sort - keys are already ordered. return array; diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs new file mode 100644 index 00000000000..ae7d9159d1b --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs @@ -0,0 +1,71 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.AspNetCore.Razor.Utilities; + +/// +/// Helper that avoids creating an until its needed. +/// +internal readonly ref struct CompareHelper +{ + private readonly IComparer _comparer; + private readonly Comparison _comparison; + private readonly bool _comparerSpecified; + private readonly bool _useComparer; + private readonly bool _descending; + + public CompareHelper(IComparer? comparer, bool descending) + { + _comparerSpecified = comparer is not null; + _comparer = comparer ?? Comparer.Default; + _useComparer = true; + _descending = descending; + _comparison = null!; + } + + public CompareHelper(Comparison comparison, bool descending) + { + _comparison = comparison; + _useComparer = false; + _descending = descending; + _comparer = null!; + } + + public bool InSortedOrder(T? x, T? y) + { + // We assume that x and y are in sorted order if x is > y. + // We don't consider x == y to be sorted because the actual sor + // might not be stable, depending on T. + + return _useComparer + ? !_descending ? _comparer.Compare(x!, y!) > 0 : _comparer.Compare(y!, x!) > 0 + : !_descending ? _comparison(x!, y!) > 0 : _comparison(y!, x!) > 0; + } + + public IComparer GetOrCreateComparer() + // There are six cases to consider. + => (_useComparer, _comparerSpecified, _descending) switch + { + // Provided a comparer and the results are in ascending order. + (true, true, false) => _comparer, + + // Provided a comparer and the results are in descending order. + (true, true, true) => DescendingComparer.Create(_comparer), + + // Not provided a comparer and the results are in ascending order. + // In this case, _comparer was already set to Comparer.Default. + (true, false, false) => _comparer, + + // Not provided a comparer and the results are in descending order. + (true, false, true) => DescendingComparer.Default, + + // Provided a comparison delegate and the results are in ascending order. + (false, _, false) => Comparer.Create(_comparison), + + // Provided a comparison delegate and the results are in descending order. + (false, _, true) => DescendingComparer.Create(_comparison) + }; +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/DescendingComparer`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/DescendingComparer`1.cs new file mode 100644 index 00000000000..c987f4bc135 --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/DescendingComparer`1.cs @@ -0,0 +1,34 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.AspNetCore.Razor.Utilities; + +internal abstract class DescendingComparer : IComparer +{ + private static IComparer? s_default; + + public static IComparer Default => s_default ??= new ReversedComparer(Comparer.Default); + + public static IComparer Create(IComparer comparer) + => new ReversedComparer(comparer); + + public static IComparer Create(Comparison comparison) + => new ReversedComparison(comparison); + + public abstract int Compare(T? x, T? y); + + private sealed class ReversedComparer(IComparer comparer) : DescendingComparer + { + public override int Compare(T? x, T? y) + => comparer.Compare(y!, x!); + } + + private sealed class ReversedComparison(Comparison comparison) : DescendingComparer + { + public override int Compare(T? x, T? y) + => comparison(y!, x!); + } +} From a3c13752ee135397e492f34838a680718524fab4 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 12 Aug 2024 12:08:14 -0700 Subject: [PATCH 083/386] Add IReadOnlyList OrderAsArray extension methods --- .../ReadOnlyListExtensionsTests.cs | 158 +++++++ .../ReadOnlyListExtensions.cs | 412 ++++++++++++++++++ 2 files changed, 570 insertions(+) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs index c889d2ece2c..5529b39b231 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs @@ -277,4 +277,162 @@ IEnumerator IEnumerable.GetEnumerator() public static CustomReadOnlyList Create(ReadOnlySpan span) => new(span); } + + private static Comparison OddBeforeEven + => (x, y) => (x % 2 != 0, y % 2 != 0) switch + { + (true, false) => -1, + (false, true) => 1, + _ => x.CompareTo(y) + }; + + public readonly record struct ValueHolder(int Value) + { + public static implicit operator ValueHolder(int value) + => new(value); + } + + public static TheoryData, ImmutableArray> OrderTestData + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + }; + + public static TheoryData, ImmutableArray> OrderTestData_OddBeforeEven + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + }; + + public static TheoryData, ImmutableArray> OrderDescendingTestData + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + }; + + public static TheoryData, ImmutableArray> OrderDescendingTestData_OddBeforeEven + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + }; + + public static TheoryData, ImmutableArray> OrderByTestData + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + }; + + public static TheoryData, ImmutableArray> OrderByTestData_OddBeforeEven + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + }; + + public static TheoryData, ImmutableArray> OrderByDescendingTestData + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + }; + + public static TheoryData, ImmutableArray> OrderByDescendingTestData_OddBeforeEven + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + }; + + [Theory] + [MemberData(nameof(OrderTestData))] + public void OrderAsArray(IReadOnlyList data, ImmutableArray expected) + { + var sorted = data.OrderAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void OrderAsArray_OddBeforeEven(IReadOnlyList data, ImmutableArray expected) + { + var sorted = data.OrderAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void OrderDescendingAsArray(IReadOnlyList data, ImmutableArray expected) + { + var sorted = data.OrderDescendingAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void OrderDescendingAsArray_OddBeforeEven(IReadOnlyList data, ImmutableArray expected) + { + var sorted = data.OrderDescendingAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void OrderByAsArray(IReadOnlyList data, ImmutableArray expected) + { + var sorted = data.OrderByAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void OrderByAsArray_OddBeforeEven(IReadOnlyList data, ImmutableArray expected) + { + var sorted = data.OrderByAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void OrderByDescendingAsArray(IReadOnlyList data, ImmutableArray expected) + { + var sorted = data.OrderByDescendingAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] + public void OrderByDescendingAsArray_OddBeforeEven(IReadOnlyList data, ImmutableArray expected) + { + var sorted = data.OrderByDescendingAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs index 821c74b710d..c64e5acd553 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs @@ -1,9 +1,12 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System.Buffers; using System.Collections.Immutable; +using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.AspNetCore.Razor.Utilities; namespace System.Collections.Generic; @@ -34,6 +37,47 @@ static ImmutableArray BuildResult(IReadOnlyList items, Func(this IReadOnlyList list) + { + return list switch + { + [] => [], + [var item] => [item], + [var item1, var item2] => [item1, item2], + [var item1, var item2, var item3] => [item1, item2, item3], + [var item1, var item2, var item3, var item4] => [item1, item2, item3, item4], + var items => BuildResult(items) + }; + + static T[] BuildResult(IReadOnlyList items) + { + var result = new T[items.Count]; + items.CopyTo(result); + + return result; + } + } + + public static ImmutableArray ToImmutableArray(this IReadOnlyList list) + { + return list switch + { + [] => [], + [var item] => [item], + [var item1, var item2] => [item1, item2], + [var item1, var item2, var item3] => [item1, item2, item3], + [var item1, var item2, var item3, var item4] => [item1, item2, item3, item4], + var items => BuildResult(items) + }; + + static ImmutableArray BuildResult(IReadOnlyList items) + { + var result = items.ToArray(); + + return ImmutableCollectionsMarshal.AsImmutableArray(result); + } + } + /// /// Determines whether a list contains any elements. /// @@ -995,4 +1039,372 @@ public static void CopyTo(this IReadOnlyList list, Span destination) break; } } + + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An to ordered. + /// + /// Returns a new whose elements are sorted in ascending order. + /// + public static ImmutableArray OrderAsArray(this IReadOnlyList list) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderAsArray(array); + } + + var compareHelper = new CompareHelper(comparer: null, descending: false); + return list.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in ascending order. + /// + public static ImmutableArray OrderAsArray(this IReadOnlyList list, IComparer comparer) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderAsArray(array, comparer); + } + + var compareHelper = new CompareHelper(comparer, descending: false); + return list.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in ascending order. + /// + public static ImmutableArray OrderAsArray(this IReadOnlyList list, Comparison comparison) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderAsArray(array, comparison); + } + + var compareHelper = new CompareHelper(comparison, descending: false); + return list.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An to ordered. + /// + /// Returns a new whose elements are sorted in descending order. + /// + public static ImmutableArray OrderDescendingAsArray(this IReadOnlyList list) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderDescendingAsArray(array); + } + + var compareHelper = new CompareHelper(comparer: null, descending: true); + return list.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in descending order. + /// + public static ImmutableArray OrderDescendingAsArray(this IReadOnlyList list, IComparer comparer) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderDescendingAsArray(array, comparer); + } + + var compareHelper = new CompareHelper(comparer, descending: true); + return list.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in descending order. + /// + public static ImmutableArray OrderDescendingAsArray(this IReadOnlyList list, Comparison comparison) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderDescendingAsArray(array, comparison); + } + + var compareHelper = new CompareHelper(comparison, descending: true); + return list.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray OrderByAsArray( + this IReadOnlyList list, Func keySelector) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByAsArray(array, keySelector); + } + + var compareHelper = new CompareHelper(comparer: null, descending: false); + return list.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray OrderByAsArray( + this IReadOnlyList list, Func keySelector, IComparer comparer) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByAsArray(array, keySelector, comparer); + } + + var compareHelper = new CompareHelper(comparer, descending: false); + return list.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray OrderByAsArray( + this IReadOnlyList list, Func keySelector, Comparison comparison) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByAsArray(array, keySelector, comparison); + } + + var compareHelper = new CompareHelper(comparison, descending: false); + return list.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray OrderByDescendingAsArray( + this IReadOnlyList list, Func keySelector) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector); + } + + var compareHelper = new CompareHelper(comparer: null, descending: true); + return list.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray OrderByDescendingAsArray( + this IReadOnlyList list, Func keySelector, IComparer comparer) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector, comparer); + } + + var compareHelper = new CompareHelper(comparer, descending: true); + return list.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray OrderByDescendingAsArray( + this IReadOnlyList list, Func keySelector, Comparison comparison) + { + if (list is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector, comparison); + } + + var compareHelper = new CompareHelper(comparison, descending: true); + return list.OrderByAsArrayCore(keySelector, in compareHelper); + } + + private static ImmutableArray OrderAsArrayCore(this IReadOnlyList list, ref readonly CompareHelper compareHelper) + { + switch (list.Count) + { + case 0: + return []; + case 1: + return [list[0]]; + } + + if (AreOrdered(list, in compareHelper)) + { + // No need to sort - items are already ordered. + return ImmutableCollectionsMarshal.AsImmutableArray(list.ToArray()); + } + + var newArray = list.ToArray(); + var comparer = compareHelper.GetOrCreateComparer(); + + Array.Sort(newArray, comparer); + + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } + + private static ImmutableArray OrderByAsArrayCore( + this IReadOnlyList list, Func keySelector, ref readonly CompareHelper compareHelper) + { + switch (list.Count) + { + case 0: + return []; + case 1: + return [list[0]]; + } + + var length = list.Count; + + using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + + if (SelectKeys(list, keySelector, in compareHelper, keys.Span)) + { + // No need to sort - keys are already ordered. + return ImmutableCollectionsMarshal.AsImmutableArray(list.ToArray()); + } + + var newArray = list.ToArray(); + var comparer = compareHelper.GetOrCreateComparer(); + + Array.Sort(keys.Array, newArray, 0, length, comparer); + + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } + + /// + /// Walk through and determine whether they are already ordered using + /// the provided . + /// + /// + /// if the items are in order; otherwise . + /// + /// + /// When the items are already ordered, there's no need to perform a sort. + /// + private static bool AreOrdered(IReadOnlyList list, ref readonly CompareHelper compareHelper) + { + var isOutOfOrder = false; + var count = list.Count; + + for (var i = 1; i < count; i++) + { + if (!compareHelper.InSortedOrder(list[i], list[i - 1])) + { + isOutOfOrder = true; + break; + } + } + + return !isOutOfOrder; + } + + /// + /// Walk through and convert each element to a key using . + /// While walking, each computed key is compared with the previous one using the provided + /// to determine whether they are already ordered. + /// + /// + /// if the keys are in order; otherwise . + /// + /// + /// When the keys are already ordered, there's no need to perform a sort. + /// + private static bool SelectKeys( + IReadOnlyList list, Func keySelector, ref readonly CompareHelper compareHelper, Span keys) + { + var isOutOfOrder = false; + var count = list.Count; + + keys[0] = keySelector(list[0]); + + for (var i = 1; i < count; i++) + { + keys[i] = keySelector(list[i]); + + if (!isOutOfOrder && !compareHelper.InSortedOrder(keys[i], keys[i - 1])) + { + isOutOfOrder = true; + + // Continue processing to finish converting elements to keys. However, we can stop comparing keys. + } + } + + return !isOutOfOrder; + } } From 72be23494ec1a36a529bf8c09dc9d216c7ef4b75 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 12 Aug 2024 14:06:14 -0700 Subject: [PATCH 084/386] Add IEnumerable OrderAsArray extension methods --- .../EnumerableExtensionsTests.cs | 158 +++++++ .../EnumerableExtensions.cs | 397 ++++++++++++++++++ .../ImmutableArrayExtensions.cs | 63 +-- .../ImmutableArrayExtensions_Unsafe.cs | 4 +- .../ReadOnlyListExtensions.cs | 65 +-- .../Utilities/SortHelper.cs | 130 ++++++ 6 files changed, 691 insertions(+), 126 deletions(-) create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper.cs diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs index a549039b2b9..133fa663970 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs @@ -140,4 +140,162 @@ IEnumerator IEnumerable.GetEnumerator() public static CustomReadOnlyCollection Create(ReadOnlySpan span) => new(span); } + + private static Comparison OddBeforeEven + => (x, y) => (x % 2 != 0, y % 2 != 0) switch + { + (true, false) => -1, + (false, true) => 1, + _ => x.CompareTo(y) + }; + + public readonly record struct ValueHolder(int Value) + { + public static implicit operator ValueHolder(int value) + => new(value); + } + + public static TheoryData, ImmutableArray> OrderTestData + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + }; + + public static TheoryData, ImmutableArray> OrderTestData_OddBeforeEven + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + }; + + public static TheoryData, ImmutableArray> OrderDescendingTestData + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + }; + + public static TheoryData, ImmutableArray> OrderDescendingTestData_OddBeforeEven + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + }; + + public static TheoryData, ImmutableArray> OrderByTestData + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }, + }; + + public static TheoryData, ImmutableArray> OrderByTestData_OddBeforeEven + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [1, 3, 5, 7, 9, 2, 4, 6, 8, 10] }, + }; + + public static TheoryData, ImmutableArray> OrderByDescendingTestData + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] }, + }; + + public static TheoryData, ImmutableArray> OrderByDescendingTestData_OddBeforeEven + => new() + { + { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [10, 9, 8, 7, 6, 5, 4, 3, 2, 1], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [1, 3, 5, 7, 9, 2, 4, 6, 8, 10], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [2, 5, 8, 1, 3, 9, 7, 4, 10, 6], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + { [6, 10, 4, 7, 9, 3, 1, 8, 5, 2], [10, 8, 6, 4, 2, 9, 7, 5, 3, 1] }, + }; + + [Theory] + [MemberData(nameof(OrderTestData))] + public void OrderAsArray(IEnumerable data, ImmutableArray expected) + { + var sorted = data.OrderAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void OrderAsArray_OddBeforeEven(IEnumerable data, ImmutableArray expected) + { + var sorted = data.OrderAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void OrderDescendingAsArray(IEnumerable data, ImmutableArray expected) + { + var sorted = data.OrderDescendingAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void OrderDescendingAsArray_OddBeforeEven(IEnumerable data, ImmutableArray expected) + { + var sorted = data.OrderDescendingAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void OrderByAsArray(IEnumerable data, ImmutableArray expected) + { + var sorted = data.OrderByAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void OrderByAsArray_OddBeforeEven(IEnumerable data, ImmutableArray expected) + { + var sorted = data.OrderByAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void OrderByDescendingAsArray(IEnumerable data, ImmutableArray expected) + { + var sorted = data.OrderByDescendingAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] + public void OrderByDescendingAsArray_OddBeforeEven(IEnumerable data, ImmutableArray expected) + { + var sorted = data.OrderByDescendingAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs index 98c42a4adac..760145ee49d 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs @@ -1,9 +1,13 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System.Buffers; using System.Collections.Immutable; +using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.AspNetCore.Razor.Utilities; +using ImmutableArrayExtensions = System.Collections.Immutable.ImmutableArrayExtensions; namespace System.Collections.Generic; @@ -11,6 +15,11 @@ internal static class EnumerableExtensions { public static ImmutableArray SelectAsArray(this IEnumerable source, Func selector) { + if (source is ImmutableArray array) + { + return ImmutableArrayExtensions.SelectAsArray(array, selector); + } + if (source is IReadOnlyList list) { return list.SelectAsArray(selector); @@ -114,4 +123,392 @@ public static void CopyTo(this IEnumerable sequence, Span destination) } } } + + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An to ordered. + /// + /// Returns a new whose elements are sorted in ascending order. + /// + public static ImmutableArray OrderAsArray(this IEnumerable sequence) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderAsArray(array); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderAsArray(list); + } + + var compareHelper = new CompareHelper(comparer: null, descending: false); + return sequence.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in ascending order. + /// + public static ImmutableArray OrderAsArray(this IEnumerable sequence, IComparer comparer) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderAsArray(array, comparer); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderAsArray(list, comparer); + } + + var compareHelper = new CompareHelper(comparer, descending: false); + return sequence.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order. + /// + /// The type of the elements in . + /// An to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in ascending order. + /// + public static ImmutableArray OrderAsArray(this IEnumerable sequence, Comparison comparison) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderAsArray(array, comparison); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderAsArray(list, comparison); + } + + var compareHelper = new CompareHelper(comparison, descending: false); + return sequence.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An to ordered. + /// + /// Returns a new whose elements are sorted in descending order. + /// + public static ImmutableArray OrderDescendingAsArray(this IEnumerable sequence) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderDescendingAsArray(array); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderDescendingAsArray(list); + } + + var compareHelper = new CompareHelper(comparer: null, descending: true); + return sequence.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in descending order. + /// + public static ImmutableArray OrderDescendingAsArray(this IEnumerable sequence, IComparer comparer) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderDescendingAsArray(array, comparer); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderDescendingAsArray(list, comparer); + } + + var compareHelper = new CompareHelper(comparer, descending: true); + return sequence.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in descending order. + /// + /// The type of the elements in . + /// An to ordered. + /// An to compare elements. + /// + /// Returns a new whose elements are sorted in descending order. + /// + public static ImmutableArray OrderDescendingAsArray(this IEnumerable sequence, Comparison comparison) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderDescendingAsArray(array, comparison); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderDescendingAsArray(list, comparison); + } + + var compareHelper = new CompareHelper(comparison, descending: true); + return sequence.OrderAsArrayCore(in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray OrderByAsArray( + this IEnumerable sequence, Func keySelector) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByAsArray(array, keySelector); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderByAsArray(list, keySelector); + } + + var compareHelper = new CompareHelper(comparer: null, descending: false); + return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray OrderByAsArray( + this IEnumerable sequence, Func keySelector, IComparer comparer) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByAsArray(array, keySelector, comparer); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderByAsArray(list, keySelector, comparer); + } + + var compareHelper = new CompareHelper(comparer, descending: false); + return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray OrderByAsArray( + this IEnumerable sequence, Func keySelector, Comparison comparison) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByAsArray(array, keySelector, comparison); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderByAsArray(list, keySelector, comparison); + } + + var compareHelper = new CompareHelper(comparison, descending: false); + return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray OrderByDescendingAsArray( + this IEnumerable sequence, Func keySelector) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderByDescendingAsArray(list, keySelector); + } + + var compareHelper = new CompareHelper(comparer: null, descending: true); + return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray OrderByDescendingAsArray( + this IEnumerable sequence, Func keySelector, IComparer comparer) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector, comparer); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderByDescendingAsArray(list, keySelector, comparer); + } + + var compareHelper = new CompareHelper(comparer, descending: true); + return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + } + + /// + /// Sorts the elements of an in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// An to ordered. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray OrderByDescendingAsArray( + this IEnumerable sequence, Func keySelector, Comparison comparison) + { + if (sequence is ImmutableArray array) + { + return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector, comparison); + } + + if (sequence is IReadOnlyList list) + { + return ReadOnlyListExtensions.OrderByDescendingAsArray(list, keySelector, comparison); + } + + var compareHelper = new CompareHelper(comparison, descending: true); + return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + } + + private static ImmutableArray OrderAsArrayCore(this IEnumerable sequence, ref readonly CompareHelper compareHelper) + { + var newArray = BuildArray(sequence); + + if (newArray.Length <= 1 || SortHelper.AreOrdered(newArray.AsSpan(), in compareHelper)) + { + // No need to sort - items are already ordered. + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } + + var comparer = compareHelper.GetOrCreateComparer(); + + Array.Sort(newArray, comparer); + + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } + + private static ImmutableArray OrderByAsArrayCore( + this IEnumerable sequence, Func keySelector, ref readonly CompareHelper compareHelper) + { + var newArray = BuildArray(sequence); + + if (newArray.Length <= 1) + { + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } + + var length = newArray.Length; + + using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + + if (SortHelper.SelectKeys(newArray.AsSpan(), keySelector, in compareHelper, keys.Span)) + { + // No need to sort - keys are already ordered. + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } + + var comparer = compareHelper.GetOrCreateComparer(); + + Array.Sort(keys.Array, newArray, 0, length, comparer); + + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } + + private static T[] BuildArray(IEnumerable sequence) + { + if (!sequence.TryGetCount(out var count)) + { + return BuildSlow(sequence); + } + + if (count == 0) + { + return []; + } + + var result = new T[count]; + sequence.CopyTo(result); + + return result; + + static T[] BuildSlow(IEnumerable sequence) + { + using var builder = new PooledArrayBuilder(); + + foreach (var item in sequence) + { + builder.Add(item); + } + + return builder.ToArray(); + } + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index d317fd2b0f0..704a6b22ff7 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -376,7 +376,7 @@ private static ImmutableArray OrderAsArrayCore(this ImmutableArray arra { var items = array.AsSpan(); - if (AreOrdered(items, in compareHelper)) + if (SortHelper.AreOrdered(items, in compareHelper)) { // No need to sort - items are already ordered. return array; @@ -406,7 +406,7 @@ private static ImmutableArray OrderByAsArrayCore( using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); - if (SelectKeys(items, keySelector, in compareHelper, keys.Span)) + if (SortHelper.SelectKeys(items, keySelector, in compareHelper, keys.Span)) { // No need to sort - keys are already ordered. return array; @@ -424,63 +424,4 @@ private static ImmutableArray OrderByAsArrayCore( return array; } - - /// - /// Walk through and determine whether they are already ordered using - /// the provided . - /// - /// - /// if the items are in order; otherwise . - /// - /// - /// When the items are already ordered, there's no need to perform a sort. - /// - private static bool AreOrdered(ReadOnlySpan items, ref readonly CompareHelper compareHelper) - { - var isOutOfOrder = false; - - for (var i = 1; i < items.Length; i++) - { - if (!compareHelper.InSortedOrder(items[i], items[i - 1])) - { - isOutOfOrder = true; - break; - } - } - - return !isOutOfOrder; - } - - /// - /// Walk through and convert each element to a key using . - /// While walking, each computed key is compared with the previous one using the provided - /// to determine whether they are already ordered. - /// - /// - /// if the keys are in order; otherwise . - /// - /// - /// When the keys are already ordered, there's no need to perform a sort. - /// - private static bool SelectKeys( - ReadOnlySpan items, Func keySelector, ref readonly CompareHelper compareHelper, Span keys) - { - var isOutOfOrder = false; - - keys[0] = keySelector(items[0]); - - for (var i = 1; i < items.Length; i++) - { - keys[i] = keySelector(items[i]); - - if (!isOutOfOrder && !compareHelper.InSortedOrder(keys[i], keys[i - 1])) - { - isOutOfOrder = true; - - // Continue processing to finish converting elements to keys. However, we can stop comparing keys. - } - } - - return !isOutOfOrder; - } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs index 817b33a89c7..ca2df33a120 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs @@ -167,7 +167,7 @@ private static ImmutableArray UnsafeOrderCore(this ImmutableArray array var innerArray = ImmutableCollectionsMarshal.AsArray(array)!; var items = innerArray.AsSpan(); - if (AreOrdered(items, in compareHelper)) + if (SortHelper.AreOrdered(items, in compareHelper)) { // No need to sort - items are already ordered. return array; @@ -196,7 +196,7 @@ private static ImmutableArray UnsafeOrderByCore( using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); - if (SelectKeys(items, keySelector, in compareHelper, keys.Span)) + if (SortHelper.SelectKeys(items, keySelector, in compareHelper, keys.Span)) { // No need to sort - keys are already ordered. return array; diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs index c64e5acd553..f21214005dc 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs @@ -1304,7 +1304,7 @@ private static ImmutableArray OrderAsArrayCore(this IReadOnlyList list, return [list[0]]; } - if (AreOrdered(list, in compareHelper)) + if (SortHelper.AreOrdered(list, in compareHelper)) { // No need to sort - items are already ordered. return ImmutableCollectionsMarshal.AsImmutableArray(list.ToArray()); @@ -1333,7 +1333,7 @@ private static ImmutableArray OrderByAsArrayCore( using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); - if (SelectKeys(list, keySelector, in compareHelper, keys.Span)) + if (SortHelper.SelectKeys(list, keySelector, in compareHelper, keys.Span)) { // No need to sort - keys are already ordered. return ImmutableCollectionsMarshal.AsImmutableArray(list.ToArray()); @@ -1346,65 +1346,4 @@ private static ImmutableArray OrderByAsArrayCore( return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } - - /// - /// Walk through and determine whether they are already ordered using - /// the provided . - /// - /// - /// if the items are in order; otherwise . - /// - /// - /// When the items are already ordered, there's no need to perform a sort. - /// - private static bool AreOrdered(IReadOnlyList list, ref readonly CompareHelper compareHelper) - { - var isOutOfOrder = false; - var count = list.Count; - - for (var i = 1; i < count; i++) - { - if (!compareHelper.InSortedOrder(list[i], list[i - 1])) - { - isOutOfOrder = true; - break; - } - } - - return !isOutOfOrder; - } - - /// - /// Walk through and convert each element to a key using . - /// While walking, each computed key is compared with the previous one using the provided - /// to determine whether they are already ordered. - /// - /// - /// if the keys are in order; otherwise . - /// - /// - /// When the keys are already ordered, there's no need to perform a sort. - /// - private static bool SelectKeys( - IReadOnlyList list, Func keySelector, ref readonly CompareHelper compareHelper, Span keys) - { - var isOutOfOrder = false; - var count = list.Count; - - keys[0] = keySelector(list[0]); - - for (var i = 1; i < count; i++) - { - keys[i] = keySelector(list[i]); - - if (!isOutOfOrder && !compareHelper.InSortedOrder(keys[i], keys[i - 1])) - { - isOutOfOrder = true; - - // Continue processing to finish converting elements to keys. However, we can stop comparing keys. - } - } - - return !isOutOfOrder; - } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper.cs new file mode 100644 index 00000000000..f41137724ca --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper.cs @@ -0,0 +1,130 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.AspNetCore.Razor.Utilities; + +internal static class SortHelper +{ + /// + /// Walk through and determine whether they are already ordered using + /// the provided . + /// + /// + /// if the items are in order; otherwise . + /// + /// + /// When the items are already ordered, there's no need to perform a sort. + /// + public static bool AreOrdered(ReadOnlySpan items, ref readonly CompareHelper compareHelper) + { + var isOutOfOrder = false; + + for (var i = 1; i < items.Length; i++) + { + if (!compareHelper.InSortedOrder(items[i], items[i - 1])) + { + isOutOfOrder = true; + break; + } + } + + return !isOutOfOrder; + } + + /// + /// Walk through and determine whether they are already ordered using + /// the provided . + /// + /// + /// if the items are in order; otherwise . + /// + /// + /// When the items are already ordered, there's no need to perform a sort. + /// + public static bool AreOrdered(IReadOnlyList list, ref readonly CompareHelper compareHelper) + { + var isOutOfOrder = false; + var count = list.Count; + + for (var i = 1; i < count; i++) + { + if (!compareHelper.InSortedOrder(list[i], list[i - 1])) + { + isOutOfOrder = true; + break; + } + } + + return !isOutOfOrder; + } + + /// + /// Walk through and convert each element to a key using . + /// While walking, each computed key is compared with the previous one using the provided + /// to determine whether they are already ordered. + /// + /// + /// if the keys are in order; otherwise . + /// + /// + /// When the keys are already ordered, there's no need to perform a sort. + /// + public static bool SelectKeys( + ReadOnlySpan items, Func keySelector, ref readonly CompareHelper compareHelper, Span keys) + { + var isOutOfOrder = false; + + keys[0] = keySelector(items[0]); + + for (var i = 1; i < items.Length; i++) + { + keys[i] = keySelector(items[i]); + + if (!isOutOfOrder && !compareHelper.InSortedOrder(keys[i], keys[i - 1])) + { + isOutOfOrder = true; + + // Continue processing to finish converting elements to keys. However, we can stop comparing keys. + } + } + + return !isOutOfOrder; + } + + /// + /// Walk through and convert each element to a key using . + /// While walking, each computed key is compared with the previous one using the provided + /// to determine whether they are already ordered. + /// + /// + /// if the keys are in order; otherwise . + /// + /// + /// When the keys are already ordered, there's no need to perform a sort. + /// + public static bool SelectKeys( + IReadOnlyList list, Func keySelector, ref readonly CompareHelper compareHelper, Span keys) + { + var isOutOfOrder = false; + var count = list.Count; + + keys[0] = keySelector(list[0]); + + for (var i = 1; i < count; i++) + { + keys[i] = keySelector(list[i]); + + if (!isOutOfOrder && !compareHelper.InSortedOrder(keys[i], keys[i - 1])) + { + isOutOfOrder = true; + + // Continue processing to finish converting elements to keys. However, we can stop comparing keys. + } + } + + return !isOutOfOrder; + } +} From 4eb9cb76aa724becb2961aa21f373424fd658623 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 12 Aug 2024 14:15:25 -0700 Subject: [PATCH 085/386] Add tests to call OrderByArray methods through IEnumerable and IReadOnlyList --- .../ImmutableArrayExtensionsTests.cs | 147 +++++++++++++++++- .../ReadOnlyListExtensionsTests.cs | 72 +++++++++ 2 files changed, 218 insertions(+), 1 deletion(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs index adb827f4ac2..185fc2e3891 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.Collections.Immutable; using System.Runtime.InteropServices; using Xunit; @@ -174,7 +175,7 @@ public void OrderByAsArray(ImmutableArray data, ImmutableArray data, ImmutableArray expected) + public void OrderByAsArray_OddBeforeEven(ImmutableArray data, ImmutableArray expected) { var sorted = data.OrderByAsArray(static x => x.Value, OddBeforeEven); Assert.Equal(expected, sorted); @@ -196,6 +197,150 @@ public void OrderByDescendingAsArray_OddBeforeEven(ImmutableArray d Assert.Equal(expected, sorted); } + [Theory] + [MemberData(nameof(OrderTestData))] + public void OrderAsArray_ReadOnlyList(ImmutableArray data, ImmutableArray expected) + { + var readOnlyList = (IReadOnlyList)data; + var sorted = readOnlyList.OrderAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void OrderAsArray_ReadOnlyList_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var readOnlyList = (IReadOnlyList)data; + var sorted = readOnlyList.OrderAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void OrderDescendingAsArray_ReadOnlyList(ImmutableArray data, ImmutableArray expected) + { + var readOnlyList = (IReadOnlyList)data; + var sorted = readOnlyList.OrderDescendingAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void OrderDescendingAsArray_ReadOnlyList_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var readOnlyList = (IReadOnlyList)data; + var sorted = readOnlyList.OrderDescendingAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void OrderByAsArray_ReadOnlyList(ImmutableArray data, ImmutableArray expected) + { + var readOnlyList = (IReadOnlyList)data; + var sorted = readOnlyList.OrderByAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void OrderByAsArray_ReadOnlyList_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var readOnlyList = (IReadOnlyList)data; + var sorted = readOnlyList.OrderByAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void OrderByDescendingAsArray_ReadOnlyList(ImmutableArray data, ImmutableArray expected) + { + var readOnlyList = (IReadOnlyList)data; + var sorted = readOnlyList.OrderByDescendingAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] + public void OrderByDescendingAsArray_ReadOnlyList_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var readOnlyList = (IReadOnlyList)data; + var sorted = readOnlyList.OrderByDescendingAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData))] + public void OrderAsArray_Enumerable(ImmutableArray data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void OrderAsArray_Enumerable_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void OrderDescendingAsArray_Enumerable(ImmutableArray data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderDescendingAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void OrderDescendingAsArray_Enumerable_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderDescendingAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void OrderByAsArray_Enumerable(ImmutableArray data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderByAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void OrderByAsArray_Enumerable_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderByAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void OrderByDescendingAsArray_Enumerable(ImmutableArray data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderByDescendingAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] + public void OrderByDescendingAsArray_Enumerable_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderByDescendingAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + [Fact] public void OrderAsArray_EmptyArrayReturnsSameArray() { diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs index 5529b39b231..adc2f7d2cb2 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs @@ -435,4 +435,76 @@ public void OrderByDescendingAsArray_OddBeforeEven(IReadOnlyList da var sorted = data.OrderByDescendingAsArray(static x => x.Value, OddBeforeEven); Assert.Equal(expected, sorted); } + + [Theory] + [MemberData(nameof(OrderTestData))] + public void OrderAsArray_Enumerable(IReadOnlyList data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void OrderAsArray_Enumerable_OddBeforeEven(IReadOnlyList data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void OrderDescendingAsArray_Enumerable(IReadOnlyList data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderDescendingAsArray(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void OrderDescendingAsArray_Enumerable_OddBeforeEven(IReadOnlyList data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderDescendingAsArray(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void OrderByAsArray_Enumerable(IReadOnlyList data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderByAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void OrderByAsArray_Enumerable_OddBeforeEven(IReadOnlyList data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderByAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void OrderByDescendingAsArray_Enumerable(IReadOnlyList data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderByDescendingAsArray(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] + public void OrderByDescendingAsArray_Enumerable_OddBeforeEven(IReadOnlyList data, ImmutableArray expected) + { + var enumerable = (IEnumerable)data; + var sorted = enumerable.OrderByDescendingAsArray(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } } From 2464e6eace59cc1a8b5ae909056da00f5f28b384 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 12 Aug 2024 15:03:48 -0700 Subject: [PATCH 086/386] Add ImmutableArray.Builder ToImmutableOrdered extension methods --- .../ImmutableArrayExtensionsTests.cs | 72 ++++ .../ImmutableArrayExtensions.cs | 319 ++++++++++++++++-- 2 files changed, 361 insertions(+), 30 deletions(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs index 185fc2e3891..50196817cf7 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs @@ -341,6 +341,78 @@ public void OrderByDescendingAsArray_Enumerable_OddBeforeEven(ImmutableArray(expected, sorted); } + [Theory] + [MemberData(nameof(OrderTestData))] + public void ToImmutableOrdered(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.ToImmutableOrdered(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void ToImmutableOrdered_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.ToImmutableOrdered(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void ToImmutableOrderedDescending(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.ToImmutableOrderedDescending(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void ToImmutableOrderedDescending_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.ToImmutableOrderedDescending(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void ToImmutableOrderedBy(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.ToImmutableOrderedBy(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void ToImmutableOrderedBy_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.ToImmutableOrderedBy(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void ToImmutableOrderedByDescending(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.ToImmutableOrderedByDescending(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] + public void ToImmutableOrderedByDescending_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.ToImmutableOrderedByDescending(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + [Fact] public void OrderAsArray_EmptyArrayReturnsSameArray() { diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index 704a6b22ff7..d199ccd7512 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -372,56 +372,315 @@ public static ImmutableArray OrderByDescendingAsArray( private static ImmutableArray OrderAsArrayCore(this ImmutableArray array, ref readonly CompareHelper compareHelper) { - if (array.Length > 1) + if (array.Length <= 1) { - var items = array.AsSpan(); + return array; + } - if (SortHelper.AreOrdered(items, in compareHelper)) - { - // No need to sort - items are already ordered. - return array; - } + var items = array.AsSpan(); - var length = items.Length; - var newArray = new T[length]; - items.CopyTo(newArray); + if (SortHelper.AreOrdered(items, in compareHelper)) + { + // No need to sort - items are already ordered. + return array; + } - var comparer = compareHelper.GetOrCreateComparer(); + var length = items.Length; + var newArray = new T[length]; + items.CopyTo(newArray); - Array.Sort(newArray, comparer); + var comparer = compareHelper.GetOrCreateComparer(); - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); - } + Array.Sort(newArray, comparer); - return array; + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } private static ImmutableArray OrderByAsArrayCore( this ImmutableArray array, Func keySelector, ref readonly CompareHelper compareHelper) { - if (array.Length > 1) + if (array.Length <= 1) { - var items = array.AsSpan(); - var length = items.Length; + return array; + } - using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + var items = array.AsSpan(); + var length = items.Length; - if (SortHelper.SelectKeys(items, keySelector, in compareHelper, keys.Span)) - { - // No need to sort - keys are already ordered. - return array; - } + using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + + if (SortHelper.SelectKeys(items, keySelector, in compareHelper, keys.Span)) + { + // No need to sort - keys are already ordered. + return array; + } + + var newArray = new TElement[length]; + items.CopyTo(newArray); + + var comparer = compareHelper.GetOrCreateComparer(); + + Array.Sort(keys.Array, newArray, 0, length, comparer); + + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in ascending order. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order. + /// + public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder) + { + var compareHelper = new CompareHelper(comparer: null, descending: false); + return builder.ToImmutableOrderedCore(in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in ascending order. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// An to compare elements. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order. + /// + public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder, IComparer comparer) + { + var compareHelper = new CompareHelper(comparer, descending: false); + return builder.ToImmutableOrderedCore(in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in ascending order. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// An to compare elements. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order. + /// + public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder, Comparison comparison) + { + var compareHelper = new CompareHelper(comparison, descending: false); + return builder.ToImmutableOrderedCore(in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in descending order. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order. + /// + public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder) + { + var compareHelper = new CompareHelper(comparer: null, descending: true); + return builder.ToImmutableOrderedCore(in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in descending order. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// An to compare elements. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order. + /// + public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder, IComparer comparer) + { + var compareHelper = new CompareHelper(comparer, descending: true); + return builder.ToImmutableOrderedCore(in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in descending order. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// An to compare elements. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order. + /// + public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder, Comparison comparison) + { + var compareHelper = new CompareHelper(comparison, descending: true); + return builder.ToImmutableOrderedCore(in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray ToImmutableOrderedBy( + this ImmutableArray.Builder builder, Func keySelector) + { + var compareHelper = new CompareHelper(comparer: null, descending: false); + return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray ToImmutableOrderedBy( + this ImmutableArray.Builder builder, Func keySelector, IComparer comparer) + { + var compareHelper = new CompareHelper(comparer, descending: false); + return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in ascending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in ascending order according to a key. + /// + public static ImmutableArray ToImmutableOrderedBy( + this ImmutableArray.Builder builder, Func keySelector, Comparison comparison) + { + var compareHelper = new CompareHelper(comparison, descending: false); + return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray ToImmutableOrderedByDescending( + this ImmutableArray.Builder builder, Func keySelector) + { + var compareHelper = new CompareHelper(comparer: null, descending: true); + return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray ToImmutableOrderedByDescending( + this ImmutableArray.Builder builder, Func keySelector, IComparer comparer) + { + var compareHelper = new CompareHelper(comparer, descending: true); + return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + } + + /// + /// Returns an immutable array that contains the current contents of this + /// sorted in descending order according to a key. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// Returns a new whose elements are sorted in descending order according to a key. + /// + public static ImmutableArray ToImmutableOrderedByDescending( + this ImmutableArray.Builder builder, Func keySelector, Comparison comparison) + { + var compareHelper = new CompareHelper(comparison, descending: true); + return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + } + + private static ImmutableArray ToImmutableOrderedCore(this ImmutableArray.Builder builder, ref readonly CompareHelper compareHelper) + { + if (builder.Count <= 1) + { + return builder.ToImmutable(); + } - var newArray = new TElement[length]; - items.CopyTo(newArray); + if (SortHelper.AreOrdered(builder, in compareHelper)) + { + // No need to sort - items are already ordered. + return builder.ToImmutable(); + } - var comparer = compareHelper.GetOrCreateComparer(); + var newArray = builder.ToArray(); + var comparer = compareHelper.GetOrCreateComparer(); - Array.Sort(keys.Array, newArray, 0, length, comparer); + Array.Sort(newArray, comparer); + + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + } - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + private static ImmutableArray ToImmutableOrderedByCore( + this ImmutableArray.Builder builder, Func keySelector, ref readonly CompareHelper compareHelper) + { + if (builder.Count <= 1) + { + return builder.ToImmutable(); } - return array; + var length = builder.Count; + + using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + + if (SortHelper.SelectKeys(builder, keySelector, in compareHelper, keys.Span)) + { + // No need to sort - keys are already ordered. + return builder.ToImmutable(); + } + + var newArray = builder.ToArray(); + var comparer = compareHelper.GetOrCreateComparer(); + + Array.Sort(keys.Array, newArray, 0, length, comparer); + + return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } } From b819e3f340f290aba56412a52f4ed33059fb5364 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 13 Aug 2024 14:40:32 +1000 Subject: [PATCH 087/386] Extract existing handler to a service --- .../DocumentSymbols/DocumentSymbolEndpoint.cs | 93 ++----------------- .../RazorLanguageServer.cs | 5 +- .../DocumentSymbols/DocumentSymbolService.cs | 88 ++++++++++++++++++ .../DocumentSymbols/IDocumentSymbolService.cs | 13 +++ .../DocumentSymbolEndpointTest.cs | 7 +- 5 files changed, 120 insertions(+), 86 deletions(-) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentSymbols/DocumentSymbolService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentSymbols/IDocumentSymbolService.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSymbols/DocumentSymbolEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSymbols/DocumentSymbolEndpoint.cs index 6a783934424..87c7da60572 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSymbols/DocumentSymbolEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSymbols/DocumentSymbolEndpoint.cs @@ -10,7 +10,9 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.Protocol.DocumentSymbols; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text.Tagging; @@ -18,21 +20,14 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentSymbols; [RazorLanguageServerEndpoint(Methods.TextDocumentDocumentSymbolName)] -internal class DocumentSymbolEndpoint : IRazorRequestHandler?>, ICapabilitiesProvider +internal class DocumentSymbolEndpoint( + IClientConnection clientConnection, + IDocumentSymbolService documentSymbolService, + LanguageServerFeatureOptions languageServerFeatureOptions) : IRazorRequestHandler?>, ICapabilitiesProvider { - private readonly IClientConnection _clientConnection; - private readonly IDocumentMappingService _documentMappingService; - private readonly LanguageServerFeatureOptions _languageServerFeatureOptions; - - public DocumentSymbolEndpoint( - IClientConnection clientConnection, - IDocumentMappingService documentMappingService, - LanguageServerFeatureOptions languageServerFeatureOptions) - { - _clientConnection = clientConnection ?? throw new ArgumentNullException(nameof(clientConnection)); - _documentMappingService = documentMappingService ?? throw new ArgumentNullException(nameof(documentMappingService)); - _languageServerFeatureOptions = languageServerFeatureOptions; - } + private readonly IClientConnection _clientConnection = clientConnection; + private readonly IDocumentSymbolService _documentSymbolService = documentSymbolService; + private readonly LanguageServerFeatureOptions _languageServerFeatureOptions = languageServerFeatureOptions; public bool MutatesSolutionState => false; @@ -76,74 +71,6 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentSymbolParams req var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); var csharpDocument = codeDocument.GetCSharpDocument(); - - if (symbols.TryGetFirst(out var documentSymbols)) - { - return RemapDocumentSymbols(csharpDocument, documentSymbols); - } - else if (symbols.TryGetSecond(out var symbolInformations)) - { - using var _ = ListPool.GetPooledObject(out var mappedSymbols); - - foreach (var symbolInformation in symbolInformations) - { - if (_documentMappingService.TryMapToHostDocumentRange(csharpDocument, symbolInformation.Location.Range, out var newRange)) - { - symbolInformation.Location.Range = newRange; - symbolInformation.Location.Uri = documentContext.Uri; - mappedSymbols.Add(symbolInformation); - } - } - - return mappedSymbols.ToArray(); - } - else - { - Debug.Fail("Unsupported response type"); - throw new InvalidOperationException(); - } - } - - private DocumentSymbol[]? RemapDocumentSymbols(RazorCSharpDocument csharpDocument, DocumentSymbol[]? documentSymbols) - { - if (documentSymbols is null) - { - return null; - } - - using var _ = ListPool.GetPooledObject(out var mappedSymbols); - - foreach (var documentSymbol in documentSymbols) - { - if (TryRemapRanges(csharpDocument, documentSymbol)) - { - documentSymbol.Children = RemapDocumentSymbols(csharpDocument, documentSymbol.Children); - - mappedSymbols.Add(documentSymbol); - } - else if (documentSymbol.Children is [_, ..] && - RemapDocumentSymbols(csharpDocument, documentSymbol.Children) is [_, ..] mappedChildren) - { - // This range didn't map, but some/all of its children did, so we promote them to this level so we don't - // lose any information. - mappedSymbols.AddRange(mappedChildren); - } - } - - return mappedSymbols.ToArray(); - - bool TryRemapRanges(RazorCSharpDocument csharpDocument, DocumentSymbol documentSymbol) - { - if (_documentMappingService.TryMapToHostDocumentRange(csharpDocument, documentSymbol.Range, out var newRange) && - _documentMappingService.TryMapToHostDocumentRange(csharpDocument, documentSymbol.SelectionRange, out var newSelectionRange)) - { - documentSymbol.Range = newRange; - documentSymbol.SelectionRange = newSelectionRange; - - return true; - } - - return false; - } + return _documentSymbolService.GetDocumentSymbols(documentContext.Uri, csharpDocument, symbols); } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index 3f8f6483676..78128ef764d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -26,6 +26,7 @@ using Microsoft.AspNetCore.Razor.Telemetry; using Microsoft.CodeAnalysis.Razor.FoldingRanges; using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Protocol.DocumentSymbols; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CommonLanguageServerProtocol.Framework; using Microsoft.Extensions.DependencyInjection; @@ -190,6 +191,9 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption services.AddSingleton(); services.AddHandlerWithCapabilities(); services.AddHandler(); + + services.AddHandlerWithCapabilities(); + services.AddSingleton(); } services.AddHandler(); @@ -203,7 +207,6 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); - services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentSymbols/DocumentSymbolService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentSymbols/DocumentSymbolService.cs new file mode 100644 index 00000000000..aafd371c38e --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentSymbols/DocumentSymbolService.cs @@ -0,0 +1,88 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Diagnostics; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentSymbols; + +internal class DocumentSymbolService(IDocumentMappingService documentMappingService) : IDocumentSymbolService +{ + private readonly IDocumentMappingService _documentMappingService = documentMappingService; + + public SumType? GetDocumentSymbols(Uri razorDocumentUri, RazorCSharpDocument csharpDocument, SumType csharpSymbols) + { + if (csharpSymbols.TryGetFirst(out var documentSymbols)) + { + return RemapDocumentSymbols(csharpDocument, documentSymbols); + } + else if (csharpSymbols.TryGetSecond(out var symbolInformations)) + { + using var _ = ListPool.GetPooledObject(out var mappedSymbols); + + foreach (var symbolInformation in symbolInformations) + { + if (_documentMappingService.TryMapToHostDocumentRange(csharpDocument, symbolInformation.Location.Range, out var newRange)) + { + symbolInformation.Location.Range = newRange; + symbolInformation.Location.Uri = razorDocumentUri; + mappedSymbols.Add(symbolInformation); + } + } + + return mappedSymbols.ToArray(); + } + else + { + Debug.Fail("Unsupported response type"); + throw new InvalidOperationException(); + } + } + + private DocumentSymbol[]? RemapDocumentSymbols(RazorCSharpDocument csharpDocument, DocumentSymbol[]? documentSymbols) + { + if (documentSymbols is null) + { + return null; + } + + using var _ = ListPool.GetPooledObject(out var mappedSymbols); + + foreach (var documentSymbol in documentSymbols) + { + if (TryRemapRanges(csharpDocument, documentSymbol)) + { + documentSymbol.Children = RemapDocumentSymbols(csharpDocument, documentSymbol.Children); + + mappedSymbols.Add(documentSymbol); + } + else if (documentSymbol.Children is [_, ..] && + RemapDocumentSymbols(csharpDocument, documentSymbol.Children) is [_, ..] mappedChildren) + { + // This range didn't map, but some/all of its children did, so we promote them to this level so we don't + // lose any information. + mappedSymbols.AddRange(mappedChildren); + } + } + + return mappedSymbols.ToArray(); + + bool TryRemapRanges(RazorCSharpDocument csharpDocument, DocumentSymbol documentSymbol) + { + if (_documentMappingService.TryMapToHostDocumentRange(csharpDocument, documentSymbol.Range, out var newRange) && + _documentMappingService.TryMapToHostDocumentRange(csharpDocument, documentSymbol.SelectionRange, out var newSelectionRange)) + { + documentSymbol.Range = newRange; + documentSymbol.SelectionRange = newSelectionRange; + + return true; + } + + return false; + } + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentSymbols/IDocumentSymbolService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentSymbols/IDocumentSymbolService.cs new file mode 100644 index 00000000000..065dfe32b04 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DocumentSymbols/IDocumentSymbolService.cs @@ -0,0 +1,13 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.CodeAnalysis.Razor.Protocol.DocumentSymbols; + +internal interface IDocumentSymbolService +{ + SumType? GetDocumentSymbols(Uri razorDocumentUri, RazorCSharpDocument csharpDocument, SumType csharpSymbols); +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs index f8cbf5683e3..aa245a725be 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.DocumentSymbols; using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Protocol.DocumentSymbols; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -83,7 +84,8 @@ public async Task DocumentSymbols_DisabledWhenNotSingleServer() // This test requires the SingleServerSupport to be disabled Assert.False(TestLanguageServerFeatureOptions.Instance.SingleServerSupport); - var endpoint = new DocumentSymbolEndpoint(languageServer, DocumentMappingService, TestLanguageServerFeatureOptions.Instance); + var documentSymbolService = new DocumentSymbolService(DocumentMappingService); + var endpoint = new DocumentSymbolEndpoint(languageServer, documentSymbolService, TestLanguageServerFeatureOptions.Instance); var serverCapabilities = new VSInternalServerCapabilities(); var clientCapabilities = new VSInternalClientCapabilities(); @@ -102,7 +104,8 @@ private async Task VerifyDocumentSymbolsAsync(string input, bool hierarchical = var languageServer = await CreateLanguageServerAsync(codeDocument, razorFilePath, capabilitiesUpdater: c => c.TextDocument!.DocumentSymbol = new DocumentSymbolSetting() { HierarchicalDocumentSymbolSupport = hierarchical }); - var endpoint = new DocumentSymbolEndpoint(languageServer, DocumentMappingService, TestLanguageServerFeatureOptions.Instance); + var documentSymbolService = new DocumentSymbolService(DocumentMappingService); + var endpoint = new DocumentSymbolEndpoint(languageServer, documentSymbolService, TestLanguageServerFeatureOptions.Instance); var request = new DocumentSymbolParams() { From 512b0d1d64e91913dcadcf7657f087ad6b830713 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 13 Aug 2024 16:43:03 +1000 Subject: [PATCH 088/386] Create OOP service and cohost endpoint --- eng/targets/Services.props | 1 + .../Remote/IRemoteDocumentSymbolService.cs | 14 +++ .../Remote/RazorServices.cs | 1 + .../OOPDocumentSymbolService.cs | 14 +++ .../RemoteDocumentSymbolService.cs | 59 +++++++++ .../Cohost/CohostDocumentSymbolEndpoint.cs | 75 +++++++++++ .../CohostDocumentSymbolEndpointTest.cs | 118 ++++++++++++++++++ 7 files changed, 282 insertions(+) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDocumentSymbolService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/OOPDocumentSymbolService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/RemoteDocumentSymbolService.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSymbolEndpoint.cs create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs diff --git a/eng/targets/Services.props b/eng/targets/Services.props index 747b8e2a392..eea36357a63 100644 --- a/eng/targets/Services.props +++ b/eng/targets/Services.props @@ -25,5 +25,6 @@ + diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDocumentSymbolService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDocumentSymbolService.cs new file mode 100644 index 00000000000..095033d8932 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDocumentSymbolService.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.CodeAnalysis.Razor.Remote; + +internal interface IRemoteDocumentSymbolService : IRemoteJsonService +{ + ValueTask?> GetDocumentSymbolsAsync(JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId documentId, bool useHierarchicalSymbols, CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs index 47d908d75ed..b2fd7618854 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs @@ -28,6 +28,7 @@ internal static class RazorServices [ (typeof(IRemoteSignatureHelpService), null), (typeof(IRemoteInlayHintService), null), + (typeof(IRemoteDocumentSymbolService), null), ]; private const string ComponentName = "Razor"; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/OOPDocumentSymbolService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/OOPDocumentSymbolService.cs new file mode 100644 index 00000000000..7da70f4ed75 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/OOPDocumentSymbolService.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Protocol.DocumentSymbols; + +namespace Microsoft.CodeAnalysis.Remote.Razor.DocumentSymbols; + +[Export(typeof(IDocumentSymbolService)), Shared] +[method: ImportingConstructor] +internal class OOPDocumentSymbolService(IDocumentMappingService documentMappingService) : DocumentSymbolService(documentMappingService) +{ +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/RemoteDocumentSymbolService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/RemoteDocumentSymbolService.cs new file mode 100644 index 00000000000..264adbeafbd --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/RemoteDocumentSymbolService.cs @@ -0,0 +1,59 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Protocol.DocumentSymbols; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; + +namespace Microsoft.CodeAnalysis.Remote.Razor; + +internal sealed partial class RemoteDocumentSymbolService(in ServiceArgs args) : RazorDocumentServiceBase(in args), IRemoteDocumentSymbolService +{ + internal sealed class Factory : FactoryBase + { + protected override IRemoteDocumentSymbolService CreateService(in ServiceArgs args) + => new RemoteDocumentSymbolService(in args); + } + + private readonly IDocumentSymbolService _documentSymbolService = args.ExportProvider.GetExportedValue(); + private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); + + public ValueTask?> GetDocumentSymbolsAsync(JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId razorDocumentId, bool useHierarchicalSymbols, CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + razorDocumentId, + context => GetDocumentSymbolsAsync(context, useHierarchicalSymbols, cancellationToken), + cancellationToken); + + private async ValueTask?> GetDocumentSymbolsAsync(RemoteDocumentContext context, bool useHierarchicalSymbols, CancellationToken cancellationToken) + { + var generatedDocument = await context.GetGeneratedDocumentAsync(_filePathService, cancellationToken).ConfigureAwait(false); + var csharpSymbols = await ExternalHandlers.DocumentSymbols.GetDocumentSymbolsAsync(generatedDocument, useHierarchicalSymbols, cancellationToken).ConfigureAwait(false); + + var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + var csharpDocument = codeDocument.GetCSharpDocument(); + + // This is, to say the least, not ideal. In future we're going to normalize on to Roslyn LSP types, and this can go. + var options = new JsonSerializerOptions(); + foreach (var converter in RazorServiceDescriptorsWrapper.GetLspConverters()) + { + options.Converters.Add(converter); + } + + var vsCSharpSymbols = JsonSerializer.Deserialize?>(JsonSerializer.SerializeToDocument(csharpSymbols), options); + if (vsCSharpSymbols is not { } convertedSymbols) + { + return null; + } + + return _documentSymbolService.GetDocumentSymbols(context.Uri, csharpDocument, convertedSymbols); + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSymbolEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSymbolEndpoint.cs new file mode 100644 index 00000000000..6cf79767d65 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSymbolEndpoint.cs @@ -0,0 +1,75 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(Methods.TextDocumentDocumentSymbolName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostDocumentSymbolEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostDocumentSymbolEndpoint(IRemoteServiceInvoker remoteServiceInvoker) + : AbstractRazorCohostDocumentRequestHandler?>, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + private bool _useHierarchicalSymbols; + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.TextDocument?.DocumentSymbol?.DynamicRegistration == true) + { + _useHierarchicalSymbols = clientCapabilities.TextDocument.DocumentSymbol.HierarchicalDocumentSymbolSupport; + + return new Registration + { + Method = Methods.TextDocumentDocumentSymbolName, + RegisterOptions = new DocumentSymbolRegistrationOptions() + { + DocumentSelector = filter + } + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(DocumentSymbolParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task?> HandleRequestAsync(DocumentSymbolParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(context.TextDocument.AssumeNotNull(), _useHierarchicalSymbols, cancellationToken); + + private async Task?> HandleRequestAsync(TextDocument razorDocument, bool useHierarchicalSymbols, CancellationToken cancellationToken) + { + // Normally we could remove the await here, but in this case it neatly converts from ValueTask to Task for us, + // and more importantly this method is essentially a public API entry point (via LSP) so having it appear in + // call stacks is desirable + return await _remoteServiceInvoker.TryInvokeAsync?>( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => service.GetDocumentSymbolsAsync(solutionInfo, razorDocument.Id, useHierarchicalSymbols, cancellationToken), + cancellationToken).ConfigureAwait(false); + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostDocumentSymbolEndpoint instance) + { + public Task?> HandleRequestAsync(TextDocument razorDocument, bool useHierarchicalSymbols, CancellationToken cancellationToken) + => instance.HandleRequestAsync(razorDocument, useHierarchicalSymbols, cancellationToken); + } +} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs new file mode 100644 index 00000000000..0f008bc6ef2 --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs @@ -0,0 +1,118 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis.Testing; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +public class CohostDocumentSymbolEndpointTest(ITestOutputHelper testOutput) : CohostEndpointTestBase(testOutput) +{ + [Theory] + [CombinatorialData] + public Task DocumentSymbols_CSharpClassWithMethods(bool hierarchical) + => VerifyDocumentSymbolsAsync( + """ + @functions { + class {|SomeProject.File1.C:C|} + { + private void {|HandleString(string s):HandleString|}(string s) + { + s += "Hello"; + } + + private void {|M(int i):M|}(int i) + { + i++; + } + + private string {|ObjToString(object o):ObjToString|}(object o) + { + return o.ToString(); + } + } + } + + """, hierarchical); + + [Theory] + [CombinatorialData] + public Task DocumentSymbols_CSharpMethods(bool hierarchical) + => VerifyDocumentSymbolsAsync( + """ + @functions { + private void {|HandleString(string s):HandleString|}(string s) + { + s += "Hello"; + } + + private void {|M(int i):M|}(int i) + { + i++; + } + + private string {|ObjToString(object o):ObjToString|}(object o) + { + return o.ToString(); + } + } + + """, hierarchical); + + private async Task VerifyDocumentSymbolsAsync(string input, bool hierarchical = false) + { + TestFileMarkupParser.GetSpans(input, out input, out ImmutableDictionary> spansDict); + var document = CreateProjectAndRazorDocument(input); + + var endpoint = new CohostDocumentSymbolEndpoint(RemoteServiceInvoker); + + var result = await endpoint.GetTestAccessor().HandleRequestAsync(document, hierarchical, DisposalToken); + + if (hierarchical) + { + var documentSymbols = result.Value.First; + var sourceText = SourceText.From(input); + var seen = 0; + + VerifyDocumentSymbols(spansDict, documentSymbols, sourceText, ref seen); + + Assert.Equal(spansDict.Values.Count(), seen); + } + else + { + var symbolsInformations = result.Value.Second; + Assert.Equal(spansDict.Values.Count(), symbolsInformations.Length); + + var sourceText = SourceText.From(input); + foreach (var symbolInformation in symbolsInformations) + { + Assert.True(spansDict.TryGetValue(symbolInformation.Name, out var spans), $"Expected {symbolInformation.Name} to be in test provided markers"); + var expectedRange = sourceText.GetRange(Assert.Single(spans)); + Assert.Equal(expectedRange, symbolInformation.Location.Range); + } + } + } + + private static void VerifyDocumentSymbols(ImmutableDictionary> spansDict, DocumentSymbol[] documentSymbols, SourceText sourceText, ref int seen) + { + foreach (var symbol in documentSymbols) + { + seen++; + Assert.True(spansDict.TryGetValue(symbol.Detail.AssumeNotNull(), out var spans), $"Expected {symbol.Detail} to be in test provided markers"); + var expectedRange = sourceText.GetRange(Assert.Single(spans)); + Assert.Equal(expectedRange, symbol.SelectionRange); + + if (symbol.Children is not null) + { + VerifyDocumentSymbols(spansDict, symbol.Children, sourceText, ref seen); + } + } + } +} From 335c77534a41a44147af219286096bcd8b50912d Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 13 Aug 2024 08:32:15 -0700 Subject: [PATCH 089/386] Don't copy IEnumerable elements twice --- .../EnumerableExtensions.cs | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs index 760145ee49d..779779fab4a 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs @@ -81,7 +81,7 @@ public static bool TryGetCount(this IEnumerable sequence, out int count) /// public static void CopyTo(this IEnumerable sequence, Span destination) { - // Check a couple of common cases. + // First, check a few common cases. switch (sequence) { // We specifically test ImmutableArray to avoid boxing it as an IReadOnlyList. @@ -98,28 +98,35 @@ public static void CopyTo(this IEnumerable sequence, Span destination) case IReadOnlyList list: list.CopyTo(destination); break; + + default: + CopySequence(sequence, destination); + break; } - if (sequence.TryGetCount(out var count)) + static void CopySequence(IEnumerable sequence, Span destination) { - ArgHelper.ThrowIfDestinationTooShort(destination, count); + if (sequence.TryGetCount(out var count)) + { + ArgHelper.ThrowIfDestinationTooShort(destination, count); - var index = 0; + var index = 0; - foreach (var item in sequence) - { - destination[index++] = item; + foreach (var item in sequence) + { + destination[index++] = item; + } } - } - else - { - var index = 0; - - foreach (var item in sequence) + else { - ArgHelper.ThrowIfDestinationTooShort(destination, index + 1); + var index = 0; + + foreach (var item in sequence) + { + ArgHelper.ThrowIfDestinationTooShort(destination, index + 1); - destination[index++] = item; + destination[index++] = item; + } } } } From b64bf6c5f4d0eb82e85df7c14932cd969c5d7076 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 13 Aug 2024 08:59:36 -0700 Subject: [PATCH 090/386] Simplify CompareHelper This change removes two bool state fields from CompareHelper and simplifies its conditional logic. --- .../Utilities/CompareHelper`1.cs | 44 +++++-------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs index ae7d9159d1b..63f232f8cab 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Runtime.CompilerServices; namespace Microsoft.AspNetCore.Razor.Utilities; @@ -12,60 +13,39 @@ namespace Microsoft.AspNetCore.Razor.Utilities; internal readonly ref struct CompareHelper { private readonly IComparer _comparer; - private readonly Comparison _comparison; - private readonly bool _comparerSpecified; - private readonly bool _useComparer; + private readonly Comparison? _comparison; private readonly bool _descending; public CompareHelper(IComparer? comparer, bool descending) { - _comparerSpecified = comparer is not null; _comparer = comparer ?? Comparer.Default; - _useComparer = true; + _comparison = null; _descending = descending; - _comparison = null!; } public CompareHelper(Comparison comparison, bool descending) { + _comparer = null!; // This value will never be used when _comparison is non-null. _comparison = comparison; - _useComparer = false; _descending = descending; - _comparer = null!; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool InSortedOrder(T? x, T? y) { // We assume that x and y are in sorted order if x is > y. - // We don't consider x == y to be sorted because the actual sor + // We don't consider x == y to be sorted because the actual sort // might not be stable, depending on T. - return _useComparer + return _comparison is null ? !_descending ? _comparer.Compare(x!, y!) > 0 : _comparer.Compare(y!, x!) > 0 : !_descending ? _comparison(x!, y!) > 0 : _comparison(y!, x!) > 0; } public IComparer GetOrCreateComparer() - // There are six cases to consider. - => (_useComparer, _comparerSpecified, _descending) switch - { - // Provided a comparer and the results are in ascending order. - (true, true, false) => _comparer, - - // Provided a comparer and the results are in descending order. - (true, true, true) => DescendingComparer.Create(_comparer), - - // Not provided a comparer and the results are in ascending order. - // In this case, _comparer was already set to Comparer.Default. - (true, false, false) => _comparer, - - // Not provided a comparer and the results are in descending order. - (true, false, true) => DescendingComparer.Default, - - // Provided a comparison delegate and the results are in ascending order. - (false, _, false) => Comparer.Create(_comparison), - - // Provided a comparison delegate and the results are in descending order. - (false, _, true) => DescendingComparer.Create(_comparison) - }; + { + return _comparison is null + ? !_descending ? _comparer : DescendingComparer.Create(_comparer) + : !_descending ? Comparer.Create(_comparison) : DescendingComparer.Create(_comparison); + } } From 17cbe2e7ee104132f02a0ac9011d8a20d8b4e4cb Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 13 Aug 2024 15:21:57 -0700 Subject: [PATCH 091/386] Use stable sort for the OrderAsArray extensions Because the sort performed by Enumerable.Order(...) and Enumerable.OrderBy(...) is stable, we need to do the same in the OrderAsArray* extension methods. This requires a pretty substantial change to compare indices in addition to values. --- .../EnumerableExtensionsTests.cs | 99 +++++++++ .../ImmutableArrayExtensionsTests.cs | 99 +++++++++ .../ReadOnlyListExtensionsTests.cs | 99 +++++++++ .../StringHolder.cs | 61 ++++++ .../EnumerableExtensions.cs | 75 +++---- .../ImmutableArrayExtensions.cs | 162 +++++--------- .../ImmutableArrayExtensions_Unsafe.cs | 84 +++---- .../ReadOnlyListExtensions.cs | 83 +++---- .../Utilities/CompareHelper`1.cs | 51 ----- .../Utilities/DescendingComparer`1.cs | 34 --- .../Utilities/SortComparer`1.cs | 77 +++++++ .../Utilities/SortHelper.cs | 130 ----------- .../Utilities/SortHelper`1.cs | 207 ++++++++++++++++++ .../Utilities/SortKey`1.cs | 13 ++ 14 files changed, 807 insertions(+), 467 deletions(-) create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/StringHolder.cs delete mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs delete mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/DescendingComparer`1.cs create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortComparer`1.cs delete mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper.cs create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper`1.cs create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortKey`1.cs diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs index 133fa663970..fd5f276ea83 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/EnumerableExtensionsTests.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; +using System.Linq; using System.Runtime.CompilerServices; using Xunit; using SR = Microsoft.AspNetCore.Razor.Utilities.Shared.Resources.SR; @@ -298,4 +299,102 @@ public void OrderByDescendingAsArray_OddBeforeEven(IEnumerable data var sorted = data.OrderByDescendingAsArray(static x => x.Value, OddBeforeEven); Assert.Equal(expected, sorted); } + +#if NET // Enumerable.Order(...) and Enumerable.OrderDescending(...) were introduced in .NET 7 + + [Fact] + public void OrderAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.Order(), + testFunction: data => data.OrderAsArray()); + } + + [Fact] + public void OrderAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.Order(StringHolder.Comparer.Ordinal), + testFunction: data => data.OrderAsArray(StringHolder.Comparer.Ordinal)); + + OrderAndAssertStableSort( + linqFunction: data => data.Order(StringHolder.Comparer.OrdinalIgnoreCase), + testFunction: data => data.OrderAsArray(StringHolder.Comparer.OrdinalIgnoreCase)); + } + + [Fact] + public void OrderDescendingAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(), + testFunction: data => data.OrderDescendingAsArray()); + } + + [Fact] + public void OrderDescendingAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(StringHolder.Comparer.Ordinal), + testFunction: data => data.OrderDescendingAsArray(StringHolder.Comparer.Ordinal)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(StringHolder.Comparer.OrdinalIgnoreCase), + testFunction: data => data.OrderDescendingAsArray(StringHolder.Comparer.OrdinalIgnoreCase)); + } + +#endif + + [Fact] + public void OrderByAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text), + testFunction: data => data.OrderByAsArray(static x => x?.Text)); + } + + [Fact] + public void OrderByAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + } + + [Fact] + public void OrderByDescendingAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text)); + } + + [Fact] + public void OrderByDescendingAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + } + + private static void OrderAndAssertStableSort( + Func, IEnumerable> linqFunction, + Func, ImmutableArray> testFunction) + { + IEnumerable data = [ + "All", "Your", "Base", "Are", "belong", null, "To", "Us", + "all", "your", null, "Base", "are", "belong", "to", "us"]; + + var expected = linqFunction(data); + var actual = testFunction(data); + + Assert.Equal(expected, actual, ReferenceEquals); + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs index 50196817cf7..9769ce16662 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Linq; using System.Runtime.InteropServices; using Xunit; @@ -612,4 +613,102 @@ public void UnsafeOrderByDescending_OddBeforeEven(ImmutableArray da sorted.Unsafe().OrderByDescending(static x => x.Value, OddBeforeEven); Assert.Equal(expected, sorted); } + +#if NET // Enumerable.Order(...) and Enumerable.OrderDescending(...) were introduced in .NET 7 + + [Fact] + public void OrderAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.Order(), + testFunction: data => data.OrderAsArray()); + } + + [Fact] + public void OrderAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.Order(StringHolder.Comparer.Ordinal), + testFunction: data => data.OrderAsArray(StringHolder.Comparer.Ordinal)); + + OrderAndAssertStableSort( + linqFunction: data => data.Order(StringHolder.Comparer.OrdinalIgnoreCase), + testFunction: data => data.OrderAsArray(StringHolder.Comparer.OrdinalIgnoreCase)); + } + + [Fact] + public void OrderDescendingAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(), + testFunction: data => data.OrderDescendingAsArray()); + } + + [Fact] + public void OrderDescendingAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(StringHolder.Comparer.Ordinal), + testFunction: data => data.OrderDescendingAsArray(StringHolder.Comparer.Ordinal)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(StringHolder.Comparer.OrdinalIgnoreCase), + testFunction: data => data.OrderDescendingAsArray(StringHolder.Comparer.OrdinalIgnoreCase)); + } + +#endif + + [Fact] + public void OrderByAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text), + testFunction: data => data.OrderByAsArray(static x => x?.Text)); + } + + [Fact] + public void OrderByAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + } + + [Fact] + public void OrderByDescendingAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text)); + } + + [Fact] + public void OrderByDescendingAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + } + + private static void OrderAndAssertStableSort( + Func, IEnumerable> linqFunction, + Func, ImmutableArray> testFunction) + { + ImmutableArray data = [ + "All", "Your", "Base", "Are", "belong", null, "To", "Us", + "all", "your", null, "Base", "are", "belong", "to", "us"]; + + var expected = linqFunction(data); + var actual = testFunction(data); + + Assert.Equal(expected, actual, ReferenceEquals); + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs index adc2f7d2cb2..30a6b4920ba 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ReadOnlyListExtensionsTests.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; +using System.Linq; using System.Runtime.CompilerServices; using Xunit; using SR = Microsoft.AspNetCore.Razor.Utilities.Shared.Resources.SR; @@ -507,4 +508,102 @@ public void OrderByDescendingAsArray_Enumerable_OddBeforeEven(IReadOnlyList x.Value, OddBeforeEven); Assert.Equal(expected, sorted); } + +#if NET // Enumerable.Order(...) and Enumerable.OrderDescending(...) were introduced in .NET 7 + + [Fact] + public void OrderAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.Order(), + testFunction: data => data.OrderAsArray()); + } + + [Fact] + public void OrderAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.Order(StringHolder.Comparer.Ordinal), + testFunction: data => data.OrderAsArray(StringHolder.Comparer.Ordinal)); + + OrderAndAssertStableSort( + linqFunction: data => data.Order(StringHolder.Comparer.OrdinalIgnoreCase), + testFunction: data => data.OrderAsArray(StringHolder.Comparer.OrdinalIgnoreCase)); + } + + [Fact] + public void OrderDescendingAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(), + testFunction: data => data.OrderDescendingAsArray()); + } + + [Fact] + public void OrderDescendingAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(StringHolder.Comparer.Ordinal), + testFunction: data => data.OrderDescendingAsArray(StringHolder.Comparer.Ordinal)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderDescending(StringHolder.Comparer.OrdinalIgnoreCase), + testFunction: data => data.OrderDescendingAsArray(StringHolder.Comparer.OrdinalIgnoreCase)); + } + +#endif + + [Fact] + public void OrderByAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text), + testFunction: data => data.OrderByAsArray(static x => x?.Text)); + } + + [Fact] + public void OrderByAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderBy(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + } + + [Fact] + public void OrderByDescendingAsArray_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text)); + } + + [Fact] + public void OrderByDescendingAsArray_Comparer_IsStable() + { + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + + OrderAndAssertStableSort( + linqFunction: data => data.OrderByDescending(static x => x?.Text, StringComparer.OrdinalIgnoreCase), + testFunction: data => data.OrderByDescendingAsArray(static x => x?.Text, StringComparer.OrdinalIgnoreCase)); + } + + private static void OrderAndAssertStableSort( + Func, IEnumerable> linqFunction, + Func, ImmutableArray> testFunction) + { + IReadOnlyList data = [ + "All", "Your", "Base", "Are", "belong", null, "To", "Us", + "all", "your", null, "Base", "are", "belong", "to", "us"]; + + var expected = linqFunction(data); + var actual = testFunction(data); + + Assert.Equal(expected, actual, ReferenceEquals); + } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/StringHolder.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/StringHolder.cs new file mode 100644 index 00000000000..1eb80d369de --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/StringHolder.cs @@ -0,0 +1,61 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.AspNetCore.Razor.Utilities.Shared.Test; + +public sealed class StringHolder(string? text) : IComparable +{ + public string? Text => text; + + public int CompareTo(StringHolder? other) + { + if (other is null) + { + return 1; + } + + return string.CompareOrdinal(Text, other.Text); + } + + public override string ToString() => Text ?? string.Empty; + + public static implicit operator StringHolder(string? text) + => new(text); + + public sealed class Comparer : IComparer + { + public static readonly IComparer Ordinal = new Comparer(StringComparer.Ordinal); + public static readonly IComparer OrdinalIgnoreCase = new Comparer(StringComparer.OrdinalIgnoreCase); + + private readonly StringComparer _comparer; + + private Comparer(StringComparer comparer) + { + _comparer = comparer; + } + + public int Compare(StringHolder? x, StringHolder? y) + { + if (x is null) + { + if (y is not null) + { + return 1; + } + else + { + return 0; + } + } + else if (y is null) + { + return -1; + } + + return _comparer.Compare(x.Text, y.Text); + } + } +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs index 779779fab4a..002647660cb 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Buffers; using System.Collections.Immutable; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor; @@ -151,8 +150,8 @@ public static ImmutableArray OrderAsArray(this IEnumerable sequence) return ReadOnlyListExtensions.OrderAsArray(list); } - var compareHelper = new CompareHelper(comparer: null, descending: false); - return sequence.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + return sequence.OrderAsArrayCore(in sortHelper); } /// @@ -176,8 +175,8 @@ public static ImmutableArray OrderAsArray(this IEnumerable sequence, IC return ReadOnlyListExtensions.OrderAsArray(list, comparer); } - var compareHelper = new CompareHelper(comparer, descending: false); - return sequence.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + return sequence.OrderAsArrayCore(in sortHelper); } /// @@ -201,8 +200,8 @@ public static ImmutableArray OrderAsArray(this IEnumerable sequence, Co return ReadOnlyListExtensions.OrderAsArray(list, comparison); } - var compareHelper = new CompareHelper(comparison, descending: false); - return sequence.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + return sequence.OrderAsArrayCore(in sortHelper); } /// @@ -225,8 +224,8 @@ public static ImmutableArray OrderDescendingAsArray(this IEnumerable se return ReadOnlyListExtensions.OrderDescendingAsArray(list); } - var compareHelper = new CompareHelper(comparer: null, descending: true); - return sequence.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + return sequence.OrderAsArrayCore(in sortHelper); } /// @@ -250,8 +249,8 @@ public static ImmutableArray OrderDescendingAsArray(this IEnumerable se return ReadOnlyListExtensions.OrderDescendingAsArray(list, comparer); } - var compareHelper = new CompareHelper(comparer, descending: true); - return sequence.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + return sequence.OrderAsArrayCore(in sortHelper); } /// @@ -275,8 +274,8 @@ public static ImmutableArray OrderDescendingAsArray(this IEnumerable se return ReadOnlyListExtensions.OrderDescendingAsArray(list, comparison); } - var compareHelper = new CompareHelper(comparison, descending: true); - return sequence.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + return sequence.OrderAsArrayCore(in sortHelper); } /// @@ -302,8 +301,8 @@ public static ImmutableArray OrderByAsArray( return ReadOnlyListExtensions.OrderByAsArray(list, keySelector); } - var compareHelper = new CompareHelper(comparer: null, descending: false); - return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + return sequence.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -330,8 +329,8 @@ public static ImmutableArray OrderByAsArray( return ReadOnlyListExtensions.OrderByAsArray(list, keySelector, comparer); } - var compareHelper = new CompareHelper(comparer, descending: false); - return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + return sequence.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -358,8 +357,8 @@ public static ImmutableArray OrderByAsArray( return ReadOnlyListExtensions.OrderByAsArray(list, keySelector, comparison); } - var compareHelper = new CompareHelper(comparison, descending: false); - return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + return sequence.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -385,8 +384,8 @@ public static ImmutableArray OrderByDescendingAsArray( return ReadOnlyListExtensions.OrderByDescendingAsArray(list, keySelector); } - var compareHelper = new CompareHelper(comparer: null, descending: true); - return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + return sequence.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -413,8 +412,8 @@ public static ImmutableArray OrderByDescendingAsArray( return ReadOnlyListExtensions.OrderByDescendingAsArray(list, keySelector, comparer); } - var compareHelper = new CompareHelper(comparer, descending: true); - return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + return sequence.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -441,29 +440,15 @@ public static ImmutableArray OrderByDescendingAsArray( return ReadOnlyListExtensions.OrderByDescendingAsArray(list, keySelector, comparison); } - var compareHelper = new CompareHelper(comparison, descending: true); - return sequence.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + return sequence.OrderByAsArrayCore(keySelector, in sortHelper); } - private static ImmutableArray OrderAsArrayCore(this IEnumerable sequence, ref readonly CompareHelper compareHelper) - { - var newArray = BuildArray(sequence); - - if (newArray.Length <= 1 || SortHelper.AreOrdered(newArray.AsSpan(), in compareHelper)) - { - // No need to sort - items are already ordered. - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); - } - - var comparer = compareHelper.GetOrCreateComparer(); - - Array.Sort(newArray, comparer); - - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); - } + private static ImmutableArray OrderAsArrayCore(this IEnumerable sequence, ref readonly SortHelper sortHelper) + => sequence.OrderByAsArrayCore(SortHelper.IdentityFunc, in sortHelper); private static ImmutableArray OrderByAsArrayCore( - this IEnumerable sequence, Func keySelector, ref readonly CompareHelper compareHelper) + this IEnumerable sequence, Func keySelector, ref readonly SortHelper sortHelper) { var newArray = BuildArray(sequence); @@ -474,15 +459,15 @@ private static ImmutableArray OrderByAsArrayCore( var length = newArray.Length; - using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + using var keys = SortKey.GetPooledArray(minimumLength: length); - if (SortHelper.SelectKeys(newArray.AsSpan(), keySelector, in compareHelper, keys.Span)) + if (sortHelper.ComputeKeys(newArray.AsSpan(), keySelector, keys.Span)) { // No need to sort - keys are already ordered. return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } - var comparer = compareHelper.GetOrCreateComparer(); + var comparer = sortHelper.GetOrCreateComparer(); Array.Sort(keys.Array, newArray, 0, length, comparer); diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index d199ccd7512..548724e337b 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Buffers; using System.Collections.Generic; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor.PooledObjects; @@ -186,8 +185,8 @@ public static int BinarySearchBy(this ImmutableArray array, TArg arg /// public static ImmutableArray OrderAsArray(this ImmutableArray array) { - var compareHelper = new CompareHelper(comparer: null, descending: false); - return array.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + return array.OrderAsArrayCore(in sortHelper); } /// @@ -201,8 +200,8 @@ public static ImmutableArray OrderAsArray(this ImmutableArray array) /// public static ImmutableArray OrderAsArray(this ImmutableArray array, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: false); - return array.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + return array.OrderAsArrayCore(in sortHelper); } /// @@ -216,8 +215,8 @@ public static ImmutableArray OrderAsArray(this ImmutableArray array, IC /// public static ImmutableArray OrderAsArray(this ImmutableArray array, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: false); - return array.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + return array.OrderAsArrayCore(in sortHelper); } /// @@ -230,8 +229,8 @@ public static ImmutableArray OrderAsArray(this ImmutableArray array, Co /// public static ImmutableArray OrderDescendingAsArray(this ImmutableArray array) { - var compareHelper = new CompareHelper(comparer: null, descending: true); - return array.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + return array.OrderAsArrayCore(in sortHelper); } /// @@ -245,8 +244,8 @@ public static ImmutableArray OrderDescendingAsArray(this ImmutableArray /// public static ImmutableArray OrderDescendingAsArray(this ImmutableArray array, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: true); - return array.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + return array.OrderAsArrayCore(in sortHelper); } /// @@ -260,8 +259,8 @@ public static ImmutableArray OrderDescendingAsArray(this ImmutableArray /// public static ImmutableArray OrderDescendingAsArray(this ImmutableArray array, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: true); - return array.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + return array.OrderAsArrayCore(in sortHelper); } /// @@ -277,8 +276,8 @@ public static ImmutableArray OrderDescendingAsArray(this ImmutableArray public static ImmutableArray OrderByAsArray( this ImmutableArray array, Func keySelector) { - var compareHelper = new CompareHelper(comparer: null, descending: false); - return array.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + return array.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -295,8 +294,8 @@ public static ImmutableArray OrderByAsArray( public static ImmutableArray OrderByAsArray( this ImmutableArray array, Func keySelector, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: false); - return array.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + return array.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -313,8 +312,8 @@ public static ImmutableArray OrderByAsArray( public static ImmutableArray OrderByAsArray( this ImmutableArray array, Func keySelector, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: false); - return array.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + return array.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -330,8 +329,8 @@ public static ImmutableArray OrderByAsArray( public static ImmutableArray OrderByDescendingAsArray( this ImmutableArray array, Func keySelector) { - var compareHelper = new CompareHelper(comparer: null, descending: true); - return array.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + return array.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -348,8 +347,8 @@ public static ImmutableArray OrderByDescendingAsArray( public static ImmutableArray OrderByDescendingAsArray( this ImmutableArray array, Func keySelector, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: true); - return array.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + return array.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -366,38 +365,15 @@ public static ImmutableArray OrderByDescendingAsArray( public static ImmutableArray OrderByDescendingAsArray( this ImmutableArray array, Func keySelector, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: true); - return array.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + return array.OrderByAsArrayCore(keySelector, in sortHelper); } - private static ImmutableArray OrderAsArrayCore(this ImmutableArray array, ref readonly CompareHelper compareHelper) - { - if (array.Length <= 1) - { - return array; - } - - var items = array.AsSpan(); - - if (SortHelper.AreOrdered(items, in compareHelper)) - { - // No need to sort - items are already ordered. - return array; - } - - var length = items.Length; - var newArray = new T[length]; - items.CopyTo(newArray); - - var comparer = compareHelper.GetOrCreateComparer(); - - Array.Sort(newArray, comparer); - - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); - } + private static ImmutableArray OrderAsArrayCore(this ImmutableArray array, ref readonly SortHelper sortHelper) + => array.OrderByAsArrayCore(SortHelper.IdentityFunc, in sortHelper); private static ImmutableArray OrderByAsArrayCore( - this ImmutableArray array, Func keySelector, ref readonly CompareHelper compareHelper) + this ImmutableArray array, Func keySelector, ref readonly SortHelper sortHelper) { if (array.Length <= 1) { @@ -407,9 +383,9 @@ private static ImmutableArray OrderByAsArrayCore( var items = array.AsSpan(); var length = items.Length; - using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + using var keys = SortKey.GetPooledArray(minimumLength: length); - if (SortHelper.SelectKeys(items, keySelector, in compareHelper, keys.Span)) + if (sortHelper.ComputeKeys(items, keySelector, keys.Span)) { // No need to sort - keys are already ordered. return array; @@ -418,7 +394,7 @@ private static ImmutableArray OrderByAsArrayCore( var newArray = new TElement[length]; items.CopyTo(newArray); - var comparer = compareHelper.GetOrCreateComparer(); + var comparer = sortHelper.GetOrCreateComparer(); Array.Sort(keys.Array, newArray, 0, length, comparer); @@ -437,8 +413,8 @@ private static ImmutableArray OrderByAsArrayCore( /// public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder) { - var compareHelper = new CompareHelper(comparer: null, descending: false); - return builder.ToImmutableOrderedCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + return builder.ToImmutableOrderedCore(in sortHelper); } /// @@ -454,8 +430,8 @@ public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Bui /// public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: false); - return builder.ToImmutableOrderedCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + return builder.ToImmutableOrderedCore(in sortHelper); } /// @@ -471,8 +447,8 @@ public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Bui /// public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: false); - return builder.ToImmutableOrderedCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + return builder.ToImmutableOrderedCore(in sortHelper); } /// @@ -487,8 +463,8 @@ public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Bui /// public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder) { - var compareHelper = new CompareHelper(comparer: null, descending: true); - return builder.ToImmutableOrderedCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + return builder.ToImmutableOrderedCore(in sortHelper); } /// @@ -504,8 +480,8 @@ public static ImmutableArray ToImmutableOrderedDescending(this ImmutableAr /// public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: true); - return builder.ToImmutableOrderedCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + return builder.ToImmutableOrderedCore(in sortHelper); } /// @@ -521,8 +497,8 @@ public static ImmutableArray ToImmutableOrderedDescending(this ImmutableAr /// public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: true); - return builder.ToImmutableOrderedCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + return builder.ToImmutableOrderedCore(in sortHelper); } /// @@ -539,8 +515,8 @@ public static ImmutableArray ToImmutableOrderedDescending(this ImmutableAr public static ImmutableArray ToImmutableOrderedBy( this ImmutableArray.Builder builder, Func keySelector) { - var compareHelper = new CompareHelper(comparer: null, descending: false); - return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); } /// @@ -558,8 +534,8 @@ public static ImmutableArray ToImmutableOrderedBy( public static ImmutableArray ToImmutableOrderedBy( this ImmutableArray.Builder builder, Func keySelector, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: false); - return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); } /// @@ -577,8 +553,8 @@ public static ImmutableArray ToImmutableOrderedBy( public static ImmutableArray ToImmutableOrderedBy( this ImmutableArray.Builder builder, Func keySelector, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: false); - return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); } /// @@ -595,8 +571,8 @@ public static ImmutableArray ToImmutableOrderedBy( public static ImmutableArray ToImmutableOrderedByDescending( this ImmutableArray.Builder builder, Func keySelector) { - var compareHelper = new CompareHelper(comparer: null, descending: true); - return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); } /// @@ -614,8 +590,8 @@ public static ImmutableArray ToImmutableOrderedByDescending ToImmutableOrderedByDescending( this ImmutableArray.Builder builder, Func keySelector, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: true); - return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); } /// @@ -633,33 +609,15 @@ public static ImmutableArray ToImmutableOrderedByDescending ToImmutableOrderedByDescending( this ImmutableArray.Builder builder, Func keySelector, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: true); - return builder.ToImmutableOrderedByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); } - private static ImmutableArray ToImmutableOrderedCore(this ImmutableArray.Builder builder, ref readonly CompareHelper compareHelper) - { - if (builder.Count <= 1) - { - return builder.ToImmutable(); - } - - if (SortHelper.AreOrdered(builder, in compareHelper)) - { - // No need to sort - items are already ordered. - return builder.ToImmutable(); - } - - var newArray = builder.ToArray(); - var comparer = compareHelper.GetOrCreateComparer(); - - Array.Sort(newArray, comparer); - - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); - } + private static ImmutableArray ToImmutableOrderedCore(this ImmutableArray.Builder builder, ref readonly SortHelper sortHelper) + => builder.ToImmutableOrderedByCore(SortHelper.IdentityFunc, in sortHelper); private static ImmutableArray ToImmutableOrderedByCore( - this ImmutableArray.Builder builder, Func keySelector, ref readonly CompareHelper compareHelper) + this ImmutableArray.Builder builder, Func keySelector, ref readonly SortHelper sortHelper) { if (builder.Count <= 1) { @@ -668,16 +626,16 @@ private static ImmutableArray ToImmutableOrderedByCore var length = builder.Count; - using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + using var keys = SortKey.GetPooledArray(minimumLength: length); - if (SortHelper.SelectKeys(builder, keySelector, in compareHelper, keys.Span)) + if (sortHelper.ComputeKeys(builder, keySelector, keys.Span)) { // No need to sort - keys are already ordered. return builder.ToImmutable(); } var newArray = builder.ToArray(); - var comparer = compareHelper.GetOrCreateComparer(); + var comparer = sortHelper.GetOrCreateComparer(); Array.Sort(keys.Array, newArray, 0, length, comparer); diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs index ca2df33a120..e42d5c32051 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Buffers; using System.Collections.Generic; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor.Utilities; @@ -31,8 +30,8 @@ public readonly ref struct UnsafeOperations(ImmutableArray array) /// public void Order() { - var compareHelper = new CompareHelper(comparer: null, descending: false); - array.UnsafeOrderCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + array.UnsafeOrderCore(in sortHelper); } /// @@ -41,8 +40,8 @@ public void Order() /// An to compare elements. public void Order(IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: false); - array.UnsafeOrderCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + array.UnsafeOrderCore(in sortHelper); } /// @@ -51,8 +50,8 @@ public void Order(IComparer comparer) /// A to compare elements. public void Order(Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: false); - array.UnsafeOrderCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + array.UnsafeOrderCore(in sortHelper); } /// @@ -60,8 +59,8 @@ public void Order(Comparison comparison) /// public void OrderDescending() { - var compareHelper = new CompareHelper(comparer: null, descending: true); - array.UnsafeOrderCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + array.UnsafeOrderCore(in sortHelper); } /// @@ -70,8 +69,8 @@ public void OrderDescending() /// An to compare elements. public void OrderDescending(IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: true); - array.UnsafeOrderCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + array.UnsafeOrderCore(in sortHelper); } /// @@ -80,8 +79,8 @@ public void OrderDescending(IComparer comparer) /// A to compare elements. public void OrderDescending(Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: true); - array.UnsafeOrderCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + array.UnsafeOrderCore(in sortHelper); } /// @@ -91,8 +90,8 @@ public void OrderDescending(Comparison comparison) /// A function to extract a key from an element. public void OrderBy(Func keySelector) { - var compareHelper = new CompareHelper(comparer: null, descending: false); - array.UnsafeOrderByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + array.UnsafeOrderByCore(keySelector, in sortHelper); } /// @@ -103,8 +102,8 @@ public void OrderBy(Func keySelector) /// An to compare elements. public void OrderBy(Func keySelector, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: false); - array.UnsafeOrderByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + array.UnsafeOrderByCore(keySelector, in sortHelper); } /// @@ -115,8 +114,8 @@ public void OrderBy(Func keySelector, IComparer comparer) /// An to compare elements. public void OrderBy(Func keySelector, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: false); - array.UnsafeOrderByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + array.UnsafeOrderByCore(keySelector, in sortHelper); } /// @@ -126,8 +125,8 @@ public void OrderBy(Func keySelector, Comparison comparison /// A function to extract a key from an element. public void OrderByDescending(Func keySelector) { - var compareHelper = new CompareHelper(comparer: null, descending: true); - array.UnsafeOrderByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + array.UnsafeOrderByCore(keySelector, in sortHelper); } /// @@ -138,8 +137,8 @@ public void OrderByDescending(Func keySelector) /// An to compare elements. public void OrderByDescending(Func keySelector, IComparer comparer) { - var compareHelper = new CompareHelper(comparer, descending: true); - array.UnsafeOrderByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + array.UnsafeOrderByCore(keySelector, in sortHelper); } /// @@ -150,38 +149,16 @@ public void OrderByDescending(Func keySelector, IComparer c /// An to compare elements. public void OrderByDescending(Func keySelector, Comparison comparison) { - var compareHelper = new CompareHelper(comparison, descending: true); - array.UnsafeOrderByCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + array.UnsafeOrderByCore(keySelector, in sortHelper); } } - private static ImmutableArray UnsafeOrderCore(this ImmutableArray array, ref readonly CompareHelper compareHelper) - { - // Note: Checking the length will throw if array.IsDefault returns true. - // So, we can assume that the inner array below is non-null. - if (array.Length <= 1) - { - return array; - } - - var innerArray = ImmutableCollectionsMarshal.AsArray(array)!; - var items = innerArray.AsSpan(); - - if (SortHelper.AreOrdered(items, in compareHelper)) - { - // No need to sort - items are already ordered. - return array; - } - - var comparer = compareHelper.GetOrCreateComparer(); - - Array.Sort(innerArray, comparer); - - return array; - } + private static ImmutableArray UnsafeOrderCore(this ImmutableArray array, ref readonly SortHelper sortHelper) + => array.UnsafeOrderByCore(SortHelper.IdentityFunc, in sortHelper); private static ImmutableArray UnsafeOrderByCore( - this ImmutableArray array, Func keySelector, ref readonly CompareHelper compareHelper) + this ImmutableArray array, Func keySelector, ref readonly SortHelper sortHelper) { // Note: Checking the length will throw if array.IsDefault returns true. // So, we can assume that the inner array below is non-null. @@ -194,18 +171,19 @@ private static ImmutableArray UnsafeOrderByCore( var items = innerArray.AsSpan(); var length = items.Length; - using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + using var keys = SortKey.GetPooledArray(minimumLength: length); - if (SortHelper.SelectKeys(items, keySelector, in compareHelper, keys.Span)) + if (sortHelper.ComputeKeys(items, keySelector, keys.Span)) { // No need to sort - keys are already ordered. return array; } - var comparer = compareHelper.GetOrCreateComparer(); + var comparer = sortHelper.GetOrCreateComparer(); Array.Sort(keys.Array, innerArray, 0, length, comparer); + // Because we modified the inner array, we can just return array. return array; } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs index f21214005dc..5301b6d724e 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Buffers; using System.Collections.Immutable; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor; @@ -1055,8 +1054,8 @@ public static ImmutableArray OrderAsArray(this IReadOnlyList list) return ImmutableArrayExtensions.OrderAsArray(array); } - var compareHelper = new CompareHelper(comparer: null, descending: false); - return list.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + return list.OrderAsArrayCore(in sortHelper); } /// @@ -1075,8 +1074,8 @@ public static ImmutableArray OrderAsArray(this IReadOnlyList list, ICom return ImmutableArrayExtensions.OrderAsArray(array, comparer); } - var compareHelper = new CompareHelper(comparer, descending: false); - return list.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + return list.OrderAsArrayCore(in sortHelper); } /// @@ -1095,8 +1094,8 @@ public static ImmutableArray OrderAsArray(this IReadOnlyList list, Comp return ImmutableArrayExtensions.OrderAsArray(array, comparison); } - var compareHelper = new CompareHelper(comparison, descending: false); - return list.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + return list.OrderAsArrayCore(in sortHelper); } /// @@ -1114,8 +1113,8 @@ public static ImmutableArray OrderDescendingAsArray(this IReadOnlyList return ImmutableArrayExtensions.OrderDescendingAsArray(array); } - var compareHelper = new CompareHelper(comparer: null, descending: true); - return list.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + return list.OrderAsArrayCore(in sortHelper); } /// @@ -1134,8 +1133,8 @@ public static ImmutableArray OrderDescendingAsArray(this IReadOnlyList return ImmutableArrayExtensions.OrderDescendingAsArray(array, comparer); } - var compareHelper = new CompareHelper(comparer, descending: true); - return list.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + return list.OrderAsArrayCore(in sortHelper); } /// @@ -1154,8 +1153,8 @@ public static ImmutableArray OrderDescendingAsArray(this IReadOnlyList return ImmutableArrayExtensions.OrderDescendingAsArray(array, comparison); } - var compareHelper = new CompareHelper(comparison, descending: true); - return list.OrderAsArrayCore(in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + return list.OrderAsArrayCore(in sortHelper); } /// @@ -1176,8 +1175,8 @@ public static ImmutableArray OrderByAsArray( return ImmutableArrayExtensions.OrderByAsArray(array, keySelector); } - var compareHelper = new CompareHelper(comparer: null, descending: false); - return list.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: false); + return list.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -1199,8 +1198,8 @@ public static ImmutableArray OrderByAsArray( return ImmutableArrayExtensions.OrderByAsArray(array, keySelector, comparer); } - var compareHelper = new CompareHelper(comparer, descending: false); - return list.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: false); + return list.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -1222,8 +1221,8 @@ public static ImmutableArray OrderByAsArray( return ImmutableArrayExtensions.OrderByAsArray(array, keySelector, comparison); } - var compareHelper = new CompareHelper(comparison, descending: false); - return list.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: false); + return list.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -1244,8 +1243,8 @@ public static ImmutableArray OrderByDescendingAsArray( return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector); } - var compareHelper = new CompareHelper(comparer: null, descending: true); - return list.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer: null, descending: true); + return list.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -1267,8 +1266,8 @@ public static ImmutableArray OrderByDescendingAsArray( return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector, comparer); } - var compareHelper = new CompareHelper(comparer, descending: true); - return list.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparer, descending: true); + return list.OrderByAsArrayCore(keySelector, in sortHelper); } /// @@ -1290,36 +1289,16 @@ public static ImmutableArray OrderByDescendingAsArray( return ImmutableArrayExtensions.OrderByDescendingAsArray(array, keySelector, comparison); } - var compareHelper = new CompareHelper(comparison, descending: true); - return list.OrderByAsArrayCore(keySelector, in compareHelper); + var sortHelper = new SortHelper(comparison, descending: true); + return list.OrderByAsArrayCore(keySelector, in sortHelper); } - private static ImmutableArray OrderAsArrayCore(this IReadOnlyList list, ref readonly CompareHelper compareHelper) - { - switch (list.Count) - { - case 0: - return []; - case 1: - return [list[0]]; - } - - if (SortHelper.AreOrdered(list, in compareHelper)) - { - // No need to sort - items are already ordered. - return ImmutableCollectionsMarshal.AsImmutableArray(list.ToArray()); - } - - var newArray = list.ToArray(); - var comparer = compareHelper.GetOrCreateComparer(); - - Array.Sort(newArray, comparer); - - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); - } + private static ImmutableArray OrderAsArrayCore( + this IReadOnlyList list, ref readonly SortHelper sortHelper) + => list.OrderByAsArrayCore(SortHelper.IdentityFunc, in sortHelper); private static ImmutableArray OrderByAsArrayCore( - this IReadOnlyList list, Func keySelector, ref readonly CompareHelper compareHelper) + this IReadOnlyList list, Func keySelector, ref readonly SortHelper sortHelper) { switch (list.Count) { @@ -1331,16 +1310,16 @@ private static ImmutableArray OrderByAsArrayCore( var length = list.Count; - using var keys = ArrayPool.Shared.GetPooledArray(minimumLength: length); + using var keys = SortKey.GetPooledArray(minimumLength: length); - if (SortHelper.SelectKeys(list, keySelector, in compareHelper, keys.Span)) + if (sortHelper.ComputeKeys(list, keySelector, keys.Span)) { // No need to sort - keys are already ordered. return ImmutableCollectionsMarshal.AsImmutableArray(list.ToArray()); } var newArray = list.ToArray(); - var comparer = compareHelper.GetOrCreateComparer(); + var comparer = sortHelper.GetOrCreateComparer(); Array.Sort(keys.Array, newArray, 0, length, comparer); diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs deleted file mode 100644 index 63f232f8cab..00000000000 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/CompareHelper`1.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; - -namespace Microsoft.AspNetCore.Razor.Utilities; - -/// -/// Helper that avoids creating an until its needed. -/// -internal readonly ref struct CompareHelper -{ - private readonly IComparer _comparer; - private readonly Comparison? _comparison; - private readonly bool _descending; - - public CompareHelper(IComparer? comparer, bool descending) - { - _comparer = comparer ?? Comparer.Default; - _comparison = null; - _descending = descending; - } - - public CompareHelper(Comparison comparison, bool descending) - { - _comparer = null!; // This value will never be used when _comparison is non-null. - _comparison = comparison; - _descending = descending; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool InSortedOrder(T? x, T? y) - { - // We assume that x and y are in sorted order if x is > y. - // We don't consider x == y to be sorted because the actual sort - // might not be stable, depending on T. - - return _comparison is null - ? !_descending ? _comparer.Compare(x!, y!) > 0 : _comparer.Compare(y!, x!) > 0 - : !_descending ? _comparison(x!, y!) > 0 : _comparison(y!, x!) > 0; - } - - public IComparer GetOrCreateComparer() - { - return _comparison is null - ? !_descending ? _comparer : DescendingComparer.Create(_comparer) - : !_descending ? Comparer.Create(_comparison) : DescendingComparer.Create(_comparison); - } -} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/DescendingComparer`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/DescendingComparer`1.cs deleted file mode 100644 index c987f4bc135..00000000000 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/DescendingComparer`1.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; - -namespace Microsoft.AspNetCore.Razor.Utilities; - -internal abstract class DescendingComparer : IComparer -{ - private static IComparer? s_default; - - public static IComparer Default => s_default ??= new ReversedComparer(Comparer.Default); - - public static IComparer Create(IComparer comparer) - => new ReversedComparer(comparer); - - public static IComparer Create(Comparison comparison) - => new ReversedComparison(comparison); - - public abstract int Compare(T? x, T? y); - - private sealed class ReversedComparer(IComparer comparer) : DescendingComparer - { - public override int Compare(T? x, T? y) - => comparer.Compare(y!, x!); - } - - private sealed class ReversedComparison(Comparison comparison) : DescendingComparer - { - public override int Compare(T? x, T? y) - => comparison(y!, x!); - } -} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortComparer`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortComparer`1.cs new file mode 100644 index 00000000000..e2bb49fbe11 --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortComparer`1.cs @@ -0,0 +1,77 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.AspNetCore.Razor.Utilities; + +internal abstract class SortComparer : IComparer> +{ + public static IComparer> GetOrCreate(IComparer comparer, bool descending) + { + if (ReferenceEquals(comparer, Comparer.Default)) + { + return descending + ? DescendingComparer.Default + : AscendingComparer.Default; + } + + return descending + ? new DescendingComparer(comparer) + : new AscendingComparer(comparer); + } + + public static IComparer> Create(Comparison comparison, bool descending) + => descending + ? new DescendingComparison(comparison) + : new AscendingComparison(comparison); + + private SortComparer() + { + } + + protected abstract int CompareValues(T x, T y); + + public int Compare(SortKey x, SortKey y) + => CompareValues(x.Value, y.Value) switch + { + // If the values are equal, use their indices to ensure stability. + 0 => x.Index - y.Index, + var result => result + }; + + private sealed class AscendingComparer(IComparer comparer) : SortComparer + { + private static SortComparer? s_default; + + public static SortComparer Default + => s_default ?? InterlockedOperations.Initialize(ref s_default, new AscendingComparer(Comparer.Default)); + + protected override int CompareValues(T x, T y) + => comparer.Compare(x, y); + } + + private sealed class DescendingComparer(IComparer comparer) : SortComparer + { + private static SortComparer? s_default; + + public static SortComparer Default + => s_default ?? InterlockedOperations.Initialize(ref s_default, new DescendingComparer(Comparer.Default)); + + protected override int CompareValues(T x, T y) + => comparer.Compare(y, x); + } + + private sealed class AscendingComparison(Comparison comparison) : SortComparer + { + protected override int CompareValues(T x, T y) + => comparison(x, y); + } + + private sealed class DescendingComparison(Comparison comparison) : SortComparer + { + protected override int CompareValues(T x, T y) + => comparison(y, x); + } +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper.cs deleted file mode 100644 index f41137724ca..00000000000 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; - -namespace Microsoft.AspNetCore.Razor.Utilities; - -internal static class SortHelper -{ - /// - /// Walk through and determine whether they are already ordered using - /// the provided . - /// - /// - /// if the items are in order; otherwise . - /// - /// - /// When the items are already ordered, there's no need to perform a sort. - /// - public static bool AreOrdered(ReadOnlySpan items, ref readonly CompareHelper compareHelper) - { - var isOutOfOrder = false; - - for (var i = 1; i < items.Length; i++) - { - if (!compareHelper.InSortedOrder(items[i], items[i - 1])) - { - isOutOfOrder = true; - break; - } - } - - return !isOutOfOrder; - } - - /// - /// Walk through and determine whether they are already ordered using - /// the provided . - /// - /// - /// if the items are in order; otherwise . - /// - /// - /// When the items are already ordered, there's no need to perform a sort. - /// - public static bool AreOrdered(IReadOnlyList list, ref readonly CompareHelper compareHelper) - { - var isOutOfOrder = false; - var count = list.Count; - - for (var i = 1; i < count; i++) - { - if (!compareHelper.InSortedOrder(list[i], list[i - 1])) - { - isOutOfOrder = true; - break; - } - } - - return !isOutOfOrder; - } - - /// - /// Walk through and convert each element to a key using . - /// While walking, each computed key is compared with the previous one using the provided - /// to determine whether they are already ordered. - /// - /// - /// if the keys are in order; otherwise . - /// - /// - /// When the keys are already ordered, there's no need to perform a sort. - /// - public static bool SelectKeys( - ReadOnlySpan items, Func keySelector, ref readonly CompareHelper compareHelper, Span keys) - { - var isOutOfOrder = false; - - keys[0] = keySelector(items[0]); - - for (var i = 1; i < items.Length; i++) - { - keys[i] = keySelector(items[i]); - - if (!isOutOfOrder && !compareHelper.InSortedOrder(keys[i], keys[i - 1])) - { - isOutOfOrder = true; - - // Continue processing to finish converting elements to keys. However, we can stop comparing keys. - } - } - - return !isOutOfOrder; - } - - /// - /// Walk through and convert each element to a key using . - /// While walking, each computed key is compared with the previous one using the provided - /// to determine whether they are already ordered. - /// - /// - /// if the keys are in order; otherwise . - /// - /// - /// When the keys are already ordered, there's no need to perform a sort. - /// - public static bool SelectKeys( - IReadOnlyList list, Func keySelector, ref readonly CompareHelper compareHelper, Span keys) - { - var isOutOfOrder = false; - var count = list.Count; - - keys[0] = keySelector(list[0]); - - for (var i = 1; i < count; i++) - { - keys[i] = keySelector(list[i]); - - if (!isOutOfOrder && !compareHelper.InSortedOrder(keys[i], keys[i - 1])) - { - isOutOfOrder = true; - - // Continue processing to finish converting elements to keys. However, we can stop comparing keys. - } - } - - return !isOutOfOrder; - } -} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper`1.cs new file mode 100644 index 00000000000..5f2fe57a3cc --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortHelper`1.cs @@ -0,0 +1,207 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.CompilerServices; + +namespace Microsoft.AspNetCore.Razor.Utilities; + +/// +/// Helper that avoids creating an until its needed. +/// +internal readonly ref struct SortHelper +{ + public static readonly Func IdentityFunc = x => x; + + private readonly IComparer _comparer; + private readonly Comparison? _comparison; + private readonly bool _descending; + + public SortHelper(IComparer? comparer, bool descending) + { + _comparer = comparer ?? Comparer.Default; + _comparison = null; + _descending = descending; + } + + public SortHelper(Comparison comparison, bool descending) + { + _comparer = null!; // This value will never be used when _comparison is non-null. + _comparison = comparison; + _descending = descending; + } + + public IComparer> GetOrCreateComparer() + => _comparison is null + ? SortComparer.GetOrCreate(_comparer, _descending) + : SortComparer.Create(_comparison, _descending); + + /// + /// Determines whether is greater than + /// using the provided or . + /// + /// + /// We assume that value and previousValue are in sorted order if value is > previousValue. + /// We don't consider value == previousValue to be sorted because the actual sort might + /// not be stable, depending on T. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private bool AreInSortedOrder(T? value, T? previousValue) + => (_comparison, _descending) switch + { + (null, true) => _comparer.Compare(previousValue!, value!) > 0, + (null, false) => _comparer.Compare(value!, previousValue!) > 0, + (not null, true) => _comparison(previousValue!, value!) > 0, + (not null, false) => _comparison(value!, previousValue!) > 0, + }; + + /// + /// Walk through and convert each element to a key using . + /// While walking, each computed key is compared with the previous one using the provided + /// to determine whether they are already ordered. + /// + /// + /// if the keys are in order; otherwise . + /// + /// + /// When the keys are already ordered, there's no need to perform a sort. + /// + public bool ComputeKeys(ReadOnlySpan items, Func keySelector, Span> keys) + { + // Is this our identity func? If so, we can call a faster path that casts T -> TKey. + if (ReferenceEquals(IdentityFunc, keySelector)) + { + return ComputeIdentityKeys(items, keys); + } + + var isOutOfOrder = false; + + var previousKey = keySelector(items[0]); + keys[0] = new(Index: 0, previousKey); + + for (var i = 1; i < items.Length; i++) + { + var currentKey = keySelector(items[i]); + keys[i] = new(Index: i, currentKey); + + if (!isOutOfOrder) + { + if (!AreInSortedOrder(currentKey, previousKey)) + { + // Continue processing to finish converting elements to keys. However, we can stop comparing keys. + isOutOfOrder = true; + } + + previousKey = currentKey; + } + } + + return !isOutOfOrder; + } + + private bool ComputeIdentityKeys(ReadOnlySpan items, Span> keys) + { + Debug.Assert(typeof(TElement) == typeof(T)); + + var isOutOfOrder = false; + + var previousKey = (T)(object)items[0]!; + keys[0] = new(Index: 0, previousKey); + + for (var i = 1; i < items.Length; i++) + { + var currentKey = (T)(object)items[i]!; + keys[i] = new(Index: i, currentKey); + + if (!isOutOfOrder) + { + if (!AreInSortedOrder(currentKey, previousKey)) + { + // Continue processing to finish converting elements to keys. However, we can stop comparing keys. + isOutOfOrder = true; + } + + previousKey = currentKey; + } + } + + return !isOutOfOrder; + } + + /// + /// Walk through and convert each element to a key using . + /// While walking, each computed key is compared with the previous one using the provided + /// to determine whether they are already ordered. + /// + /// + /// if the keys are in order; otherwise . + /// + /// + /// When the keys are already ordered, there's no need to perform a sort. + /// + public bool ComputeKeys(IReadOnlyList items, Func keySelector, Span> keys) + { + // Is this our identity func? If so, we can call a faster path that casts T -> TKey. + if (ReferenceEquals(IdentityFunc, keySelector)) + { + return ComputeIdentityKeys(items, keys); + } + + var isOutOfOrder = false; + var count = items.Count; + + var previousKey = keySelector(items[0]); + keys[0] = new(Index: 0, previousKey); + + for (var i = 1; i < count; i++) + { + var currentKey = keySelector(items[i]); + keys[i] = new(Index: i, currentKey); + + if (!isOutOfOrder) + { + if (!AreInSortedOrder(currentKey, previousKey)) + { + // Continue processing to finish converting elements to keys. However, we can stop comparing keys. + isOutOfOrder = true; + } + + previousKey = currentKey; + } + } + + return !isOutOfOrder; + } + + private bool ComputeIdentityKeys(IReadOnlyList items, Span> keys) + { + Debug.Assert(typeof(TElement) == typeof(T)); + + var isOutOfOrder = false; + var count = items.Count; + + var previousKey = (T)(object)items[0]!; + keys[0] = new(Index: 0, previousKey); + + for (var i = 1; i < count; i++) + { + var currentKey = (T)(object)items[i]!; + keys[i] = new(Index: i, currentKey); + + if (!isOutOfOrder) + { + if (!AreInSortedOrder(currentKey, previousKey)) + { + // Continue processing to finish converting elements to keys. However, we can stop comparing keys. + isOutOfOrder = true; + } + + previousKey = currentKey; + } + } + + return !isOutOfOrder; + } +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortKey`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortKey`1.cs new file mode 100644 index 00000000000..38231426f20 --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Utilities/SortKey`1.cs @@ -0,0 +1,13 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Buffers; +using Microsoft.AspNetCore.Razor.PooledObjects; + +namespace Microsoft.AspNetCore.Razor.Utilities; + +internal readonly record struct SortKey(int Index, T Value) +{ + public static PooledArray> GetPooledArray(int minimumLength) + => ArrayPool>.Shared.GetPooledArray(minimumLength); +} From 761e2c6f14957d8ee32d922e6b2df9ff285b1962 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 13 Aug 2024 15:26:18 -0700 Subject: [PATCH 092/386] Remove invalid comment --- .../EnumerableExtensions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs index 002647660cb..5350bc00a24 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs @@ -83,7 +83,6 @@ public static void CopyTo(this IEnumerable sequence, Span destination) // First, check a few common cases. switch (sequence) { - // We specifically test ImmutableArray to avoid boxing it as an IReadOnlyList. case ImmutableArray array: ArgHelper.ThrowIfDestinationTooShort(destination, array.Length); array.CopyTo(destination); From bdcd5cdf7747de392a891343b7f8043240ac6f65 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 13 Aug 2024 15:46:30 -0700 Subject: [PATCH 093/386] Add immutable array builder DrainToImmutableOrdered variant extensions --- .../ImmutableArrayExtensionsTests.cs | 72 ++++ .../ImmutableArrayExtensions.cs | 309 ++++++++++++++++++ 2 files changed, 381 insertions(+) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs index 9769ce16662..992e477c198 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/ImmutableArrayExtensionsTests.cs @@ -414,6 +414,78 @@ public void ToImmutableOrderedByDescending_OddBeforeEven(ImmutableArray(expected, sorted); } + [Theory] + [MemberData(nameof(OrderTestData))] + public void DrainToImmutableOrdered(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.DrainToImmutableOrdered(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderTestData_OddBeforeEven))] + public void DrainToImmutableOrdered_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.DrainToImmutableOrdered(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData))] + public void DrainToImmutableOrderedDescending(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.DrainToImmutableOrderedDescending(); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] + public void DrainToImmutableOrderedDescending_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.DrainToImmutableOrderedDescending(OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData))] + public void DrainToImmutableOrderedBy(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.DrainToImmutableOrderedBy(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByTestData_OddBeforeEven))] + public void DrainToImmutableOrderedBy_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.DrainToImmutableOrderedBy(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData))] + public void DrainToImmutableOrderedByDescending(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.DrainToImmutableOrderedByDescending(static x => x.Value); + Assert.Equal(expected, sorted); + } + + [Theory] + [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] + public void DrainToImmutableOrderedByDescending_OddBeforeEven(ImmutableArray data, ImmutableArray expected) + { + var builder = data.ToBuilder(); + var sorted = builder.DrainToImmutableOrderedByDescending(static x => x.Value, OddBeforeEven); + Assert.Equal(expected, sorted); + } + [Fact] public void OrderAsArray_EmptyArrayReturnsSameArray() { diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index 548724e337b..789d390c9a8 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Collections.Generic; +using System.Linq; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.Utilities; @@ -641,4 +642,312 @@ private static ImmutableArray ToImmutableOrderedByCore return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in ascending order and sets the collection to a zero length array. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrdered(this ImmutableArray.Builder builder) + { + var array = builder.DrainToImmutable(); + array.Unsafe().Order(); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in ascending order and sets the collection to a zero length array. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// An to compare elements. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrdered(this ImmutableArray.Builder builder, IComparer comparer) + { + var array = builder.DrainToImmutable(); + array.Unsafe().Order(comparer); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in ascending order and sets the collection to a zero length array. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// An to compare elements. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrdered(this ImmutableArray.Builder builder, Comparison comparison) + { + var array = builder.DrainToImmutable(); + array.Unsafe().Order(comparison); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in descending order and sets the collection to a zero length array. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedDescending(this ImmutableArray.Builder builder) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderDescending(); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in descending order and sets the collection to a zero length array. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// An to compare elements. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedDescending(this ImmutableArray.Builder builder, IComparer comparer) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderDescending(comparer); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in descending order and sets the collection to a zero length array. + /// + /// The type of the elements in . + /// The whose contents will be sorted. + /// An to compare elements. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedDescending(this ImmutableArray.Builder builder, Comparison comparison) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderDescending(comparison); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in ascending order according to a key and sets + /// the collection to a zero length array. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order according to a key. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedBy( + this ImmutableArray.Builder builder, Func keySelector) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderBy(keySelector); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in ascending order according to a key and sets + /// the collection to a zero length array. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order according to a key. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedBy( + this ImmutableArray.Builder builder, Func keySelector, IComparer comparer) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderBy(keySelector, comparer); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in ascending order according to a key and sets + /// the collection to a zero length array. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// An immutable array that contains the current contents of this + /// sorted in ascending order according to a key. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedBy( + this ImmutableArray.Builder builder, Func keySelector, Comparison comparison) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderBy(keySelector, comparison); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in descending order according to a key and sets + /// the collection to a zero length array. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order according to a key. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedByDescending( + this ImmutableArray.Builder builder, Func keySelector) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderByDescending(keySelector); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in descending order according to a key and sets + /// the collection to a zero length array. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order according to a key. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedByDescending( + this ImmutableArray.Builder builder, Func keySelector, IComparer comparer) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderByDescending(keySelector, comparer); + return array; + } + + /// + /// Returns the current contents of this + /// as an immutable array sorted in descending order according to a key and sets + /// the collection to a zero length array. + /// + /// The type of the elements in . + /// The type of key returned by . + /// The whose contents will be sorted. + /// A function to extract a key from an element. + /// An to compare keys. + /// + /// An immutable array that contains the current contents of this + /// sorted in descending order according to a key. + /// + /// + /// If Capacity equals + /// Count, the internal array will be extracted as an + /// without copying the contents. Otherwise, the contents will be copied + /// into a new array. The collection will then be set to a zero length array. + /// + public static ImmutableArray DrainToImmutableOrderedByDescending( + this ImmutableArray.Builder builder, Func keySelector, Comparison comparison) + { + var array = builder.DrainToImmutable(); + array.Unsafe().OrderByDescending(keySelector, comparison); + return array; + } } From 795149fef1d657c26dbcc727d7825dffb8f35ff7 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 13 Aug 2024 16:00:32 -0700 Subject: [PATCH 094/386] Use Unsafe() extensions to implement ToImmutableOrdered* extensions --- .../ImmutableArrayExtensions.cs | 90 ++++++++----------- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index 789d390c9a8..efeba8dc05d 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.Utilities; @@ -414,8 +413,9 @@ private static ImmutableArray OrderByAsArrayCore( /// public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder) { - var sortHelper = new SortHelper(comparer: null, descending: false); - return builder.ToImmutableOrderedCore(in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().Order(); + return array; } /// @@ -431,8 +431,9 @@ public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Bui /// public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder, IComparer comparer) { - var sortHelper = new SortHelper(comparer, descending: false); - return builder.ToImmutableOrderedCore(in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().Order(comparer); + return array; } /// @@ -448,8 +449,9 @@ public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Bui /// public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Builder builder, Comparison comparison) { - var sortHelper = new SortHelper(comparison, descending: false); - return builder.ToImmutableOrderedCore(in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().Order(comparison); + return array; } /// @@ -464,8 +466,9 @@ public static ImmutableArray ToImmutableOrdered(this ImmutableArray.Bui /// public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder) { - var sortHelper = new SortHelper(comparer: null, descending: true); - return builder.ToImmutableOrderedCore(in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().OrderDescending(); + return array; } /// @@ -481,8 +484,9 @@ public static ImmutableArray ToImmutableOrderedDescending(this ImmutableAr /// public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder, IComparer comparer) { - var sortHelper = new SortHelper(comparer, descending: true); - return builder.ToImmutableOrderedCore(in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().OrderDescending(comparer); + return array; } /// @@ -498,8 +502,9 @@ public static ImmutableArray ToImmutableOrderedDescending(this ImmutableAr /// public static ImmutableArray ToImmutableOrderedDescending(this ImmutableArray.Builder builder, Comparison comparison) { - var sortHelper = new SortHelper(comparison, descending: true); - return builder.ToImmutableOrderedCore(in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().OrderDescending(comparison); + return array; } /// @@ -516,8 +521,9 @@ public static ImmutableArray ToImmutableOrderedDescending(this ImmutableAr public static ImmutableArray ToImmutableOrderedBy( this ImmutableArray.Builder builder, Func keySelector) { - var sortHelper = new SortHelper(comparer: null, descending: false); - return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().OrderBy(keySelector); + return array; } /// @@ -535,8 +541,9 @@ public static ImmutableArray ToImmutableOrderedBy( public static ImmutableArray ToImmutableOrderedBy( this ImmutableArray.Builder builder, Func keySelector, IComparer comparer) { - var sortHelper = new SortHelper(comparer, descending: false); - return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().OrderBy(keySelector, comparer); + return array; } /// @@ -554,8 +561,9 @@ public static ImmutableArray ToImmutableOrderedBy( public static ImmutableArray ToImmutableOrderedBy( this ImmutableArray.Builder builder, Func keySelector, Comparison comparison) { - var sortHelper = new SortHelper(comparison, descending: false); - return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().OrderBy(keySelector, comparison); + return array; } /// @@ -572,8 +580,9 @@ public static ImmutableArray ToImmutableOrderedBy( public static ImmutableArray ToImmutableOrderedByDescending( this ImmutableArray.Builder builder, Func keySelector) { - var sortHelper = new SortHelper(comparer: null, descending: true); - return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().OrderByDescending(keySelector); + return array; } /// @@ -591,8 +600,9 @@ public static ImmutableArray ToImmutableOrderedByDescending ToImmutableOrderedByDescending( this ImmutableArray.Builder builder, Func keySelector, IComparer comparer) { - var sortHelper = new SortHelper(comparer, descending: true); - return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); + var array = builder.ToImmutable(); + array.Unsafe().OrderByDescending(keySelector, comparer); + return array; } /// @@ -610,37 +620,9 @@ public static ImmutableArray ToImmutableOrderedByDescending ToImmutableOrderedByDescending( this ImmutableArray.Builder builder, Func keySelector, Comparison comparison) { - var sortHelper = new SortHelper(comparison, descending: true); - return builder.ToImmutableOrderedByCore(keySelector, in sortHelper); - } - - private static ImmutableArray ToImmutableOrderedCore(this ImmutableArray.Builder builder, ref readonly SortHelper sortHelper) - => builder.ToImmutableOrderedByCore(SortHelper.IdentityFunc, in sortHelper); - - private static ImmutableArray ToImmutableOrderedByCore( - this ImmutableArray.Builder builder, Func keySelector, ref readonly SortHelper sortHelper) - { - if (builder.Count <= 1) - { - return builder.ToImmutable(); - } - - var length = builder.Count; - - using var keys = SortKey.GetPooledArray(minimumLength: length); - - if (sortHelper.ComputeKeys(builder, keySelector, keys.Span)) - { - // No need to sort - keys are already ordered. - return builder.ToImmutable(); - } - - var newArray = builder.ToArray(); - var comparer = sortHelper.GetOrCreateComparer(); - - Array.Sort(keys.Array, newArray, 0, length, comparer); - - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + var array = builder.ToImmutable(); + array.Unsafe().OrderByDescending(keySelector, comparison); + return array; } /// From 0e33edc19656c3fc3cbc8245faa7c1a9590e9c91 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 13 Aug 2024 16:03:07 -0700 Subject: [PATCH 095/386] Remove unnecessary type alias --- .../EnumerableExtensions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs index 5350bc00a24..bc650d10dd7 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs @@ -6,7 +6,6 @@ using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.Utilities; -using ImmutableArrayExtensions = System.Collections.Immutable.ImmutableArrayExtensions; namespace System.Collections.Generic; From 7508c52c9173d09db90ef8f237c35cd3ecffe7ab Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 13 Aug 2024 16:12:22 -0700 Subject: [PATCH 096/386] A bit of clean up --- .../EnumerableExtensions.cs | 11 +++-------- .../ImmutableArrayExtensions.cs | 6 ++---- .../ImmutableArrayExtensions_Unsafe.cs | 11 +++-------- .../ReadOnlyListExtensions.cs | 5 ++--- 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs index bc650d10dd7..0017b1e40a0 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/EnumerableExtensions.cs @@ -456,19 +456,14 @@ private static ImmutableArray OrderByAsArrayCore( } var length = newArray.Length; - using var keys = SortKey.GetPooledArray(minimumLength: length); - if (sortHelper.ComputeKeys(newArray.AsSpan(), keySelector, keys.Span)) + if (!sortHelper.ComputeKeys(newArray.AsSpan(), keySelector, keys.Span)) { - // No need to sort - keys are already ordered. - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); + // The keys are not ordered, so we need to sort the array. + Array.Sort(keys.Array, newArray, 0, length, sortHelper.GetOrCreateComparer()); } - var comparer = sortHelper.GetOrCreateComparer(); - - Array.Sort(keys.Array, newArray, 0, length, comparer); - return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs index efeba8dc05d..808f00451e8 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions.cs @@ -387,16 +387,14 @@ private static ImmutableArray OrderByAsArrayCore( if (sortHelper.ComputeKeys(items, keySelector, keys.Span)) { - // No need to sort - keys are already ordered. + // The keys are already ordered, so we don't need to create a new array and sort it. return array; } var newArray = new TElement[length]; items.CopyTo(newArray); - var comparer = sortHelper.GetOrCreateComparer(); - - Array.Sort(keys.Array, newArray, 0, length, comparer); + Array.Sort(keys.Array, newArray, 0, length, sortHelper.GetOrCreateComparer()); return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs index e42d5c32051..a7195275c71 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ImmutableArrayExtensions_Unsafe.cs @@ -173,17 +173,12 @@ private static ImmutableArray UnsafeOrderByCore( using var keys = SortKey.GetPooledArray(minimumLength: length); - if (sortHelper.ComputeKeys(items, keySelector, keys.Span)) + if (!sortHelper.ComputeKeys(items, keySelector, keys.Span)) { - // No need to sort - keys are already ordered. - return array; + // The keys are not ordered, so we need to sort the array. + Array.Sort(keys.Array, innerArray, 0, length, sortHelper.GetOrCreateComparer()); } - var comparer = sortHelper.GetOrCreateComparer(); - - Array.Sort(keys.Array, innerArray, 0, length, comparer); - - // Because we modified the inner array, we can just return array. return array; } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs index 5301b6d724e..01c96def822 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/ReadOnlyListExtensions.cs @@ -1314,14 +1314,13 @@ private static ImmutableArray OrderByAsArrayCore( if (sortHelper.ComputeKeys(list, keySelector, keys.Span)) { - // No need to sort - keys are already ordered. + // The keys are already ordered, so we don't need to create a new array and sort it. return ImmutableCollectionsMarshal.AsImmutableArray(list.ToArray()); } var newArray = list.ToArray(); - var comparer = sortHelper.GetOrCreateComparer(); - Array.Sort(keys.Array, newArray, 0, length, comparer); + Array.Sort(keys.Array, newArray, 0, length, sortHelper.GetOrCreateComparer()); return ImmutableCollectionsMarshal.AsImmutableArray(newArray); } From 718cea3013b94c037580bf2319c52e63bce225ff Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 14 Aug 2024 12:34:08 +0000 Subject: [PATCH 097/386] Update dependencies from https://github.com/dotnet/arcade build 20240812.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24376.1 -> To Version 8.0.0-beta.24412.1 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c82d3837f10..296eefb7923 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 1e2be7464703499cf98e20536fb4da4218c8fce1 + 770e16f44e6727d0efe1168e62279a399cc92edd - + https://github.com/dotnet/arcade - 1e2be7464703499cf98e20536fb4da4218c8fce1 + 770e16f44e6727d0efe1168e62279a399cc92edd diff --git a/eng/Versions.props b/eng/Versions.props index 3cb51b4a92b..4d26f56b0bc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24376.1 + 8.0.0-beta.24412.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index d2da2009ac8..e89a34a82ba 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24376.1", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24412.1", "Microsoft.Build.NoTargets": "3.7.0" } } From 0fc71bec980dc700db1902f172f95e731a9577cc Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 15 Aug 2024 18:15:12 +1000 Subject: [PATCH 098/386] Cleanup --- .../ColorPresentationEndpoint.cs | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs index 3e53f3ab948..6da931e401c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs @@ -9,37 +9,26 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; using Microsoft.VisualStudio.LanguageServer.Protocol; +using LspColorPresentation = Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation.ColorPresentation; namespace Microsoft.AspNetCore.Razor.LanguageServer.ColorPresentation; -using ColorPresentation = CodeAnalysis.Razor.Protocol.ColorPresentation.ColorPresentation; - [RazorLanguageServerEndpoint(CustomMessageNames.ColorPresentationMethodName)] -internal sealed class ColorPresentationEndpoint : IRazorRequestHandler +internal sealed class ColorPresentationEndpoint(IClientConnection clientConnection) : IRazorRequestHandler { - private readonly IClientConnection _clientConnection; - - public ColorPresentationEndpoint(IClientConnection clientConnection) - { - if (clientConnection is null) - { - throw new ArgumentNullException(nameof(clientConnection)); - } - - _clientConnection = clientConnection; - } + private readonly IClientConnection _clientConnection = clientConnection; public bool MutatesSolutionState => false; public TextDocumentIdentifier GetTextDocumentIdentifier(ColorPresentationParams request) => request.TextDocument; - public async Task HandleRequestAsync(ColorPresentationParams request, RazorRequestContext context, CancellationToken cancellationToken) + public async Task HandleRequestAsync(ColorPresentationParams request, RazorRequestContext context, CancellationToken cancellationToken) { var documentContext = context.DocumentContext; if (documentContext is null) { - return Array.Empty(); + return []; } var delegatedRequest = new DelegatedColorPresentationParams @@ -50,14 +39,14 @@ public async Task HandleRequestAsync(ColorPresentationParam TextDocument = request.TextDocument }; - var colorPresentations = await _clientConnection.SendRequestAsync( + var colorPresentations = await _clientConnection.SendRequestAsync( CustomMessageNames.RazorProvideHtmlColorPresentationEndpoint, delegatedRequest, cancellationToken).ConfigureAwait(false); if (colorPresentations is null) { - return Array.Empty(); + return []; } // HTML and Razor documents have identical mapping locations. Because of this we can return the result as-is. From 16164684c76ed272c569b43674457e057aa00b22 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 15 Aug 2024 18:15:22 +1000 Subject: [PATCH 099/386] Remove shared service since there is no sharing happening --- .../DocumentColor/DocumentColorEndpoint.cs | 43 +++++++++++++++--- .../DocumentColor/DocumentColorService.cs | 45 ------------------- .../DocumentColor/IDocumentColorService.cs | 15 ------- .../VSInternalServerCapabilitiesExtensions.cs | 5 --- 4 files changed, 36 insertions(+), 72 deletions(-) delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorService.cs delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/IDocumentColorService.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs index 61fa87dd95e..f3f870e3470 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs @@ -1,29 +1,58 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentColor; [RazorLanguageServerEndpoint(Methods.TextDocumentDocumentColorName)] -internal sealed class DocumentColorEndpoint(IDocumentColorService documentColorService, IClientConnection clientConnection) : IRazorRequestHandler, ICapabilitiesProvider +internal sealed class DocumentColorEndpoint(IClientConnection clientConnection) : IRazorRequestHandler, ICapabilitiesProvider { - private readonly IDocumentColorService _documentColorService = documentColorService ?? throw new ArgumentNullException(nameof(documentColorService)); - private readonly IClientConnection _clientConnection = clientConnection ?? throw new ArgumentNullException(nameof(clientConnection)); + private readonly IClientConnection _clientConnection = clientConnection; public bool MutatesSolutionState => false; public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, VSInternalClientCapabilities clientCapabilities) - => serverCapabilities.EnableDocumentColorProvider(); + => serverCapabilities.DocumentColorProvider = true; public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentColorParams request) => request.TextDocument; - public Task HandleRequestAsync(DocumentColorParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) - => _documentColorService.GetColorInformationAsync(_clientConnection, request, requestContext.DocumentContext, cancellationToken); + public async Task HandleRequestAsync(DocumentColorParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) + { + var documentContext = requestContext.DocumentContext; + + // Workaround for Web Tools bug https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1743689 where they sometimes + // send requests for filenames that are stale, possibly due to adornment taggers being cached incorrectly (or caching + // filenames incorrectly) + if (documentContext is null) + { + return []; + } + + var delegatedRequest = new DelegatedDocumentColorParams() + { + HostDocumentVersion = documentContext.Version, + TextDocument = request.TextDocument + }; + + var documentColors = await _clientConnection.SendRequestAsync( + CustomMessageNames.RazorProvideHtmlDocumentColorEndpoint, + delegatedRequest, + cancellationToken).ConfigureAwait(false); + + if (documentColors is null) + { + return []; + } + + // HTML and Razor documents have identical mapping locations. Because of this we can return the result as-is. + return documentColors; + } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorService.cs deleted file mode 100644 index 56cf6818cd2..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorService.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; -using Microsoft.VisualStudio.LanguageServer.Protocol; - -namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentColor; - -internal sealed class DocumentColorService() : IDocumentColorService -{ - public async Task GetColorInformationAsync(IClientConnection clientConnection, DocumentColorParams request, VersionedDocumentContext? documentContext, CancellationToken cancellationToken) - { - // Workaround for Web Tools bug https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1743689 where they sometimes - // send requests for filenames that are stale, possibly due to adornment taggers being cached incorrectly (or caching - // filenames incorrectly) - if (documentContext is null) - { - return []; - } - - var delegatedRequest = new DelegatedDocumentColorParams() - { - HostDocumentVersion = documentContext.Version, - TextDocument = request.TextDocument - }; - - var documentColors = await clientConnection.SendRequestAsync( - CustomMessageNames.RazorProvideHtmlDocumentColorEndpoint, - delegatedRequest, - cancellationToken).ConfigureAwait(false); - - if (documentColors is null) - { - return []; - } - - // HTML and Razor documents have identical mapping locations. Because of this we can return the result as-is. - return documentColors; - } -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/IDocumentColorService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/IDocumentColorService.cs deleted file mode 100644 index f2e90ab2df7..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/IDocumentColorService.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; - -namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentColor; - -internal interface IDocumentColorService -{ - Task GetColorInformationAsync(IClientConnection clientConnection, DocumentColorParams request, VersionedDocumentContext? documentContext, CancellationToken cancellationToken); -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs index 83b32a3dd23..cb9f96cecb3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs @@ -17,11 +17,6 @@ public static void EnableInlayHints(this VSInternalServerCapabilities serverCapa }; } - public static void EnableDocumentColorProvider(this VSInternalServerCapabilities serverCapabilities) - { - serverCapabilities.DocumentColorProvider = new DocumentColorOptions(); - } - public static void EnableSemanticTokens(this VSInternalServerCapabilities serverCapabilities, ISemanticTokensLegendService legend) { serverCapabilities.SemanticTokensOptions = new SemanticTokensOptions().EnableSemanticTokens(legend); From ac4b407d2d5a49ad167061c34636e3b3b291f64b Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 15 Aug 2024 18:16:20 +1000 Subject: [PATCH 100/386] Add cohost endpoints for the things that don't call Roslyn at all --- .../IServiceCollectionExtensions.cs | 2 +- .../RazorLanguageServer.cs | 7 +- .../Cohost/CohostColorPresentationEndpoint.cs | 68 ++++++++++++ .../Cohost/CohostDocumentColorEndpoint.cs | 84 ++++++++++++++ .../Cohost/CohostTextPresentationEndpoint.cs | 105 ++++++++++++++++++ .../Cohost/CohostUriPresentationEndpoint.cs | 9 +- .../CohostTextPresentationEndpointTest.cs | 89 +++++++++++++++ 7 files changed, 352 insertions(+), 12 deletions(-) create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostColorPresentationEndpoint.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentColorEndpoint.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostTextPresentationEndpoint.cs create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs index 0444b9aa7e7..38dfdb87dfb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs @@ -159,9 +159,9 @@ public static void AddCodeActionsServices(this IServiceCollection services) public static void AddTextDocumentServices(this IServiceCollection services, LanguageServerFeatureOptions featureOptions) { - services.AddHandlerWithCapabilities(); if (!featureOptions.UseRazorCohostServer) { + services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index 601df17f06c..d23d7c4144f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -193,16 +193,15 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption services.AddSingleton(); services.AddHandlerWithCapabilities(); services.AddHandler(); + + services.AddHandlerWithCapabilities(); + services.AddHandler(); } services.AddHandler(); services.AddHandler(); services.AddHandler(); - services.AddHandlerWithCapabilities(); - services.AddSingleton(); - - services.AddHandler(); services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostColorPresentationEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostColorPresentationEndpoint.cs new file mode 100644 index 00000000000..df265b1bdef --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostColorPresentationEndpoint.cs @@ -0,0 +1,68 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.Protocol.ColorPresentation; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(CustomMessageNames.ColorPresentationMethodName)] +[ExportCohostStatelessLspService(typeof(CohostColorPresentationEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostColorPresentationEndpoint( + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker) + : AbstractRazorCohostDocumentRequestHandler +{ + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(ColorPresentationParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(ColorPresentationParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(request, context.TextDocument.AssumeNotNull(), cancellationToken); + + private async Task HandleRequestAsync(ColorPresentationParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + request.TextDocument = request.TextDocument.WithUri(htmlDocument.Uri); + + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + htmlDocument.Buffer, + CustomMessageNames.ColorPresentationMethodName, + RazorLSPConstants.HtmlLanguageServerName, + request, + cancellationToken).ConfigureAwait(false); + + return result?.Response; + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostColorPresentationEndpoint instance) + { + public Task HandleRequestAsync(ColorPresentationParams request, TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(request, razorDocument, cancellationToken); + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentColorEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentColorEndpoint.cs new file mode 100644 index 00000000000..2cd54d805c3 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentColorEndpoint.cs @@ -0,0 +1,84 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(Methods.TextDocumentDocumentColorName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostDocumentColorEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostDocumentColorEndpoint( + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.SupportsVisualStudioExtensions) + { + return new Registration + { + Method = Methods.TextDocumentDocumentColorName, + RegisterOptions = new DocumentColorRegistrationOptions() + { + DocumentSelector = filter + } + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(DocumentColorParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(DocumentColorParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(request, context.TextDocument.AssumeNotNull(), cancellationToken); + + private async Task HandleRequestAsync(DocumentColorParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + request.TextDocument = request.TextDocument.WithUri(htmlDocument.Uri); + + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + htmlDocument.Buffer, + Methods.TextDocumentDocumentColorName, + RazorLSPConstants.HtmlLanguageServerName, + request, + cancellationToken).ConfigureAwait(false); + + return result?.Response; + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostDocumentColorEndpoint instance) + { + public Task HandleRequestAsync(DocumentColorParams request, TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(request, razorDocument, cancellationToken); + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostTextPresentationEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostTextPresentationEndpoint.cs new file mode 100644 index 00000000000..66030cfa570 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostTextPresentationEndpoint.cs @@ -0,0 +1,105 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(VSInternalMethods.TextDocumentTextPresentationName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostTextPresentationEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostTextPresentationEndpoint( + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + IFilePathService filePathService, + LSPRequestInvoker requestInvoker) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly IFilePathService _filePathService = filePathService; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.SupportsVisualStudioExtensions) + { + return new Registration + { + Method = VSInternalMethods.TextDocumentTextPresentationName, + RegisterOptions = new TextDocumentRegistrationOptions() + { + DocumentSelector = filter + } + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(VSInternalTextPresentationParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(VSInternalTextPresentationParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(request, context.TextDocument.AssumeNotNull(), cancellationToken); + + private async Task HandleRequestAsync(VSInternalTextPresentationParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + request.TextDocument = request.TextDocument.WithUri(htmlDocument.Uri); + + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + htmlDocument.Buffer, + VSInternalMethods.TextDocumentTextPresentationName, + RazorLSPConstants.HtmlLanguageServerName, + request, + cancellationToken).ConfigureAwait(false); + + if (result?.Response is not { } workspaceEdit) + { + return null; + } + + if (!workspaceEdit.TryGetTextDocumentEdits(out var edits)) + { + return null; + } + + foreach (var edit in edits) + { + if (_filePathService.IsVirtualHtmlFile(edit.TextDocument.Uri)) + { + edit.TextDocument = new OptionalVersionedTextDocumentIdentifier { Uri = _filePathService.GetRazorDocumentUri(edit.TextDocument.Uri) }; + } + } + + return workspaceEdit; + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostTextPresentationEndpoint instance) + { + public Task HandleRequestAsync(VSInternalTextPresentationParams request, TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(request, razorDocument, cancellationToken); + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostUriPresentationEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostUriPresentationEndpoint.cs index 7d9d55e302c..3c368fff259 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostUriPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostUriPresentationEndpoint.cs @@ -101,18 +101,13 @@ internal class CohostUriPresentationEndpoint( return null; } - var presentationParams = new VSInternalUriPresentationParams - { - Range = request.Range, - Uris = request.Uris, - TextDocument = new TextDocumentIdentifier { Uri = htmlDocument.Uri } - }; + request.TextDocument = request.TextDocument.WithUri(htmlDocument.Uri); var result = await _requestInvoker.ReinvokeRequestOnServerAsync( htmlDocument.Buffer, VSInternalMethods.TextDocumentUriPresentationName, RazorLSPConstants.HtmlLanguageServerName, - presentationParams, + request, cancellationToken).ConfigureAwait(false); // TODO: We _really_ should go back to OOP to remap the response to razor, but the fact is, Razor and Html are 1:1 mappings, so we're diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs new file mode 100644 index 00000000000..f946a642581 --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs @@ -0,0 +1,89 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Testing; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +public class CohostTextPresentationEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +{ + [Fact] + public async Task HtmlResponse_TranslatesVirtualDocumentUri() + { + await VerifyUriPresentationAsync( + input: """ + This is a Razor document. + +
+ [||] +
+ + The end. + """, + text: "Hello World", + htmlResponse: new WorkspaceEdit + { + DocumentChanges = new TextDocumentEdit[] + { + new() + { + TextDocument = new() + { + Uri = FileUri("File1.razor.g.html") + }, + Edits = [VsLspFactory.CreateTextEdit(position: (0, 0), "Hello World")] + } + } + }, + expected: "Hello World"); + } + + private static Uri FileUri(string projectRelativeFileName) + => new(File(projectRelativeFileName)); + + private static string File(string projectRelativeFileName) + => Path.Combine(TestProjectData.SomeProjectPath, projectRelativeFileName); + + private async Task VerifyUriPresentationAsync(string input, string text, string? expected, WorkspaceEdit? htmlResponse = null) + { + TestFileMarkupParser.GetSpan(input, out input, out var span); + var document = CreateProjectAndRazorDocument(input); + var sourceText = await document.GetTextAsync(DisposalToken); + + var requestInvoker = new TestLSPRequestInvoker([(VSInternalMethods.TextDocumentTextPresentationName, htmlResponse)]); + + var endpoint = new CohostTextPresentationEndpoint(TestHtmlDocumentSynchronizer.Instance, FilePathService, requestInvoker); + + var request = new VSInternalTextPresentationParams() + { + TextDocument = new TextDocumentIdentifier() + { + Uri = document.CreateUri() + }, + Range = sourceText.GetRange(span), + Text = text + }; + + var result = await endpoint.GetTestAccessor().HandleRequestAsync(request, document, DisposalToken); + + if (expected is null) + { + Assert.Null(result); + } + else + { + Assert.NotNull(result); + Assert.NotNull(result.DocumentChanges); + Assert.Equal(expected, result.DocumentChanges.Value.First[0].Edits[0].NewText); + Assert.Equal(document.CreateUri(), result.DocumentChanges.Value.First[0].TextDocument.Uri); + } + } +} From 9e63e09781a5776054a84e29a96b6a16f2820b6c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 15 Aug 2024 12:54:01 +0000 Subject: [PATCH 101/386] Update dependencies from https://github.com/dotnet/arcade build 20240814.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24408.2 -> To Version 9.0.0-beta.24414.3 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 76f9e043b17..e888013264e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba
- + https://github.com/dotnet/arcade - 60ae233c3d77f11c5fdb53e570b64d503b13ba59 + 4d15f8d1f2d61f6513b70f0bcd4bd3c1828a3a68 - + https://github.com/dotnet/arcade - 60ae233c3d77f11c5fdb53e570b64d503b13ba59 + 4d15f8d1f2d61f6513b70f0bcd4bd3c1828a3a68 diff --git a/eng/Versions.props b/eng/Versions.props index bb76ebd6c09..3b6f2e471ab 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24408.2 + 9.0.0-beta.24414.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index 4c7a8f700f4..c545052a5aa 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24408.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24414.3", "Microsoft.Build.NoTargets": "3.7.0" } } From f38b165f41f8417544417520264b6f0bf4f40863 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 15 Aug 2024 13:20:23 +0000 Subject: [PATCH 102/386] Update dependencies from https://github.com/dotnet/arcade build 20240813.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24412.1 -> To Version 8.0.0-beta.24413.2 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 296eefb7923..228c071e3f0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 770e16f44e6727d0efe1168e62279a399cc92edd + 51321b7e150a2f426cb9e1334687bdfab68ec323 - + https://github.com/dotnet/arcade - 770e16f44e6727d0efe1168e62279a399cc92edd + 51321b7e150a2f426cb9e1334687bdfab68ec323 diff --git a/eng/Versions.props b/eng/Versions.props index 4d26f56b0bc..085902e05e4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24412.1 + 8.0.0-beta.24413.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index e89a34a82ba..1734d1724cc 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "8.0.107", + "dotnet": "8.0.108", "runtimes": { "dotnet": [ "2.1.30", @@ -16,12 +16,12 @@ } }, "sdk": { - "version": "8.0.107", + "version": "8.0.108", "allowPrerelease": false, "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24412.1", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24413.2", "Microsoft.Build.NoTargets": "3.7.0" } } From db5a78f96824de4a08d2b17ca0ce46859c148e26 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Thu, 15 Aug 2024 18:53:50 +0200 Subject: [PATCH 103/386] Fix parser debug helpers (#10741) * Fix parser debug display * Remove unused method * Mark property private --- .../src/Language/Legacy/ParserContext.cs | 38 ++----------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ParserContext.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ParserContext.cs index b96ded3d778..e6ba1a6464e 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ParserContext.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/ParserContext.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; namespace Microsoft.AspNetCore.Razor.Language.Legacy; @@ -68,46 +67,17 @@ public bool EndOfFile [DebuggerDisplay("{" + nameof(DebuggerToString) + "(),nq}")] internal partial class ParserContext { - private const int InfiniteLoopCountThreshold = 1000; - private int _infiniteLoopGuardCount; - private SourceLocation? _infiniteLoopGuardLocation; - - internal string Unparsed + private string Unparsed { get { - var remaining = ((TextReader)Source).ReadToEnd(); - Source.Position -= remaining.Length; + var bookmark = Source.Position; + var remaining = Source.ReadToEnd(); + Source.Position = bookmark; return remaining; } } - private bool CheckInfiniteLoop() - { - // Infinite loop guard - // Basically, if this property is accessed 1000 times in a row without having advanced the source reader to the next position, we - // cause a parser error - if (_infiniteLoopGuardLocation != null) - { - if (Source.Location.Equals(_infiniteLoopGuardLocation.Value)) - { - _infiniteLoopGuardCount++; - if (_infiniteLoopGuardCount > InfiniteLoopCountThreshold) - { - Debug.Fail("An internal parser error is causing an infinite loop at this location."); - - return true; - } - } - else - { - _infiniteLoopGuardCount = 0; - } - } - _infiniteLoopGuardLocation = Source.Location; - return false; - } - private string DebuggerToString() { return Unparsed; From e6fa90c22519117a2b0acc4ce2b7b1d4a156e0ca Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Fri, 2 Aug 2024 13:37:42 -0700 Subject: [PATCH 104/386] Add co-hosting endpoint and remote service for GTD This change adds all of the boilerplate needed to handle C# Go to Definition --- eng/targets/Services.props | 1 + .../RoslynLspExtensions_Location.cs | 12 +++ .../Extensions/RoslynLspFactory.cs | 7 ++ .../Remote/IRemoteGoToDefinitionService.cs | 19 ++++ .../Remote/RazorServices.cs | 1 + .../RemoteGoToDefinitionService.cs | 90 +++++++++++++++++++ .../Cohost/CohostGoToDefinitionEndpoint.cs | 70 +++++++++++++++ 7 files changed, 200 insertions(+) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Location.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToDefinitionService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs diff --git a/eng/targets/Services.props b/eng/targets/Services.props index e4ce786f254..61ba0e77547 100644 --- a/eng/targets/Services.props +++ b/eng/targets/Services.props @@ -25,6 +25,7 @@ + diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Location.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Location.cs new file mode 100644 index 00000000000..d79991b8e22 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_Location.cs @@ -0,0 +1,12 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; + +namespace Roslyn.LanguageServer.Protocol; + +internal static partial class RoslynLspExtensions +{ + public static void Deconstruct(this Location position, out Uri uri, out Range range) + => (uri, range) = (position.Uri, position.Range); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspFactory.cs index 841ea8c1ed4..aba1d9efb3d 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspFactory.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; using System.Diagnostics; using Microsoft.CodeAnalysis.Text; @@ -159,6 +160,12 @@ public static Range CreateSingleLineRange(LinePosition start, int length) public static Range CreateSingleLineRange((int line, int character) start, int length) => CreateRange(CreatePosition(start), CreatePosition(start.line, start.character + length)); + public static Location CreateLocation(Uri uri, Range range) + => new() { Uri = uri, Range = range }; + + public static Location CreateLocation(Uri uri, LinePositionSpan span) + => new() { Uri = uri, Range = CreateRange(span) }; + public static TextEdit CreateTextEdit(Range range, string newText) => new() { Range = range, NewText = newText }; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToDefinitionService.cs new file mode 100644 index 00000000000..386ccf6354d --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToDefinitionService.cs @@ -0,0 +1,19 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; +using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; + +namespace Microsoft.CodeAnalysis.Razor.Remote; + +internal interface IRemoteGoToDefinitionService : IRemoteJsonService +{ + ValueTask GetDefinitionAsync( + JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, + JsonSerializableDocumentId razorDocumentId, + RoslynPosition position, + CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs index 06bf0950825..e1310e1658e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs @@ -26,6 +26,7 @@ internal static class RazorServices // Internal for testing internal static readonly IEnumerable<(Type, Type?)> JsonServices = [ + (typeof(IRemoteGoToDefinitionService), null), (typeof(IRemoteSignatureHelpService), null), (typeof(IRemoteInlayHintService), null), (typeof(IRemoteRenameService), null), diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs new file mode 100644 index 00000000000..61c8f234751 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs @@ -0,0 +1,90 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.CodeAnalysis.Remote.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Text; +using Roslyn.LanguageServer.Protocol; +using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; +using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; +using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; + +namespace Microsoft.CodeAnalysis.Remote.Razor; + +internal sealed class RemoteGoToDefinitionService(in ServiceArgs args) : RazorDocumentServiceBase(in args), IRemoteGoToDefinitionService +{ + internal sealed class Factory : FactoryBase + { + protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs args) + => new RemoteGoToDefinitionService(in args); + } + + private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); + private readonly IDocumentMappingService _documentMappingService = args.ExportProvider.GetExportedValue(); + + public ValueTask GetDefinitionAsync( + JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, + JsonSerializableDocumentId documentId, + RoslynPosition position, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => GetDefinitionAsync(context, position, cancellationToken), + cancellationToken); + + private async ValueTask GetDefinitionAsync( + RemoteDocumentContext context, + RoslynPosition position, + CancellationToken cancellationToken) + { + var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + var absoluteIndex = codeDocument.Source.Text.GetRequiredAbsoluteIndex(position.ToLinePosition()); + + var generatedDocument = await context.GetGeneratedDocumentAsync(_filePathService, cancellationToken).ConfigureAwait(false); + + if (_documentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), absoluteIndex, out var mappedPosition, out _)) + { + var locations = await ExternalHandlers.GoToDefinition + .GetDefinitionsAsync( + RemoteWorkspaceAccessor.GetWorkspace(), + generatedDocument, + typeOnly: false, + mappedPosition, + cancellationToken) + .ConfigureAwait(false); + + if (locations is null and not []) + { + return locations; + } + + using var mappedLocations = new PooledArrayBuilder(locations.Length); + + foreach (var location in locations) + { + var (uri, range) = location; + + var (mappedDocumentUri, mappedRange) = await _documentMappingService + .MapToHostDocumentUriAndRangeAsync((RemoteDocumentSnapshot)context.Snapshot, uri, range.ToLinePositionSpan(), cancellationToken) + .ConfigureAwait(false); + + var mappedLocation = RoslynLspFactory.CreateLocation(mappedDocumentUri, mappedRange); + + mappedLocations.Add(mappedLocation); + } + + return mappedLocations.ToArray(); + } + + return null; + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs new file mode 100644 index 00000000000..74a8571e1a6 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs @@ -0,0 +1,70 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using static Roslyn.LanguageServer.Protocol.RoslynLspExtensions; +using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; +using RoslynLspFactory = Roslyn.LanguageServer.Protocol.RoslynLspFactory; +using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(Methods.TextDocumentDefinitionName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostGoToDefinitionEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal sealed class CohostGoToDefinitionEndpoint(IRemoteServiceInvoker remoteServiceInvoker) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.TextDocument?.Definition?.DynamicRegistration == true) + { + return new Registration + { + Method = Methods.TextDocumentDefinitionName, + RegisterOptions = new DefinitionOptions() + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(TextDocumentPositionParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(TextDocumentPositionParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync( + context.TextDocument.AssumeNotNull(), + RoslynLspFactory.CreatePosition(request.Position.ToLinePosition()), + cancellationToken); + + private async Task HandleRequestAsync(TextDocument razorDocument, RoslynPosition linePosition, CancellationToken cancellationToken) + { + var result = await _remoteServiceInvoker + .TryInvokeAsync( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => + service.GetDefinitionAsync(solutionInfo, razorDocument.Id, linePosition, cancellationToken), + cancellationToken) + .ConfigureAwait(false); + + return result; + } +} From f364cd8bab610dc84dce24c4c5c03c4065f5edec Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Thu, 15 Aug 2024 12:05:26 -0700 Subject: [PATCH 105/386] Push Razor component GTD logic down to Workspaces layer --- .../Definition/DefinitionEndpoint.cs | 279 ++---------- .../RazorComponentDefinitionService.cs | 22 + .../RazorLanguageServer.cs | 6 +- .../Extensions/VsLspExtensions_Location.cs | 12 + .../Extensions/VsLspFactory.cs | 25 ++ ...AbstractRazorComponentDefinitionService.cs | 83 ++++ .../IRazorComponentDefinitionService.cs | 17 + .../RazorComponentDefinitionHelpers.cs | 201 +++++++++ .../DefinitionEndpointDelegationTest.cs | 105 ++--- .../Definition/DefinitionEndpointTest.cs | 418 ------------------ .../RazorComponentDefinitionHelpersTest.cs | 402 +++++++++++++++++ ...tingEndpointTestBase.TestLanguageServer.cs | 4 +- 12 files changed, 856 insertions(+), 718 deletions(-) create mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/RazorComponentDefinitionService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_Location.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/AbstractRazorComponentDefinitionService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/IRazorComponentDefinitionService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/RazorComponentDefinitionHelpers.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointTest.cs create mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/RazorComponentDefinitionHelpersTest.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs index 304c7729526..c573fb9577b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs @@ -1,42 +1,38 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System; -using System.Linq; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Threading; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.GoToDefinition; using Microsoft.CodeAnalysis.Razor.Logging; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.VisualStudio.LanguageServer.Protocol; using DefinitionResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation, - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation[], + Microsoft.VisualStudio.LanguageServer.Protocol.Location, + Microsoft.VisualStudio.LanguageServer.Protocol.Location[], Microsoft.VisualStudio.LanguageServer.Protocol.DocumentLink[]>; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; -using SyntaxKind = Microsoft.AspNetCore.Razor.Language.SyntaxKind; namespace Microsoft.AspNetCore.Razor.LanguageServer.Definition; [RazorLanguageServerEndpoint(Methods.TextDocumentDefinitionName)] internal sealed class DefinitionEndpoint( - IRazorComponentSearchEngine componentSearchEngine, + IRazorComponentDefinitionService componentDefinitionService, IDocumentMappingService documentMappingService, LanguageServerFeatureOptions languageServerFeatureOptions, IClientConnection clientConnection, ILoggerFactory loggerFactory) - : AbstractRazorDelegatingEndpoint(languageServerFeatureOptions, documentMappingService, clientConnection, loggerFactory.GetOrCreateLogger()), ICapabilitiesProvider + : AbstractRazorDelegatingEndpoint( + languageServerFeatureOptions, + documentMappingService, + clientConnection, + loggerFactory.GetOrCreateLogger()), ICapabilitiesProvider { - private readonly IRazorComponentSearchEngine _componentSearchEngine = componentSearchEngine; + private readonly IRazorComponentDefinitionService _componentDefinitionService = componentDefinitionService; private readonly IDocumentMappingService _documentMappingService = documentMappingService; protected override bool PreferCSharpOverHtmlIfPossible => true; @@ -50,60 +46,31 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V serverCapabilities.DefinitionProvider = new DefinitionOptions(); } - protected async override Task TryHandleAsync(TextDocumentPositionParams request, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) + protected async override Task TryHandleAsync( + TextDocumentPositionParams request, + RazorRequestContext requestContext, + DocumentPositionInfo positionInfo, + CancellationToken cancellationToken) { Logger.LogInformation($"Starting go-to-def endpoint request."); + var documentContext = requestContext.DocumentContext; if (documentContext is null) { return null; } - if (!FileKinds.IsComponent(documentContext.FileKind)) - { - Logger.LogInformation($"FileKind '{documentContext.FileKind}' is not a component type."); - return default; - } - // If single server support is on, then we ignore attributes, as they are better handled by delegating to Roslyn - var (originTagDescriptor, attributeDescriptor) = await GetOriginTagHelperBindingAsync(documentContext, positionInfo.HostDocumentIndex, SingleServerSupport, Logger, cancellationToken).ConfigureAwait(false); - if (originTagDescriptor is null) - { - Logger.LogInformation($"Origin TagHelper descriptor is null."); - return default; - } - - var originComponentDocumentSnapshot = await _componentSearchEngine.TryLocateComponentAsync(documentContext.Snapshot, originTagDescriptor).ConfigureAwait(false); - if (originComponentDocumentSnapshot is null) - { - Logger.LogInformation($"Origin TagHelper document snapshot is null."); - return default; - } - - var originComponentDocumentFilePath = originComponentDocumentSnapshot.FilePath.AssumeNotNull(); - - Logger.LogInformation($"Definition found at file path: {originComponentDocumentFilePath}"); - - var range = await GetNavigateRangeAsync(originComponentDocumentSnapshot, attributeDescriptor, cancellationToken).ConfigureAwait(false); - - var originComponentUri = new UriBuilder - { - Path = originComponentDocumentFilePath, - Scheme = Uri.UriSchemeFile, - Host = string.Empty, - }.Uri; - - return new[] - { - new VSInternalLocation - { - Uri = originComponentUri, - Range = range, - }, - }; + return await _componentDefinitionService + .GetDefinitionAsync(documentContext, positionInfo.HostDocumentIndex, ignoreAttributes: SingleServerSupport, cancellationToken) + .ConfigureAwait(false); } - protected override Task CreateDelegatedParamsAsync(TextDocumentPositionParams request, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) + protected override Task CreateDelegatedParamsAsync( + TextDocumentPositionParams request, + RazorRequestContext requestContext, + DocumentPositionInfo positionInfo, + CancellationToken cancellationToken) { var documentContext = requestContext.DocumentContext; if (documentContext is null) @@ -117,25 +84,30 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V positionInfo.LanguageKind)); } - protected async override Task HandleDelegatedResponseAsync(DefinitionResult? response, TextDocumentPositionParams originalRequest, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) + protected async override Task HandleDelegatedResponseAsync( + DefinitionResult? response, + TextDocumentPositionParams originalRequest, + RazorRequestContext requestContext, + DocumentPositionInfo positionInfo, + CancellationToken cancellationToken) { - if (response is null) + if (response is not DefinitionResult result) { return null; } - if (response.Value.TryGetFirst(out var location)) + if (result.TryGetFirst(out var location)) { (location.Uri, location.Range) = await _documentMappingService.MapToHostDocumentUriAndRangeAsync(location.Uri, location.Range, cancellationToken).ConfigureAwait(false); } - else if (response.Value.TryGetSecond(out var locations)) + else if (result.TryGetSecond(out var locations)) { foreach (var loc in locations) { (loc.Uri, loc.Range) = await _documentMappingService.MapToHostDocumentUriAndRangeAsync(loc.Uri, loc.Range, cancellationToken).ConfigureAwait(false); } } - else if (response.Value.TryGetThird(out var links)) + else if (result.TryGetThird(out var links)) { foreach (var link in links) { @@ -146,187 +118,6 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V } } - return response; - } - - internal static async Task<(TagHelperDescriptor?, BoundAttributeDescriptor?)> GetOriginTagHelperBindingAsync( - DocumentContext documentContext, - int absoluteIndex, - bool ignoreAttributes, - ILogger logger, - CancellationToken cancellationToken) - { - var owner = await documentContext.GetSyntaxNodeAsync(absoluteIndex, cancellationToken).ConfigureAwait(false); - if (owner is null) - { - logger.LogInformation($"Could not locate owner."); - return (null, null); - } - - var node = owner.FirstAncestorOrSelf(n => - n.Kind == SyntaxKind.MarkupTagHelperStartTag || - n.Kind == SyntaxKind.MarkupTagHelperEndTag); - if (node is null) - { - logger.LogInformation($"Could not locate ancestor of type MarkupTagHelperStartTag or MarkupTagHelperEndTag."); - return (null, null); - } - - var name = GetStartOrEndTagName(node); - if (name is null) - { - logger.LogInformation($"Could not retrieve name of start or end tag."); - return (null, null); - } - - string? propertyName = null; - - if (!ignoreAttributes && node is MarkupTagHelperStartTagSyntax startTag) - { - // Include attributes where the end index also matches, since GetSyntaxNodeAsync will consider that the start tag but we behave - // as if the user wants to go to the attribute definition. - // ie: - var selectedAttribute = startTag.Attributes.FirstOrDefault(a => a.Span.Contains(absoluteIndex) || a.Span.End == absoluteIndex); - - // If we're on an attribute then just validate against the attribute name - if (selectedAttribute is MarkupTagHelperAttributeSyntax attribute) - { - // Normal attribute, ie - name = attribute.Name; - propertyName = attribute.TagHelperAttributeInfo.Name; - } - else if (selectedAttribute is MarkupMinimizedTagHelperAttributeSyntax minimizedAttribute) - { - // Minimized attribute, ie - name = minimizedAttribute.Name; - propertyName = minimizedAttribute.TagHelperAttributeInfo.Name; - } - } - - if (!name.Span.IntersectsWith(absoluteIndex)) - { - logger.LogInformation($"Tag name or attributes' span does not intersect with location's absolute index ({absoluteIndex})."); - return (null, null); - } - - if (node.Parent is not MarkupTagHelperElementSyntax tagHelperElement) - { - logger.LogInformation($"Parent of start or end tag is not a MarkupTagHelperElement."); - return (null, null); - } - - if (tagHelperElement.TagHelperInfo?.BindingResult is not TagHelperBinding binding) - { - logger.LogInformation($"MarkupTagHelperElement does not contain TagHelperInfo."); - return (null, null); - } - - var originTagDescriptor = binding.Descriptors.FirstOrDefault(static d => !d.IsAttributeDescriptor()); - if (originTagDescriptor is null) - { - logger.LogInformation($"Origin TagHelper descriptor is null."); - return (null, null); - } - - var attributeDescriptor = (propertyName is not null) - ? originTagDescriptor.BoundAttributes.FirstOrDefault(a => a.Name?.Equals(propertyName, StringComparison.Ordinal) == true) - : null; - - return (originTagDescriptor, attributeDescriptor); - } - - private static SyntaxNode? GetStartOrEndTagName(SyntaxNode node) - { - return node switch - { - MarkupTagHelperStartTagSyntax tagHelperStartTag => tagHelperStartTag.Name, - MarkupTagHelperEndTagSyntax tagHelperEndTag => tagHelperEndTag.Name, - _ => null - }; - } - - private async Task GetNavigateRangeAsync(IDocumentSnapshot documentSnapshot, BoundAttributeDescriptor? attributeDescriptor, CancellationToken cancellationToken) - { - if (attributeDescriptor is not null) - { - Logger.LogInformation($"Attempting to get definition from an attribute directly."); - - var originCodeDocument = await documentSnapshot.GetGeneratedOutputAsync().ConfigureAwait(false); - var range = await TryGetPropertyRangeAsync(originCodeDocument, attributeDescriptor.GetPropertyName(), _documentMappingService, Logger, cancellationToken).ConfigureAwait(false); - - if (range is not null) - { - return range; - } - } - - // When navigating from a start or end tag, we just take the user to the top of the file. - // If we were trying to navigate to a property, and we couldn't find it, we can at least take - // them to the file for the component. If the property was defined in a partial class they can - // at least then press F7 to go there. - return VsLspFactory.DefaultRange; - } - - internal static async Task TryGetPropertyRangeAsync(RazorCodeDocument codeDocument, string propertyName, IDocumentMappingService documentMappingService, ILogger logger, CancellationToken cancellationToken) - { - // Parse the C# file and find the property that matches the name. - // We don't worry about parameter attributes here for two main reasons: - // 1. We don't have symbolic information, so the best we could do would be checking for any - // attribute named Parameter, regardless of which namespace. It also means we would have - // to do more checks for all of the various ways that the attribute could be specified - // (eg fully qualified, aliased, etc.) - // 2. Since C# doesn't allow multiple properties with the same name, and we're doing a case - // sensitive search, we know the property we find is the one the user is trying to encode in a - // tag helper attribute. If they don't have the [Parameter] attribute then the Razor compiler - // will error, but allowing them to Go To Def on that property regardless, actually helps - // them fix the error. - var csharpText = codeDocument.GetCSharpSourceText(); - var syntaxTree = CSharpSyntaxTree.ParseText(csharpText, cancellationToken: cancellationToken); - var root = await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); - - // Since we know how the compiler generates the C# source we can be a little specific here, and avoid - // long tree walks. If the compiler ever changes how they generate their code, the tests for this will break - // so we'll know about it. - if (GetClassDeclaration(root) is { } classDeclaration) - { - var property = classDeclaration - .Members - .OfType() - .Where(p => p.Identifier.ValueText.Equals(propertyName, StringComparison.Ordinal)) - .FirstOrDefault(); - - if (property is null) - { - // The property probably exists in a partial class - logger.LogInformation($"Could not find property in the generated source. Comes from partial?"); - return null; - } - - var range = csharpText.GetRange(property.Identifier.Span); - if (documentMappingService.TryMapToHostDocumentRange(codeDocument.GetCSharpDocument(), range, out var originalRange)) - { - return originalRange; - } - - logger.LogInformation($"Property found but couldn't map its location."); - } - - logger.LogInformation($"Generated C# was not in expected shape (CompilationUnit [-> Namespace] -> Class)"); - - return null; - - static ClassDeclarationSyntax? GetClassDeclaration(CodeAnalysis.SyntaxNode root) - { - return root switch - { - CompilationUnitSyntax unit => unit switch - { - { Members: [NamespaceDeclarationSyntax { Members: [ClassDeclarationSyntax c, ..] }, ..] } => c, - { Members: [ClassDeclarationSyntax c, ..] } => c, - _ => null, - }, - _ => null, - }; - } + return result; } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/RazorComponentDefinitionService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/RazorComponentDefinitionService.cs new file mode 100644 index 00000000000..9a330263563 --- /dev/null +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/RazorComponentDefinitionService.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.GoToDefinition; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Workspaces; + +namespace Microsoft.AspNetCore.Razor.LanguageServer.Definition; + +internal sealed class RazorComponentDefinitionService( + IRazorComponentSearchEngine componentSearchEngine, + IDocumentMappingService documentMappingService, + ILoggerFactory loggerFactory) + : AbstractRazorComponentDefinitionService(componentSearchEngine, documentMappingService, loggerFactory.GetOrCreateLogger()) +{ +} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index 601df17f06c..535501e83b2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -25,6 +25,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.WrapWithTag; using Microsoft.AspNetCore.Razor.Telemetry; using Microsoft.CodeAnalysis.Razor.FoldingRanges; +using Microsoft.CodeAnalysis.Razor.GoToDefinition; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Rename; using Microsoft.CodeAnalysis.Razor.Workspaces; @@ -178,10 +179,11 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); - services.AddHandlerWithCapabilities(); - if (!featureOptions.UseRazorCohostServer) { + services.AddSingleton(); + services.AddHandlerWithCapabilities(); + services.AddSingleton(); services.AddHandlerWithCapabilities(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_Location.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_Location.cs new file mode 100644 index 00000000000..e3d77984aae --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspExtensions_Location.cs @@ -0,0 +1,12 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; + +namespace Microsoft.VisualStudio.LanguageServer.Protocol; + +internal static partial class VsLspExtensions +{ + public static void Deconstruct(this Location position, out Uri uri, out Range range) + => (uri, range) = (position.Uri, position.Range); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspFactory.cs index 5b29d44cc60..53664af6b1f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/VsLspFactory.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; using System.Diagnostics; using Microsoft.CodeAnalysis.Text; @@ -159,6 +160,18 @@ public static Range CreateSingleLineRange(LinePosition start, int length) public static Range CreateSingleLineRange((int line, int character) start, int length) => CreateRange(CreatePosition(start), CreatePosition(start.line, start.character + length)); + public static Location CreateLocation(string filePath, LinePositionSpan span) + => CreateLocation(CreateFilePathUri(filePath), CreateRange(span)); + + public static Location CreateLocation(Uri uri, LinePositionSpan span) + => CreateLocation(uri, CreateRange(span)); + + public static Location CreateLocation(string filePath, Range range) + => CreateLocation(CreateFilePathUri(filePath), range); + + public static Location CreateLocation(Uri uri, Range range) + => new() { Uri = uri, Range = range }; + public static TextEdit CreateTextEdit(Range range, string newText) => new() { Range = range, NewText = newText }; @@ -185,4 +198,16 @@ public static TextEdit CreateTextEdit(LinePosition position, string newText) public static TextEdit CreateTextEdit((int line, int character) position, string newText) => CreateTextEdit(CreateZeroWidthRange(position), newText); + + public static Uri CreateFilePathUri(string filePath) + { + var builder = new UriBuilder + { + Path = filePath, + Scheme = Uri.UriSchemeFile, + Host = string.Empty, + }; + + return builder.Uri; + } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/AbstractRazorComponentDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/AbstractRazorComponentDefinitionService.cs new file mode 100644 index 00000000000..13e2e0d03a2 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/AbstractRazorComponentDefinitionService.cs @@ -0,0 +1,83 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using LspLocation = Microsoft.VisualStudio.LanguageServer.Protocol.Location; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; + +namespace Microsoft.CodeAnalysis.Razor.GoToDefinition; + +internal abstract class AbstractRazorComponentDefinitionService( + IRazorComponentSearchEngine componentSearchEngine, + IDocumentMappingService documentMappingService, + ILogger logger) : IRazorComponentDefinitionService +{ + private readonly IRazorComponentSearchEngine _componentSearchEngine = componentSearchEngine; + private readonly IDocumentMappingService _documentMappingService = documentMappingService; + private readonly ILogger _logger = logger; + + public async Task GetDefinitionAsync(DocumentContext documentContext, int hostDocumentIndex, bool ignoreAttributes, CancellationToken cancellationToken) + { + if (!FileKinds.IsComponent(documentContext.FileKind)) + { + _logger.LogInformation($"'{documentContext.FileKind}' is not a component type."); + return null; + } + + var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + + if (!RazorComponentDefinitionHelpers.TryGetBoundTagHelpers(codeDocument, hostDocumentIndex, ignoreAttributes, _logger, out var boundTagHelper, out var boundAttribute)) + { + _logger.LogInformation($"Could not retrieve bound tag helper information."); + return null; + } + + var componentDocument = await _componentSearchEngine.TryLocateComponentAsync(documentContext.Snapshot, boundTagHelper).ConfigureAwait(false); + if (componentDocument is null) + { + _logger.LogInformation($"Could not locate component document."); + return null; + } + + var componentFilePath = componentDocument.FilePath.AssumeNotNull(); + + _logger.LogInformation($"Definition found at file path: {componentFilePath}"); + + var range = await GetNavigateRangeAsync(componentDocument, boundAttribute, cancellationToken).ConfigureAwait(false); + + return VsLspFactory.CreateLocation(componentFilePath, range); + } + + private async Task GetNavigateRangeAsync(IDocumentSnapshot documentSnapshot, BoundAttributeDescriptor? attributeDescriptor, CancellationToken cancellationToken) + { + if (attributeDescriptor is not null) + { + _logger.LogInformation($"Attempting to get definition from an attribute directly."); + + var originCodeDocument = await documentSnapshot.GetGeneratedOutputAsync().ConfigureAwait(false); + + var range = await RazorComponentDefinitionHelpers + .TryGetPropertyRangeAsync(originCodeDocument, attributeDescriptor.GetPropertyName(), _documentMappingService, _logger, cancellationToken) + .ConfigureAwait(false); + + if (range is not null) + { + return range; + } + } + + // When navigating from a start or end tag, we just take the user to the top of the file. + // If we were trying to navigate to a property, and we couldn't find it, we can at least take + // them to the file for the component. If the property was defined in a partial class they can + // at least then press F7 to go there. + return VsLspFactory.DefaultRange; + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/IRazorComponentDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/IRazorComponentDefinitionService.cs new file mode 100644 index 00000000000..3ccf588938b --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/IRazorComponentDefinitionService.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using LspLocation = Microsoft.VisualStudio.LanguageServer.Protocol.Location; + +namespace Microsoft.CodeAnalysis.Razor.GoToDefinition; + +/// +/// Go to Definition support for Razor components. +/// +internal interface IRazorComponentDefinitionService +{ + Task GetDefinitionAsync(DocumentContext documentContext, int hostDocumentIndex, bool ignoreAttributes, CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/RazorComponentDefinitionHelpers.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/RazorComponentDefinitionHelpers.cs new file mode 100644 index 00000000000..66177fb6be2 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/RazorComponentDefinitionHelpers.cs @@ -0,0 +1,201 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.Language.Syntax; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using RazorSyntaxKind = Microsoft.AspNetCore.Razor.Language.SyntaxKind; +using RazorSyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; +using RazorSyntaxToken = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxToken; + +namespace Microsoft.CodeAnalysis.Razor.GoToDefinition; + +internal static class RazorComponentDefinitionHelpers +{ + public static bool TryGetBoundTagHelpers( + RazorCodeDocument codeDocument, int absoluteIndex, bool ignoreAttributes, ILogger logger, + [NotNullWhen(true)] out TagHelperDescriptor? boundTagHelper, + [MaybeNullWhen(true)] out BoundAttributeDescriptor? boundAttribute) + { + boundTagHelper = null; + boundAttribute = null; + + var syntaxTree = codeDocument.GetSyntaxTree(); + + var innermostNode = syntaxTree.Root.FindInnermostNode(absoluteIndex); + if (innermostNode is null) + { + logger.LogInformation($"Could not locate innermost node at index, {absoluteIndex}."); + return false; + } + + var tagHelperNode = innermostNode.FirstAncestorOrSelf(IsTagHelperNode); + if (tagHelperNode is null) + { + logger.LogInformation($"Could not locate ancestor of type MarkupTagHelperStartTag or MarkupTagHelperEndTag."); + return false; + } + + if (!TryGetTagName(tagHelperNode, out var tagName)) + { + logger.LogInformation($"Could not retrieve name of start or end tag."); + return false; + } + + var nameSpan = tagName.Span; + string? propertyName = null; + + if (!ignoreAttributes && tagHelperNode is MarkupTagHelperStartTagSyntax startTag) + { + // Include attributes where the end index also matches, since GetSyntaxNodeAsync will consider that the start tag but we behave + // as if the user wants to go to the attribute definition. + // ie: + var selectedAttribute = startTag.Attributes.FirstOrDefault(a => a.Span.Contains(absoluteIndex) || a.Span.End == absoluteIndex); + + // If we're on an attribute then just validate against the attribute name + switch (selectedAttribute) + { + case MarkupTagHelperAttributeSyntax attribute: + // Normal attribute, ie + nameSpan = attribute.Name.Span; + propertyName = attribute.TagHelperAttributeInfo.Name; + break; + + case MarkupMinimizedTagHelperAttributeSyntax minimizedAttribute: + // Minimized attribute, ie + nameSpan = minimizedAttribute.Name.Span; + propertyName = minimizedAttribute.TagHelperAttributeInfo.Name; + break; + } + } + + if (!nameSpan.IntersectsWith(absoluteIndex)) + { + logger.LogInformation($"Tag name or attributes' span does not intersect with index, {absoluteIndex}."); + return false; + } + + if (tagHelperNode.Parent is not MarkupTagHelperElementSyntax tagHelperElement) + { + logger.LogInformation($"Parent of start or end tag is not a MarkupTagHelperElement."); + return false; + } + + if (tagHelperElement.TagHelperInfo?.BindingResult is not TagHelperBinding binding) + { + logger.LogInformation($"MarkupTagHelperElement does not contain TagHelperInfo."); + return false; + } + + boundTagHelper = binding.Descriptors.FirstOrDefault(static d => !d.IsAttributeDescriptor()); + if (boundTagHelper is null) + { + logger.LogInformation($"Could not locate bound TagHelperDescriptor."); + return false; + } + + boundAttribute = propertyName is not null + ? boundTagHelper.BoundAttributes.FirstOrDefault(a => a.Name?.Equals(propertyName, StringComparison.Ordinal) == true) + : null; + + return true; + + static bool IsTagHelperNode(RazorSyntaxNode node) + { + return node.Kind is RazorSyntaxKind.MarkupTagHelperStartTag or RazorSyntaxKind.MarkupTagHelperEndTag; + } + + static bool TryGetTagName(RazorSyntaxNode node, [NotNullWhen(true)] out RazorSyntaxToken? tagName) + { + tagName = node switch + { + MarkupTagHelperStartTagSyntax tagHelperStartTag => tagHelperStartTag.Name, + MarkupTagHelperEndTagSyntax tagHelperEndTag => tagHelperEndTag.Name, + _ => null + }; + + return tagName is not null; + } + } + + public static async Task TryGetPropertyRangeAsync( + RazorCodeDocument codeDocument, + string propertyName, + IDocumentMappingService documentMappingService, + ILogger logger, + CancellationToken cancellationToken) + { + // Parse the C# file and find the property that matches the name. + // We don't worry about parameter attributes here for two main reasons: + // 1. We don't have symbolic information, so the best we could do would be checking for any + // attribute named Parameter, regardless of which namespace. It also means we would have + // to do more checks for all of the various ways that the attribute could be specified + // (eg fully qualified, aliased, etc.) + // 2. Since C# doesn't allow multiple properties with the same name, and we're doing a case + // sensitive search, we know the property we find is the one the user is trying to encode in a + // tag helper attribute. If they don't have the [Parameter] attribute then the Razor compiler + // will error, but allowing them to Go To Def on that property regardless, actually helps + // them fix the error. + var csharpText = codeDocument.GetCSharpSourceText(); + var syntaxTree = CSharpSyntaxTree.ParseText(csharpText, cancellationToken: cancellationToken); + var root = await syntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false); + + // Since we know how the compiler generates the C# source we can be a little specific here, and avoid + // long tree walks. If the compiler ever changes how they generate their code, the tests for this will break + // so we'll know about it. + if (TryGetClassDeclaration(root, out var classDeclaration)) + { + var property = classDeclaration + .Members + .OfType() + .Where(p => p.Identifier.ValueText.Equals(propertyName, StringComparison.Ordinal)) + .FirstOrDefault(); + + if (property is null) + { + // The property probably exists in a partial class + logger.LogInformation($"Could not find property in the generated source. Comes from partial?"); + return null; + } + + var range = csharpText.GetRange(property.Identifier.Span); + if (documentMappingService.TryMapToHostDocumentRange(codeDocument.GetCSharpDocument(), range, out var originalRange)) + { + return originalRange; + } + + logger.LogInformation($"Property found but couldn't map its location."); + } + + logger.LogInformation($"Generated C# was not in expected shape (CompilationUnit [-> Namespace] -> Class)"); + + return null; + + static bool TryGetClassDeclaration(SyntaxNode root, [NotNullWhen(true)] out ClassDeclarationSyntax? classDeclaration) + { + classDeclaration = root switch + { + CompilationUnitSyntax unit => unit switch + { + { Members: [NamespaceDeclarationSyntax { Members: [ClassDeclarationSyntax c, ..] }, ..] } => c, + { Members: [ClassDeclarationSyntax c, ..] } => c, + _ => null, + }, + _ => null, + }; + + return classDeclaration is not null; + } + } +} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs index 2711a8dc359..c5c53d1ff0b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs @@ -15,8 +15,8 @@ using Xunit; using Xunit.Abstractions; using DefinitionResult = Microsoft.VisualStudio.LanguageServer.Protocol.SumType< - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation, - Microsoft.VisualStudio.LanguageServer.Protocol.VSInternalLocation[], + Microsoft.VisualStudio.LanguageServer.Protocol.Location, + Microsoft.VisualStudio.LanguageServer.Protocol.Location[], Microsoft.VisualStudio.LanguageServer.Protocol.DocumentLink[]>; namespace Microsoft.AspNetCore.Razor.LanguageServer.Definition; @@ -27,17 +27,17 @@ public class DefinitionEndpointDelegationTest(ITestOutputHelper testOutput) : Si public async Task Handle_SingleServer_CSharp_Method() { var input = """ -
- @{ - var x = Ge$$tX(); - } - @functions +
+ @{ + var x = Ge$$tX(); + } + @functions + { + void [|GetX|]() { - void [|GetX|]() - { - } } - """; + } + """; await VerifyCSharpGoToDefinitionAsync(input); } @@ -46,19 +46,19 @@ public async Task Handle_SingleServer_CSharp_Method() public async Task Handle_SingleServer_CSharp_Local() { var input = """ -
- @{ - var x = GetX(); - } - @functions +
+ @{ + var x = GetX(); + } + @functions + { + private string [|_name|]; + string GetX() { - private string [|_name|]; - string GetX() - { - return _na$$me; - } + return _na$$me; } - """; + } + """; await VerifyCSharpGoToDefinitionAsync(input); } @@ -67,12 +67,12 @@ string GetX() public async Task Handle_SingleServer_CSharp_MetadataReference() { var input = """ -
- @functions - { - private stri$$ng _name; - } - """; +
+ @functions + { + private stri$$ng _name; + } + """; // Arrange TestFileMarkupParser.GetPosition(input, out var output, out var cursorPosition); @@ -104,15 +104,15 @@ public async Task Handle_SingleServer_CSharp_MetadataReference() public async Task Handle_SingleServer_Attribute_SameFile(string method) { var input = $$""" -
internal interface IRazorComponentDefinitionService { - Task GetDefinitionAsync(DocumentContext documentContext, int hostDocumentIndex, bool ignoreAttributes, CancellationToken cancellationToken); + Task GetDefinitionAsync(DocumentContext documentContext, DocumentPositionInfo positionInfo, bool ignoreAttributes, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToDefinitionService.cs index 386ccf6354d..b8e91db72c5 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToDefinitionService.cs @@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Razor.Remote; internal interface IRemoteGoToDefinitionService : IRemoteJsonService { - ValueTask GetDefinitionAsync( + ValueTask> GetDefinitionAsync( JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId razorDocumentId, RoslynPosition position, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RazorComponentDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RazorComponentDefinitionService.cs new file mode 100644 index 00000000000..790ad2c5f2f --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RazorComponentDefinitionService.cs @@ -0,0 +1,20 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.GoToDefinition; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Workspaces; + +namespace Microsoft.CodeAnalysis.Remote.Razor.GoToDefinition; + +[Export(typeof(IRazorComponentDefinitionService)), Shared] +[method: ImportingConstructor] +internal sealed class RazorComponentDefinitionService( + IRazorComponentSearchEngine componentSearchEngine, + IDocumentMappingService documentMappingService, + ILoggerFactory loggerFactory) + : AbstractRazorComponentDefinitionService(componentSearchEngine, documentMappingService, loggerFactory.GetOrCreateLogger()) +{ +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs index 61c8f234751..b50fa8fd3bb 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs @@ -7,15 +7,19 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.GoToDefinition; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.LanguageServer.Protocol; using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; +using static Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; +using Microsoft.CodeAnalysis.Razor.Protocol; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -27,10 +31,11 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg => new RemoteGoToDefinitionService(in args); } + private readonly IRazorComponentDefinitionService _componentDefinitionService = args.ExportProvider.GetExportedValue(); private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); private readonly IDocumentMappingService _documentMappingService = args.ExportProvider.GetExportedValue(); - public ValueTask GetDefinitionAsync( + public ValueTask> GetDefinitionAsync( JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId documentId, RoslynPosition position, @@ -41,50 +46,69 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg context => GetDefinitionAsync(context, position, cancellationToken), cancellationToken); - private async ValueTask GetDefinitionAsync( + private async ValueTask> GetDefinitionAsync( RemoteDocumentContext context, RoslynPosition position, CancellationToken cancellationToken) { var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var absoluteIndex = codeDocument.Source.Text.GetRequiredAbsoluteIndex(position.ToLinePosition()); + var hostDocumentIndex = codeDocument.Source.Text.GetRequiredAbsoluteIndex(position.ToLinePosition()); + var positionInfo = _documentMappingService.GetPositionInfo(codeDocument, hostDocumentIndex); - var generatedDocument = await context.GetGeneratedDocumentAsync(_filePathService, cancellationToken).ConfigureAwait(false); + // First, see if this is a Razor component. + var componentLocation = await _componentDefinitionService.GetDefinitionAsync(context, positionInfo, ignoreAttributes: false, cancellationToken).ConfigureAwait(false); + if (componentLocation is not null) + { + // Convert from VS LSP Location to Roslyn. This can be removed when Razor moves fully onto Roslyn's LSP types. + return Results([RoslynLspFactory.CreateLocation(componentLocation.Uri, componentLocation.Range.ToLinePositionSpan())]); + } - if (_documentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), absoluteIndex, out var mappedPosition, out _)) + // If it isn't a Razor component, and it isn't C#, let the server know to delegate to HTML. + if (positionInfo.LanguageKind != RazorLanguageKind.CSharp) { - var locations = await ExternalHandlers.GoToDefinition - .GetDefinitionsAsync( - RemoteWorkspaceAccessor.GetWorkspace(), - generatedDocument, - typeOnly: false, - mappedPosition, - cancellationToken) - .ConfigureAwait(false); + return CallHtml; + } + + if (!_documentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), hostDocumentIndex, out var mappedPosition, out _)) + { + // If we can't map to the generated C# file, we're done. + return NoFurtherHandling; + } - if (locations is null and not []) - { - return locations; - } + // Finally, call into C#. + var generatedDocument = await context.GetGeneratedDocumentAsync(_filePathService, cancellationToken).ConfigureAwait(false); - using var mappedLocations = new PooledArrayBuilder(locations.Length); + var locations = await ExternalHandlers.GoToDefinition + .GetDefinitionsAsync( + RemoteWorkspaceAccessor.GetWorkspace(), + generatedDocument, + typeOnly: false, + mappedPosition, + cancellationToken) + .ConfigureAwait(false); - foreach (var location in locations) - { - var (uri, range) = location; + if (locations is null and not []) + { + // C# didn't return anything, so we're done. + return NoFurtherHandling; + } - var (mappedDocumentUri, mappedRange) = await _documentMappingService - .MapToHostDocumentUriAndRangeAsync((RemoteDocumentSnapshot)context.Snapshot, uri, range.ToLinePositionSpan(), cancellationToken) - .ConfigureAwait(false); + // Map the C# locations back to the Razor file. + using var mappedLocations = new PooledArrayBuilder(locations.Length); - var mappedLocation = RoslynLspFactory.CreateLocation(mappedDocumentUri, mappedRange); + foreach (var location in locations) + { + var (uri, range) = location; + + var (mappedDocumentUri, mappedRange) = await _documentMappingService + .MapToHostDocumentUriAndRangeAsync((RemoteDocumentSnapshot)context.Snapshot, uri, range.ToLinePositionSpan(), cancellationToken) + .ConfigureAwait(false); - mappedLocations.Add(mappedLocation); - } + var mappedLocation = RoslynLspFactory.CreateLocation(mappedDocumentUri, mappedRange); - return mappedLocations.ToArray(); + mappedLocations.Add(mappedLocation); } - return null; + return Results(mappedLocations.ToArray()); } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs index 74a8571e1a6..bc53ca94a4b 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs @@ -1,18 +1,22 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; using System.Composition; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; +using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.LanguageServer.Protocol; using static Roslyn.LanguageServer.Protocol.RoslynLspExtensions; +using RoslynDocumentLink = Roslyn.LanguageServer.Protocol.DocumentLink; using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; using RoslynLspFactory = Roslyn.LanguageServer.Protocol.RoslynLspFactory; -using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; +using VsLspLocation = Microsoft.VisualStudio.LanguageServer.Protocol.Location; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; @@ -23,10 +27,15 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; [ExportCohostStatelessLspService(typeof(CohostGoToDefinitionEndpoint))] [method: ImportingConstructor] #pragma warning restore RS0030 // Do not use banned APIs -internal sealed class CohostGoToDefinitionEndpoint(IRemoteServiceInvoker remoteServiceInvoker) - : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +internal sealed class CohostGoToDefinitionEndpoint( + IRemoteServiceInvoker remoteServiceInvoker, + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker) + : AbstractRazorCohostDocumentRequestHandler?>, IDynamicRegistrationProvider { private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; protected override bool MutatesSolutionState => false; @@ -49,22 +58,84 @@ internal sealed class CohostGoToDefinitionEndpoint(IRemoteServiceInvoker remoteS protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(TextDocumentPositionParams request) => request.TextDocument.ToRazorTextDocumentIdentifier(); - protected override Task HandleRequestAsync(TextDocumentPositionParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + protected override Task?> HandleRequestAsync(TextDocumentPositionParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) => HandleRequestAsync( + request, context.TextDocument.AssumeNotNull(), - RoslynLspFactory.CreatePosition(request.Position.ToLinePosition()), cancellationToken); - private async Task HandleRequestAsync(TextDocument razorDocument, RoslynPosition linePosition, CancellationToken cancellationToken) + private async Task?> HandleRequestAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken) { - var result = await _remoteServiceInvoker - .TryInvokeAsync( + var position = RoslynLspFactory.CreatePosition(request.Position.ToLinePosition()); + + var response = await _remoteServiceInvoker + .TryInvokeAsync>( razorDocument.Project.Solution, (service, solutionInfo, cancellationToken) => - service.GetDefinitionAsync(solutionInfo, razorDocument.Id, linePosition, cancellationToken), + service.GetDefinitionAsync(solutionInfo, razorDocument.Id, position, cancellationToken), cancellationToken) .ConfigureAwait(false); - return result; + if (response.Result is RoslynLocation[] locations) + { + return locations; + } + + if (response.StopHandling) + { + return null; + } + + return await GetHtmlDefinitionsAsync(request, razorDocument, cancellationToken).ConfigureAwait(false); + } + + private async Task?> GetHtmlDefinitionsAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + request.TextDocument.Uri = htmlDocument.Uri; + + var result = await _requestInvoker + .ReinvokeRequestOnServerAsync?>( + htmlDocument.Buffer, + Methods.TextDocumentDefinitionName, + RazorLSPConstants.HtmlLanguageServerName, + request, + cancellationToken) + .ConfigureAwait(false); + + if (result is not { Response: { } response }) + { + return null; + } + + if (response.TryGetFirst(out var singleLocation)) + { + return RoslynLspFactory.CreateLocation(singleLocation.Uri, singleLocation.Range.ToLinePositionSpan()); + } + else if (response.TryGetSecond(out var multipleLocations)) + { + return Array.ConvertAll(multipleLocations, static l => RoslynLspFactory.CreateLocation(l.Uri, l.Range.ToLinePositionSpan())); + } + else if (response.TryGetThird(out var documentLinks)) + { + using var builder = new PooledArrayBuilder(capacity: documentLinks.Length); + + foreach (var documentLink in documentLinks) + { + if (documentLink.Target is Uri target) + { + builder.Add(RoslynLspFactory.CreateDocumentLink(target, documentLink.Range.ToLinePositionSpan())); + } + } + + return builder.ToArray(); + } + + return null; } } From e34dc5482edbcdc2de791b8c119372a0d0dc75fc Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 16 Aug 2024 14:03:36 +1000 Subject: [PATCH 107/386] Don't add already known documents to the misc files project --- .../ProjectSystem/RazorProjectService.cs | 19 +++++++++++---- .../RazorProjectServiceTest.cs | 23 +++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs index 74ebb392272..1f896304173 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs @@ -159,14 +159,25 @@ await _projectManager private void AddDocumentToMiscProjectCore(ProjectSnapshotManager.Updater updater, string filePath) { var textDocumentPath = FilePathNormalizer.Normalize(filePath); + _logger.LogDebug($"Asked to add {textDocumentPath} to the miscellaneous files project, because we don't have project info (yet?)"); - _logger.LogDebug($"Adding {filePath} to the miscellaneous files project, because we don't have project info (yet?)"); - var miscFilesProject = _projectManager.GetMiscellaneousProject(); + var potentialProjects = _projectManager.FindPotentialProjects(textDocumentPath); + foreach (var project in potentialProjects) + { + if (project.DocumentFilePaths.Contains(textDocumentPath, FilePathComparer.Instance)) + { + // Already in a known project, so we don't want it in the misc files project + _logger.LogDebug($"File {textDocumentPath} is already in {project.Key} so we're not adding it to the miscellaneous files project"); + return; + } + } - if (miscFilesProject.GetDocument(FilePathNormalizer.Normalize(textDocumentPath)) is not null) + var miscFilesProject = _projectManager.GetMiscellaneousProject(); + if (miscFilesProject.GetDocument(textDocumentPath) is not null) { // Document already added. This usually occurs when VSCode has already pre-initialized // open documents and then we try to manually add all known razor documents. + _logger.LogDebug($"File {textDocumentPath} is already in the miscellaneous files project, so no-op"); return; } @@ -176,7 +187,7 @@ private void AddDocumentToMiscProjectCore(ProjectSnapshotManager.Updater updater var hostDocument = new HostDocument(textDocumentPath, normalizedTargetFilePath); var textLoader = _remoteTextLoaderFactory.Create(textDocumentPath); - _logger.LogInformation($"Adding document '{filePath}' to project '{miscFilesProject.Key}'."); + _logger.LogInformation($"Adding document '{textDocumentPath}' to project '{miscFilesProject.Key}'."); updater.DocumentAdded(miscFilesProject.Key, hostDocument, textLoader); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs index 0802a4cf61d..0c37f082d9d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs @@ -733,6 +733,29 @@ public async Task AddDocumentToMiscProjectAsync_AddsDocumentToMiscellaneousProje Assert.False(_projectManager.IsDocumentOpen(DocumentFilePath)); } + [Fact] + public async Task AddDocumentToMiscProjectAsync_IgnoresKnownDocument() + { + // Arrange + const string ProjectFilePath = "C:/path/to/project.csproj"; + const string IntermediateOutputPath = "C:/path/to/obj"; + const string RootNamespace = "TestRootNamespace"; + const string DocumentFilePath = "C:/path/to/document.cshtml"; + + await _projectService.AddProjectAsync( + ProjectFilePath, IntermediateOutputPath, RazorConfiguration.Default, RootNamespace, displayName: null, DisposalToken); + await _projectService.AddDocumentToPotentialProjectsAsync(DocumentFilePath, DisposalToken); + + // Act + using var listener = _projectManager.ListenToNotifications(); + + // Act + await _projectService.AddDocumentToMiscProjectAsync(DocumentFilePath, DisposalToken); + + // Assert + listener.AssertNoNotifications(); + } + [Fact] public async Task RemoveDocument_RemovesDocumentFromOwnerProject() { From c2894e201ba6287902689c9add80f6d3768640e2 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 21 Jun 2024 17:13:04 +1000 Subject: [PATCH 108/386] Add a numeric version to document snapshot, and increment it automatically --- .../ProjectSystem/DocumentSnapshot.cs | 2 ++ .../ProjectSystem/DocumentState.cs | 31 ++++++++++++++----- .../ProjectSystem/IDocumentSnapshot.cs | 2 ++ .../ProjectSystem/ImportDocumentSnapshot.cs | 2 ++ .../ProjectSystem/ProjectState.cs | 2 +- .../ProjectSystem/RemoteDocumentSnapshot.cs | 2 ++ 6 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs index e43ca72a06c..fb46ddb484f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs @@ -17,6 +17,8 @@ internal class DocumentSnapshot : IDocumentSnapshot public IProjectSnapshot Project => ProjectInternal; public bool SupportsOutput => true; + public int Version => State.Version; + public ProjectSnapshot ProjectInternal { get; } public DocumentState State { get; } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs index 859673968b2..64385538afa 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentState.cs @@ -28,9 +28,11 @@ internal partial class DocumentState private Task? _loaderTask; private SourceText? _sourceText; private VersionStamp? _version; + private readonly int _numericVersion; public static DocumentState Create( HostDocument hostDocument, + int numericVersion, Func>? loader) { if (hostDocument is null) @@ -38,7 +40,19 @@ public static DocumentState Create( throw new ArgumentNullException(nameof(hostDocument)); } - return new DocumentState(hostDocument, null, null, loader); + return new DocumentState(hostDocument, null, null, numericVersion, loader); + } + + public static DocumentState Create( + HostDocument hostDocument, + Func>? loader) + { + if (hostDocument is null) + { + throw new ArgumentNullException(nameof(hostDocument)); + } + + return new DocumentState(hostDocument, null, null, 1, loader); } // Internal for testing @@ -46,16 +60,19 @@ internal DocumentState( HostDocument hostDocument, SourceText? text, VersionStamp? version, + int numericVersion, Func>? loader) { HostDocument = hostDocument; _sourceText = text; _version = version; + _numericVersion = numericVersion; _loader = loader ?? EmptyLoader; _lock = new object(); } public HostDocument HostDocument { get; } + public int Version => _numericVersion; public bool IsGeneratedOutputResultAvailable => ComputedState.IsResultAvailable == true; @@ -152,12 +169,12 @@ public bool TryGetTextVersion(out VersionStamp result) public virtual DocumentState WithConfigurationChange() { - var state = new DocumentState(HostDocument, _sourceText, _version, _loader) + var state = new DocumentState(HostDocument, _sourceText, _version, _numericVersion + 1, _loader) { // The source could not have possibly changed. _sourceText = _sourceText, _version = _version, - _loaderTask = _loaderTask + _loaderTask = _loaderTask, }; // Do not cache computed state @@ -167,7 +184,7 @@ public virtual DocumentState WithConfigurationChange() public virtual DocumentState WithImportsChange() { - var state = new DocumentState(HostDocument, _sourceText, _version, _loader) + var state = new DocumentState(HostDocument, _sourceText, _version, _numericVersion + 1, _loader) { // The source could not have possibly changed. _sourceText = _sourceText, @@ -183,7 +200,7 @@ public virtual DocumentState WithImportsChange() public virtual DocumentState WithProjectWorkspaceStateChange() { - var state = new DocumentState(HostDocument, _sourceText, _version, _loader) + var state = new DocumentState(HostDocument, _sourceText, _version, _numericVersion + 1, _loader) { // The source could not have possibly changed. _sourceText = _sourceText, @@ -206,7 +223,7 @@ public virtual DocumentState WithText(SourceText sourceText, VersionStamp versio // Do not cache the computed state - return new DocumentState(HostDocument, sourceText, version, null); + return new DocumentState(HostDocument, sourceText, version, _numericVersion + 1, null); } public virtual DocumentState WithTextLoader(Func> loader) @@ -218,7 +235,7 @@ public virtual DocumentState WithTextLoader(Func> loader) // Do not cache the computed state - return new DocumentState(HostDocument, null, null, loader); + return new DocumentState(HostDocument, null, null, _numericVersion + 1, loader); } // Internal, because we are temporarily sharing code with CohostDocumentSnapshot diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs index c1306beee09..460cfac55d5 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs @@ -16,6 +16,8 @@ internal interface IDocumentSnapshot IProjectSnapshot Project { get; } bool SupportsOutput { get; } + int Version { get; } + Task GetTextAsync(); Task GetTextVersionAsync(); Task GetGeneratedOutputAsync(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ImportDocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ImportDocumentSnapshot.cs index 68f7b345d16..2cc8f3cba02 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ImportDocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ImportDocumentSnapshot.cs @@ -32,6 +32,8 @@ public ImportDocumentSnapshot(IProjectSnapshot project, RazorProjectItem item) _version = VersionStamp.Default; } + public int Version => 1; + public Task GetGeneratedOutputAsync() => throw new NotSupportedException(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectState.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectState.cs index e8db1a11848..b51e3bbd285 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectState.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectState.cs @@ -243,7 +243,7 @@ public ProjectState WithAddedHostDocument(HostDocument hostDocument, Func true; + public int Version => throw new NotImplementedException("We don't expect to use this in cohosting because we do not control generated document creation."); + public Task GetTextAsync() => _textDocument.GetTextAsync(); public Task GetTextVersionAsync() => _textDocument.GetTextVersionAsync(); From 546a349bcd0123b94d40020b0392b98bf67e5dc3 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 21 Jun 2024 17:13:28 +1000 Subject: [PATCH 109/386] Remove document version cache --- .../RazorSemanticTokensBenchmark.cs | 9 - ...zorSemanticTokensRangeEndpointBenchmark.cs | 8 - .../RazorSemanticTokensScrollingBenchmark.cs | 7 - .../DocumentContextFactory.cs | 11 +- .../DocumentVersionCache.DocumentEntry.cs | 17 - .../DocumentVersionCache.TestAccessor.cs | 57 ---- .../DocumentVersionCache.cs | 179 ---------- .../IServiceCollectionExtensions.cs | 3 - .../Formatting/HtmlFormatter.cs | 20 +- .../Formatting/HtmlFormattingPass.cs | 3 +- .../GeneratedDocumentSynchronizer.cs | 12 +- .../IDocumentVersionCache.cs | 16 - .../ProjectSystem/RazorProjectService.cs | 35 -- .../Endpoints/RazorCustomMessageTarget.cs | 16 + ...RazorCustomMessageTarget_SemanticTokens.cs | 6 +- ...rCustomMessageTarget_UpdateCSharpBuffer.cs | 13 +- .../CodeActionEndToEndTest.NetFx.cs | 2 +- .../DocumentContextFactoryTest.cs | 15 +- ...extDocumentUriPresentationEndpointTests.cs | 16 +- .../DocumentVersionCacheTest.cs | 322 ------------------ .../Formatting_NetFx/FormattingTestBase.cs | 5 +- .../TestRazorFormattingService.cs | 8 +- .../GeneratedDocumentSynchronizerTest.cs | 9 +- .../RazorComponentSearchEngineTest.cs | 3 - .../RazorProjectServiceTest.cs | 11 +- .../Refactoring/RenameEndpointTest.cs | 4 +- .../TestRazorProjectService.cs | 2 - .../ProjectSystem/TestDocumentSnapshot.cs | 2 + .../ProjectSystem/ProjectStateTest.cs | 2 +- 29 files changed, 64 insertions(+), 749 deletions(-) delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.DocumentEntry.cs delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.TestAccessor.cs delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.cs delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentVersionCache.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentVersionCacheTest.cs diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs index d7825241214..8afb6f83298 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using BenchmarkDotNet.Attributes; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.LanguageServer; using Microsoft.AspNetCore.Razor.LanguageServer.Semantic; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; @@ -28,8 +27,6 @@ public class RazorSemanticTokensBenchmark : RazorLanguageServerBenchmarkBase { private IRazorSemanticTokensInfoService RazorSemanticTokenService { get; set; } - private IDocumentVersionCache VersionCache { get; set; } - private Uri DocumentUri => DocumentContext.Uri; private IDocumentSnapshot DocumentSnapshot => DocumentContext.Snapshot; @@ -75,9 +72,6 @@ public async Task InitializeRazorSemanticAsync() public async Task RazorSemanticTokensRangeAsync() { var cancellationToken = CancellationToken.None; - var documentVersion = 1; - - VersionCache.TrackDocumentVersion(DocumentSnapshot, documentVersion); await RazorSemanticTokenService.GetSemanticTokensAsync(DocumentContext, Range.ToLinePositionSpan(), colorBackground: false, Guid.Empty, cancellationToken: cancellationToken).ConfigureAwait(false); } @@ -98,10 +92,7 @@ protected internal override void Builder(IServiceCollection collection) private void EnsureServicesInitialized() { - var capabilitiesService = new BenchmarkClientCapabilitiesService(new VSInternalClientCapabilities { SupportsVisualStudioExtensions = true }); - var legend = new RazorSemanticTokensLegendService(capabilitiesService); RazorSemanticTokenService = RazorLanguageServerHost.GetRequiredService(); - VersionCache = RazorLanguageServerHost.GetRequiredService(); } internal class TestRazorSemanticTokensInfoService : RazorSemanticTokensInfoService diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs index 8258f197fc8..041413a31b5 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs @@ -32,12 +32,8 @@ public class RazorSemanticTokensRangeEndpointBenchmark : RazorLanguageServerBenc private SemanticTokensRangeEndpoint SemanticTokensRangeEndpoint { get; set; } - private IDocumentVersionCache VersionCache { get; set; } - private Uri DocumentUri => DocumentContext.Uri; - private IDocumentSnapshot DocumentSnapshot => DocumentContext.Snapshot; - private VersionedDocumentContext DocumentContext { get; set; } private Range Range { get; set; } @@ -83,9 +79,6 @@ public async Task InitializeRazorSemanticAsync() start: (0, 0), end: (text.Lines.Count - 1, text.Lines[^1].Span.Length - 1)); - var documentVersion = 1; - VersionCache.TrackDocumentVersion(DocumentSnapshot, documentVersion); - RequestContext = new RazorRequestContext(DocumentContext, RazorLanguageServerHost.GetRequiredService(), "lsp/method", uri: null); var random = new Random(); @@ -133,7 +126,6 @@ protected internal override void Builder(IServiceCollection collection) private void EnsureServicesInitialized() { RazorSemanticTokenService = RazorLanguageServerHost.GetRequiredService(); - VersionCache = RazorLanguageServerHost.GetRequiredService(); } internal class TestCustomizableRazorSemanticTokensInfoService : RazorSemanticTokensInfoService diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs index 4063270b669..6f5107bb265 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs @@ -8,7 +8,6 @@ using System.Threading; using System.Threading.Tasks; using BenchmarkDotNet.Attributes; -using Microsoft.AspNetCore.Razor.LanguageServer; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.SemanticTokens; using Microsoft.CodeAnalysis.Text; @@ -23,8 +22,6 @@ public class RazorSemanticTokensScrollingBenchmark : RazorLanguageServerBenchmar { private IRazorSemanticTokensInfoService RazorSemanticTokenService { get; set; } - private IDocumentVersionCache VersionCache { get; set; } - private VersionedDocumentContext DocumentContext { get; set; } private Uri DocumentUri => DocumentContext.Uri; @@ -66,9 +63,6 @@ public async Task InitializeRazorSemanticAsync() public async Task RazorSemanticTokensRangeScrollingAsync() { var cancellationToken = CancellationToken.None; - var documentVersion = 1; - - VersionCache!.TrackDocumentVersion(DocumentSnapshot, documentVersion); var documentLineCount = Range.End.Line; @@ -105,6 +99,5 @@ protected internal override void Builder(IServiceCollection collection) private void EnsureServicesInitialized() { RazorSemanticTokenService = RazorLanguageServerHost.GetRequiredService(); - VersionCache = RazorLanguageServerHost.GetRequiredService(); } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs index c752e617e0b..7f46807c2a3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs @@ -18,12 +18,10 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; internal sealed class DocumentContextFactory( IProjectSnapshotManager projectManager, - IDocumentVersionCache documentVersionCache, ILoggerFactory loggerFactory) : IDocumentContextFactory { private readonly IProjectSnapshotManager _projectManager = projectManager; - private readonly IDocumentVersionCache _documentVersionCache = documentVersionCache; private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); public bool TryCreate( @@ -80,13 +78,8 @@ private bool TryGetDocumentAndVersion( return true; } - if (_documentVersionCache.TryGetDocumentVersion(documentSnapshot, out var version)) - { - documentAndVersion = new DocumentSnapshotAndVersion(documentSnapshot, version.Value); - return true; - } - - _logger.LogWarning($"Tried to create context for document {filePath} and project {projectContext?.Id} and a document was found, but version didn't match."); + documentAndVersion = new DocumentSnapshotAndVersion(documentSnapshot, documentSnapshot.Version); + return true; } // This is super rare, if we get here it could mean many things. Some of which: diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.DocumentEntry.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.DocumentEntry.cs deleted file mode 100644 index 8c75ad73168..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.DocumentEntry.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; - -namespace Microsoft.AspNetCore.Razor.LanguageServer; - -internal sealed partial class DocumentVersionCache -{ - private readonly struct DocumentEntry(IDocumentSnapshot document, int version) - { - public WeakReference Document { get; } = new WeakReference(document); - - public int Version { get; } = version; - } -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.TestAccessor.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.TestAccessor.cs deleted file mode 100644 index 8af39581c2a..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.TestAccessor.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -#if !NET -using System.Collections.Generic; -#endif -using System.Collections.Immutable; -using Microsoft.AspNetCore.Razor.PooledObjects; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; - -namespace Microsoft.AspNetCore.Razor.LanguageServer; - -internal sealed partial class DocumentVersionCache -{ - internal TestAccessor GetTestAccessor() => new(this); - - internal class TestAccessor(DocumentVersionCache @this) - { - private readonly DocumentVersionCache _this = @this; - - public record struct DocumentEntry(IDocumentSnapshot? Document, int Version); - - public ImmutableDictionary> GetEntries() - { - using var result = new PooledDictionaryBuilder>(); - using var _ = _this._lock.EnterReadLock(); - - foreach (var (key, entries) in _this._documentLookup_NeedsLock) - { - using var versions = new PooledArrayBuilder(); - - foreach (var entry in entries) - { - var document = entry.Document.TryGetTarget(out var target) - ? target - : null; - - var version = entry.Version; - - versions.Add(new(document, version)); - } - - result.Add(key, versions.ToImmutable()); - } - - return result.ToImmutable(); - } - - public void MarkAsLatestVersion(IDocumentSnapshot document) - { - using (_this._lock.EnterUpgradeableReadLock()) - { - _this.MarkAsLatestVersion(document); - } - } - } -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.cs deleted file mode 100644 index b92fc2a926e..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentVersionCache.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using Microsoft.CodeAnalysis.Razor; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.CodeAnalysis.Razor.Workspaces; - -namespace Microsoft.AspNetCore.Razor.LanguageServer; - -internal sealed partial class DocumentVersionCache : IDocumentVersionCache, IRazorStartupService -{ - internal const int MaxDocumentTrackingCount = 20; - - private readonly Dictionary> _documentLookup_NeedsLock = new(FilePathComparer.Instance); - private readonly ReadWriterLocker _lock = new(); - private readonly IProjectSnapshotManager _projectManager; - - public DocumentVersionCache(IProjectSnapshotManager projectManager) - { - _projectManager = projectManager; - _projectManager.Changed += ProjectManager_Changed; - } - - private void ProjectManager_Changed(object? sender, ProjectChangeEventArgs args) - { - // Don't do any work if the solution is closing - if (args.SolutionIsClosing) - { - return; - } - - if (args.Kind == ProjectChangeKind.DocumentChanged) - { - var documentFilePath = args.DocumentFilePath.AssumeNotNull(); - - using (_lock.EnterUpgradeableReadLock()) - { - if (_documentLookup_NeedsLock.ContainsKey(documentFilePath) && - !_projectManager.IsDocumentOpen(documentFilePath)) - { - using (_lock.EnterWriteLock()) - { - // Document closed, evict entry. - _documentLookup_NeedsLock.Remove(documentFilePath); - } - } - } - } - - // Any event that has a project may have changed the state of the documents - // and therefore requires us to mark all existing documents as latest. - if (!_projectManager.TryGetLoadedProject(args.ProjectKey, out var project)) - { - // Project no longer loaded, so there's no work to do. - return; - } - - CaptureProjectDocumentsAsLatest(project); - } - - public void TrackDocumentVersion(IDocumentSnapshot documentSnapshot, int version) - { - if (documentSnapshot is null) - { - throw new ArgumentNullException(nameof(documentSnapshot)); - } - - using (_lock.EnterUpgradeableReadLock()) - { - TrackDocumentVersionCore(documentSnapshot, version); - } - } - - private void TrackDocumentVersionCore(IDocumentSnapshot documentSnapshot, int version) - { - Debug.Assert(_lock.IsUpgradeableReadLockHeld); - - // Need to ensure the write lock covers all uses of documentEntries, not just DocumentLookup - using (_lock.EnterWriteLock()) - { - var key = documentSnapshot.FilePath.AssumeNotNull(); - if (!_documentLookup_NeedsLock.TryGetValue(key, out var documentEntries)) - { - documentEntries = []; - _documentLookup_NeedsLock.Add(key, documentEntries); - } - - if (documentEntries.Count == MaxDocumentTrackingCount) - { - // Clear the oldest document entry - - // With this approach we'll slowly leak memory as new documents are added to the system. We don't clear up - // document file paths where where all of the corresponding entries are expired. - documentEntries.RemoveAt(0); - } - - var entry = new DocumentEntry(documentSnapshot, version); - documentEntries.Add(entry); - } - } - - public int GetLatestDocumentVersion(string filePath) - { - using var _ = _lock.EnterReadLock(); - - if (!_documentLookup_NeedsLock.TryGetValue(filePath, out var documentEntries)) - { - return -1; - } - - return documentEntries[^1].Version; - } - - public bool TryGetDocumentVersion(IDocumentSnapshot documentSnapshot, [NotNullWhen(true)] out int? version) - { - if (documentSnapshot is null) - { - throw new ArgumentNullException(nameof(documentSnapshot)); - } - - using var _ = _lock.EnterReadLock(); - - var filePath = documentSnapshot.FilePath.AssumeNotNull(); - if (!_documentLookup_NeedsLock.TryGetValue(filePath, out var documentEntries)) - { - version = null; - return false; - } - - // We iterate backwards over the entries to prioritize newer entries. - for (var i = documentEntries.Count - 1; i >= 0; i--) - { - if (documentEntries[i].Document.TryGetTarget(out var document) && - document == documentSnapshot) - { - version = documentEntries[i].Version; - return true; - } - } - - version = null; - return false; - } - - private void CaptureProjectDocumentsAsLatest(IProjectSnapshot projectSnapshot) - { - Debug.Assert(!_lock.IsUpgradeableReadLockHeld); - - using var _ = _lock.EnterUpgradeableReadLock(); - - foreach (var documentPath in projectSnapshot.DocumentFilePaths) - { - if (_documentLookup_NeedsLock.ContainsKey(documentPath) && - projectSnapshot.GetDocument(documentPath) is { } document) - { - MarkAsLatestVersion(document); - } - } - } - - private void MarkAsLatestVersion(IDocumentSnapshot document) - { - Debug.Assert(_lock.IsUpgradeableReadLockHeld); - - if (!_documentLookup_NeedsLock.TryGetValue(document.FilePath.AssumeNotNull(), out var documentEntries)) - { - return; - } - - var latestEntry = documentEntries[^1]; - - // Update our internal tracking state to track the changed document as the latest document. - TrackDocumentVersionCore(document, latestEntry.Version); - } -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs index 38dfdb87dfb..42a5baee4c9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs @@ -195,9 +195,6 @@ public static void AddDocumentManagementServices(this IServiceCollection service services.AddSingleton(); services.AddSingleton(sp => new Lazy(sp.GetRequiredService)); - services.AddSingleton(); - services.AddSingleton((services) => (IRazorStartupService)services.GetRequiredService()); - services.AddSingleton(); services.AddSingleton(); services.AddSingleton((services) => (RazorProjectService)services.GetRequiredService()); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs index 288afdeacac..4e990827dea 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs @@ -16,15 +16,11 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; internal class HtmlFormatter { - private readonly IDocumentVersionCache _documentVersionCache; private readonly IClientConnection _clientConnection; - public HtmlFormatter( - IClientConnection clientConnection, - IDocumentVersionCache documentVersionCache) + public HtmlFormatter(IClientConnection clientConnection) { _clientConnection = clientConnection; - _documentVersionCache = documentVersionCache; } public async Task FormatAsync( @@ -36,10 +32,7 @@ public async Task FormatAsync( throw new ArgumentNullException(nameof(context)); } - if (!_documentVersionCache.TryGetDocumentVersion(context.OriginalSnapshot, out var documentVersion)) - { - return Array.Empty(); - } + var documentVersion = context.OriginalSnapshot.Version; var @params = new RazorDocumentFormattingParams() { @@ -47,7 +40,7 @@ public async Task FormatAsync( { Uri = context.Uri, }, - HostDocumentVersion = documentVersion.Value, + HostDocumentVersion = documentVersion, Options = context.Options }; @@ -63,10 +56,7 @@ public async Task FormatOnTypeAsync( FormattingContext context, CancellationToken cancellationToken) { - if (!_documentVersionCache.TryGetDocumentVersion(context.OriginalSnapshot, out var documentVersion)) - { - return Array.Empty(); - } + var documentVersion = context.OriginalSnapshot.Version; var @params = new RazorDocumentOnTypeFormattingParams() { @@ -74,7 +64,7 @@ public async Task FormatOnTypeAsync( Character = context.TriggerCharacter.ToString(), TextDocument = new TextDocumentIdentifier { Uri = context.Uri }, Options = context.Options, - HostDocumentVersion = documentVersion.Value, + HostDocumentVersion = documentVersion, }; var result = await _clientConnection.SendRequestAsync( diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs index f522ea5790c..3e9f87b7ea7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs @@ -19,11 +19,10 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; internal sealed class HtmlFormattingPass( IDocumentMappingService documentMappingService, IClientConnection clientConnection, - IDocumentVersionCache documentVersionCache, ILoggerFactory loggerFactory) : FormattingPassBase(documentMappingService) { - private readonly HtmlFormatter _htmlFormatter = new HtmlFormatter(clientConnection, documentVersionCache); + private readonly HtmlFormatter _htmlFormatter = new HtmlFormatter(clientConnection); private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); // We want this to run first because it uses the client HTML formatter. diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs index 2fe06d466d3..b3a01451ce5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs @@ -9,20 +9,14 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; internal class GeneratedDocumentSynchronizer( IGeneratedDocumentPublisher publisher, - IDocumentVersionCache documentVersionCache, LanguageServerFeatureOptions languageServerFeatureOptions) : IDocumentProcessedListener { private readonly IGeneratedDocumentPublisher _publisher = publisher; - private readonly IDocumentVersionCache _documentVersionCache = documentVersionCache; private readonly LanguageServerFeatureOptions _languageServerFeatureOptions = languageServerFeatureOptions; public void DocumentProcessed(RazorCodeDocument codeDocument, IDocumentSnapshot document) { - if (!_documentVersionCache.TryGetDocumentVersion(document, out var hostDocumentVersion)) - { - // Could not resolve document version - return; - } + var hostDocumentVersion = document.Version; var filePath = document.FilePath.AssumeNotNull(); @@ -31,11 +25,11 @@ public void DocumentProcessed(RazorCodeDocument codeDocument, IDocumentSnapshot { var htmlText = codeDocument.GetHtmlSourceText(); - _publisher.PublishHtml(document.Project.Key, filePath, htmlText, hostDocumentVersion.Value); + _publisher.PublishHtml(document.Project.Key, filePath, htmlText, hostDocumentVersion); } var csharpText = codeDocument.GetCSharpSourceText(); - _publisher.PublishCSharp(document.Project.Key, filePath, csharpText, hostDocumentVersion.Value); + _publisher.PublishCSharp(document.Project.Key, filePath, csharpText, hostDocumentVersion); } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentVersionCache.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentVersionCache.cs deleted file mode 100644 index 932d55ea68a..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentVersionCache.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System.Diagnostics.CodeAnalysis; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; - -namespace Microsoft.AspNetCore.Razor.LanguageServer; - -internal interface IDocumentVersionCache -{ - bool TryGetDocumentVersion(IDocumentSnapshot documentSnapshot, [NotNullWhen(true)] out int? version); - void TrackDocumentVersion(IDocumentSnapshot documentSnapshot, int version); - - // HACK: This is temporary to allow the cohosting and normal language server to co-exist and share code - int GetLatestDocumentVersion(string filePath); -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs index 74ebb392272..696129efb99 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs @@ -36,7 +36,6 @@ internal partial class RazorProjectService : IRazorProjectService, IRazorProject private readonly IRazorProjectInfoDriver _projectInfoDriver; private readonly IProjectSnapshotManager _projectManager; private readonly RemoteTextLoaderFactory _remoteTextLoaderFactory; - private readonly IDocumentVersionCache _documentVersionCache; private readonly ILogger _logger; private readonly CancellationTokenSource _disposeTokenSource; @@ -45,14 +44,12 @@ internal partial class RazorProjectService : IRazorProjectService, IRazorProject public RazorProjectService( IProjectSnapshotManager projectManager, IRazorProjectInfoDriver projectInfoDriver, - IDocumentVersionCache documentVersionCache, RemoteTextLoaderFactory remoteTextLoaderFactory, ILoggerFactory loggerFactory) { _projectInfoDriver = projectInfoDriver; _projectManager = projectManager; _remoteTextLoaderFactory = remoteTextLoaderFactory; - _documentVersionCache = documentVersionCache; _logger = loggerFactory.GetOrCreateLogger(); // We kick off initialization immediately to ensure that the IRazorProjectService @@ -208,14 +205,6 @@ await _projectManager.UpdateAsync( _logger.LogInformation($"Opening document '{textDocumentPath}' in project '{projectSnapshot.Key}'."); updater.DocumentOpened(projectSnapshot.Key, textDocumentPath, sourceText); }); - - // Use a separate loop, as the above call modified out projects, so we have to make sure we're operating on the latest snapshot - ActOnDocumentInMultipleProjects( - filePath, - (projectSnapshot, textDocumentPath) => - { - TrackDocumentVersion(projectSnapshot, textDocumentPath, version, startGenerating: true); - }); }, cancellationToken) .ConfigureAwait(false); @@ -304,14 +293,6 @@ await _projectManager.UpdateAsync( updater.DocumentChanged(project.Key, textDocumentPath, sourceText); }); - - // Use a separate loop, as the above call modified out projects, so we have to make sure we're operating on the latest snapshot - ActOnDocumentInMultipleProjects( - filePath, - (projectSnapshot, textDocumentPath) => - { - TrackDocumentVersion(projectSnapshot, textDocumentPath, version, startGenerating: false); - }); }, cancellationToken) .ConfigureAwait(false); @@ -672,20 +653,4 @@ private void TryMigrateMiscellaneousDocumentsToProject(ProjectSnapshotManager.Up updater.DocumentAdded(projectSnapshot.Key, newHostDocument, textLoader); } } - - private void TrackDocumentVersion(IProjectSnapshot projectSnapshot, string textDocumentPath, int version, bool startGenerating) - { - if (projectSnapshot.GetDocument(FilePathNormalizer.Normalize(textDocumentPath)) is not { } documentSnapshot) - { - return; - } - - _documentVersionCache.TrackDocumentVersion(documentSnapshot, version); - - if (startGenerating) - { - // Start generating the C# for the document so it can immediately be ready for incoming requests. - documentSnapshot.GetGeneratedOutputAsync().Forget(); - } - } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs index 1ae779026f7..c16944aa492 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs @@ -136,6 +136,7 @@ private async Task> TrySynchronizeV int requiredHostDocumentVersion, TextDocumentIdentifier hostDocument, CancellationToken cancellationToken, + Range? _ = null, bool rejectOnNewerParallelRequest = true, [CallerMemberName] string? caller = null) where TVirtualDocumentSnapshot : VirtualDocumentSnapshot @@ -200,6 +201,21 @@ private async Task> TrySynchronizeV _logger.LogDebug($"{(result.Synchronized ? "Did" : "Did NOT")} synchronize for {caller}: Version {requiredHostDocumentVersion} for {result.VirtualSnapshot?.Uri}"); } + //if (requiredHostDocumentVersion == 1 && + // result.Synchronized && + // result.VirtualSnapshot is not null && + // range is not null) + //{ + // // If we're at version 1, and we're synced, lets make sure the buffer has enough lines to handle the request + // if (range.Start.Line > result.VirtualSnapshot.Snapshot.LineCount || + // range.End.Line > result.VirtualSnapshot.Snapshot.LineCount) + // { + // Debug.Fail("It worked!"); + // _logger.LogWarning($"Requested line ({range.Start.Line} or {range.End.Line}) is out of bounds for {result.VirtualSnapshot.Uri}. Sync failed."); + // return new SynchronizedResult(false, null); + // } + //} + return result; } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs index 1d895280ad4..90656ea4453 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; @@ -70,7 +71,8 @@ internal partial class RazorCustomMessageTarget var (synchronized, csharpDoc) = await TrySynchronizeVirtualDocumentAsync( (int)semanticTokensParams.RequiredHostDocumentVersion, semanticTokensParams.TextDocument, - cancellationToken); + cancellationToken, + semanticTokensParams.Ranges.FirstOrDefault()); if (csharpDoc is null) { @@ -92,6 +94,8 @@ internal partial class RazorCustomMessageTarget if (csharpDoc.Snapshot.LineCount < lastGeneratedDocumentLine) { + _logger.LogWarning($"Pretending we're not synced because we're asking for line {lastGeneratedDocumentLine} but there are only {csharpDoc.Snapshot.LineCount} lines in the buffer."); + Debug.Fail("Rejecting!"); // We report this as a fail to synchronize, as that's essentially what it is: We were asked for v1, with X lines // and whilst we have v1, we don't have X lines, so we need to wait for a future update to arrive and give us // more content. diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs index 9ebc750ea31..e2b6355c927 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs @@ -78,7 +78,7 @@ request.ProjectKeyId is not null && { if (virtualDocument.ProjectKey.Equals(new ProjectKey(request.ProjectKeyId))) { - _logger.LogDebug($"UpdateCSharpBuffer virtual doc for {request.HostDocumentVersion} of {virtualDocument.Uri}"); + _logger.LogDebug($"UpdateCSharpBuffer virtual doc for {request.HostDocumentVersion} of {virtualDocument.Uri}. Previous lines: {virtualDocument.Snapshot.LineCount}"); _documentManager.UpdateVirtualDocument( hostDocumentUri, @@ -86,6 +86,17 @@ request.ProjectKeyId is not null && request.Changes.Select(change => change.ToVisualStudioTextChange()).ToArray(), request.HostDocumentVersion.Value, state: request.PreviousWasEmpty); + + if (_documentManager.TryGetDocument(hostDocumentUri, out var newDocSnapshot)) + { + var newDoc = newDocSnapshot.VirtualDocuments.Where(e => e.Uri == virtualDocument.Uri).FirstOrDefault(); + + if (newDoc is not null) + { + _logger.LogDebug($"UpdateCSharpBuffer finished updating doc for {request.HostDocumentVersion} of {virtualDocument.Uri}. New lines: {newDoc.Snapshot.LineCount}"); + } + } + return; } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs index 33b35e3df98..3afd4bc01c2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs @@ -1131,7 +1131,7 @@ private async Task ValidateCodeActionAsync( Assert.NotNull(codeActionToRun); - var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, documentContext.Snapshot, optionsMonitor?.CurrentValue); + var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, optionsMonitor?.CurrentValue); var changes = await GetEditsAsync( codeActionToRun, requestContext, diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs index 31394f347d2..295533b052e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs @@ -21,13 +21,11 @@ public class DocumentContextFactoryTest : LanguageServerTestBase private static readonly string s_baseDirectory = PathUtilities.CreateRootedPath("path", "to"); private readonly TestProjectSnapshotManager _projectManager; - private readonly IDocumentVersionCache _documentVersionCache; public DocumentContextFactoryTest(ITestOutputHelper testOutput) : base(testOutput) { _projectManager = CreateProjectSnapshotManager(); - _documentVersionCache = new DocumentVersionCache(_projectManager); } [Fact] @@ -37,7 +35,7 @@ public void TryCreateAsync_CanNotResolveDocument_ReturnsNull() var filePath = FilePathNormalizer.Normalize(Path.Combine(s_baseDirectory, "file.cshtml")); var uri = new Uri(filePath); - var factory = new DocumentContextFactory(_projectManager, _documentVersionCache, LoggerFactory); + var factory = new DocumentContextFactory(_projectManager, LoggerFactory); // Act Assert.False(factory.TryCreate(uri, out _)); @@ -50,7 +48,7 @@ public void TryCreateForOpenDocumentAsync_CanNotResolveDocument_ReturnsNull() var filePath = FilePathNormalizer.Normalize(Path.Combine(s_baseDirectory, "file.cshtml")); var uri = new Uri(filePath); - var factory = new DocumentContextFactory(_projectManager, _documentVersionCache, LoggerFactory); + var factory = new DocumentContextFactory(_projectManager, LoggerFactory); // Act Assert.False(factory.TryCreateForOpenDocument(uri, out _)); @@ -70,7 +68,7 @@ await _projectManager.UpdateAsync(updater => updater.DocumentAdded(MiscFilesHostProject.Instance.Key, hostDocument, TestMocks.CreateTextLoader(filePath, "")); }); - var factory = new DocumentContextFactory(_projectManager, _documentVersionCache, LoggerFactory); + var factory = new DocumentContextFactory(_projectManager, LoggerFactory); // Act Assert.False(factory.TryCreateForOpenDocument(uri, out _)); @@ -94,7 +92,7 @@ await _projectManager.UpdateAsync(updater => var documentSnapshot = miscFilesProject.GetDocument(filePath); Assert.NotNull(documentSnapshot); - var factory = new DocumentContextFactory(_projectManager, _documentVersionCache, LoggerFactory); + var factory = new DocumentContextFactory(_projectManager, LoggerFactory); // Act Assert.True(factory.TryCreate(uri, out var documentContext)); @@ -113,7 +111,7 @@ public async Task TryCreateAsync_WithProjectContext_Resolves() var projectFilePath = Path.Combine(s_baseDirectory, "project.csproj"); var uri = new Uri(filePath); - var factory = new DocumentContextFactory(_projectManager, _documentVersionCache, LoggerFactory); + var factory = new DocumentContextFactory(_projectManager, LoggerFactory); var hostProject = new HostProject(projectFilePath, intermediateOutputPath, RazorConfiguration.Default, rootNamespace: null); var hostDocument = new HostDocument(filePath, "file.cshtml"); @@ -149,8 +147,7 @@ await _projectManager.UpdateAsync(updater => var documentSnapshot = miscFilesProject.GetDocument(filePath); Assert.NotNull(documentSnapshot); - _documentVersionCache.TrackDocumentVersion(documentSnapshot, version: 1337); - var factory = new DocumentContextFactory(_projectManager, _documentVersionCache, LoggerFactory); + var factory = new DocumentContextFactory(_projectManager, LoggerFactory); // Act Assert.True(factory.TryCreateForOpenDocument(uri, out var documentContext)); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs index 318436e546a..100667df822 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs @@ -47,11 +47,9 @@ public async Task Handle_SimpleComponent_ReturnsResult() var razorFilePath = "c:/path/index.razor"; var uri = new Uri(razorFilePath); - var documentVersionCache = new DocumentVersionCache(projectManager); await projectManager.UpdateAsync(updater => updater.DocumentOpened(project.Key, razorFilePath, SourceText.From("
"))); var documentSnapshot = projectManager.GetLoadedProject(project.Key).GetDocument(razorFilePath).AssumeNotNull(); - documentVersionCache.TrackDocumentVersion(documentSnapshot, 1); - var documentContextFactory = new DocumentContextFactory(projectManager, documentVersionCache, LoggerFactory); + var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, null, out var documentContext)); var clientConnection = new Mock(MockBehavior.Strict); @@ -105,11 +103,9 @@ public async Task Handle_SimpleComponentWithChildFile_ReturnsResult() var razorFilePath = "c:/path/index.razor"; var uri = new Uri(razorFilePath); - var documentVersionCache = new DocumentVersionCache(projectManager); await projectManager.UpdateAsync(updater => updater.DocumentOpened(project.Key, razorFilePath, SourceText.From("
"))); var documentSnapshot = projectManager.GetLoadedProject(project.Key).GetDocument(razorFilePath).AssumeNotNull(); - documentVersionCache.TrackDocumentVersion(documentSnapshot, 1); - var documentContextFactory = new DocumentContextFactory(projectManager, documentVersionCache, LoggerFactory); + var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, null, out var documentContext)); var clientConnection = new Mock(MockBehavior.Strict); @@ -174,11 +170,9 @@ public async Task Handle_ComponentWithRequiredAttribute_ReturnsResult() var razorFilePath = "c:/path/index.razor"; var uri = new Uri(razorFilePath); - var documentVersionCache = new DocumentVersionCache(projectManager); await projectManager.UpdateAsync(updater => updater.DocumentOpened(project.Key, razorFilePath, SourceText.From("
"))); var documentSnapshot = projectManager.GetLoadedProject(project.Key).GetDocument(razorFilePath).AssumeNotNull(); - documentVersionCache.TrackDocumentVersion(documentSnapshot, 1); - var documentContextFactory = new DocumentContextFactory(projectManager, documentVersionCache, LoggerFactory); + var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, null, out var documentContext)); var clientConnection = new Mock(MockBehavior.Strict); @@ -382,11 +376,9 @@ public async Task Handle_ComponentWithNestedFiles_ReturnsResult() var razorFilePath = "c:/path/index.razor"; var uri = new Uri(razorFilePath); - var documentVersionCache = new DocumentVersionCache(projectManager); await projectManager.UpdateAsync(updater => updater.DocumentOpened(project.Key, razorFilePath, SourceText.From("
"))); var documentSnapshot = projectManager.GetLoadedProject(project.Key).GetDocument(razorFilePath).AssumeNotNull(); - documentVersionCache.TrackDocumentVersion(documentSnapshot, 1); - var documentContextFactory = new DocumentContextFactory(projectManager, documentVersionCache, LoggerFactory); + var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, null, out var documentContext)); var clientConnection = new Mock(MockBehavior.Strict); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentVersionCacheTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentVersionCacheTest.cs deleted file mode 100644 index acad8a273e2..00000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentVersionCacheTest.cs +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -#if NETFRAMEWORK -using System; -using System.Collections.Generic; -#endif -using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.ProjectSystem; -using Microsoft.CodeAnalysis; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.AspNetCore.Razor.LanguageServer; - -public class DocumentVersionCacheTest(ITestOutputHelper testOutput) : LanguageServerTestBase(testOutput) -{ - [Fact] - public void MarkAsLatestVersion_UntrackedDocument_Noops() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - var cacheAccessor = cache.GetTestAccessor(); - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - cache.TrackDocumentVersion(document, 123); - var untrackedDocument = TestDocumentSnapshot.Create("C:/other.cshtml"); - - // Act - cacheAccessor.MarkAsLatestVersion(untrackedDocument); - - // Assert - Assert.False(cache.TryGetDocumentVersion(untrackedDocument, out var version)); - Assert.Null(version); - } - - [Fact] - public void MarkAsLatestVersion_KnownDocument_TracksNewDocumentAsLatest() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - var cacheAccessor = cache.GetTestAccessor(); - var documentInitial = TestDocumentSnapshot.Create("C:/file.cshtml"); - cache.TrackDocumentVersion(documentInitial, 123); - var documentLatest = TestDocumentSnapshot.Create(documentInitial.FilePath); - - // Act - cacheAccessor.MarkAsLatestVersion(documentLatest); - - // Assert - Assert.True(cache.TryGetDocumentVersion(documentLatest, out var version)); - Assert.Equal(123, version); - } - - [Fact] - public async Task ProjectSnapshotManager_Changed_DocumentRemoved_DoesNotEvictDocument() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - Assert.True(document.TryGetText(out var text)); - Assert.True(document.TryGetTextVersion(out var textVersion)); - var textAndVersion = TextAndVersion.Create(text, textVersion); - cache.TrackDocumentVersion(document, 1337); - - await projectManager.UpdateAsync(updater => - { - updater.ProjectAdded(document.ProjectInternal.HostProject); - updater.DocumentAdded(document.ProjectInternal.Key, document.State.HostDocument, TextLoader.From(textAndVersion)); - }); - - // Act - 1 - var result = cache.TryGetDocumentVersion(document, out _); - - // Assert - 1 - Assert.True(result); - - // Act - 2 - await projectManager.UpdateAsync(updater => - updater.DocumentRemoved(document.ProjectInternal.Key, document.State.HostDocument)); - result = cache.TryGetDocumentVersion(document, out _); - - // Assert - 2 - Assert.True(result); - } - - [Fact] - public async Task ProjectSnapshotManager_Changed_OpenDocumentRemoved_DoesNotEvictDocument() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - Assert.True(document.TryGetText(out var text)); - Assert.True(document.TryGetTextVersion(out var textVersion)); - var textAndVersion = TextAndVersion.Create(text, textVersion); - cache.TrackDocumentVersion(document, 1337); - - await projectManager.UpdateAsync(updater => - { - updater.ProjectAdded(document.ProjectInternal.HostProject); - updater.DocumentAdded(document.ProjectInternal.Key, document.State.HostDocument, TextLoader.From(textAndVersion)); - updater.DocumentOpened(document.ProjectInternal.Key, document.FilePath, textAndVersion.Text); - }); - - // Act - 1 - var result = cache.TryGetDocumentVersion(document, out _); - - // Assert - 1 - Assert.True(result); - Assert.True(projectManager.IsDocumentOpen(document.FilePath)); - - // Act - 2 - await projectManager.UpdateAsync(updater => - updater.DocumentRemoved(document.ProjectInternal.Key, document.State.HostDocument)); - result = cache.TryGetDocumentVersion(document, out _); - - // Assert - 2 - Assert.True(result); - } - - [Fact] - public async Task ProjectSnapshotManager_Changed_DocumentClosed_EvictsDocument() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - Assert.True(document.TryGetText(out var text)); - Assert.True(document.TryGetTextVersion(out var textVersion)); - var textAndVersion = TextAndVersion.Create(text, textVersion); - cache.TrackDocumentVersion(document, 1337); - var textLoader = TextLoader.From(textAndVersion); - - await projectManager.UpdateAsync(updater => - { - updater.ProjectAdded(document.ProjectInternal.HostProject); - updater.DocumentAdded(document.ProjectInternal.Key, document.State.HostDocument, textLoader); - }); - - // Act - 1 - var result = cache.TryGetDocumentVersion(document, out _); - - // Assert - 1 - Assert.True(result); - - // Act - 2 - await projectManager.UpdateAsync(updater => - updater.DocumentClosed(document.ProjectInternal.HostProject.Key, document.State.HostDocument.FilePath, textLoader)); - result = cache.TryGetDocumentVersion(document, out var version); - - // Assert - 2 - Assert.False(result); - Assert.Null(version); - } - - [Fact] - public void TrackDocumentVersion_AddsFirstEntry() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - var cacheAccessor = cache.GetTestAccessor(); - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - - // Act - cache.TrackDocumentVersion(document, 1337); - - // Assert - var entries = cacheAccessor.GetEntries(); - var (filePath, entry) = Assert.Single(entries); - Assert.Equal(document.FilePath, filePath); - var (actualDocument, actualVersion) = Assert.Single(entry); - Assert.Same(document, actualDocument); - Assert.Equal(1337, actualVersion); - } - - [Fact] - public void TrackDocumentVersion_EvictsOldEntries() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - var cacheAccessor = cache.GetTestAccessor(); - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - - for (var i = 0; i < DocumentVersionCache.MaxDocumentTrackingCount; i++) - { - cache.TrackDocumentVersion(document, i); - } - - // Act - cache.TrackDocumentVersion(document, 1337); - - // Assert - var (_, entry) = Assert.Single(cacheAccessor.GetEntries()); - Assert.Equal(DocumentVersionCache.MaxDocumentTrackingCount, entry.Length); - Assert.Equal(1337, entry[^1].Version); - } - - [Fact] - public void TryGetDocumentVersion_UntrackedDocumentPath_ReturnsFalse() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - - // Act - var result = cache.TryGetDocumentVersion(document, out var version); - - // Assert - Assert.False(result); - Assert.Null(version); - } - - [Fact] - public void TryGetDocumentVersion_EvictedDocument_ReturnsFalse() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - var evictedDocument = TestDocumentSnapshot.Create(document.FilePath); - cache.TrackDocumentVersion(document, 1337); - - // Act - var result = cache.TryGetDocumentVersion(evictedDocument, out var version); - - // Assert - Assert.False(result); - Assert.Null(version); - } - - [Fact] - public void TryGetDocumentVersion_KnownDocument_ReturnsTrue() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - var document = TestDocumentSnapshot.Create("C:/file.cshtml"); - cache.TrackDocumentVersion(document, 1337); - - // Act - var result = cache.TryGetDocumentVersion(document, out var version); - - // Assert - Assert.True(result); - Assert.Equal(1337, version); - } - - [Fact] - public async Task ProjectSnapshotManager_KnownDocumentAdded_TracksNewDocument() - { - // Arrange - var projectManager = CreateProjectSnapshotManager(); - var cache = new DocumentVersionCache(projectManager); - var cacheAccessor = cache.GetTestAccessor(); - - var project1 = TestProjectSnapshot.Create( - "C:/path/to/project1.csproj", - intermediateOutputPath: "C:/path/to/obj1", - documentFilePaths: [], - RazorConfiguration.Default, - projectWorkspaceState: null); - - var document1 = await projectManager.UpdateAsync(updater => - { - updater.ProjectAdded(project1.HostProject); - return updater.CreateAndAddDocument(project1, @"C:\path\to\file.razor"); - }); - - // Act - cache.TrackDocumentVersion(document1, 1337); - - // Assert - var (filePath, entries) = Assert.Single(cacheAccessor.GetEntries()); - Assert.Equal(document1.FilePath, filePath); - var (actualDocument, actualVersion) = Assert.Single(entries); - Assert.Same(document1, actualDocument); - Assert.Equal(1337, actualVersion); - - // Act II - var project2 = TestProjectSnapshot.Create( - "C:/path/to/project2.csproj", - intermediateOutputPath: "C:/path/to/obj2", - documentFilePaths: [], - RazorConfiguration.Default, - projectWorkspaceState: null); - - var document2 = await projectManager.UpdateAsync(updater => - { - updater.ProjectAdded(project2.HostProject); - updater.CreateAndAddDocument(project2, @"C:\path\to\file.razor"); - - return updater - .GetLoadedProject(project2.Key) - .GetDocument(document1.FilePath); - }); - - // Assert II - (filePath, entries) = Assert.Single(cacheAccessor.GetEntries()); - Assert.Equal(document1.FilePath, filePath); - Assert.Equal(2, entries.Length); - - // Should still be tracking document 1 with no changes - (actualDocument, actualVersion) = entries[0]; - Assert.Same(document1, actualDocument); - Assert.Equal(1337, actualVersion); - - (actualDocument, actualVersion) = entries[1]; - Assert.Same(document2, actualDocument); - Assert.Equal(1337, actualVersion); - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index 112e7ae0016..b785c9fadc0 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -76,7 +76,7 @@ private async Task RunFormattingTestAsync(string input, string expected, int tab InsertSpaces = insertSpaces, }; - var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, documentSnapshot, razorLSPOptions); + var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, razorLSPOptions); var documentContext = new VersionedDocumentContext(uri, documentSnapshot, projectContext: null, version: 1); // Act @@ -120,8 +120,7 @@ private protected async Task RunOnTypeFormattingTestAsync( filePathService, new TestDocumentContextFactory(), LoggerFactory); var languageKind = mappingService.GetLanguageKind(codeDocument, positionAfterTrigger, rightAssociative: false); - var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync( - LoggerFactory, codeDocument, documentSnapshot, razorLSPOptions); + var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, razorLSPOptions); var options = new FormattingOptions() { TabSize = tabSize, diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs index 12c22645152..4aeed2f02c1 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs @@ -21,7 +21,6 @@ internal static class TestRazorFormattingService public static async Task CreateWithFullSupportAsync( ILoggerFactory loggerFactory, RazorCodeDocument? codeDocument = null, - IDocumentSnapshot? documentSnapshot = null, RazorLSPOptions? razorLSPOptions = null) { codeDocument ??= TestRazorCodeDocument.CreateEmpty(); @@ -30,11 +29,6 @@ public static async Task CreateWithFullSupportAsync( var mappingService = new LspDocumentMappingService(filePathService, new TestDocumentContextFactory(), loggerFactory); var projectManager = StrictMock.Of(); - var versionCache = new DocumentVersionCache(projectManager); - if (documentSnapshot is not null) - { - versionCache.TrackDocumentVersion(documentSnapshot, version: 1); - } var client = new FormattingLanguageServerClient(loggerFactory); client.AddCodeDocument(codeDocument); @@ -54,7 +48,7 @@ public static async Task CreateWithFullSupportAsync( var passes = new List() { - new HtmlFormattingPass(mappingService, client, versionCache, loggerFactory), + new HtmlFormattingPass(mappingService, client, loggerFactory), new CSharpFormattingPass(mappingService, loggerFactory), new CSharpOnTypeFormattingPass(mappingService, loggerFactory), new RazorFormattingPass(mappingService, optionsMonitor), diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs index cd462b579ec..5ae7ee253ca 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs @@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.ProjectSystem; -using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.AspNetCore.Razor.Test.Common.ProjectSystem; using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; @@ -16,7 +15,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; public class GeneratedDocumentSynchronizerTest : LanguageServerTestBase { - private readonly DocumentVersionCache _cache; private readonly GeneratedDocumentSynchronizer _synchronizer; private readonly TestGeneratedDocumentPublisher _publisher; private readonly IDocumentSnapshot _document; @@ -25,10 +23,8 @@ public class GeneratedDocumentSynchronizerTest : LanguageServerTestBase public GeneratedDocumentSynchronizerTest(ITestOutputHelper testOutput) : base(testOutput) { - var projectManager = StrictMock.Of(); - _cache = new DocumentVersionCache(projectManager); _publisher = new TestGeneratedDocumentPublisher(); - _synchronizer = new GeneratedDocumentSynchronizer(_publisher, _cache, TestLanguageServerFeatureOptions.Instance); + _synchronizer = new GeneratedDocumentSynchronizer(_publisher, TestLanguageServerFeatureOptions.Instance); _document = TestDocumentSnapshot.Create("C:/path/to/file.razor"); _codeDocument = CreateCodeDocument("

Hello World

"); } @@ -49,9 +45,6 @@ public void DocumentProcessed_UnknownVersion_Noops() [Fact] public void DocumentProcessed_KnownVersion_Publishes() { - // Arrange - _cache.TrackDocumentVersion(_document, version: 1337); - // Act _synchronizer.DocumentProcessed(_codeDocument, _document); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorComponentSearchEngineTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorComponentSearchEngineTest.cs index 453c64f7064..3fd1cbf2fb6 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorComponentSearchEngineTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorComponentSearchEngineTest.cs @@ -48,8 +48,6 @@ protected override async Task InitializeAsync() { _projectManager = CreateProjectSnapshotManager(); - var documentVersionCache = new DocumentVersionCache(_projectManager); - var remoteTextLoaderFactoryMock = new StrictMock(); remoteTextLoaderFactoryMock .Setup(x => x.Create(It.IsAny())) @@ -65,7 +63,6 @@ protected override async Task InitializeAsync() var projectService = new TestRazorProjectService( remoteTextLoaderFactoryMock.Object, - documentVersionCache, _projectManager, LoggerFactory); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs index 0802a4cf61d..25555ab946a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs @@ -32,7 +32,6 @@ public class RazorProjectServiceTest(ITestOutputHelper testOutput) : LanguageSer // Each of these is initialized by InitializeAsync() below. #nullable disable private TestProjectSnapshotManager _projectManager; - private DocumentVersionCache _documentVersionCache; private TestRazorProjectService _projectService; #nullable enable @@ -41,7 +40,6 @@ protected override Task InitializeAsync() var optionsMonitor = TestRazorLSPOptionsMonitor.Create(); var projectEngineFactoryProvider = new LspProjectEngineFactoryProvider(optionsMonitor); _projectManager = CreateProjectSnapshotManager(projectEngineFactoryProvider); - _documentVersionCache = new DocumentVersionCache(_projectManager); var remoteTextLoaderFactoryMock = new StrictMock(); remoteTextLoaderFactoryMock @@ -50,7 +48,6 @@ protected override Task InitializeAsync() _projectService = new TestRazorProjectService( remoteTextLoaderFactoryMock.Object, - _documentVersionCache, _projectManager, LoggerFactory); @@ -850,14 +847,8 @@ public async Task RemoveDocument_RemovesDocumentFromMiscellaneousProject() public async Task RemoveDocument_NoopsIfOwnerProjectDoesNotContainDocument() { // Arrange - const string ProjectFilePath = "C:/path/to/project.csproj"; - const string IntermediateOutputPath = "C:/path/to/obj"; - const string RootNamespace = "TestRootNamespace"; const string DocumentFilePath = "C:/path/to/document.cshtml"; - var ownerProjectKey = await _projectService.AddProjectAsync( - ProjectFilePath, IntermediateOutputPath, RazorConfiguration.Default, RootNamespace, displayName: null, DisposalToken); - using var listener = _projectManager.ListenToNotifications(); // Act @@ -998,7 +989,7 @@ public async Task UpdateDocument_TracksKnownDocumentVersion() listener.AssertNotifications( x => x.DocumentChanged(DocumentFilePath, ownerProject.Key)); - var latestVersion = _documentVersionCache.GetLatestDocumentVersion(DocumentFilePath); + var latestVersion = _projectManager.GetLoadedProject(ownerProjectKey).GetDocument(DocumentFilePath)!.Version;// _documentVersionCache.GetLatestDocumentVersion(DocumentFilePath); Assert.Equal(43, latestVersion); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs index 3aa916de91a..8792aeca17a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs @@ -625,8 +625,7 @@ public async Task Handle_Rename_SingleServer_DoesNotDelegateForRazor() var projectManager = CreateProjectSnapshotManager(); - var documentVersionCache = new DocumentVersionCache(projectManager); - var documentContextFactory = new DocumentContextFactory(projectManager, documentVersionCache, LoggerFactory); + var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); var remoteTextLoaderFactoryMock = new StrictMock(); remoteTextLoaderFactoryMock @@ -643,7 +642,6 @@ public async Task Handle_Rename_SingleServer_DoesNotDelegateForRazor() var projectService = new TestRazorProjectService( remoteTextLoaderFactoryMock.Object, - documentVersionCache, projectManager, LoggerFactory); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestRazorProjectService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestRazorProjectService.cs index f0acf1af497..e4f29f50c72 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestRazorProjectService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestRazorProjectService.cs @@ -19,13 +19,11 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem; internal class TestRazorProjectService( RemoteTextLoaderFactory remoteTextLoaderFactory, - IDocumentVersionCache documentVersionCache, IProjectSnapshotManager projectManager, ILoggerFactory loggerFactory) : RazorProjectService( projectManager, CreateProjectInfoDriver(), - documentVersionCache, remoteTextLoaderFactory, loggerFactory) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs index 707786555aa..a419a5bff05 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs @@ -41,6 +41,7 @@ public static TestDocumentSnapshot Create(string filePath, string text, VersionS hostDocument, SourceText.From(text), version, + 1, () => Task.FromResult(TextAndVersion.Create(sourceText, version))); var testDocument = new TestDocumentSnapshot(projectSnapshot, documentState); @@ -64,6 +65,7 @@ internal static TestDocumentSnapshot Create(ProjectSnapshot projectSnapshot, str hostDocument, SourceText.From(text), version, + 1, () => Task.FromResult(TextAndVersion.Create(sourceText, version.Value))); var testDocument = new TestDocumentSnapshot(projectSnapshot, documentState); diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateTest.cs index 77fd4a8f7b2..3cc38fe40d3 100644 --- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateTest.cs +++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/ProjectStateTest.cs @@ -1026,7 +1026,7 @@ private TestDocumentState( Action? onConfigurationChange, Action? onImportsChange, Action? onProjectWorkspaceStateChange) - : base(hostDocument, text, version, loader) + : base(hostDocument, text, version, 1, loader) { _onTextChange = onTextChange; _onTextLoaderChange = onTextLoaderChange; From 032f7ca74d3d3938665adc69327812682f6bfccc Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 24 Jun 2024 17:20:11 +1000 Subject: [PATCH 110/386] Semantic tokens tweaks fixup semantic tokens tweask --- .../ProvideSemanticTokensRangesParams.cs | 4 +- .../AbstractRazorSemanticTokensInfoService.cs | 2 + .../Endpoints/RazorCustomMessageTarget.cs | 2 +- ...RazorCustomMessageTarget_SemanticTokens.cs | 51 +++++-------------- .../RazorCSharpInterceptionMiddleLayer.cs | 11 ++-- 5 files changed, 22 insertions(+), 48 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs index 73e62bf91db..b1f7082ecbe 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/SemanticTokens/ProvideSemanticTokensRangesParams.cs @@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; internal class ProvideSemanticTokensRangesParams : SemanticTokensParams { [JsonPropertyName("requiredHostDocumentVersion")] - public long RequiredHostDocumentVersion { get; } + public int RequiredHostDocumentVersion { get; } [JsonPropertyName("ranges")] public Range[] Ranges { get; } @@ -19,7 +19,7 @@ internal class ProvideSemanticTokensRangesParams : SemanticTokensParams [JsonPropertyName("correlationId")] public Guid CorrelationId { get; } - public ProvideSemanticTokensRangesParams(TextDocumentIdentifier textDocument, long requiredHostDocumentVersion, Range[] ranges, Guid correlationId) + public ProvideSemanticTokensRangesParams(TextDocumentIdentifier textDocument, int requiredHostDocumentVersion, Range[] ranges, Guid correlationId) { TextDocument = textDocument; RequiredHostDocumentVersion = requiredHostDocumentVersion; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/AbstractRazorSemanticTokensInfoService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/AbstractRazorSemanticTokensInfoService.cs index 712506f4e53..0acf4494658 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/AbstractRazorSemanticTokensInfoService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/AbstractRazorSemanticTokensInfoService.cs @@ -170,6 +170,8 @@ private static ImmutableArray CombineSemanticRanges(ImmutableArra csharpRanges = [csharpRange]; } + _logger.LogDebug($"Requesting C# semantic tokens for host version {documentContext.Version}, correlation ID {correlationId}, and the server thinks there are {codeDocument.GetCSharpSourceText().Lines.Count} lines of C#"); + var csharpResponse = await _csharpSemanticTokensProvider.GetCSharpSemanticTokensResponseAsync(documentContext, csharpRanges, correlationId, cancellationToken).ConfigureAwait(false); // Indicates an issue with retrieving the C# response (e.g. no response or C# is out of sync with us). diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs index c16944aa492..1c52c7fd813 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs @@ -136,7 +136,7 @@ private async Task> TrySynchronizeV int requiredHostDocumentVersion, TextDocumentIdentifier hostDocument, CancellationToken cancellationToken, - Range? _ = null, + LanguageServer.Protocol.Range? _ = null, bool rejectOnNewerParallelRequest = true, [CallerMemberName] string? caller = null) where TVirtualDocumentSnapshot : VirtualDocumentSnapshot diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs index 90656ea4453..15b5ae81682 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol.SemanticTokens; @@ -58,18 +57,10 @@ internal partial class RazorCustomMessageTarget SemanticTokensParams requestParams, CancellationToken cancellationToken) { - if (semanticTokensParams is null) - { - throw new ArgumentNullException(nameof(semanticTokensParams)); - } - - if (semanticTokensParams.Ranges is null) - { - throw new ArgumentNullException(nameof(semanticTokensParams.Ranges)); - } + _logger.LogDebug($"Semantic tokens request for {semanticTokensParams.Ranges.Max(r => r.End.Line)} max line number, host version {semanticTokensParams.RequiredHostDocumentVersion}, correlation ID {semanticTokensParams.CorrelationId}"); var (synchronized, csharpDoc) = await TrySynchronizeVirtualDocumentAsync( - (int)semanticTokensParams.RequiredHostDocumentVersion, + semanticTokensParams.RequiredHostDocumentVersion, semanticTokensParams.TextDocument, cancellationToken, semanticTokensParams.Ranges.FirstOrDefault()); @@ -79,30 +70,6 @@ internal partial class RazorCustomMessageTarget return null; } - if (synchronized && csharpDoc.HostDocumentSyncVersion == 1) - { - // HACK: Workaround for https://github.com/dotnet/razor/issues/9197 to stop Roslyn NFWs - // Sometimes we get asked for semantic tokens on v1, and we have sent a v1 to Roslyn, but its the wrong v1. - // To prevent Roslyn throwing, let's validate the range we're asking about with the generated document they - // would have seen. - var lastGeneratedDocumentLine = requestParams switch - { - SemanticTokensRangeParams range => range.Range.End.Line, - SemanticTokensRangesParams ranges => ranges.Ranges[^1].End.Line, - _ => Assumed.Unreachable() - }; - - if (csharpDoc.Snapshot.LineCount < lastGeneratedDocumentLine) - { - _logger.LogWarning($"Pretending we're not synced because we're asking for line {lastGeneratedDocumentLine} but there are only {csharpDoc.Snapshot.LineCount} lines in the buffer."); - Debug.Fail("Rejecting!"); - // We report this as a fail to synchronize, as that's essentially what it is: We were asked for v1, with X lines - // and whilst we have v1, we don't have X lines, so we need to wait for a future update to arrive and give us - // more content. - return new ProvideSemanticTokensResponse(tokens: null, -1); - } - } - if (!synchronized) { // If we're unable to synchronize we won't produce useful results, but we have to indicate @@ -110,15 +77,19 @@ internal partial class RazorCustomMessageTarget return new ProvideSemanticTokensResponse(tokens: null, hostDocumentSyncVersion: csharpDoc.HostDocumentSyncVersion ?? -1); } - semanticTokensParams.TextDocument.Uri = csharpDoc.Uri; + requestParams.TextDocument.Uri = csharpDoc.Uri; var textBuffer = csharpDoc.Snapshot.TextBuffer; + _logger.LogDebug($"Requesting semantic tokens for {csharpDoc.Uri}, for buffer version {textBuffer.CurrentSnapshot.Version.VersionNumber} and snapshot version {csharpDoc.Snapshot.Version.VersionNumber}, host version {semanticTokensParams.RequiredHostDocumentVersion}, correlation ID {semanticTokensParams.CorrelationId}"); + cancellationToken.ThrowIfCancellationRequested(); var languageServerName = RazorLSPConstants.RazorCSharpLanguageServerName; SemanticTokens? response; using (var disposable = _telemetryReporter.TrackLspRequest(lspMethodName, languageServerName, semanticTokensParams.CorrelationId)) { + try + { var result = await _requestInvoker.ReinvokeRequestOnServerAsync( textBuffer, lspMethodName, @@ -126,7 +97,13 @@ internal partial class RazorCustomMessageTarget requestParams, cancellationToken).ConfigureAwait(false); - response = result?.Response; + response = result?.Response; + } + catch + { + _logger.LogWarning($"Error getting semantic tokens from Roslyn for host version {semanticTokensParams.RequiredHostDocumentVersion}, correlation ID {semanticTokensParams.CorrelationId}"); + throw; + } } if (response?.Data is null) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorCSharpInterceptionMiddleLayer.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorCSharpInterceptionMiddleLayer.cs index b2f6692ba35..7a7415f1455 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorCSharpInterceptionMiddleLayer.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/RazorCSharpInterceptionMiddleLayer.cs @@ -16,15 +16,10 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient; [Export(typeof(IRazorCSharpInterceptionMiddleLayer))] -internal class RazorCSharpInterceptionMiddleLayer : IRazorCSharpInterceptionMiddleLayer +[method: ImportingConstructor] +internal class RazorCSharpInterceptionMiddleLayer(LSPRequestInvoker requestInvoker) : IRazorCSharpInterceptionMiddleLayer { - private readonly LSPRequestInvoker _requestInvoker; - - [ImportingConstructor] - public RazorCSharpInterceptionMiddleLayer(LSPRequestInvoker requestInvoker) - { - _requestInvoker = requestInvoker; - } + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; public bool CanHandle(string methodName) => methodName.Equals(Methods.WorkspaceSemanticTokensRefreshName); From 97be219f90651dfd5ce56ca92e3f01e65c704e38 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 24 Jun 2024 17:34:53 +1000 Subject: [PATCH 111/386] Fix tests --- .../DocumentContextFactoryTest.cs | 22 +------------------ .../Formatting_NetFx/FormattingTestBase.cs | 3 +++ .../GeneratedDocumentSynchronizerTest.cs | 13 ----------- .../RazorProjectServiceTest.cs | 6 ++--- 4 files changed, 7 insertions(+), 37 deletions(-) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs index 295533b052e..61e48cb7880 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs @@ -54,26 +54,6 @@ public void TryCreateForOpenDocumentAsync_CanNotResolveDocument_ReturnsNull() Assert.False(factory.TryCreateForOpenDocument(uri, out _)); } - [Fact] - public async Task TryCreateForOpenDocumentAsync_CanNotResolveVersion_ReturnsNull() - { - // Arrange - var filePath = FilePathNormalizer.Normalize(Path.Combine(s_baseDirectory, "file.cshtml")); - var uri = new Uri(filePath); - - var hostDocument = new HostDocument(filePath, "file.cshtml"); - - await _projectManager.UpdateAsync(updater => - { - updater.DocumentAdded(MiscFilesHostProject.Instance.Key, hostDocument, TestMocks.CreateTextLoader(filePath, "")); - }); - - var factory = new DocumentContextFactory(_projectManager, LoggerFactory); - - // Act - Assert.False(factory.TryCreateForOpenDocument(uri, out _)); - } - [Fact] public async Task TryCreateAsync_ResolvesContent() { @@ -153,7 +133,7 @@ await _projectManager.UpdateAsync(updater => Assert.True(factory.TryCreateForOpenDocument(uri, out var documentContext)); // Assert - Assert.Equal(1337, documentContext.Version); + Assert.Equal(1, documentContext.Version); Assert.Equal(uri, documentContext.Uri); Assert.Same(documentSnapshot, documentContext.Snapshot); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index b785c9fadc0..a6089dfe1d8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -312,6 +312,9 @@ internal static IDocumentSnapshot CreateDocumentSnapshot(string path, ImmutableA documentSnapshot .Setup(d => d.FileKind) .Returns(fileKind); + documentSnapshot + .Setup(d => d.Version) + .Returns(1); documentSnapshot .Setup(d => d.WithText(It.IsAny())) .Returns(text => diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs index 5ae7ee253ca..7805abd04b1 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs @@ -29,19 +29,6 @@ public GeneratedDocumentSynchronizerTest(ITestOutputHelper testOutput) _codeDocument = CreateCodeDocument("

Hello World

"); } - [Fact] - public void DocumentProcessed_UnknownVersion_Noops() - { - // Arrange - - // Act - _synchronizer.DocumentProcessed(_codeDocument, _document); - - // Assert - Assert.False(_publisher.PublishedCSharp); - Assert.False(_publisher.PublishedHtml); - } - [Fact] public void DocumentProcessed_KnownVersion_Publishes() { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs index 25555ab946a..08ca59d78db 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs @@ -966,7 +966,7 @@ public async Task UpdateDocument_ChangesDocumentInMiscProject() } [Fact] - public async Task UpdateDocument_TracksKnownDocumentVersion() + public async Task UpdateDocument_DocumentVersionUpdated() { // Arrange const string ProjectFilePath = "C:/path/to/project.csproj"; @@ -989,8 +989,8 @@ public async Task UpdateDocument_TracksKnownDocumentVersion() listener.AssertNotifications( x => x.DocumentChanged(DocumentFilePath, ownerProject.Key)); - var latestVersion = _projectManager.GetLoadedProject(ownerProjectKey).GetDocument(DocumentFilePath)!.Version;// _documentVersionCache.GetLatestDocumentVersion(DocumentFilePath); - Assert.Equal(43, latestVersion); + var latestVersion = _projectManager.GetLoadedProject(ownerProjectKey).GetDocument(DocumentFilePath)!.Version; + Assert.Equal(2, latestVersion); } [Fact] From 162c7d55ba4075b4f894d53d3bb8316e5a02c0d2 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 9 Aug 2024 15:00:59 +1000 Subject: [PATCH 112/386] Remove unused parameter --- .../DocumentDidChangeEndpoint.cs | 2 +- .../DocumentDidOpenEndpoint.cs | 2 +- .../ProjectSystem/IRazorProjectService.cs | 4 +-- .../ProjectSystem/RazorProjectService.cs | 4 +-- .../DocumentDidChangeEndpointTest.cs | 7 ++-- .../DocumentDidOpenEndpointTest.cs | 5 ++- .../RazorComponentSearchEngineTest.cs | 6 ++-- .../RazorProjectServiceTest.cs | 32 +++++++++---------- .../Refactoring/RenameEndpointTest.cs | 18 +++++------ 9 files changed, 39 insertions(+), 41 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs index afd1da50b3c..73c66dab4b9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs @@ -60,7 +60,7 @@ public async Task HandleNotificationAsync(DidChangeTextDocumentParams request, R sourceText = ApplyContentChanges(request.ContentChanges, sourceText); await _projectService - .UpdateDocumentAsync(documentContext.FilePath, sourceText, request.TextDocument.Version, cancellationToken) + .UpdateDocumentAsync(documentContext.FilePath, sourceText, cancellationToken) .ConfigureAwait(false); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidOpenEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidOpenEndpoint.cs index 8af40ddf029..cb07a86ef22 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidOpenEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidOpenEndpoint.cs @@ -23,6 +23,6 @@ public Task HandleNotificationAsync(DidOpenTextDocumentParams request, RazorRequ var sourceText = SourceText.From(request.TextDocument.Text); return _projectService.OpenDocumentAsync( - request.TextDocument.Uri.GetAbsoluteOrUNCPath(), sourceText, request.TextDocument.Version, cancellationToken); + request.TextDocument.Uri.GetAbsoluteOrUNCPath(), sourceText, cancellationToken); } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/IRazorProjectService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/IRazorProjectService.cs index e83c8c327f1..942c95985bc 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/IRazorProjectService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/IRazorProjectService.cs @@ -14,8 +14,8 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem; internal interface IRazorProjectService { Task AddDocumentToMiscProjectAsync(string filePath, CancellationToken cancellationToken); - Task OpenDocumentAsync(string filePath, SourceText sourceText, int version, CancellationToken cancellationToken); - Task UpdateDocumentAsync(string filePath, SourceText sourceText, int version, CancellationToken cancellationToken); + Task OpenDocumentAsync(string filePath, SourceText sourceText, CancellationToken cancellationToken); + Task UpdateDocumentAsync(string filePath, SourceText sourceText, CancellationToken cancellationToken); Task CloseDocumentAsync(string filePath, CancellationToken cancellationToken); Task RemoveDocumentAsync(string filePath, CancellationToken cancellationToken); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs index 696129efb99..2704661674e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs @@ -178,7 +178,7 @@ private void AddDocumentToMiscProjectCore(ProjectSnapshotManager.Updater updater updater.DocumentAdded(miscFilesProject.Key, hostDocument, textLoader); } - public async Task OpenDocumentAsync(string filePath, SourceText sourceText, int version, CancellationToken cancellationToken) + public async Task OpenDocumentAsync(string filePath, SourceText sourceText, CancellationToken cancellationToken) { await WaitForInitializationAsync().ConfigureAwait(false); @@ -278,7 +278,7 @@ await _projectManager.UpdateAsync( .ConfigureAwait(false); } - public async Task UpdateDocumentAsync(string filePath, SourceText sourceText, int version, CancellationToken cancellationToken) + public async Task UpdateDocumentAsync(string filePath, SourceText sourceText, CancellationToken cancellationToken) { await WaitForInitializationAsync().ConfigureAwait(false); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs index baf947911fb..93e144b75a4 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidChangeEndpointTest.cs @@ -33,7 +33,7 @@ public void ApplyContentChanges_SingleChange() }; // Act - var result = endpoint.ApplyContentChanges(new[] { change }, sourceText); + var result = endpoint.ApplyContentChanges([change], sourceText); // Assert Assert.Equal("Hello! World", result.ToString()); @@ -98,13 +98,12 @@ public async Task Handle_DidChangeTextDocument_UpdatesDocument() var documentContext = CreateDocumentContext(documentPath, codeDocument); var projectService = new StrictMock(); projectService - .Setup(service => service.UpdateDocumentAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(service => service.UpdateDocumentAsync(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(Task.CompletedTask) - .Callback((string path, SourceText text, int version, CancellationToken cancellationToken) => + .Callback((string path, SourceText text, CancellationToken cancellationToken) => { Assert.Equal("

", text.ToString()); Assert.Equal(documentPath.OriginalString, path); - Assert.Equal(1337, version); }); var endpoint = new DocumentDidChangeEndpoint(projectService.Object, LoggerFactory); var change = new TextDocumentContentChangeEvent() diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidOpenEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidOpenEndpointTest.cs index 4867629a6f9..a2067331373 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidOpenEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSynchronization/DocumentDidOpenEndpointTest.cs @@ -25,13 +25,12 @@ public async Task Handle_DidOpenTextDocument_AddsDocument() var documentPath = "C:/path/to/document.cshtml"; var projectService = new StrictMock(); projectService - .Setup(service => service.OpenDocumentAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(service => service.OpenDocumentAsync(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(Task.CompletedTask) - .Callback((string path, SourceText text, int version, CancellationToken cancellationToken) => + .Callback((string path, SourceText text, CancellationToken cancellationToken) => { Assert.Equal("hello", text.ToString()); Assert.Equal(documentPath, path); - Assert.Equal(1337, version); }); var endpoint = new DocumentDidOpenEndpoint(projectService.Object); var request = new DidOpenTextDocumentParams() diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorComponentSearchEngineTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorComponentSearchEngineTest.cs index 3fd1cbf2fb6..3f372b9f668 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorComponentSearchEngineTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorComponentSearchEngineTest.cs @@ -75,10 +75,10 @@ await projectService.AddProjectAsync( DisposalToken); await projectService.AddDocumentToPotentialProjectsAsync(s_componentFilePath1, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentFilePath1, SourceText.From(""), version: 1, DisposalToken); + await projectService.UpdateDocumentAsync(s_componentFilePath1, SourceText.From(""), DisposalToken); await projectService.AddDocumentToPotentialProjectsAsync(s_componentFilePath2, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentFilePath2, SourceText.From("@namespace Test"), version: 1, DisposalToken); + await projectService.UpdateDocumentAsync(s_componentFilePath2, SourceText.From("@namespace Test"), DisposalToken); await projectService.AddProjectAsync( s_projectFilePath2, @@ -89,7 +89,7 @@ await projectService.AddProjectAsync( DisposalToken); await projectService.AddDocumentToPotentialProjectsAsync(s_componentFilePath3, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentFilePath3, SourceText.From(""), version: 1, DisposalToken); + await projectService.UpdateDocumentAsync(s_componentFilePath3, SourceText.From(""), DisposalToken); } [Fact] diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs index 08ca59d78db..ba7e5d7563e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs @@ -475,7 +475,7 @@ public async Task CloseDocument_ClosesDocumentInOwnerProject() var ownerProjectKey = await _projectService.AddProjectAsync( ProjectFilePath, IntermediateOutputPath, RazorConfiguration.Default, RootNamespace, displayName: null, DisposalToken); await _projectService.AddDocumentToPotentialProjectsAsync(DocumentFilePath, DisposalToken); - await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, DisposalToken); var ownerProject = _projectManager.GetLoadedProject(ownerProjectKey); @@ -508,7 +508,7 @@ public async Task CloseDocument_ClosesDocumentInAllOwnerProjects() var ownerProjectKey2 = await _projectService.AddProjectAsync( ProjectFilePath, IntermediateOutputPath2, RazorConfiguration.Default, RootNamespace, displayName: null, DisposalToken); await _projectService.AddDocumentToPotentialProjectsAsync(DocumentFilePath, DisposalToken); - await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, DisposalToken); var ownerProject1 = _projectManager.GetLoadedProject(ownerProjectKey1); var ownerProject2 = _projectManager.GetLoadedProject(ownerProjectKey2); @@ -535,7 +535,7 @@ public async Task CloseDocument_ClosesDocumentInMiscellaneousProject() const string DocumentFilePath = "document.cshtml"; await _projectService.AddDocumentToPotentialProjectsAsync(DocumentFilePath, DisposalToken); - await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, DisposalToken); var miscProject = _projectManager.GetMiscellaneousProject(); @@ -573,7 +573,7 @@ public async Task OpenDocument_OpensAlreadyAddedDocumentInOwnerProject() using var listener = _projectManager.ListenToNotifications(); // Act - await _projectService.OpenDocumentAsync(DocumentFilePath, SourceText.From("Hello World"), version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, SourceText.From("Hello World"), DisposalToken); // Assert listener.AssertNotifications( @@ -606,7 +606,7 @@ public async Task OpenDocument_OpensAlreadyAddedDocumentInAllOwnerProjects() using var listener = _projectManager.ListenToNotifications(); // Act - await _projectService.OpenDocumentAsync(DocumentFilePath, SourceText.From("Hello World"), version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, SourceText.From("Hello World"), DisposalToken); // Assert listener.AssertNotifications( @@ -631,7 +631,7 @@ public async Task OpenDocument_OpensAlreadyAddedDocumentInMiscellaneousProject() using var listener = _projectManager.ListenToNotifications(); // Act - await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, DisposalToken); // Assert listener.AssertNotifications( @@ -657,7 +657,7 @@ public async Task OpenDocument_OpensAndAddsDocumentToMiscellaneousProject() using var listener = _projectManager.ListenToNotifications(); // Act - await _projectService.OpenDocumentAsync(DocumentFilePath, SourceText.From("Hello World"), version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, SourceText.From("Hello World"), DisposalToken); // Assert listener.AssertNotifications( @@ -801,7 +801,7 @@ public async Task RemoveOpenDocument_RemovesDocumentFromOwnerProject_MovesToMisc var ownerProjectKey = await _projectService.AddProjectAsync( ProjectFilePath, IntermediateOutputPath, RazorConfiguration.Default, RootNamespace, displayName: null, DisposalToken); await _projectService.AddDocumentToPotentialProjectsAsync(DocumentFilePath, DisposalToken); - await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, DisposalToken); var ownerProject = _projectManager.GetLoadedProject(ownerProjectKey); var miscProject = _projectManager.GetMiscellaneousProject(); @@ -887,7 +887,7 @@ public async Task UpdateDocument_ChangesDocumentInOwnerProject() var ownerProjectKey = await _projectService.AddProjectAsync( ProjectFilePath, IntermediateOutputPath, RazorConfiguration.Default, RootNamespace, displayName: null, DisposalToken); await _projectService.AddDocumentToPotentialProjectsAsync(DocumentFilePath, DisposalToken); - await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, DisposalToken); var ownerProject = _projectManager.GetLoadedProject(ownerProjectKey); @@ -896,7 +896,7 @@ public async Task UpdateDocument_ChangesDocumentInOwnerProject() using var listener = _projectManager.ListenToNotifications(); // Act - await _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), version: 43, DisposalToken); + await _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), DisposalToken); // Assert listener.AssertNotifications( @@ -920,7 +920,7 @@ public async Task UpdateDocument_ChangesDocumentInAllOwnerProjects() var ownerProjectKey2 = await _projectService.AddProjectAsync( ProjectFilePath, IntermediateOutputPath2, RazorConfiguration.Default, RootNamespace, displayName: null, DisposalToken); await _projectService.AddDocumentToPotentialProjectsAsync(DocumentFilePath, DisposalToken); - await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, DisposalToken); var ownerProject1 = _projectManager.GetLoadedProject(ownerProjectKey1); var ownerProject2 = _projectManager.GetLoadedProject(ownerProjectKey2); @@ -930,7 +930,7 @@ public async Task UpdateDocument_ChangesDocumentInAllOwnerProjects() using var listener = _projectManager.ListenToNotifications(); // Act - await _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), version: 43, DisposalToken); + await _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), DisposalToken); // Assert listener.AssertNotifications( @@ -947,7 +947,7 @@ public async Task UpdateDocument_ChangesDocumentInMiscProject() const string DocumentFilePath = "document.cshtml"; await _projectService.AddDocumentToPotentialProjectsAsync(DocumentFilePath, DisposalToken); - await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, version: 42, DisposalToken); + await _projectService.OpenDocumentAsync(DocumentFilePath, s_emptyText, DisposalToken); var miscProject = _projectManager.GetMiscellaneousProject(); @@ -956,7 +956,7 @@ public async Task UpdateDocument_ChangesDocumentInMiscProject() using var listener = _projectManager.ListenToNotifications(); // Act - await _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), version: 43, DisposalToken); + await _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), DisposalToken); // Assert listener.AssertNotifications( @@ -983,7 +983,7 @@ public async Task UpdateDocument_DocumentVersionUpdated() using var listener = _projectManager.ListenToNotifications(); // Act - await _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), version: 43, DisposalToken); + await _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), DisposalToken); // Assert listener.AssertNotifications( @@ -1008,7 +1008,7 @@ await _projectService.AddProjectAsync( // Act await Assert.ThrowsAnyAsync(() => { - return _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), version: 43, DisposalToken); + return _projectService.UpdateDocumentAsync(DocumentFilePath, s_emptyText.Replace(0, 0, "Hello World"), DisposalToken); }); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs index 8792aeca17a..7f5a35cd276 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs @@ -660,12 +660,12 @@ await projectManager.UpdateAsync(updater => await projectService.AddDocumentToPotentialProjectsAsync(s_componentFilePath1337, DisposalToken); await projectService.AddDocumentToPotentialProjectsAsync(s_indexFilePath1, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentFilePath1, SourceText.From(ComponentText1), version: 42, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentFilePath2, SourceText.From(ComponentText2), version: 42, DisposalToken); - await projectService.UpdateDocumentAsync(s_directoryFilePath1, SourceText.From(DirectoryText1), version: 42, DisposalToken); - await projectService.UpdateDocumentAsync(s_directoryFilePath2, SourceText.From(DirectoryText2), version: 4, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentFilePath1337, SourceText.From(ComponentText1337), version: 42, DisposalToken); - await projectService.UpdateDocumentAsync(s_indexFilePath1, SourceText.From(IndexText1), version: 42, DisposalToken); + await projectService.UpdateDocumentAsync(s_componentFilePath1, SourceText.From(ComponentText1), DisposalToken); + await projectService.UpdateDocumentAsync(s_componentFilePath2, SourceText.From(ComponentText2), DisposalToken); + await projectService.UpdateDocumentAsync(s_directoryFilePath1, SourceText.From(DirectoryText1), DisposalToken); + await projectService.UpdateDocumentAsync(s_directoryFilePath2, SourceText.From(DirectoryText2), DisposalToken); + await projectService.UpdateDocumentAsync(s_componentFilePath1337, SourceText.From(ComponentText1337), DisposalToken); + await projectService.UpdateDocumentAsync(s_indexFilePath1, SourceText.From(IndexText1), DisposalToken); var projectKey2 = await projectService.AddProjectAsync( s_projectFilePath2, s_intermediateOutputPath2, RazorConfiguration.Default, RootNamespace2, displayName: null, DisposalToken); @@ -679,9 +679,9 @@ await projectManager.UpdateAsync(updater => await projectService.AddDocumentToPotentialProjectsAsync(s_componentFilePath4, DisposalToken); await projectService.AddDocumentToPotentialProjectsAsync(s_componentWithParamFilePath, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentFilePath3, SourceText.From(ComponentText3), version: 42, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentFilePath4, SourceText.From(ComponentText4), version: 42, DisposalToken); - await projectService.UpdateDocumentAsync(s_componentWithParamFilePath, SourceText.From(ComponentWithParamText), version: 42, DisposalToken); + await projectService.UpdateDocumentAsync(s_componentFilePath3, SourceText.From(ComponentText3), DisposalToken); + await projectService.UpdateDocumentAsync(s_componentFilePath4, SourceText.From(ComponentText4), DisposalToken); + await projectService.UpdateDocumentAsync(s_componentWithParamFilePath, SourceText.From(ComponentWithParamText), DisposalToken); var searchEngine = new RazorComponentSearchEngine(projectManager, LoggerFactory); options ??= StrictMock.Of(o => From 186a134a3bbe0668043e59b74ef2cfe7d03a9cb7 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 12 Aug 2024 10:35:32 +1000 Subject: [PATCH 113/386] Remove VersionedDocumentContext and the separate methods to create one --- .../RazorCSharpFormattingBenchmark.cs | 2 +- .../RazorCodeActionsBenchmark.cs | 2 +- .../RazorCompletionBenchmark.cs | 4 +- .../RazorDiagnosticsBenchmark.cs | 8 +-- .../RazorSemanticTokensBenchmark.cs | 7 +-- ...zorSemanticTokensRangeEndpointBenchmark.cs | 7 +-- .../RazorSemanticTokensScrollingBenchmark.cs | 4 +- .../CSharp/DefaultCSharpCodeActionResolver.cs | 6 +- ...mattedRemappingCSharpCodeActionResolver.cs | 6 +- .../CodeActions/CodeActionEndpoint.cs | 6 +- .../Html/DefaultHtmlCodeActionResolver.cs | 4 +- .../Razor/GenerateMethodCodeActionResolver.cs | 6 +- .../ColorPresentationEndpoint.cs | 2 +- .../Completion/CompletionListProvider.cs | 2 +- .../DelegatedCompletionItemResolver.cs | 2 +- .../DelegatedCompletionListProvider.cs | 6 +- .../Completion/RazorCompletionListProvider.cs | 2 +- .../DocumentPullDiagnosticsEndpoint.cs | 4 +- .../DocumentColor/DocumentColorEndpoint.cs | 2 +- .../DocumentContextFactory.cs | 48 +--------------- ...actTextDocumentPresentationEndpointBase.cs | 4 +- .../EndpointContracts/RazorRequestContext.cs | 4 +- .../Folding/FoldingRangeEndpoint.cs | 2 +- .../Formatting/IRazorFormattingService.cs | 2 +- .../Formatting/RazorFormattingService.cs | 4 +- .../Hover/HoverService.cs | 4 +- .../Hover/IHoverService.cs | 4 +- .../InlayHints/IInlayHintService.cs | 2 +- .../InlayHints/InlayHintService.cs | 2 +- .../LspEditMappingService.cs | 14 +---- .../MapCode/MapCodeEndpoint.cs | 8 +-- .../Mapping/RazorLanguageQueryEndpoint.cs | 2 +- .../RazorMapToDocumentRangesEndpoint.cs | 4 +- .../RazorRequestContextFactory.cs | 6 +- .../LSPCSharpSemanticTokensProvider.cs | 4 +- .../SpellCheck/DocumentSpellCheckEndpoint.cs | 4 +- .../WrapWithTag/WrapWithTagEndpoint.cs | 2 +- .../AbstractEditMappingService.cs | 14 ++--- .../ProjectSystem/DocumentContext.cs | 4 ++ .../ProjectSystem/IDocumentContextFactory.cs | 1 - .../IDocumentContextFactoryExtensions.cs | 57 +------------------ .../ProjectSystem/VersionedDocumentContext.cs | 17 ------ .../Rename/IRenameService.cs | 2 +- .../Rename/RenameService.cs | 2 +- .../AbstractRazorSemanticTokensInfoService.cs | 10 ++-- .../ICSharpSemanticTokensProvider.cs | 2 +- .../IRazorSemanticTokenInfoService.cs | 2 +- .../RemoteEditMappingService.cs | 10 +--- .../DocumentContextExtensions.cs | 2 +- .../ProjectSystem/RemoteDocumentContext.cs | 6 +- .../ProjectSystem/RemoteDocumentSnapshot.cs | 2 +- .../RemoteCSharpSemanticTokensProvider.cs | 2 +- .../Endpoints/RazorCustomMessageTarget.cs | 16 ------ ...RazorCustomMessageTarget_SemanticTokens.cs | 15 +++-- .../OnAutoInsertEndpointTest.NetFx.cs | 2 +- .../CodeActionEndToEndTest.NetFx.cs | 6 +- .../Completion/CompletionListProviderTest.cs | 8 +-- ...legatedCompletionItemResolverTest.NetFx.cs | 6 +- .../Delegation/ResponseRewriterTestBase.cs | 2 +- .../RazorCompletionListProviderTest.cs | 16 +++--- .../ValidateBreakpointRangeEndpointTest.cs | 4 +- .../DefinitionEndpointDelegationTest.cs | 2 +- .../DocumentContextFactoryTest.cs | 6 +- .../DocumentHighlightEndpointTest.cs | 2 +- ...extDocumentUriPresentationEndpointTests.cs | 8 +-- .../DocumentSymbolEndpointTest.cs | 2 +- .../FindAllReferencesEndpointTest.cs | 2 +- .../Folding/FoldingEndpointTest.cs | 2 +- .../DocumentOnTypeFormattingEndpointTest.cs | 2 +- .../FormattingLanguageServerTestBase.cs | 2 +- .../Formatting_NetFx/FormattingTestBase.cs | 6 +- .../Hover/HoverServiceTest.cs | 7 ++- .../ImplementationEndpointTest.cs | 2 +- .../InlayHints/InlayHintEndpointTest.cs | 2 +- .../MapCode/MapCodeTest.cs | 4 +- .../Mapping/RazorLanguageQueryEndpointTest.cs | 4 -- .../RazorMapToDocumentRangesEndpointTest.cs | 7 --- .../ProjectContextsEndpointTest.cs | 2 +- .../RenameEndpointDelegationTest.cs | 2 +- .../Refactoring/RenameEndpointTest.cs | 26 ++++----- .../Semantic/SemanticTokensTest.cs | 15 ++--- .../SignatureHelpEndpointTest.cs | 2 +- .../SingleServerDelegatingEndpointTestBase.cs | 2 +- .../LanguageServer/LanguageServerTestBase.cs | 12 ++-- .../LanguageServer/TestDocumentContext.cs | 8 +-- .../TestDocumentContextFactory.cs | 17 +----- .../ProjectSystem/TestDocumentSnapshot.cs | 12 ++-- 87 files changed, 195 insertions(+), 373 deletions(-) delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/VersionedDocumentContext.cs diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs index 4cfa36773c0..4de35d8b605 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs @@ -116,7 +116,7 @@ public async Task RazorCSharpFormattingAsync() InsertSpaces = true }; - var documentContext = new VersionedDocumentContext(DocumentUri, DocumentSnapshot, projectContext: null, version: 1); + var documentContext = new DocumentContext(DocumentUri, DocumentSnapshot, projectContext: null); var edits = await RazorFormattingService.FormatAsync(documentContext, range: null, options, CancellationToken.None); diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs index efeead6a96e..d1d21777c6f 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCodeActionsBenchmark.cs @@ -83,7 +83,7 @@ public async Task SetupAsync() CSharpCodeActionRange = DocumentText.GetZeroWidthRange(csharpCodeActionIndex); HtmlCodeActionRange = DocumentText.GetZeroWidthRange(htmlCodeActionIndex); - var documentContext = new VersionedDocumentContext(DocumentUri, DocumentSnapshot, projectContext: null, 1); + var documentContext = new DocumentContext(DocumentUri, DocumentSnapshot, projectContext: null); var codeDocument = await documentContext.GetCodeDocumentAsync(CancellationToken.None); // Need a root namespace for the Extract to Code Behind light bulb to be happy diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs index 0bf6c9fea83..d35a168a36e 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCompletionBenchmark.cs @@ -79,7 +79,7 @@ public async Task SetupAsync() RazorPosition = DocumentText.GetPosition(razorCodeActionIndex); - var documentContext = new VersionedDocumentContext(DocumentUri, DocumentSnapshot, projectContext: null, 1); + var documentContext = new DocumentContext(DocumentUri, DocumentSnapshot, projectContext: null); RazorRequestContext = new RazorRequestContext(documentContext, RazorLanguageServerHost.GetRequiredService(), "lsp/method", uri: null); } @@ -146,7 +146,7 @@ public TestDelegatedCompletionListProvider(IEnumerable GetCompletionListAsync(int absoluteIndex, VSInternalCompletionContext completionContext, VersionedDocumentContext documentContext, VSInternalClientCapabilities clientCapabilities, Guid correlationId, CancellationToken cancellationToken) + public override Task GetCompletionListAsync(int absoluteIndex, VSInternalCompletionContext completionContext, DocumentContext documentContext, VSInternalClientCapabilities clientCapabilities, Guid correlationId, CancellationToken cancellationToken) { return Task.FromResult( new VSInternalCompletionList diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs index 9e50156d7f5..77c5a38937a 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs @@ -36,7 +36,7 @@ public class RazorDiagnosticsBenchmark : RazorLanguageServerBenchmarkBase private ImmutableArray SourceMappings { get; set; } private string? GeneratedCode { get; set; } private object? Diagnostics { get; set; } - private VersionedDocumentContext? VersionedDocumentContext { get; set; } + private DocumentContext? DocumentContext { get; set; } private VSInternalDocumentDiagnosticsParams? Request { get; set; } private IEnumerable? Response { get; set; } @@ -74,17 +74,17 @@ public void Setup() RazorCodeDocument = mockRazorCodeDocument.Object; SourceText = RazorCodeDocument.Source.Text; - var documentContext = new Mock( + var documentContext = new Mock( MockBehavior.Strict, new object[] { It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny() }); documentContext .Setup(r => r.GetCodeDocumentAsync(It.IsAny())) .ReturnsAsync(RazorCodeDocument); documentContext.Setup(r => r.Uri).Returns(It.IsAny()); - documentContext.Setup(r => r.Version).Returns(It.IsAny()); + documentContext.Setup(r => r.Snapshot.Version).Returns(It.IsAny()); documentContext.Setup(r => r.GetSourceTextAsync(It.IsAny())).ReturnsAsync(It.IsAny()); RazorRequestContext = new RazorRequestContext(documentContext.Object, null!, "lsp/method", uri: null); - VersionedDocumentContext = documentContext.Object; + DocumentContext = documentContext.Object; var loggerFactory = EmptyLoggerFactory.Instance; var languageServerFeatureOptions = BuildFeatureOptions(); diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs index 8afb6f83298..dd76b418ad0 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensBenchmark.cs @@ -31,7 +31,7 @@ public class RazorSemanticTokensBenchmark : RazorLanguageServerBenchmarkBase private IDocumentSnapshot DocumentSnapshot => DocumentContext.Snapshot; - private VersionedDocumentContext DocumentContext { get; set; } + private DocumentContext DocumentContext { get; set; } private Range Range { get; set; } @@ -59,8 +59,7 @@ public async Task InitializeRazorSemanticAsync() var documentUri = new Uri(filePath); var documentSnapshot = await GetDocumentSnapshotAsync(ProjectFilePath, filePath, TargetPath); - var version = 1; - DocumentContext = new VersionedDocumentContext(documentUri, documentSnapshot, projectContext: null, version); + DocumentContext = new DocumentContext(documentUri, documentSnapshot, projectContext: null); var text = await DocumentContext.GetSourceTextAsync(CancellationToken.None).ConfigureAwait(false); Range = VsLspFactory.CreateRange( @@ -108,7 +107,7 @@ public TestRazorSemanticTokensInfoService( // We can't get C# responses without significant amounts of extra work, so let's just shim it for now, any non-Null result is fine. protected override Task?> GetCSharpSemanticRangesAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, RazorCodeDocument codeDocument, LinePositionSpan razorRange, bool colorBackground, diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs index 041413a31b5..e4c3e5fffd0 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensRangeEndpointBenchmark.cs @@ -34,7 +34,7 @@ public class RazorSemanticTokensRangeEndpointBenchmark : RazorLanguageServerBenc private Uri DocumentUri => DocumentContext.Uri; - private VersionedDocumentContext DocumentContext { get; set; } + private DocumentContext DocumentContext { get; set; } private Range Range { get; set; } @@ -66,8 +66,7 @@ public async Task InitializeRazorSemanticAsync() var documentUri = new Uri(filePath); var documentSnapshot = await GetDocumentSnapshotAsync(ProjectFilePath, filePath, TargetPath); - var version = 1; - DocumentContext = new VersionedDocumentContext(documentUri, documentSnapshot, projectContext: null, version); + DocumentContext = new DocumentContext(documentUri, documentSnapshot, projectContext: null); var razorOptionsMonitor = RazorLanguageServerHost.GetRequiredService(); var clientCapabilitiesService = new BenchmarkClientCapabilitiesService(new VSInternalClientCapabilities() { SupportsVisualStudioExtensions = true }); @@ -141,7 +140,7 @@ public TestCustomizableRazorSemanticTokensInfoService( // We can't get C# responses without significant amounts of extra work, so let's just shim it for now, any non-Null result is fine. protected override Task?> GetCSharpSemanticRangesAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, RazorCodeDocument codeDocument, LinePositionSpan razorSpan, bool colorBackground, diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs index 6f5107bb265..20bcd3f5505 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorSemanticTokensScrollingBenchmark.cs @@ -22,7 +22,7 @@ public class RazorSemanticTokensScrollingBenchmark : RazorLanguageServerBenchmar { private IRazorSemanticTokensInfoService RazorSemanticTokenService { get; set; } - private VersionedDocumentContext DocumentContext { get; set; } + private DocumentContext DocumentContext { get; set; } private Uri DocumentUri => DocumentContext.Uri; @@ -49,7 +49,7 @@ public async Task InitializeRazorSemanticAsync() var documentUri = new Uri(filePath); var documentSnapshot = await GetDocumentSnapshotAsync(ProjectFilePath, filePath, TargetPath); - DocumentContext = new VersionedDocumentContext(documentUri, documentSnapshot, projectContext: null, version: 1); + DocumentContext = new DocumentContext(documentUri, documentSnapshot, projectContext: null); var text = await DocumentSnapshot.GetTextAsync().ConfigureAwait(false); Range = VsLspFactory.CreateRange( diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs index 9e62f694a04..343f7e480cd 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs @@ -46,12 +46,12 @@ public async override Task ResolveAsync( CodeAction codeAction, CancellationToken cancellationToken) { - if (!_documentContextFactory.TryCreateForOpenDocument(csharpParams.RazorFileIdentifier, out var documentContext)) + if (!_documentContextFactory.TryCreate(csharpParams.RazorFileIdentifier, out var documentContext)) { return codeAction; } - var resolvedCodeAction = await ResolveCodeActionWithServerAsync(csharpParams.RazorFileIdentifier, documentContext.Version, RazorLanguageKind.CSharp, codeAction, cancellationToken).ConfigureAwait(false); + var resolvedCodeAction = await ResolveCodeActionWithServerAsync(csharpParams.RazorFileIdentifier, documentContext.Snapshot.Version, RazorLanguageKind.CSharp, codeAction, cancellationToken).ConfigureAwait(false); if (resolvedCodeAction?.Edit?.DocumentChanges is null) { // Unable to resolve code action with server, return original code action @@ -88,7 +88,7 @@ public async override Task ResolveAsync( cancellationToken.ThrowIfCancellationRequested(); - var documentVersion = documentContext.Version; + var documentVersion = documentContext.Snapshot.Version; var codeDocumentIdentifier = new OptionalVersionedTextDocumentIdentifier() { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs index 964f576f653..7e0e29d5499 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/UnformattedRemappingCSharpCodeActionResolver.cs @@ -37,12 +37,12 @@ public async override Task ResolveAsync( { cancellationToken.ThrowIfCancellationRequested(); - if (!_documentContextFactory.TryCreateForOpenDocument(csharpParams.RazorFileIdentifier, out var documentContext)) + if (!_documentContextFactory.TryCreate(csharpParams.RazorFileIdentifier, out var documentContext)) { return codeAction; } - var resolvedCodeAction = await ResolveCodeActionWithServerAsync(csharpParams.RazorFileIdentifier, documentContext.Version, RazorLanguageKind.CSharp, codeAction, cancellationToken).ConfigureAwait(false); + var resolvedCodeAction = await ResolveCodeActionWithServerAsync(csharpParams.RazorFileIdentifier, documentContext.Snapshot.Version, RazorLanguageKind.CSharp, codeAction, cancellationToken).ConfigureAwait(false); if (resolvedCodeAction?.Edit?.DocumentChanges is null) { // Unable to resolve code action with server, return original code action @@ -87,7 +87,7 @@ public async override Task ResolveAsync( var codeDocumentIdentifier = new OptionalVersionedTextDocumentIdentifier() { Uri = csharpParams.RazorFileIdentifier.Uri, - Version = documentContext.Version, + Version = documentContext.Snapshot.Version, }; resolvedCodeAction.Edit = new WorkspaceEdit() { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs index 4a72ea63208..a2d9c0a841c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CodeActionEndpoint.cs @@ -175,7 +175,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V return context; } - private async Task> GetDelegatedCodeActionsAsync(VersionedDocumentContext documentContext, RazorCodeActionContext context, Guid correlationId, CancellationToken cancellationToken) + private async Task> GetDelegatedCodeActionsAsync(DocumentContext documentContext, RazorCodeActionContext context, Guid correlationId, CancellationToken cancellationToken) { var languageKind = _documentMappingService.GetLanguageKind(context.CodeDocument, context.Location.AbsoluteIndex, rightAssociative: false); @@ -256,7 +256,7 @@ private static async Task> FilterCodeA } // Internal for testing - internal async Task GetCodeActionsFromLanguageServerAsync(RazorLanguageKind languageKind, VersionedDocumentContext documentContext, RazorCodeActionContext context, Guid correlationId, CancellationToken cancellationToken) + internal async Task GetCodeActionsFromLanguageServerAsync(RazorLanguageKind languageKind, DocumentContext documentContext, RazorCodeActionContext context, Guid correlationId, CancellationToken cancellationToken) { if (languageKind == RazorLanguageKind.CSharp) { @@ -282,7 +282,7 @@ internal async Task GetCodeActionsFromLanguageServe var delegatedParams = new DelegatedCodeActionParams() { - HostDocumentVersion = documentContext.Version, + HostDocumentVersion = documentContext.Snapshot.Version, CodeActionParams = context.Request, LanguageKind = languageKind, CorrelationId = correlationId diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs index e95ca9d060c..4c8fa0a60f3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Html/DefaultHtmlCodeActionResolver.cs @@ -28,12 +28,12 @@ public async override Task ResolveAsync( CodeAction codeAction, CancellationToken cancellationToken) { - if (!_documentContextFactory.TryCreateForOpenDocument(resolveParams.RazorFileIdentifier, out var documentContext)) + if (!_documentContextFactory.TryCreate(resolveParams.RazorFileIdentifier, out var documentContext)) { return codeAction; } - var resolvedCodeAction = await ResolveCodeActionWithServerAsync(resolveParams.RazorFileIdentifier, documentContext.Version, RazorLanguageKind.Html, codeAction, cancellationToken).ConfigureAwait(false); + var resolvedCodeAction = await ResolveCodeActionWithServerAsync(resolveParams.RazorFileIdentifier, documentContext.Snapshot.Version, RazorLanguageKind.Html, codeAction, cancellationToken).ConfigureAwait(false); if (resolvedCodeAction?.Edit?.DocumentChanges is null) { // Unable to resolve code action with server, return original code action diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs index 86af5075d71..b990b515e79 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/GenerateMethodCodeActionResolver.cs @@ -58,7 +58,7 @@ internal sealed class GenerateMethodCodeActionResolver( return null; } - if (!_documentContextFactory.TryCreateForOpenDocument(actionParams.Uri, out var documentContext)) + if (!_documentContextFactory.TryCreate(actionParams.Uri, out var documentContext)) { return null; } @@ -139,7 +139,7 @@ razorClassName is null || private async Task GenerateMethodInCodeBlockAsync( RazorCodeDocument code, GenerateMethodCodeActionParams actionParams, - VersionedDocumentContext documentContext, + DocumentContext documentContext, string? razorNamespace, string? razorClassName, CancellationToken cancellationToken) @@ -228,7 +228,7 @@ private async Task GenerateMethodInCodeBlockAsync( return new WorkspaceEdit() { DocumentChanges = new[] { razorTextDocEdit } }; } - private static async Task PopulateMethodSignatureAsync(VersionedDocumentContext documentContext, GenerateMethodCodeActionParams actionParams, CancellationToken cancellationToken) + private static async Task PopulateMethodSignatureAsync(DocumentContext documentContext, GenerateMethodCodeActionParams actionParams, CancellationToken cancellationToken) { var templateWithMethodSignature = s_generateMethodTemplate.Replace(MethodName, actionParams.MethodName); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs index 6da931e401c..8cd27d497a3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ColorPresentation/ColorPresentationEndpoint.cs @@ -33,7 +33,7 @@ public async Task HandleRequestAsync(ColorPresentationPa var delegatedRequest = new DelegatedColorPresentationParams { - RequiredHostDocumentVersion = documentContext.Version, + RequiredHostDocumentVersion = documentContext.Snapshot.Version, Color = request.Color, Range = request.Range, TextDocument = request.TextDocument diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs index f296da09b3d..9caeb7cc5de 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/CompletionListProvider.cs @@ -33,7 +33,7 @@ public CompletionListProvider(RazorCompletionListProvider razorCompletionListPro public async Task GetCompletionListAsync( int absoluteIndex, VSInternalCompletionContext completionContext, - VersionedDocumentContext documentContext, + DocumentContext documentContext, VSInternalClientCapabilities clientCapabilities, Guid correlationId, CancellationToken cancellationToken) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs index f977eb4b4ff..3e9464e62f7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionItemResolver.cs @@ -100,7 +100,7 @@ private async Task PostProcessCompletionItemAsync( } var identifier = context.OriginalRequestParams.Identifier.TextDocumentIdentifier; - if (!_documentContextFactory.TryCreateForOpenDocument(identifier, out var documentContext)) + if (!_documentContextFactory.TryCreate(identifier, out var documentContext)) { return resolvedCompletionItem; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs index 2c8e023b46d..fcdc554aa3f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs @@ -51,7 +51,7 @@ public DelegatedCompletionListProvider( public virtual async Task GetCompletionListAsync( int absoluteIndex, VSInternalCompletionContext completionContext, - VersionedDocumentContext documentContext, + DocumentContext documentContext, VSInternalClientCapabilities clientCapabilities, Guid correlationId, CancellationToken cancellationToken) @@ -119,7 +119,7 @@ public DelegatedCompletionListProvider( return rewrittenResponse; } - private async Task ShouldIncludeSnippetsAsync(VersionedDocumentContext documentContext, int absoluteIndex, CancellationToken cancellationToken) + private async Task ShouldIncludeSnippetsAsync(DocumentContext documentContext, int absoluteIndex, CancellationToken cancellationToken) { var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); var tree = codeDocument.GetSyntaxTree(); @@ -182,7 +182,7 @@ private static VSInternalCompletionContext RewriteContext(VSInternalCompletionCo } private async Task TryGetProvisionalCompletionInfoAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, VSInternalCompletionContext completionContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionListProvider.cs index e73f38dcad8..ea0b2a76a02 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionListProvider.cs @@ -39,7 +39,7 @@ internal class RazorCompletionListProvider( public virtual async Task GetCompletionListAsync( int absoluteIndex, VSInternalCompletionContext completionContext, - VersionedDocumentContext documentContext, + DocumentContext documentContext, VSInternalClientCapabilities clientCapabilities, HashSet? existingCompletions, CancellationToken cancellationToken) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs index 68d893f9b24..cc175aa49c0 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs @@ -121,7 +121,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentDiagno return allDiagnostics.ToArray(); } - private static async Task GetRazorDiagnosticsAsync(VersionedDocumentContext documentContext, CancellationToken cancellationToken) + private static async Task GetRazorDiagnosticsAsync(DocumentContext documentContext, CancellationToken cancellationToken) { var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); var sourceText = await documentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); @@ -145,7 +145,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentDiagno ]; } - private async Task<(VSInternalDiagnosticReport[]? CSharpDiagnostics, VSInternalDiagnosticReport[]? HtmlDiagnostics)> GetHtmlCSharpDiagnosticsAsync(VersionedDocumentContext documentContext, Guid correlationId, CancellationToken cancellationToken) + private async Task<(VSInternalDiagnosticReport[]? CSharpDiagnostics, VSInternalDiagnosticReport[]? HtmlDiagnostics)> GetHtmlCSharpDiagnosticsAsync(DocumentContext documentContext, Guid correlationId, CancellationToken cancellationToken) { var delegatedParams = new DelegatedDiagnosticParams(documentContext.GetTextDocumentIdentifierAndVersion(), correlationId); var delegatedResponse = await _clientConnection.SendRequestAsync( diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs index f3f870e3470..1275669a97c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentColor/DocumentColorEndpoint.cs @@ -38,7 +38,7 @@ public async Task HandleRequestAsync(DocumentColorParams req var delegatedRequest = new DelegatedDocumentColorParams() { - HostDocumentVersion = documentContext.Version, + HostDocumentVersion = documentContext.Snapshot.Version, TextDocument = request.TextDocument }; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs index 7f46807c2a3..68755ea2ae8 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentContextFactory.cs @@ -27,19 +27,17 @@ internal sealed class DocumentContextFactory( public bool TryCreate( Uri documentUri, VSProjectContext? projectContext, - bool versioned, [NotNullWhen(true)] out DocumentContext? context) { var filePath = documentUri.GetAbsoluteOrUNCPath(); - if (!TryGetDocumentAndVersion(filePath, projectContext, versioned, out var documentAndVersion)) + if (!TryResolveDocument(filePath, projectContext, out var documentSnapshot)) { // Stale request or misbehaving client, see above comment. context = null; return false; } - var (documentSnapshot, version) = documentAndVersion; if (documentSnapshot is null) { Debug.Fail($"Document snapshot should never be null here for '{filePath}'. This indicates that our acquisition of documents / versions did not behave as expected."); @@ -47,52 +45,10 @@ public bool TryCreate( return false; } - if (versioned) - { - // If we were asked for a versioned document, but have no version info, then we didn't find the document - if (version is null) - { - context = null; - return false; - } - - context = new VersionedDocumentContext(documentUri, documentSnapshot, projectContext, version.Value); - return true; - } - context = new DocumentContext(documentUri, documentSnapshot, projectContext); return true; } - private bool TryGetDocumentAndVersion( - string filePath, - VSProjectContext? projectContext, - bool versioned, - [NotNullWhen(true)] out DocumentSnapshotAndVersion? documentAndVersion) - { - if (TryResolveDocument(filePath, projectContext, out var documentSnapshot)) - { - if (!versioned) - { - documentAndVersion = new DocumentSnapshotAndVersion(documentSnapshot, Version: null); - return true; - } - - documentAndVersion = new DocumentSnapshotAndVersion(documentSnapshot, documentSnapshot.Version); - return true; - } - - // This is super rare, if we get here it could mean many things. Some of which: - // 1. Stale request: - // - Got queued after a "document closed" / "document removed" type action - // - Took too long to run and by the time the request needed the document context the - // version cache has evicted the entry - // 2. Client is misbehaving and sending requests for a document that we've never seen before. - _logger.LogWarning($"Tried to create context for document {filePath} and project {projectContext?.Id} which was not found."); - documentAndVersion = null; - return false; - } - private bool TryResolveDocument( string filePath, VSProjectContext? projectContext, @@ -125,6 +81,4 @@ private bool TryResolveDocument( documentSnapshot = null; return false; } - - private record DocumentSnapshotAndVersion(IDocumentSnapshot Snapshot, int? Version); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs index f0059d00a19..330dd3201d3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs @@ -93,7 +93,7 @@ internal abstract class AbstractTextDocumentPresentationEndpointBase( var requestParams = CreateRazorRequestParameters(request); - requestParams.HostDocumentVersion = documentContext.Version; + requestParams.HostDocumentVersion = documentContext.Snapshot.Version; requestParams.Kind = languageKind; // For CSharp we need to map the range to the generated document @@ -115,7 +115,7 @@ internal abstract class AbstractTextDocumentPresentationEndpointBase( // The responses we get back will be for virtual documents, so we have to map them back to the real // document, and in the case of C#, map the returned ranges too - var edit = MapWorkspaceEdit(response, mapRanges: languageKind == RazorLanguageKind.CSharp, codeDocument, documentContext.Version); + var edit = MapWorkspaceEdit(response, mapRanges: languageKind == RazorLanguageKind.CSharp, codeDocument, documentContext.Snapshot.Version); return edit; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/RazorRequestContext.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/RazorRequestContext.cs index a81541b76d2..97819fcb3f0 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/RazorRequestContext.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/EndpointContracts/RazorRequestContext.cs @@ -7,9 +7,9 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; -internal readonly struct RazorRequestContext(VersionedDocumentContext? documentContext, ILspServices lspServices, string method, Uri? uri) +internal readonly struct RazorRequestContext(DocumentContext? documentContext, ILspServices lspServices, string method, Uri? uri) { - public readonly VersionedDocumentContext? DocumentContext = documentContext; + public readonly DocumentContext? DocumentContext = documentContext; public readonly ILspServices LspServices = lspServices; public readonly string Method = method; public readonly Uri? Uri = uri; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Folding/FoldingRangeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Folding/FoldingRangeEndpoint.cs index d94e078be6b..f2f71470096 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Folding/FoldingRangeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Folding/FoldingRangeEndpoint.cs @@ -55,7 +55,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(FoldingRangeParams reque var requestParams = new RazorFoldingRangeRequestParam { - HostDocumentVersion = documentContext.Version, + HostDocumentVersion = documentContext.Snapshot.Version, TextDocument = @params.TextDocument, }; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs index 9048b915931..55e87401e30 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IRazorFormattingService.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; internal interface IRazorFormattingService { Task FormatAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, Range? range, FormattingOptions options, CancellationToken cancellationToken); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs index 7989815323b..3994238012e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/RazorFormattingService.cs @@ -36,7 +36,7 @@ public RazorFormattingService( } public async Task FormatAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, Range? range, FormattingOptions options, CancellationToken cancellationToken) @@ -68,7 +68,7 @@ public async Task FormatAsync( var uri = documentContext.Uri; var documentSnapshot = documentContext.Snapshot; - var hostDocumentVersion = documentContext.Version; + var hostDocumentVersion = documentContext.Snapshot.Version; using var context = FormattingContext.Create(uri, documentSnapshot, codeDocument, options, _workspaceFactory); var originalText = context.SourceText; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs index 4fb546a09d6..de1dadb9643 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs @@ -35,7 +35,7 @@ internal sealed partial class HoverService( private readonly IDocumentMappingService _documentMappingService = documentMappingService; private readonly IClientCapabilitiesService _clientCapabilitiesService = clientCapabilitiesService; - public async Task GetRazorHoverInfoAsync(VersionedDocumentContext documentContext, DocumentPositionInfo positionInfo, Position position, CancellationToken cancellationToken) + public async Task GetRazorHoverInfoAsync(DocumentContext documentContext, DocumentPositionInfo positionInfo, Position position, CancellationToken cancellationToken) { // HTML can still sometimes be handled by razor. For example hovering over // a component tag like will still be in an html context @@ -57,7 +57,7 @@ internal sealed partial class HoverService( return await GetHoverInfoAsync(documentContext.FilePath, codeDocument, location, _clientCapabilitiesService.ClientCapabilities, cancellationToken).ConfigureAwait(false); } - public async Task TranslateDelegatedResponseAsync(VSInternalHover? response, VersionedDocumentContext documentContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) + public async Task TranslateDelegatedResponseAsync(VSInternalHover? response, DocumentContext documentContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) { if (response?.Range is null) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs index 5408dd8f17d..b3ef864a76c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/IHoverService.cs @@ -11,6 +11,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Hover; internal interface IHoverService { - Task GetRazorHoverInfoAsync(VersionedDocumentContext versionedDocumentContext, DocumentPositionInfo positionInfo, Position position, CancellationToken cancellationToken); - Task TranslateDelegatedResponseAsync(VSInternalHover? response, VersionedDocumentContext versionedDocumentContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken); + Task GetRazorHoverInfoAsync(DocumentContext versionedDocumentContext, DocumentPositionInfo positionInfo, Position position, CancellationToken cancellationToken); + Task TranslateDelegatedResponseAsync(VSInternalHover? response, DocumentContext versionedDocumentContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs index 54865b68151..fce91249bf1 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/IInlayHintService.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.InlayHints; internal interface IInlayHintService { - Task GetInlayHintsAsync(IClientConnection clientConnection, VersionedDocumentContext documentContext, Range range, CancellationToken cancellationToken); + Task GetInlayHintsAsync(IClientConnection clientConnection, DocumentContext documentContext, Range range, CancellationToken cancellationToken); Task ResolveInlayHintAsync(IClientConnection clientConnection, InlayHint inlayHint, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs index 294a6adc827..60b405b5faa 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlayHints/InlayHintService.cs @@ -22,7 +22,7 @@ internal sealed class InlayHintService(IDocumentMappingService documentMappingSe { private readonly IDocumentMappingService _documentMappingService = documentMappingService; - public async Task GetInlayHintsAsync(IClientConnection clientConnection, VersionedDocumentContext documentContext, Range range, CancellationToken cancellationToken) + public async Task GetInlayHintsAsync(IClientConnection clientConnection, DocumentContext documentContext, Range range, CancellationToken cancellationToken) { var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); var csharpDocument = codeDocument.GetCSharpDocument(); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspEditMappingService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspEditMappingService.cs index e8d9f6c580e..bd88b799311 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspEditMappingService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspEditMappingService.cs @@ -22,19 +22,9 @@ internal class LspEditMappingService( { private readonly IDocumentContextFactory _documentContextFactory = documentContextFactory; - protected override bool TryGetVersionedDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, VSProjectContext? projectContext, [NotNullWhen(true)] out VersionedDocumentContext? documentContext) + protected override bool TryGetDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, VSProjectContext? projectContext, [NotNullWhen(true)] out DocumentContext? documentContext) { - if (!_documentContextFactory.TryCreateForOpenDocument(razorDocumentUri, projectContext, out documentContext)) - { - return false; - } - - return true; - } - - protected override bool TryGetDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, [NotNullWhen(true)] out DocumentContext? documentContext) - { - if (!_documentContextFactory.TryCreate(razorDocumentUri, out documentContext)) + if (!_documentContextFactory.TryCreate(razorDocumentUri, projectContext, out documentContext)) { return false; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs index e38ace89ca0..4d61c202e32 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs @@ -85,7 +85,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V continue; } - if (!_documentContextFactory.TryCreateForOpenDocument(mapping.TextDocument.Uri, out var documentContext)) + if (!_documentContextFactory.TryCreate(mapping.TextDocument.Uri, out var documentContext)) { continue; } @@ -131,7 +131,7 @@ private async Task TryMapCodeAsync( Location[][] locations, List changes, Guid mapCodeCorrelationId, - VersionedDocumentContext documentContext, + DocumentContext documentContext, CancellationToken cancellationToken) { var syntaxTree = codeToMap.GetSyntaxTree(); @@ -162,7 +162,7 @@ private async Task TryMapCodeAsync( ImmutableArray nodesToMap, Guid mapCodeCorrelationId, List changes, - VersionedDocumentContext documentContext, + DocumentContext documentContext, CancellationToken cancellationToken) { var didCalculateCSharpFocusLocations = false; @@ -357,7 +357,7 @@ private async Task GetCSharpFocusLocationsAsync(Location[][] focus continue; } - if (!_documentContextFactory.TryCreateForOpenDocument(potentialLocation.Uri, out var documentContext)) + if (!_documentContextFactory.TryCreate(potentialLocation.Uri, out var documentContext)) { continue; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs index 62f55e00a19..7c7bc03cc47 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs @@ -39,7 +39,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(RazorLanguageQueryParams } var documentSnapshot = documentContext.Snapshot; - var documentVersion = documentContext.Version; + var documentVersion = documentContext.Snapshot.Version; var codeDocument = await documentSnapshot.GetGeneratedOutputAsync().ConfigureAwait(false); var sourceText = await documentSnapshot.GetTextAsync().ConfigureAwait(false); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs index a6e0c6f6a29..1223d0f5c39 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorMapToDocumentRangesEndpoint.cs @@ -53,7 +53,7 @@ public Uri GetTextDocumentIdentifier(RazorMapToDocumentRangesParams request) return new RazorMapToDocumentRangesResponse() { Ranges = request.ProjectedRanges, - HostDocumentVersion = documentContext.Version, + HostDocumentVersion = documentContext.Snapshot.Version, }; } @@ -76,7 +76,7 @@ public Uri GetTextDocumentIdentifier(RazorMapToDocumentRangesParams request) return new RazorMapToDocumentRangesResponse() { Ranges = ranges, - HostDocumentVersion = documentContext.Version, + HostDocumentVersion = documentContext.Snapshot.Version, }; } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorRequestContextFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorRequestContextFactory.cs index 3383b82b7cb..f89b213204c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorRequestContextFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorRequestContextFactory.cs @@ -21,7 +21,7 @@ public override Task CreateRequestContextAsync().GetOrCreateLogger(); - VersionedDocumentContext? documentContext = null; + DocumentContext? documentContext = null; var textDocumentHandler = methodHandler as ITextDocumentIdentifierHandler; Uri? uri = null; @@ -35,7 +35,7 @@ public override Task CreateRequestContextAsync uriHandler) { @@ -43,7 +43,7 @@ public override Task CreateRequestContextAsync(); public async Task GetCSharpSemanticTokensResponseAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, ImmutableArray csharpSpans, Guid correlationId, CancellationToken cancellationToken) { - var documentVersion = documentContext.Version; + var documentVersion = documentContext.Snapshot.Version; using var _ = ListPool.GetPooledObject(out var csharpRangeList); foreach (var span in csharpSpans) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs index 3d2b69e43a5..625c7a6086b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs @@ -79,7 +79,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentSpellC }; } - private static async Task AddRazorSpellCheckRangesAsync(List ranges, VersionedDocumentContext documentContext, CancellationToken cancellationToken) + private static async Task AddRazorSpellCheckRangesAsync(List ranges, DocumentContext documentContext, CancellationToken cancellationToken) { var tree = await documentContext.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); @@ -127,7 +127,7 @@ MarkupMinimizedTagHelperDirectiveAttributeSyntax or } } - private async Task AddCSharpSpellCheckRangesAsync(List ranges, VersionedDocumentContext documentContext, CancellationToken cancellationToken) + private async Task AddCSharpSpellCheckRangesAsync(List ranges, DocumentContext documentContext, CancellationToken cancellationToken) { var delegatedParams = new DelegatedSpellCheckParams(documentContext.GetTextDocumentIdentifierAndVersion()); var delegatedResponse = await _clientConnection.SendRequestAsync( diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs index 990dbc07a6e..aa168ece625 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs @@ -104,7 +104,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(WrapWithTagParams reques var versioned = new VersionedTextDocumentIdentifier { Uri = request.TextDocument.Uri, - Version = documentContext.Version, + Version = documentContext.Snapshot.Version, }; var parameter = new DelegatedWrapWithTagParams(versioned, request); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractEditMappingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractEditMappingService.cs index f19d04c3500..a06a6ec3d52 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractEditMappingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractEditMappingService.cs @@ -26,7 +26,7 @@ public async Task RemapWorkspaceEditAsync(IDocumentSnapshot conte if (workspaceEdit.TryGetTextDocumentEdits(out var documentEdits)) { // The LSP spec says, we should prefer `DocumentChanges` property over `Changes` if available. - var remappedEdits = await RemapVersionedDocumentEditsAsync(contextDocumentSnapshot, documentEdits, cancellationToken).ConfigureAwait(false); + var remappedEdits = await RemapTextDocumentEditsAsync(contextDocumentSnapshot, documentEdits, cancellationToken).ConfigureAwait(false); return new WorkspaceEdit() { @@ -62,7 +62,7 @@ private async Task> RemapDocumentEditsAsync(IDocu continue; } - if (!TryGetDocumentContext(contextDocumentSnapshot, uri, out var documentContext)) + if (!TryGetDocumentContext(contextDocumentSnapshot, uri, projectContext: null, out var documentContext)) { continue; } @@ -107,7 +107,7 @@ private TextEdit[] RemapTextEditsCore(Uri generatedDocumentUri, RazorCodeDocumen return remappedEdits.ToArray(); } - private async Task RemapVersionedDocumentEditsAsync(IDocumentSnapshot contextDocumentSnapshot, TextDocumentEdit[] documentEdits, CancellationToken cancellationToken) + private async Task RemapTextDocumentEditsAsync(IDocumentSnapshot contextDocumentSnapshot, TextDocumentEdit[] documentEdits, CancellationToken cancellationToken) { using var remappedDocumentEdits = new PooledArrayBuilder(documentEdits.Length); @@ -125,7 +125,7 @@ private async Task RemapVersionedDocumentEditsAsync(IDocumen var razorDocumentUri = _filePathService.GetRazorDocumentUri(generatedDocumentUri); - if (!TryGetVersionedDocumentContext(contextDocumentSnapshot, razorDocumentUri, entry.TextDocument.GetProjectContext(), out var documentContext)) + if (!TryGetDocumentContext(contextDocumentSnapshot, razorDocumentUri, entry.TextDocument.GetProjectContext(), out var documentContext)) { continue; } @@ -144,7 +144,7 @@ private async Task RemapVersionedDocumentEditsAsync(IDocumen TextDocument = new OptionalVersionedTextDocumentIdentifier() { Uri = razorDocumentUri, - Version = documentContext.Version + Version = documentContext.Snapshot.Version }, Edits = remappedEdits }); @@ -153,7 +153,5 @@ private async Task RemapVersionedDocumentEditsAsync(IDocumen return remappedDocumentEdits.ToArray(); } - protected abstract bool TryGetVersionedDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, VSProjectContext? projectContext, [NotNullWhen(true)] out VersionedDocumentContext? documentContext); - - protected abstract bool TryGetDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, [NotNullWhen(true)] out DocumentContext? documentContext); + protected abstract bool TryGetDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, VSProjectContext? projectContext, [NotNullWhen(true)] out DocumentContext? documentContext); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs index a99c792531f..207357dbbcc 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Syntax; +using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; using RazorSyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; @@ -33,6 +34,9 @@ public TextDocumentIdentifier GetTextDocumentIdentifier() ProjectContext = _projectContext, }; + public TextDocumentIdentifierAndVersion GetTextDocumentIdentifierAndVersion() + => new(GetTextDocumentIdentifier(), Snapshot.Version); + private bool TryGetCodeDocument([NotNullWhen(true)] out RazorCodeDocument? codeDocument) { codeDocument = _codeDocument; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactory.cs index 6eb544326ec..a29c943da58 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactory.cs @@ -12,6 +12,5 @@ internal interface IDocumentContextFactory bool TryCreate( Uri documentUri, VSProjectContext? projectContext, - bool versioned, [NotNullWhen(true)] out DocumentContext? context); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactoryExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactoryExtensions.cs index 519212b9df7..4843df493cf 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactoryExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentContextFactoryExtensions.cs @@ -13,64 +13,11 @@ public static bool TryCreate( this IDocumentContextFactory service, TextDocumentIdentifier documentIdentifier, [NotNullWhen(true)] out DocumentContext? context) - => service.TryCreate(documentIdentifier.Uri, documentIdentifier.GetProjectContext(), versioned: false, out context); + => service.TryCreate(documentIdentifier.Uri, documentIdentifier.GetProjectContext(), out context); public static bool TryCreate( this IDocumentContextFactory service, Uri documentUri, [NotNullWhen(true)] out DocumentContext? context) - => service.TryCreate(documentUri, projectContext: null, versioned: false, out context); - - public static bool TryCreate( - this IDocumentContextFactory service, - Uri documentUri, - VSProjectContext? projectContext, - [NotNullWhen(true)] out DocumentContext? context) - => service.TryCreate(documentUri, projectContext, versioned: false, out context); - - public static bool TryCreateForOpenDocument( - this IDocumentContextFactory service, - Uri documentUri, - [NotNullWhen(true)] out VersionedDocumentContext? context) - { - if (service.TryCreate(documentUri, projectContext: null, versioned: true, out var documentContext)) - { - context = (VersionedDocumentContext)documentContext; - return true; - } - - context = null; - return false; - } - - public static bool TryCreateForOpenDocument( - this IDocumentContextFactory service, - TextDocumentIdentifier documentIdentifier, - [NotNullWhen(true)] out VersionedDocumentContext? context) - { - if (service.TryCreate(documentIdentifier.Uri, documentIdentifier.GetProjectContext(), versioned: true, out var documentContext)) - { - context = (VersionedDocumentContext)documentContext; - return true; - } - - context = null; - return false; - } - - public static bool TryCreateForOpenDocument( - this IDocumentContextFactory service, - Uri documentUri, - VSProjectContext? projectContext, - [NotNullWhen(true)] out VersionedDocumentContext? context) - { - if (service.TryCreate(documentUri, projectContext, versioned: true, out var documentContext)) - { - context = (VersionedDocumentContext)documentContext; - return true; - } - - context = null; - return false; - } + => service.TryCreate(documentUri, projectContext: null, out context); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/VersionedDocumentContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/VersionedDocumentContext.cs deleted file mode 100644 index 6c4bbcf8ade..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/VersionedDocumentContext.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.VisualStudio.LanguageServer.Protocol; - -namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; - -internal class VersionedDocumentContext(Uri uri, IDocumentSnapshot snapshot, VSProjectContext? projectContext, int version) - : DocumentContext(uri, snapshot, projectContext) -{ - public int Version { get; } = version; - - public TextDocumentIdentifierAndVersion GetTextDocumentIdentifierAndVersion() - => new(GetTextDocumentIdentifier(), Version); -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/IRenameService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/IRenameService.cs index 36c271f15d2..6567bf92ba2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/IRenameService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/IRenameService.cs @@ -11,5 +11,5 @@ namespace Microsoft.CodeAnalysis.Razor.Rename; internal interface IRenameService { - Task TryGetRazorRenameEditsAsync(VersionedDocumentContext documentContext, DocumentPositionInfo positionInfo, string newName, CancellationToken cancellationToken); + Task TryGetRazorRenameEditsAsync(DocumentContext documentContext, DocumentPositionInfo positionInfo, string newName, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs index 6563e5bb059..4d74b88fd01 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs @@ -32,7 +32,7 @@ internal class RenameService( private readonly IProjectCollectionResolver _projectCollectionResolver = projectCollectionResolver; private readonly LanguageServerFeatureOptions _languageServerFeatureOptions = languageServerFeatureOptions; - public async Task TryGetRazorRenameEditsAsync(VersionedDocumentContext documentContext, DocumentPositionInfo positionInfo, string newName, CancellationToken cancellationToken) + public async Task TryGetRazorRenameEditsAsync(DocumentContext documentContext, DocumentPositionInfo positionInfo, string newName, CancellationToken cancellationToken) { // We only support renaming of .razor components, not .cshtml tag helpers if (!FileKinds.IsComponent(documentContext.FileKind)) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/AbstractRazorSemanticTokensInfoService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/AbstractRazorSemanticTokensInfoService.cs index 0acf4494658..fbd237c3710 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/AbstractRazorSemanticTokensInfoService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/AbstractRazorSemanticTokensInfoService.cs @@ -36,7 +36,7 @@ internal abstract class AbstractRazorSemanticTokensInfoService( private readonly ILogger _logger = logger; public async Task GetSemanticTokensAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, LinePositionSpan span, bool colorBackground, Guid correlationId, @@ -58,7 +58,7 @@ internal abstract class AbstractRazorSemanticTokensInfoService( } private async Task GetSemanticTokensAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, LinePositionSpan span, Guid correlationId, bool colorBackground, @@ -89,7 +89,7 @@ internal abstract class AbstractRazorSemanticTokensInfoService( // We return null (which to the LSP is a no-op) to prevent flashing of CSharp elements. if (csharpSemanticRangesResult is not { } csharpSemanticRanges) { - _logger.LogDebug($"Couldn't get C# tokens for version {documentContext.Version} of {documentContext.Uri}. Returning null"); + _logger.LogDebug($"Couldn't get C# tokens for version {documentContext.Snapshot.Version} of {documentContext.Uri}. Returning null"); return null; } @@ -134,7 +134,7 @@ private static ImmutableArray CombineSemanticRanges(ImmutableArra // Virtual for benchmarks protected virtual async Task?> GetCSharpSemanticRangesAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, RazorCodeDocument codeDocument, LinePositionSpan razorSpan, bool colorBackground, @@ -170,7 +170,7 @@ private static ImmutableArray CombineSemanticRanges(ImmutableArra csharpRanges = [csharpRange]; } - _logger.LogDebug($"Requesting C# semantic tokens for host version {documentContext.Version}, correlation ID {correlationId}, and the server thinks there are {codeDocument.GetCSharpSourceText().Lines.Count} lines of C#"); + _logger.LogDebug($"Requesting C# semantic tokens for host version {documentContext.Snapshot.Version}, correlation ID {correlationId}, and the server thinks there are {codeDocument.GetCSharpSourceText().Lines.Count} lines of C#"); var csharpResponse = await _csharpSemanticTokensProvider.GetCSharpSemanticTokensResponseAsync(documentContext, csharpRanges, correlationId, cancellationToken).ConfigureAwait(false); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/ICSharpSemanticTokensProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/ICSharpSemanticTokensProvider.cs index fede98e6331..216f320b74d 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/ICSharpSemanticTokensProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/ICSharpSemanticTokensProvider.cs @@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Razor.SemanticTokens; internal interface ICSharpSemanticTokensProvider { Task GetCSharpSemanticTokensResponseAsync( - VersionedDocumentContext documentContext, + DocumentContext documentContext, ImmutableArray csharpSpans, Guid correlationId, CancellationToken cancellationToken); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/IRazorSemanticTokenInfoService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/IRazorSemanticTokenInfoService.cs index 26de9805eca..b9240e16426 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/IRazorSemanticTokenInfoService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/IRazorSemanticTokenInfoService.cs @@ -15,5 +15,5 @@ internal interface IRazorSemanticTokensInfoService /// Gets the int array representing the semantic tokens for the given range. ///
/// See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens for details about the int array - Task GetSemanticTokensAsync(VersionedDocumentContext documentContext, LinePositionSpan range, bool colorBackground, Guid correlationId, CancellationToken cancellationToken); + Task GetSemanticTokensAsync(DocumentContext documentContext, LinePositionSpan range, bool colorBackground, Guid correlationId, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentMapping/RemoteEditMappingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentMapping/RemoteEditMappingService.cs index 359c4e90729..7110af27edd 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentMapping/RemoteEditMappingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentMapping/RemoteEditMappingService.cs @@ -21,7 +21,7 @@ internal sealed class RemoteEditMappingService( { private readonly DocumentSnapshotFactory _documentSnapshotFactory = documentSnapshotFactory; - protected override bool TryGetVersionedDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, VSProjectContext? projectContext, [NotNullWhen(true)] out VersionedDocumentContext? documentContext) + protected override bool TryGetDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, VSProjectContext? projectContext, [NotNullWhen(true)] out DocumentContext? documentContext) { if (contextDocumentSnapshot is not RemoteDocumentSnapshot originSnapshot) { @@ -40,12 +40,4 @@ protected override bool TryGetVersionedDocumentContext(IDocumentSnapshot context documentContext = new RemoteDocumentContext(razorDocumentUri, razorDocumentSnapshot); return true; } - - protected override bool TryGetDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, [NotNullWhen(true)] out DocumentContext? documentContext) - { - // In OOP there is no difference between versioned and unversioned document contexts. - var result = TryGetVersionedDocumentContext(contextDocumentSnapshot, razorDocumentUri, projectContext: null, out var versionedDocumentContext); - documentContext = versionedDocumentContext; - return result; - } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextExtensions.cs index bd29cf52ab3..b1213b419f0 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextExtensions.cs @@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.Remote.Razor; internal static class DocumentContextExtensions { public static async Task GetGeneratedDocumentAsync( - this VersionedDocumentContext documentContext, + this DocumentContext documentContext, IFilePathService filePathService, CancellationToken cancellationToken) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentContext.cs index bfd3a34bdff..d96a578fb2a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentContext.cs @@ -6,13 +6,13 @@ namespace Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; -internal class RemoteDocumentContext : VersionedDocumentContext +internal class RemoteDocumentContext : DocumentContext { public TextDocument TextDocument => ((RemoteDocumentSnapshot)Snapshot).TextDocument; public RemoteDocumentContext(Uri uri, RemoteDocumentSnapshot snapshot) - // HACK: Need to revisit version and projectContext here I guess - : base(uri, snapshot, projectContext: null, version: 1) + // HACK: Need to revisit projectContext here I guess + : base(uri, snapshot, projectContext: null) { } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs index 0449adbc393..36efc36202e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs @@ -34,7 +34,7 @@ internal class RemoteDocumentSnapshot(TextDocument textDocument, RemoteProjectSn public bool SupportsOutput => true; - public int Version => throw new NotImplementedException("We don't expect to use this in cohosting because we do not control generated document creation."); + public int Version => -999; // We don't expect to use this in cohosting, but plenty of existing code logs it's value public Task GetTextAsync() => _textDocument.GetTextAsync(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SemanticTokens/RemoteCSharpSemanticTokensProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SemanticTokens/RemoteCSharpSemanticTokensProvider.cs index afd2f6463ab..2823c1a9175 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SemanticTokens/RemoteCSharpSemanticTokensProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SemanticTokens/RemoteCSharpSemanticTokensProvider.cs @@ -22,7 +22,7 @@ internal class RemoteCSharpSemanticTokensProvider(IFilePathService filePathServi private readonly IFilePathService _filePathService = filePathService; private readonly ITelemetryReporter _telemetryReporter = telemetryReporter; - public async Task GetCSharpSemanticTokensResponseAsync(VersionedDocumentContext documentContext, ImmutableArray csharpRanges, Guid correlationId, CancellationToken cancellationToken) + public async Task GetCSharpSemanticTokensResponseAsync(DocumentContext documentContext, ImmutableArray csharpRanges, Guid correlationId, CancellationToken cancellationToken) { using var _ = _telemetryReporter.TrackLspRequest(nameof(SemanticTokensRange.GetSemanticTokensAsync), Constants.ExternalAccessServerName, correlationId); diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs index 1c52c7fd813..1ae779026f7 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs @@ -136,7 +136,6 @@ private async Task> TrySynchronizeV int requiredHostDocumentVersion, TextDocumentIdentifier hostDocument, CancellationToken cancellationToken, - LanguageServer.Protocol.Range? _ = null, bool rejectOnNewerParallelRequest = true, [CallerMemberName] string? caller = null) where TVirtualDocumentSnapshot : VirtualDocumentSnapshot @@ -201,21 +200,6 @@ private async Task> TrySynchronizeV _logger.LogDebug($"{(result.Synchronized ? "Did" : "Did NOT")} synchronize for {caller}: Version {requiredHostDocumentVersion} for {result.VirtualSnapshot?.Uri}"); } - //if (requiredHostDocumentVersion == 1 && - // result.Synchronized && - // result.VirtualSnapshot is not null && - // range is not null) - //{ - // // If we're at version 1, and we're synced, lets make sure the buffer has enough lines to handle the request - // if (range.Start.Line > result.VirtualSnapshot.Snapshot.LineCount || - // range.End.Line > result.VirtualSnapshot.Snapshot.LineCount) - // { - // Debug.Fail("It worked!"); - // _logger.LogWarning($"Requested line ({range.Start.Line} or {range.End.Line}) is out of bounds for {result.VirtualSnapshot.Uri}. Sync failed."); - // return new SynchronizedResult(false, null); - // } - //} - return result; } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs index 15b5ae81682..654bb036108 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs @@ -62,8 +62,7 @@ internal partial class RazorCustomMessageTarget var (synchronized, csharpDoc) = await TrySynchronizeVirtualDocumentAsync( semanticTokensParams.RequiredHostDocumentVersion, semanticTokensParams.TextDocument, - cancellationToken, - semanticTokensParams.Ranges.FirstOrDefault()); + cancellationToken); if (csharpDoc is null) { @@ -90,12 +89,12 @@ internal partial class RazorCustomMessageTarget { try { - var result = await _requestInvoker.ReinvokeRequestOnServerAsync( - textBuffer, - lspMethodName, - languageServerName, - requestParams, - cancellationToken).ConfigureAwait(false); + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + textBuffer, + lspMethodName, + languageServerName, + requestParams, + cancellationToken).ConfigureAwait(false); response = result?.Response; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs index 7f7e31e9747..26b5acd8561 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs @@ -371,7 +371,7 @@ private async Task VerifyCSharpOnAutoInsertAsync(string input, string expected, InsertSpaces = true }, }; - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(@params.TextDocument, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(@params.TextDocument, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs index 3afd4bc01c2..0fa1e83882d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs @@ -1240,9 +1240,8 @@ private class GenerateMethodResolverDocumentContextFactory : TestDocumentContext public GenerateMethodResolverDocumentContextFactory (string filePath, RazorCodeDocument codeDocument, - TagHelperDescriptor[]? tagHelpers = null, - int? version = null) - : base(filePath, codeDocument, version) + TagHelperDescriptor[]? tagHelpers = null) + : base(filePath, codeDocument) { _tagHelperDescriptors = CreateTagHelperDescriptors(); if (tagHelpers is not null) @@ -1254,7 +1253,6 @@ public GenerateMethodResolverDocumentContextFactory public override bool TryCreate( Uri documentUri, VSProjectContext? projectContext, - bool versioned, [NotNullWhen(true)] out DocumentContext? context) { if (FilePath is null || CodeDocument is null) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs index e3f63cfb270..e793aa35659 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/CompletionListProviderTest.cs @@ -27,7 +27,7 @@ public class CompletionListProviderTest : LanguageServerTestBase private readonly RazorCompletionListProvider _razorCompletionProvider; private readonly DelegatedCompletionListProvider _delegatedCompletionProvider; private readonly VSInternalCompletionContext _completionContext; - private readonly VersionedDocumentContext _documentContext; + private readonly DocumentContext _documentContext; private readonly VSInternalClientCapabilities _clientCapabilities; public CompletionListProviderTest(ITestOutputHelper testOutput) @@ -38,7 +38,7 @@ public CompletionListProviderTest(ITestOutputHelper testOutput) _razorCompletionProvider = new TestRazorCompletionListProvider(_completionList1, new[] { SharedTriggerCharacter, }, LoggerFactory); _delegatedCompletionProvider = new TestDelegatedCompletionListProvider(_completionList2, new[] { SharedTriggerCharacter, CompletionList2OnlyTriggerCharacter }); _completionContext = new VSInternalCompletionContext(); - _documentContext = TestDocumentContext.From("C:/path/to/file.cshtml", hostDocumentVersion: 0); + _documentContext = TestDocumentContext.From("C:/path/to/file.cshtml"); _clientCapabilities = new VSInternalClientCapabilities(); } @@ -89,7 +89,7 @@ public TestDelegatedCompletionListProvider(VSInternalCompletionList completionLi public override Task GetCompletionListAsync( int absoluteIndex, VSInternalCompletionContext completionContext, - VersionedDocumentContext documentContext, + DocumentContext documentContext, VSInternalClientCapabilities clientCapabilities, Guid correlationId, CancellationToken cancellationToken) @@ -117,7 +117,7 @@ public TestRazorCompletionListProvider( public override Task GetCompletionListAsync( int absoluteIndex, VSInternalCompletionContext completionContext, - VersionedDocumentContext documentContext, + DocumentContext documentContext, VSInternalClientCapabilities clientCapabilities, HashSet existingCompletions, CancellationToken cancellationToken) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs index 90b3f93b7db..6df70d43a2c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs @@ -51,7 +51,7 @@ public DelegatedCompletionItemResolverTest(ITestOutputHelper testOutput) } }; - var documentContext = TestDocumentContext.From("C:/path/to/file.cshtml", hostDocumentVersion: 0); + var documentContext = TestDocumentContext.From("C:/path/to/file.cshtml"); _csharpCompletionParams = new DelegatedCompletionParams( documentContext.GetTextDocumentIdentifierAndVersion(), VsLspFactory.CreatePosition(10, 6), @@ -222,7 +222,7 @@ private async Task ResolveCompletionItemAsync(string c await using var csharpServer = await CreateCSharpServerAsync(codeDocument); var server = TestDelegatedCompletionItemResolverServer.Create(csharpServer, DisposalToken); - var documentContextFactory = new TestDocumentContextFactory("C:/path/to/file.razor", codeDocument, version: 123); + var documentContextFactory = new TestDocumentContextFactory("C:/path/to/file.razor", codeDocument); var resolver = new DelegatedCompletionItemResolver(documentContextFactory, _formattingService.GetValue(), server); var (containingCompletionList, csharpCompletionParams) = await GetCompletionListAndOriginalParamsAsync( cursorPosition, codeDocument, csharpServer); @@ -268,7 +268,7 @@ private async Task CreateCSharpServerAsync(RazorCodeDocumen CSharpTestLspServer csharpServer) { var completionContext = new VSInternalCompletionContext() { TriggerKind = CompletionTriggerKind.Invoked }; - var documentContext = TestDocumentContext.From("C:/path/to/file.razor", codeDocument, hostDocumentVersion: 1337); + var documentContext = TestDocumentContext.From("C:/path/to/file.razor", codeDocument); var provider = TestDelegatedCompletionListProvider.Create(csharpServer, LoggerFactory, DisposalToken); var completionList = await provider.GetCompletionListAsync( diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs index 66225461c0c..b338d8d03a1 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/ResponseRewriterTestBase.cs @@ -27,7 +27,7 @@ private protected async Task GetRewrittenCompletionLis { var completionContext = new VSInternalCompletionContext(); var codeDocument = CreateCodeDocument(documentContent); - var documentContext = TestDocumentContext.From("C:/path/to/file.cshtml", codeDocument, hostDocumentVersion: 0); + var documentContext = TestDocumentContext.From("C:/path/to/file.cshtml", codeDocument); var provider = TestDelegatedCompletionListProvider.Create(initialCompletionList, LoggerFactory, rewriter ?? Rewriter); var clientCapabilities = new VSInternalClientCapabilities(); var completionList = await provider.GetCompletionListAsync(absoluteIndex, completionContext, documentContext, clientCapabilities, correlationId: Guid.Empty, cancellationToken: DisposalToken); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionListProviderTest.cs index cd809b718d3..1f80264a23c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/RazorCompletionListProviderTest.cs @@ -364,7 +364,7 @@ public async Task GetCompletionListAsync_ProvidesDirectiveCompletionItems(string var documentPath = "C:/path/to/document.cshtml"; TestFileMarkupParser.GetPosition(documentText, out documentText, out var cursorPosition); var codeDocument = CreateCodeDocument(documentText); - var documentContext = TestDocumentContext.From(documentPath, codeDocument, hostDocumentVersion: 0); + var documentContext = TestDocumentContext.From(documentPath, codeDocument); var provider = new RazorCompletionListProvider(_completionFactsService, _completionListCache, LoggerFactory); // Act @@ -385,7 +385,7 @@ public async Task GetCompletionListAsync_ProvidesDirectiveCompletions_Incomplete // Arrange var documentPath = "C:/path/to/document.cshtml"; var codeDocument = CreateCodeDocument("@"); - var documentContext = TestDocumentContext.From(documentPath, codeDocument, hostDocumentVersion: 0); + var documentContext = TestDocumentContext.From(documentPath, codeDocument); var completionContext = new VSInternalCompletionContext() { TriggerKind = CompletionTriggerKind.TriggerForIncompleteCompletions, @@ -418,7 +418,7 @@ public async Task GetCompletionListAsync_ProvidesInjectOnIncomplete_KeywordIn() var tagHelperContext = TagHelperDocumentContext.Create(prefix: string.Empty, [tagHelper]); var codeDocument = CreateCodeDocument("@in"); codeDocument.SetTagHelperContext(tagHelperContext); - var documentContext = TestDocumentContext.From(documentPath, codeDocument, hostDocumentVersion: 0); + var documentContext = TestDocumentContext.From(documentPath, codeDocument); var provider = new RazorCompletionListProvider(_completionFactsService, _completionListCache, LoggerFactory); var completionContext = new VSInternalCompletionContext() { @@ -447,7 +447,7 @@ public async Task GetCompletionListAsync_DoesNotProvideInjectOnInvoked() var tagHelperContext = TagHelperDocumentContext.Create(prefix: string.Empty, [tagHelper]); var codeDocument = CreateCodeDocument("@inje"); codeDocument.SetTagHelperContext(tagHelperContext); - var documentContext = TestDocumentContext.From(documentPath, codeDocument, hostDocumentVersion: 0); + var documentContext = TestDocumentContext.From(documentPath, codeDocument); var provider = new RazorCompletionListProvider(_completionFactsService, _completionListCache, LoggerFactory); var completionContext = new VSInternalCompletionContext() { @@ -475,7 +475,7 @@ public async Task GetCompletionListAsync_ProvidesInjectOnIncomplete() var tagHelperContext = TagHelperDocumentContext.Create(prefix: string.Empty, [tagHelper]); var codeDocument = CreateCodeDocument("@inje"); codeDocument.SetTagHelperContext(tagHelperContext); - var documentContext = TestDocumentContext.From(documentPath, codeDocument, hostDocumentVersion: 0); + var documentContext = TestDocumentContext.From(documentPath, codeDocument); var provider = new RazorCompletionListProvider(_completionFactsService, _completionListCache, LoggerFactory); var completionContext = new VSInternalCompletionContext() { @@ -505,7 +505,7 @@ public async Task GetCompletionListAsync_ProvidesTagHelperElementCompletionItems var tagHelperContext = TagHelperDocumentContext.Create(prefix: string.Empty, [tagHelper]); var codeDocument = CreateCodeDocument("<"); codeDocument.SetTagHelperContext(tagHelperContext); - var documentContext = TestDocumentContext.From(documentPath, codeDocument, hostDocumentVersion: 0); + var documentContext = TestDocumentContext.From(documentPath, codeDocument); var provider = new RazorCompletionListProvider(_completionFactsService, _completionListCache, LoggerFactory); // Act @@ -535,7 +535,7 @@ public async Task GetCompletionListAsync_ProvidesTagHelperAttributeItems() var tagHelperContext = TagHelperDocumentContext.Create(prefix: string.Empty, [tagHelper]); var codeDocument = CreateCodeDocument("(MockBehavior.Strict); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs index 2711a8dc359..b844af4ff61 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Definition/DefinitionEndpointDelegationTest.cs @@ -240,7 +240,7 @@ await projectManager.UpdateAsync(updater => var searchEngine = new RazorComponentSearchEngine(projectManager, LoggerFactory); var razorUri = new Uri(razorFilePath); - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(razorUri, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(razorUri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); var endpoint = new DefinitionEndpoint(searchEngine, DocumentMappingService, LanguageServerFeatureOptions, languageServer, LoggerFactory); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs index 61e48cb7880..a202af3d35c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentContextFactoryTest.cs @@ -51,7 +51,7 @@ public void TryCreateForOpenDocumentAsync_CanNotResolveDocument_ReturnsNull() var factory = new DocumentContextFactory(_projectManager, LoggerFactory); // Act - Assert.False(factory.TryCreateForOpenDocument(uri, out _)); + Assert.False(factory.TryCreate(uri, out _)); } [Fact] @@ -130,10 +130,10 @@ await _projectManager.UpdateAsync(updater => var factory = new DocumentContextFactory(_projectManager, LoggerFactory); // Act - Assert.True(factory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(factory.TryCreate(uri, out var documentContext)); // Assert - Assert.Equal(1, documentContext.Version); + Assert.Equal(1, documentContext.Snapshot.Version); Assert.Equal(uri, documentContext.Uri); Assert.Same(documentSnapshot, documentContext.Snapshot); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs index 060c282439d..655f2796130 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs @@ -112,7 +112,7 @@ private async Task VerifyHighlightingRangesAsync(string input) await csharpServer.OpenDocumentAsync(csharpDocumentUri, csharpSourceText.ToString()); var razorFilePath = "C:/path/to/file.razor"; - var documentContextFactory = new TestDocumentContextFactory(razorFilePath, codeDocument, version: 1337); + var documentContextFactory = new TestDocumentContextFactory(razorFilePath, codeDocument); var languageServerFeatureOptions = Mock.Of(options => options.SupportsFileManipulation == true && options.SingleServerSupport == true && diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs index 100667df822..52ee2ceb54a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs @@ -50,7 +50,7 @@ public async Task Handle_SimpleComponent_ReturnsResult() await projectManager.UpdateAsync(updater => updater.DocumentOpened(project.Key, razorFilePath, SourceText.From("
"))); var documentSnapshot = projectManager.GetLoadedProject(project.Key).GetDocument(razorFilePath).AssumeNotNull(); var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, null, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, null, out var documentContext)); var clientConnection = new Mock(MockBehavior.Strict); @@ -106,7 +106,7 @@ public async Task Handle_SimpleComponentWithChildFile_ReturnsResult() await projectManager.UpdateAsync(updater => updater.DocumentOpened(project.Key, razorFilePath, SourceText.From("
"))); var documentSnapshot = projectManager.GetLoadedProject(project.Key).GetDocument(razorFilePath).AssumeNotNull(); var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, null, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, null, out var documentContext)); var clientConnection = new Mock(MockBehavior.Strict); @@ -173,7 +173,7 @@ public async Task Handle_ComponentWithRequiredAttribute_ReturnsResult() await projectManager.UpdateAsync(updater => updater.DocumentOpened(project.Key, razorFilePath, SourceText.From("
"))); var documentSnapshot = projectManager.GetLoadedProject(project.Key).GetDocument(razorFilePath).AssumeNotNull(); var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, null, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, null, out var documentContext)); var clientConnection = new Mock(MockBehavior.Strict); @@ -379,7 +379,7 @@ public async Task Handle_ComponentWithNestedFiles_ReturnsResult() await projectManager.UpdateAsync(updater => updater.DocumentOpened(project.Key, razorFilePath, SourceText.From("
"))); var documentSnapshot = projectManager.GetLoadedProject(project.Key).GetDocument(razorFilePath).AssumeNotNull(); var documentContextFactory = new DocumentContextFactory(projectManager, LoggerFactory); - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, null, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, null, out var documentContext)); var clientConnection = new Mock(MockBehavior.Strict); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs index f8cbf5683e3..92907ce1842 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs @@ -117,7 +117,7 @@ private async Task VerifyDocumentSymbolsAsync(string input, bool hierarchical = } } }; - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(request.TextDocument, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(request.TextDocument, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); var result = await endpoint.HandleRequestAsync(request, requestContext, DisposalToken); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs index ff0cc641c58..8436afc4d0e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindReferences/FindAllReferencesEndpointTest.cs @@ -64,7 +64,7 @@ private async Task VerifyCSharpFindAllReferencesAsyncAsync(string input) }, Position = sourceText.GetPosition(cursorPosition) }; - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(request.TextDocument, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(request.TextDocument, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Folding/FoldingEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Folding/FoldingEndpointTest.cs index 4bafb189d06..1cff2a0d10f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Folding/FoldingEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Folding/FoldingEndpointTest.cs @@ -222,7 +222,7 @@ private async Task VerifyRazorFoldsAsync(string input, string? filePath = null) } } }; - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(request.TextDocument, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(request.TextDocument, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs index 17177a8e49c..bdcdea1996f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs @@ -207,7 +207,7 @@ public async Task Handle_OnTypeFormatting_UnexpectedTriggerCharacter_ReturnsNull Position = VsLspFactory.CreatePosition(2, 11), Options = new FormattingOptions { InsertSpaces = true, TabSize = 4 } }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs index 25a4ba44e63..cf6fe184229 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs @@ -37,7 +37,7 @@ internal class DummyRazorFormattingService : IRazorFormattingService { public bool Called { get; private set; } - public Task FormatAsync(VersionedDocumentContext documentContext, Range? range, FormattingOptions options, CancellationToken cancellationToken) + public Task FormatAsync(DocumentContext documentContext, Range? range, FormattingOptions options, CancellationToken cancellationToken) { Called = true; return SpecializedTasks.EmptyArray(); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index a6089dfe1d8..c8bab7fac2d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -77,7 +77,7 @@ private async Task RunFormattingTestAsync(string input, string expected, int tab }; var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, razorLSPOptions); - var documentContext = new VersionedDocumentContext(uri, documentSnapshot, projectContext: null, version: 1); + var documentContext = new DocumentContext(uri, documentSnapshot, projectContext: null); // Act var edits = await formattingService.FormatAsync(documentContext, range, options, DisposalToken); @@ -126,7 +126,7 @@ private protected async Task RunOnTypeFormattingTestAsync( TabSize = tabSize, InsertSpaces = insertSpaces, }; - var documentContext = new VersionedDocumentContext(uri, documentSnapshot, projectContext: null, version: 1); + var documentContext = new DocumentContext(uri, documentSnapshot, projectContext: null); // Act var edits = await formattingService.FormatOnTypeAsync(documentContext, languageKind, Array.Empty(), options, hostDocumentIndex: positionAfterTrigger, triggerCharacter: triggerCharacter, DisposalToken); @@ -194,7 +194,7 @@ protected async Task RunCodeActionFormattingTestAsync( TabSize = tabSize, InsertSpaces = insertSpaces, }; - var documentContext = new VersionedDocumentContext(uri, documentSnapshot, projectContext: null, version: 1); + var documentContext = new DocumentContext(uri, documentSnapshot, projectContext: null); // Act var edits = await formattingService.FormatCodeActionAsync(documentContext, languageKind, codeActionEdits, options, DisposalToken); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs index d7a1c2bc4a2..411d6405171 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs @@ -871,7 +871,7 @@ private async Task GetResultFromSingleServerEndpointAsync(strin await csharpServer.OpenDocumentAsync(csharpDocumentUri, csharpSourceText.ToString()); var razorFilePath = "C:/path/to/file.razor"; - var documentContextFactory = new TestDocumentContextFactory(razorFilePath, codeDocument, version: 1337); + var documentContextFactory = new TestDocumentContextFactory(razorFilePath, codeDocument); var languageServerFeatureOptions = Mock.Of(options => options.SupportsFileManipulation == true && options.SingleServerSupport == true && @@ -906,7 +906,7 @@ private async Task GetResultFromSingleServerEndpointAsync(strin return await endpoint.HandleRequestAsync(request, requestContext, DisposalToken); } - private VersionedDocumentContext CreateDefaultDocumentContext() + private DocumentContext CreateDefaultDocumentContext() { var txt = """ @addTagHelper *, TestAssembly @@ -927,9 +927,10 @@ public void Increment(){ d.FilePath == path && d.FileKind == FileKinds.Component && d.GetTextAsync() == Task.FromResult(sourceText) && + d.Version == 0 && d.Project == projectSnapshot, MockBehavior.Strict); - var documentContext = new VersionedDocumentContext(new Uri(path), snapshot, projectContext: null, 1337); + var documentContext = new DocumentContext(new Uri(path), snapshot, projectContext: null); return documentContext; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Implementation/ImplementationEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Implementation/ImplementationEndpointTest.cs index 0dedf24fcda..6ff8c8f61ac 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Implementation/ImplementationEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Implementation/ImplementationEndpointTest.cs @@ -105,7 +105,7 @@ private async Task VerifyCSharpGoToImplementationAsync(string input) }, Position = codeDocument.Source.Text.GetPosition(cursorPosition) }; - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(request.TextDocument, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(request.TextDocument, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs index 49e8758c700..9b964c0898a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/InlayHints/InlayHintEndpointTest.cs @@ -106,7 +106,7 @@ private async Task VerifyInlayHintsAsync(string input, Dictionary sourceMappings) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs index 271ebda9975..b70530e5cb0 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs @@ -61,7 +61,6 @@ public async Task Handle_MapToDocumentRanges_CSharp() // Assert Assert.NotNull(response); Assert.Equal(expectedRange, response!.Ranges[0]); - Assert.Equal(1337, response.HostDocumentVersion); } [Fact] @@ -94,7 +93,6 @@ public async Task Handle_MapToDocumentRanges_CSharp_Unmapped() // Assert Assert.NotNull(response); Assert.Equal(VsLspFactory.UndefinedRange, response!.Ranges[0]); - Assert.Equal(1337, response.HostDocumentVersion); } [Fact] @@ -127,7 +125,6 @@ public async Task Handle_MapToDocumentRanges_CSharp_LeadingOverlapsUnmapped() // Assert Assert.NotNull(response); Assert.Equal(VsLspFactory.UndefinedRange, response!.Ranges[0]); - Assert.Equal(1337, response.HostDocumentVersion); } [Fact] @@ -160,7 +157,6 @@ public async Task Handle_MapToDocumentRanges_CSharp_TrailingOverlapsUnmapped() // Assert Assert.NotNull(response); Assert.Equal(VsLspFactory.UndefinedRange, response!.Ranges[0]); - Assert.Equal(1337, response.HostDocumentVersion); } [Fact] @@ -186,7 +182,6 @@ public async Task Handle_MapToDocumentRanges_Html() // Assert Assert.NotNull(response); Assert.Equal(request.ProjectedRanges[0], response!.Ranges[0]); - Assert.Equal(1337, response.HostDocumentVersion); } [Fact] @@ -212,7 +207,6 @@ public async Task Handle_MapToDocumentRanges_Razor() // Assert Assert.NotNull(response); Assert.Equal(request.ProjectedRanges[0], response!.Ranges[0]); - Assert.Equal(1337, response.HostDocumentVersion); } [Fact] @@ -246,7 +240,6 @@ public async Task Handle_MapToDocumentRanges_Unsupported() // Assert Assert.NotNull(response); Assert.Equal(VsLspFactory.UndefinedRange, response!.Ranges[0]); - Assert.Equal(1337, response.HostDocumentVersion); } private static RazorCodeDocument CreateCodeDocumentWithCSharpProjection(string razorSource, string projectedCSharpSource, IEnumerable sourceMappings) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/ProjectContexts/ProjectContextsEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/ProjectContexts/ProjectContextsEndpointTest.cs index 8a17f7af7d4..1ebfb541ed6 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/ProjectContexts/ProjectContextsEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/ProjectContexts/ProjectContextsEndpointTest.cs @@ -39,7 +39,7 @@ public async Task GetProjectContexts_ReturnsExpected() } }; - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(request.TextDocument.Uri, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(request.TextDocument.Uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); var results = await endpoint.HandleRequestAsync(request, requestContext, default); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs index 620a6bba2fe..e96dbb8b141 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs @@ -86,7 +86,7 @@ await projectManager.UpdateAsync(updater => Position = codeDocument.Source.Text.GetPosition(cursorPosition), NewName = newName }; - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(request.TextDocument, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(request.TextDocument, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs index 7f5a35cd276..c4c98a997d8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs @@ -122,7 +122,7 @@ public async Task Handle_Rename_FileManipulationNotSupported_ReturnsNull() NewName = "Component5" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -145,7 +145,7 @@ public async Task Handle_Rename_WithNamespaceDirective() NewName = "Component5" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -186,7 +186,7 @@ public async Task Handle_Rename_OnComponentParameter_ReturnsNull() NewName = "Test2" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -209,7 +209,7 @@ public async Task Handle_Rename_OnOpeningBrace_ReturnsNull() NewName = "Test2" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -232,7 +232,7 @@ public async Task Handle_Rename_OnComponentNameLeadingEdge_ReturnsResult() NewName = "Test2" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -255,7 +255,7 @@ public async Task Handle_Rename_OnComponentName_ReturnsResult() NewName = "Test2" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -278,7 +278,7 @@ public async Task Handle_Rename_OnComponentNameTrailingEdge_ReturnsResult() NewName = "Test2" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -301,7 +301,7 @@ public async Task Handle_Rename_ComponentInSameFile() NewName = "Component5" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -387,7 +387,7 @@ public async Task Handle_Rename_FullyQualifiedAndNot() NewName = "Component5" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -433,7 +433,7 @@ public async Task Handle_Rename_MultipleFileUsages() NewName = "Component5" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -486,7 +486,7 @@ public async Task Handle_Rename_DifferentDirectories() NewName = "TestComponent" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -557,7 +557,7 @@ public async Task Handle_Rename_SingleServer_CallsDelegatedLanguageServer() NewName = "Test2" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act @@ -597,7 +597,7 @@ public async Task Handle_Rename_SingleServer_DoesNotDelegateForRazor() NewName = "Test2" }; - Assert.True(documentContextFactory.TryCreateForOpenDocument(request.TextDocument.Uri, out var documentContext)); + Assert.True(documentContextFactory.TryCreate(request.TextDocument.Uri, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); // Act diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs index 0bcf1c28d4e..748262ec53a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs @@ -919,7 +919,7 @@ private async Task AssertSemanticTokensAsync( AssertSemanticTokensMatchesBaseline(sourceText, tokens, testName.AssumeNotNull()); } - private static VersionedDocumentContext CreateDocumentContext( + private static DocumentContext CreateDocumentContext( string documentText, bool isRazorFile, ImmutableArray tagHelpers, @@ -942,16 +942,18 @@ private static VersionedDocumentContext CreateDocumentContext( documentSnapshotMock .Setup(x => x.GetTextAsync()) .ReturnsAsync(document.Source.Text); + documentSnapshotMock + .SetupGet(x => x.Version) + .Returns(version); - return new VersionedDocumentContext( + return new DocumentContext( uri: new Uri($@"c:\${GetFileName(isRazorFile)}"), snapshot: documentSnapshotMock.Object, - projectContext: null, - version); + projectContext: null); } private async Task CreateServiceAsync( - VersionedDocumentContext documentSnapshot, + DocumentContext documentSnapshot, ProvideSemanticTokensResponse? csharpTokens, bool withCSharpBackground, bool serverSupportsPreciseRanges, @@ -1198,12 +1200,11 @@ private static string GetFileRepresentationOfTokens(SourceText sourceText, int[] return builder.ToString(); } - private class TestDocumentContextFactory(VersionedDocumentContext? documentContext = null) : IDocumentContextFactory + private class TestDocumentContextFactory(DocumentContext? documentContext = null) : IDocumentContextFactory { public bool TryCreate( Uri documentUri, VSProjectContext? projectContext, - bool versioned, [NotNullWhen(true)] out DocumentContext? context) { context = documentContext; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SignatureHelp/SignatureHelpEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SignatureHelp/SignatureHelpEndpointTest.cs index b794fc1ece3..646b2085413 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SignatureHelp/SignatureHelpEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SignatureHelp/SignatureHelpEndpointTest.cs @@ -113,7 +113,7 @@ private async Task VerifySignatureHelpWithContextAndOptionsAsync(string input, R Context = signatureHelpContext }; - Assert.True(DocumentContextFactory.TryCreateForOpenDocument(request.TextDocument, out var documentContext)); + Assert.True(DocumentContextFactory.TryCreate(request.TextDocument, out var documentContext)); var requestContext = CreateRazorRequestContext(documentContext); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs index 4b2e2f3e871..49c4fbb7423 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs @@ -56,7 +56,7 @@ private protected async Task CreateLanguageServerAsync( } } - DocumentContextFactory = new TestDocumentContextFactory(razorFilePath, codeDocument, version: 1337); + DocumentContextFactory = new TestDocumentContextFactory(razorFilePath, codeDocument); LanguageServerFeatureOptions = Mock.Of(options => options.SupportsFileManipulation == true && diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs index e7e0f6e87e2..95ab0722b98 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/LanguageServerTestBase.cs @@ -58,7 +58,7 @@ private protected TestProjectSnapshotManager CreateProjectSnapshotManager( initializer: static updater => updater.ProjectAdded(MiscFilesHostProject.Instance)); private protected static RazorRequestContext CreateRazorRequestContext( - VersionedDocumentContext? documentContext, + DocumentContext? documentContext, ILspServices? lspServices = null) => new(documentContext, lspServices ?? StrictMock.Of(), "lsp/method", uri: null); @@ -108,9 +108,9 @@ private protected static IDocumentContextFactory CreateDocumentContextFactory(Ur return CreateDocumentContextFactory(documentPath, codeDocument); } - private protected static VersionedDocumentContext CreateDocumentContext(Uri documentPath, RazorCodeDocument codeDocument) + private protected static DocumentContext CreateDocumentContext(Uri documentPath, RazorCodeDocument codeDocument) { - return TestDocumentContext.From(documentPath.GetAbsoluteOrUNCPath(), codeDocument, hostDocumentVersion: 1337); + return TestDocumentContext.From(documentPath.GetAbsoluteOrUNCPath(), codeDocument); } private protected static IDocumentContextFactory CreateDocumentContextFactory( @@ -119,15 +119,15 @@ private protected static IDocumentContextFactory CreateDocumentContextFactory( bool documentFound = true) { var documentContextFactory = documentFound - ? new TestDocumentContextFactory(documentPath.GetAbsoluteOrUNCPath(), codeDocument, version: 1337) + ? new TestDocumentContextFactory(documentPath.GetAbsoluteOrUNCPath(), codeDocument) : new TestDocumentContextFactory(); return documentContextFactory; } - private protected static VersionedDocumentContext CreateDocumentContext(Uri uri, IDocumentSnapshot snapshot) + private protected static DocumentContext CreateDocumentContext(Uri uri, IDocumentSnapshot snapshot) { - return new VersionedDocumentContext(uri, snapshot, projectContext: null, version: 0); + return new DocumentContext(uri, snapshot, projectContext: null); } private protected static RazorLSPOptionsMonitor GetOptionsMonitor(bool enableFormatting = true, bool autoShowCompletion = true, bool autoListParams = true, bool formatOnType = true, bool autoInsertAttributeQuotes = true, bool colorBackground = false, bool codeBlockBraceOnNextLine = false, bool commitElementsWithSpace = true) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContext.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContext.cs index 27d2273b814..e6e60acffe2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContext.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContext.cs @@ -19,13 +19,13 @@ public static DocumentContext Create(Uri uri, string text) return new DocumentContext(uri, snapshot, projectContext: null); } - public static VersionedDocumentContext From(string filePath, RazorCodeDocument codeDocument, int hostDocumentVersion) + public static DocumentContext From(string filePath, RazorCodeDocument codeDocument, int hostDocumentVersion) { var content = codeDocument.Source.Text.ToString(); - var documentSnapshot = TestDocumentSnapshot.Create(filePath, content); + var documentSnapshot = TestDocumentSnapshot.Create(filePath, content, hostDocumentVersion); documentSnapshot.With(codeDocument); var uri = new Uri(filePath); - return new VersionedDocumentContext(uri, documentSnapshot, projectContext: null, hostDocumentVersion); + return new DocumentContext(uri, documentSnapshot, projectContext: null); } public static DocumentContext From(string filePath, RazorCodeDocument codeDocument) @@ -45,7 +45,7 @@ public static DocumentContext From(string filePath) return From(filePath, codeDocument); } - public static VersionedDocumentContext From(string filePath, int hostDocumentVersion) + public static DocumentContext From(string filePath, int hostDocumentVersion) { var properties = RazorSourceDocumentProperties.Create(filePath, filePath); var sourceDocument = RazorSourceDocument.Create(content: string.Empty, properties); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs index 591df7ed021..7a0aa4ba27d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/TestDocumentContextFactory.cs @@ -13,23 +13,20 @@ internal class TestDocumentContextFactory : IDocumentContextFactory { private protected readonly string? FilePath; private protected readonly RazorCodeDocument? CodeDocument; - private readonly int? _version; public TestDocumentContextFactory() { } - public TestDocumentContextFactory(string filePath, RazorCodeDocument codeDocument, int? version = null) + public TestDocumentContextFactory(string filePath, RazorCodeDocument codeDocument) { FilePath = filePath; CodeDocument = codeDocument; - _version = version; } public virtual bool TryCreate( Uri documentUri, VSProjectContext? projectContext, - bool versioned, [NotNullWhen(true)] out DocumentContext? context) { if (FilePath is null || CodeDocument is null) @@ -38,18 +35,6 @@ public virtual bool TryCreate( return false; } - if (versioned) - { - if (_version is null) - { - context = null; - return false; - } - - context = TestDocumentContext.From(FilePath, CodeDocument, _version.Value); - return true; - } - context = TestDocumentContext.From(FilePath, CodeDocument); return true; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs index a419a5bff05..1f86e7fe5ce 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs @@ -23,13 +23,13 @@ public static TestDocumentSnapshot Create(string filePath) public static TestDocumentSnapshot Create(string filePath, VersionStamp version) => Create(filePath, string.Empty, version); - public static TestDocumentSnapshot Create(string filePath, string text) - => Create(filePath, text, VersionStamp.Default); + public static TestDocumentSnapshot Create(string filePath, string text, int version = 0) + => Create(filePath, text, VersionStamp.Default, numericVersion: version); - public static TestDocumentSnapshot Create(string filePath, string text, VersionStamp version, ProjectWorkspaceState? projectWorkspaceState = null) - => Create(filePath, text, version, TestProjectSnapshot.Create(filePath + ".csproj", projectWorkspaceState)); + public static TestDocumentSnapshot Create(string filePath, string text, VersionStamp version, ProjectWorkspaceState? projectWorkspaceState = null, int numericVersion = 0) + => Create(filePath, text, version, TestProjectSnapshot.Create(filePath + ".csproj", projectWorkspaceState), numericVersion); - public static TestDocumentSnapshot Create(string filePath, string text, VersionStamp version, TestProjectSnapshot projectSnapshot) + public static TestDocumentSnapshot Create(string filePath, string text, VersionStamp version, TestProjectSnapshot projectSnapshot, int numericVersion) { var targetPath = Path.GetDirectoryName(projectSnapshot.FilePath) is string projectDirectory && filePath.StartsWith(projectDirectory) ? filePath[projectDirectory.Length..] @@ -41,7 +41,7 @@ public static TestDocumentSnapshot Create(string filePath, string text, VersionS hostDocument, SourceText.From(text), version, - 1, + numericVersion, () => Task.FromResult(TextAndVersion.Create(sourceText, version))); var testDocument = new TestDocumentSnapshot(projectSnapshot, documentState); From 4fe2eff346d1e0a2b76f2b8dd5ffaf41f8785b7d Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 12 Aug 2024 14:01:06 +1000 Subject: [PATCH 114/386] Expand testing slightly --- ...rTest.cs => ProjectSnapshotManagerTest.cs} | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) rename src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/ProjectSystem/{DefaultProjectSnapshotManagerTest.cs => ProjectSnapshotManagerTest.cs} (96%) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/ProjectSystem/DefaultProjectSnapshotManagerTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/ProjectSystem/ProjectSnapshotManagerTest.cs similarity index 96% rename from src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/ProjectSystem/DefaultProjectSnapshotManagerTest.cs rename to src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/ProjectSystem/ProjectSnapshotManagerTest.cs index 60c229fa704..62b66ef903e 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/ProjectSystem/DefaultProjectSnapshotManagerTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/ProjectSystem/ProjectSnapshotManagerTest.cs @@ -22,7 +22,7 @@ namespace Microsoft.VisualStudio.Razor.ProjectSystem; -public class DefaultProjectSnapshotManagerTest : VisualStudioWorkspaceTestBase +public class ProjectSnapshotManagerTest : VisualStudioWorkspaceTestBase { private static readonly HostDocument[] s_documents = [ @@ -52,7 +52,7 @@ public class DefaultProjectSnapshotManagerTest : VisualStudioWorkspaceTestBase private readonly TestProjectSnapshotManager _projectManager; private readonly SourceText _sourceText; - public DefaultProjectSnapshotManagerTest(ITestOutputHelper testOutput) + public ProjectSnapshotManagerTest(ITestOutputHelper testOutput) : base(testOutput) { var someTagHelpers = ImmutableArray.Create( @@ -191,6 +191,8 @@ await _projectManager.UpdateAsync(updater => filePath => filePath == s_documents[0].FilePath); listener.AssertNoNotifications(); + + Assert.Equal(1, project.GetDocument(s_documents[0].FilePath)!.Version); } [UIFact] @@ -469,6 +471,8 @@ await _projectManager.UpdateAsync(updater => Assert.Same(_sourceText, text); Assert.True(_projectManager.IsDocumentOpen(s_documents[0].FilePath)); + + Assert.Equal(2, document.Version); } [UIFact] @@ -505,6 +509,7 @@ await _projectManager.UpdateAsync(updater => var text = await document.GetTextAsync(); Assert.Same(expected, text); Assert.False(_projectManager.IsDocumentOpen(s_documents[0].FilePath)); + Assert.Equal(3, document.Version); } [UIFact] @@ -569,6 +574,7 @@ await _projectManager.UpdateAsync(updater => Assert.NotNull(document); var text = await document.GetTextAsync(); Assert.Same(expected, text); + Assert.Equal(3, document.Version); } [UIFact] @@ -602,6 +608,7 @@ await _projectManager.UpdateAsync(updater => Assert.NotNull(document); var text = await document.GetTextAsync(); Assert.Same(expected, text); + Assert.Equal(3, document.Version); } [UIFact] @@ -749,6 +756,29 @@ await _projectManager.UpdateAsync(updater => listener.AssertNoNotifications(); } + [UIFact] + public async Task ProjectWorkspaceStateChanged_UpdateDocuments() + { + // Arrange + await _projectManager.UpdateAsync(updater => + { + updater.ProjectAdded(s_hostProject); + updater.DocumentAdded(s_hostProject.Key, s_documents[0], null!); + }); + + // Act + await _projectManager.UpdateAsync(updater => + { + updater.ProjectWorkspaceStateChanged(s_hostProject.Key, _projectWorkspaceStateWithTagHelpers); + }); + + // Assert + var document = _projectManager.GetLoadedProject(s_hostProject.Key).GetDocument(s_documents[0].FilePath); + + Assert.NotNull(document); + Assert.Equal(2, document.Version); + } + [UIFact] public async Task ProjectWorkspaceStateChanged_WithHostProject_FirstTime_NotifiesListeners() { From 061347e1adc856f3dc6a6ee357d8546b57154309 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 12 Aug 2024 14:01:12 +1000 Subject: [PATCH 115/386] Minor logging cleanup --- .../Diagnostics/RazorDiagnosticsPublisher.cs | 6 +---- .../GeneratedDocumentPublisher.cs | 24 +++++-------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs index e3f0eb8d901..1f3320294e5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs @@ -155,11 +155,7 @@ .. csharpDiagnostics ?? [] PublishDiagnosticsForFilePath(document.FilePath, combinedDiagnostics); - if (_logger.IsEnabled(LogLevel.Trace)) - { - var diagnosticString = string.Join(", ", razorDiagnostics.Select(diagnostic => diagnostic.Id)); - _logger.LogTrace($"Publishing diagnostics for document '{document.FilePath}': {diagnosticString}"); - } + _logger.LogTrace($"Publishing diagnostics for document '{document.FilePath}': {string.Join(", ", razorDiagnostics.Select(diagnostic => diagnostic.Id))}"); async Task GetCSharpDiagnosticsAsync(IDocumentSnapshot document, CancellationToken token) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs index 4799f85575e..578706da84f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs @@ -79,16 +79,10 @@ public void PublishCSharp(ProjectKey projectKey, string filePath, SourceText sou return; } - if (_logger.IsEnabled(LogLevel.Trace)) - { - var previousDocumentLength = previouslyPublishedData.SourceText.Length; - var currentDocumentLength = sourceText.Length; - var documentLengthDelta = sourceText.Length - previousDocumentLength; - _logger.LogTrace( - $"Updating C# buffer of {filePath} for project {documentKey.ProjectKey} to correspond with host document " + - $"version {hostDocumentVersion}. {previousDocumentLength} -> {currentDocumentLength} = Change delta of " + - $"{documentLengthDelta} via {textChanges.Count} text changes."); - } + _logger.LogTrace( + $"Updating C# buffer of {filePath} for project {documentKey.ProjectKey} to correspond with host document " + + $"version {hostDocumentVersion}. {previouslyPublishedData.SourceText.Length} -> {sourceText.Length} = Change delta of " + + $"{sourceText.Length - previouslyPublishedData.SourceText.Length} via {textChanges.Count} text changes."); _publishedCSharpData[documentKey] = new PublishData(sourceText, hostDocumentVersion); } @@ -124,14 +118,8 @@ public void PublishHtml(ProjectKey projectKey, string filePath, SourceText sourc return; } - if (_logger.IsEnabled(LogLevel.Trace)) - { - var previousDocumentLength = previouslyPublishedData.SourceText.Length; - var currentDocumentLength = sourceText.Length; - var documentLengthDelta = sourceText.Length - previousDocumentLength; - _logger.LogTrace( - $"Updating HTML buffer of {filePath} to correspond with host document version {hostDocumentVersion}. {previousDocumentLength} -> {currentDocumentLength} = Change delta of {documentLengthDelta} via {textChanges.Count} text changes."); - } + _logger.LogTrace( + $"Updating HTML buffer of {filePath} to correspond with host document version {hostDocumentVersion}. {previouslyPublishedData.SourceText.Length} -> {sourceText.Length} = Change delta of {sourceText.Length - previouslyPublishedData.SourceText.Length} via {textChanges.Count} text changes."); _publishedHtmlData[filePath] = new PublishData(sourceText, hostDocumentVersion); } From 6a166dedddbfa49ae81dd5e400ef9c96a2cfea7f Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 13 Aug 2024 09:53:12 +1000 Subject: [PATCH 116/386] Remove unused using --- .../Endpoints/RazorCustomMessageTarget_SemanticTokens.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs index 654bb036108..1133cdb6164 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_SemanticTokens.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System; using System.Diagnostics; using System.Linq; using System.Threading; From 374e85cb336aa71ad897507ade183d2d6c96e0cd Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 16 Aug 2024 11:56:48 +1000 Subject: [PATCH 117/386] Don't allow virtual documents to go back in time --- .../GeneratedDocumentPublisher.cs | 20 +++++++++++++++++-- .../Endpoints/RazorCustomMessageTarget.cs | 4 ++-- ...zorCustomMessageTarget_UpdateHtmlBuffer.cs | 4 ++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs index 578706da84f..81a34f72030 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentPublisher.cs @@ -72,6 +72,14 @@ public void PublishCSharp(ProjectKey projectKey, string filePath, SourceText sou previouslyPublishedData = PublishData.Default; } + if (previouslyPublishedData.HostDocumentVersion > hostDocumentVersion) + { + // We've already published a newer version of this document. No-op. + Debug.Fail("C# document being published that is older than one we've previously published!"); + _logger.LogWarning($"Skipping publish of C# for {filePath} because we've already published version {previouslyPublishedData.HostDocumentVersion}, and this request is for {hostDocumentVersion}."); + return; + } + textChanges = SourceTextDiffer.GetMinimalTextChanges(previouslyPublishedData.SourceText, sourceText); if (textChanges.Count == 0 && hostDocumentVersion == previouslyPublishedData.HostDocumentVersion) { @@ -79,7 +87,7 @@ public void PublishCSharp(ProjectKey projectKey, string filePath, SourceText sou return; } - _logger.LogTrace( + _logger.LogDebug( $"Updating C# buffer of {filePath} for project {documentKey.ProjectKey} to correspond with host document " + $"version {hostDocumentVersion}. {previouslyPublishedData.SourceText.Length} -> {sourceText.Length} = Change delta of " + $"{sourceText.Length - previouslyPublishedData.SourceText.Length} via {textChanges.Count} text changes."); @@ -111,6 +119,14 @@ public void PublishHtml(ProjectKey projectKey, string filePath, SourceText sourc previouslyPublishedData = PublishData.Default; } + if (previouslyPublishedData.HostDocumentVersion > hostDocumentVersion) + { + // We've already published a newer version of this document. No-op. + Debug.Fail("Html document being published that is older than one we've previously published!"); + _logger.LogWarning($"Skipping publish of Html for {filePath} because we've already published version {previouslyPublishedData.HostDocumentVersion}, and this request is for {hostDocumentVersion}."); + return; + } + textChanges = SourceTextDiffer.GetMinimalTextChanges(previouslyPublishedData.SourceText, sourceText); if (textChanges.Count == 0 && hostDocumentVersion == previouslyPublishedData.HostDocumentVersion) { @@ -118,7 +134,7 @@ public void PublishHtml(ProjectKey projectKey, string filePath, SourceText sourc return; } - _logger.LogTrace( + _logger.LogDebug( $"Updating HTML buffer of {filePath} to correspond with host document version {hostDocumentVersion}. {previouslyPublishedData.SourceText.Length} -> {sourceText.Length} = Change delta of {sourceText.Length - previouslyPublishedData.SourceText.Length} via {textChanges.Count} text changes."); _publishedHtmlData[filePath] = new PublishData(sourceText, hostDocumentVersion); diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs index 1ae779026f7..854c9fe04a6 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget.cs @@ -146,6 +146,8 @@ private async Task> TrySynchronizeV return await TempForCohost_TrySynchronizeVirtualDocumentAsync(hostDocument, cancellationToken); } + _logger.LogDebug($"Trying to synchronize for {caller} to version {requiredHostDocumentVersion} of {hostDocument.Uri} for {hostDocument.GetProjectContext()?.Id ?? "(no project context)"}"); + // For Html documents we don't do anything fancy, just call the standard service // If we're not generating unique document file names, then we can treat C# documents the same way if (!_languageServerFeatureOptions.IncludeProjectKeyInGeneratedFilePath || @@ -154,8 +156,6 @@ private async Task> TrySynchronizeV return await _documentSynchronizer.TrySynchronizeVirtualDocumentAsync(requiredHostDocumentVersion, hostDocument.Uri, cancellationToken).ConfigureAwait(false); } - _logger.LogDebug($"Trying to synchronize for {caller} to version {requiredHostDocumentVersion} of {hostDocument.Uri} for {hostDocument.GetProjectContext()?.Id ?? "(no project context)"}"); - var virtualDocument = FindVirtualDocument(hostDocument.Uri, hostDocument.GetProjectContext()); if (virtualDocument is { ProjectKey.IsUnknown: true }) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateHtmlBuffer.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateHtmlBuffer.cs index 0bf10cdcdb6..b2c366890ff 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateHtmlBuffer.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateHtmlBuffer.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using StreamJsonRpc; @@ -35,6 +36,9 @@ internal void UpdateHtmlBuffer(UpdateBufferRequest request) } var hostDocumentUri = new Uri(request.HostDocumentFilePath); + + _logger.LogDebug($"UpdateHtmlBuffer for {request.HostDocumentVersion} of {hostDocumentUri} in {request.ProjectKeyId}"); + _documentManager.UpdateVirtualDocument( hostDocumentUri, request.Changes.Select(change => change.ToVisualStudioTextChange()).ToArray(), From b05dd12a2ae0c88af2b69799e6bbe2281340d442 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 16 Aug 2024 12:14:17 +0000 Subject: [PATCH 118/386] Failed to perform coherency update for one or more dependencies. From b81f3ebf438b2a3f7f112642bad415542dc6696d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sat, 17 Aug 2024 12:42:47 +0000 Subject: [PATCH 119/386] Update dependencies from https://github.com/dotnet/arcade build 20240816.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24414.3 -> To Version 9.0.0-beta.24416.2 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e888013264e..6bed5d53c03 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 4d15f8d1f2d61f6513b70f0bcd4bd3c1828a3a68 + 8fe02bab989df1265eee225df2c28af6dbdccc83 - + https://github.com/dotnet/arcade - 4d15f8d1f2d61f6513b70f0bcd4bd3c1828a3a68 + 8fe02bab989df1265eee225df2c28af6dbdccc83 diff --git a/eng/Versions.props b/eng/Versions.props index 3b6f2e471ab..d9e34073baf 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24414.3 + 9.0.0-beta.24416.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index c545052a5aa..ad54b2f3d29 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24414.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24416.2", "Microsoft.Build.NoTargets": "3.7.0" } } From e5cff02313bcf417de2e4e379b7d5bee9eb79a08 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 18 Aug 2024 12:04:41 +0000 Subject: [PATCH 120/386] Failed to perform coherency update for one or more dependencies. From f1c3a700f3deee5c563f3a024d563f5f36fe0da0 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 19 Aug 2024 08:49:20 +1000 Subject: [PATCH 121/386] PR feedback --- .../ProjectSystem/RazorProjectService.cs | 19 ++++--------------- .../RazorProjectServiceTest.cs | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs index 1f896304173..57e0def447f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs @@ -161,25 +161,14 @@ private void AddDocumentToMiscProjectCore(ProjectSnapshotManager.Updater updater var textDocumentPath = FilePathNormalizer.Normalize(filePath); _logger.LogDebug($"Asked to add {textDocumentPath} to the miscellaneous files project, because we don't have project info (yet?)"); - var potentialProjects = _projectManager.FindPotentialProjects(textDocumentPath); - foreach (var project in potentialProjects) + if (_projectManager.TryResolveDocumentInAnyProject(textDocumentPath, _logger, out var document)) { - if (project.DocumentFilePaths.Contains(textDocumentPath, FilePathComparer.Instance)) - { - // Already in a known project, so we don't want it in the misc files project - _logger.LogDebug($"File {textDocumentPath} is already in {project.Key} so we're not adding it to the miscellaneous files project"); - return; - } + // Already in a known project, so we don't want it in the misc files project + _logger.LogDebug($"File {textDocumentPath} is already in {document.Project.Key}, so we're not adding it to the miscellaneous files project"); + return; } var miscFilesProject = _projectManager.GetMiscellaneousProject(); - if (miscFilesProject.GetDocument(textDocumentPath) is not null) - { - // Document already added. This usually occurs when VSCode has already pre-initialized - // open documents and then we try to manually add all known razor documents. - _logger.LogDebug($"File {textDocumentPath} is already in the miscellaneous files project, so no-op"); - return; - } // Representing all of our host documents with a re-normalized target path to workaround GetRelatedDocument limitations. var normalizedTargetFilePath = textDocumentPath.Replace('/', '\\').TrimStart('\\'); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs index 0c37f082d9d..326170da442 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorProjectServiceTest.cs @@ -756,6 +756,24 @@ await _projectService.AddProjectAsync( listener.AssertNoNotifications(); } + [Fact] + public async Task AddDocumentToMiscProjectAsync_IgnoresKnownDocument_InMiscFiles() + { + // Arrange + const string DocumentFilePath = "C:/path/to/document.cshtml"; + + await _projectService.AddDocumentToMiscProjectAsync(DocumentFilePath, DisposalToken); + + // Act + using var listener = _projectManager.ListenToNotifications(); + + // Act + await _projectService.AddDocumentToMiscProjectAsync(DocumentFilePath, DisposalToken); + + // Assert + listener.AssertNoNotifications(); + } + [Fact] public async Task RemoveDocument_RemovesDocumentFromOwnerProject() { From af13ebdf10eda2a9d7f7b4c0a5522da4bd1bf418 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 19 Aug 2024 15:19:18 +1000 Subject: [PATCH 122/386] PR feedback - sorta --- .../GeneratedDocumentSynchronizer.cs | 12 ++++- .../GeneratedDocumentSynchronizerTest.cs | 52 +++++++++++++++++-- .../TestLanguageServerFeatureOptions.cs | 5 +- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs index b3a01451ce5..d057edfc632 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/GeneratedDocumentSynchronizer.cs @@ -9,17 +9,25 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; internal class GeneratedDocumentSynchronizer( IGeneratedDocumentPublisher publisher, - LanguageServerFeatureOptions languageServerFeatureOptions) : IDocumentProcessedListener + LanguageServerFeatureOptions languageServerFeatureOptions, + IProjectSnapshotManager projectManager) : IDocumentProcessedListener { private readonly IGeneratedDocumentPublisher _publisher = publisher; private readonly LanguageServerFeatureOptions _languageServerFeatureOptions = languageServerFeatureOptions; + private readonly IProjectSnapshotManager _projectManager = projectManager; public void DocumentProcessed(RazorCodeDocument codeDocument, IDocumentSnapshot document) { var hostDocumentVersion = document.Version; - var filePath = document.FilePath.AssumeNotNull(); + // If the document isn't open, and we're not updating buffers for closed documents, then we don't need to do anything. + if (!_projectManager.IsDocumentOpen(document.FilePath) && + !_languageServerFeatureOptions.UpdateBuffersForClosedDocuments) + { + return; + } + // If cohosting is on, then it is responsible for updating the Html buffer if (!_languageServerFeatureOptions.UseRazorCohostServer) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs index 7805abd04b1..bba790b36ae 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/GeneratedDocumentSynchronizerTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.ProjectSystem; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; @@ -15,8 +16,12 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; public class GeneratedDocumentSynchronizerTest : LanguageServerTestBase { + private static readonly HostProject s_hostProject = new("/path/to/project.csproj", "/path/to/obj", RazorConfiguration.Default, "TestRootNamespace"); + private static readonly HostDocument s_hostDocument = new("/path/to/file.razor", "file.razor"); + private readonly GeneratedDocumentSynchronizer _synchronizer; private readonly TestGeneratedDocumentPublisher _publisher; + private readonly TestProjectSnapshotManager _projectManager; private readonly IDocumentSnapshot _document; private readonly RazorCodeDocument _codeDocument; @@ -24,14 +29,30 @@ public GeneratedDocumentSynchronizerTest(ITestOutputHelper testOutput) : base(testOutput) { _publisher = new TestGeneratedDocumentPublisher(); - _synchronizer = new GeneratedDocumentSynchronizer(_publisher, TestLanguageServerFeatureOptions.Instance); - _document = TestDocumentSnapshot.Create("C:/path/to/file.razor"); + _projectManager = CreateProjectSnapshotManager(); + _synchronizer = new GeneratedDocumentSynchronizer(_publisher, TestLanguageServerFeatureOptions.Instance, _projectManager); + _document = TestDocumentSnapshot.Create(s_hostDocument.FilePath); _codeDocument = CreateCodeDocument("

Hello World

"); } + protected override async Task InitializeAsync() + { + await _projectManager.UpdateAsync(updater => + { + updater.ProjectAdded(s_hostProject); + updater.DocumentAdded(s_hostProject.Key, s_hostDocument, new EmptyTextLoader(s_hostDocument.FilePath)); + }); + } + [Fact] - public void DocumentProcessed_KnownVersion_Publishes() + public async Task DocumentProcessed_OpenDocument_Publishes() { + // Arrange + await _projectManager.UpdateAsync(updater => + { + updater.DocumentOpened(s_hostProject.Key, s_hostDocument.FilePath, SourceText.From("

Hello World

")); + }); + // Act _synchronizer.DocumentProcessed(_codeDocument, _document); @@ -40,6 +61,31 @@ public void DocumentProcessed_KnownVersion_Publishes() Assert.True(_publisher.PublishedHtml); } + [Fact] + public void DocumentProcessed_CloseDocument_WithOption_Publishes() + { + var options = new TestLanguageServerFeatureOptions(updateBuffersForClosedDocuments: true); + var synchronizer = new GeneratedDocumentSynchronizer(_publisher, options, _projectManager); + + // Act + synchronizer.DocumentProcessed(_codeDocument, _document); + + // Assert + Assert.True(_publisher.PublishedCSharp); + Assert.True(_publisher.PublishedHtml); + } + + [Fact] + public void DocumentProcessed_CloseDocument_DoesntPublish() + { + // Act + _synchronizer.DocumentProcessed(_codeDocument, _document); + + // Assert + Assert.False(_publisher.PublishedCSharp); + Assert.False(_publisher.PublishedHtml); + } + private class TestGeneratedDocumentPublisher : IGeneratedDocumentPublisher { public bool PublishedCSharp { get; private set; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/TestLanguageServerFeatureOptions.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/TestLanguageServerFeatureOptions.cs index 8d8c9786f81..6e4babb9bc2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/TestLanguageServerFeatureOptions.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/TestLanguageServerFeatureOptions.cs @@ -7,7 +7,8 @@ namespace Microsoft.AspNetCore.Razor.Test.Common.Workspaces; internal class TestLanguageServerFeatureOptions( bool includeProjectKeyInGeneratedFilePath = false, - bool forceRuntimeCodeGeneration = false) : LanguageServerFeatureOptions + bool forceRuntimeCodeGeneration = false, + bool updateBuffersForClosedDocuments = false) : LanguageServerFeatureOptions { public static readonly LanguageServerFeatureOptions Instance = new TestLanguageServerFeatureOptions(); @@ -27,7 +28,7 @@ internal class TestLanguageServerFeatureOptions( public override bool UsePreciseSemanticTokenRanges => true; - public override bool UpdateBuffersForClosedDocuments => false; + public override bool UpdateBuffersForClosedDocuments => updateBuffersForClosedDocuments; public override bool IncludeProjectKeyInGeneratedFilePath => includeProjectKeyInGeneratedFilePath; From 4ced6b91ddb394122abd4ce49a6e3b8602c7aa85 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 19 Aug 2024 15:35:25 +1000 Subject: [PATCH 123/386] Support component rename from an end tag --- .../Rename/RenameService.cs | 52 ++++++++----- .../Refactoring/RenameEndpointTest.cs | 23 ++++++ .../Cohost/CohostRenameEndpointTest.cs | 74 +++++++++---------- 3 files changed, 95 insertions(+), 54 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs index 6563e5bb059..11fc505f7bd 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; @@ -250,23 +251,8 @@ private static async Task> GetOriginTagHelpe return default; } - var node = owner.FirstAncestorOrSelf(n => n.Kind == RazorSyntaxKind.MarkupTagHelperStartTag); - if (node is not MarkupTagHelperStartTagSyntax tagHelperStartTag) - { - return default; - } - - // Ensure the rename action was invoked on the component name - // instead of a component parameter. This serves as an issue - // mitigation till `textDocument/prepareRename` is supported - // and we can ensure renames aren't triggered in unsupported - // contexts. (https://github.com/dotnet/aspnetcore/issues/26407) - if (!tagHelperStartTag.Name.FullSpan.IntersectsWith(absoluteIndex)) - { - return default; - } - - if (tagHelperStartTag.Parent is not MarkupTagHelperElementSyntax { TagHelperInfo.BindingResult: var binding }) + var binding = TryGetTagHelperBinding(owner, absoluteIndex); + if (binding is null) { return default; } @@ -288,6 +274,38 @@ private static async Task> GetOriginTagHelpe return [primaryTagHelper, associatedTagHelper]; } + private static TagHelperBinding? TryGetTagHelperBinding(RazorSyntaxNode owner, int absoluteIndex) + { + // End tags are easy, because there is only one possible binding result + if (owner is MarkupTagHelperEndTagSyntax { Parent: MarkupTagHelperElementSyntax { TagHelperInfo.BindingResult: var endTagBindingResult } }) + { + return endTagBindingResult; + } + + // A rename of a start tag could have an "owner" of one of its attributes, so we do a bit more checking + // to support this case + var node = owner.FirstAncestorOrSelf(n => n.Kind == RazorSyntaxKind.MarkupTagHelperStartTag); + if (node is not MarkupTagHelperStartTagSyntax tagHelperStartTag) + { + return null; + } + + // Ensure the rename action was invoked on the component name instead of a component parameter. This serves as an issue + // mitigation till `textDocument/prepareRename` is supported and we can ensure renames aren't triggered in unsupported + // contexts. (https://github.com/dotnet/razor/issues/4285) + if (!tagHelperStartTag.Name.FullSpan.IntersectsWith(absoluteIndex)) + { + return null; + } + + if (tagHelperStartTag is { Parent: MarkupTagHelperElementSyntax { TagHelperInfo.BindingResult: var startTagBindingResult } }) + { + return startTagBindingResult; + } + + return null; + } + private static TagHelperDescriptor? FindAssociatedTagHelper(TagHelperDescriptor tagHelper, ImmutableArray tagHelpers) { var typeName = tagHelper.GetTypeName(); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs index 3aa916de91a..5526787422b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs @@ -265,6 +265,29 @@ public async Task Handle_Rename_OnComponentName_ReturnsResult() Assert.NotNull(result); } + [Fact] + public async Task Handle_Rename_OnComponentEndTag_ReturnsResult() + { + // Arrange + var (endpoint, documentContextFactory) = await CreateEndpointAndDocumentContextFactoryAsync(); + var uri = PathUtilities.GetUri(s_componentWithParamFilePath); + var request = new RenameParams + { + TextDocument = new() { Uri = uri }, + Position = VsLspFactory.CreatePosition(1, 36), + NewName = "Test2" + }; + + Assert.True(documentContextFactory.TryCreateForOpenDocument(uri, out var documentContext)); + var requestContext = CreateRazorRequestContext(documentContext); + + // Act + var result = await endpoint.HandleRequestAsync(request, requestContext, DisposalToken); + + // Assert + Assert.NotNull(result); + } + [Fact] public async Task Handle_Rename_OnComponentNameTrailingEdge_ReturnsResult() { diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs index c273c9d63a7..9328744f2ae 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs @@ -112,62 +112,62 @@ The end. """, renames: [("Component.razor", "DifferentName.razor")]); - [Theory(Skip = "https://github.com/dotnet/razor/issues/10717")] + [Theory] [InlineData("$$Component")] [InlineData("Com$$ponent")] [InlineData("Component$$")] public Task Component_EndTag(string endTag) - => VerifyRenamesAsync( - input: $""" - This is a Razor document. - - + => VerifyRenamesAsync( + input: $""" + This is a Razor document. -
- - +
- + +
+ + + +
-
- The end. - """, - additionalFiles: [ - // The source generator isn't hooked up to our test project, so we have to manually "compile" the razor file - (File("Component.cs"), """ - namespace SomeProject; + The end. + """, + additionalFiles: [ + // The source generator isn't hooked up to our test project, so we have to manually "compile" the razor file + (File("Component.cs"), """ + namespace SomeProject; + + public class Component : Microsoft.AspNetCore.Components.ComponentBase + { + } + """), + // The above will make the component exist, but the .razor file needs to exist too for Uri presentation + (File("Component.razor"), "") + ], + newName: "DifferentName", + expected: """ + This is a Razor document. - public class Component : Microsoft.AspNetCore.Components.ComponentBase - { - } - """), - // The above will make the component exist, but the .razor file needs to exist too for Uri presentation - (File("Component.razor"), "") - ], - newName: "DifferentName", - expected: """ - This is a Razor document. - - - -
- - +
+
+ + + +
-
- The end. - """, - renames: [("Component.razor", "DifferentName.razor")]); + The end. + """, + renames: [("Component.razor", "DifferentName.razor")]); [Fact] public Task Mvc() From 84def3b64d3e5086eab99a4eac087e35432e71f0 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 19 Aug 2024 16:16:08 +1000 Subject: [PATCH 124/386] grrrr --- .../Rename/RenameService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs index 11fc505f7bd..3b11a188aa5 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Rename/RenameService.cs @@ -7,7 +7,6 @@ using System.Diagnostics; using System.IO; using System.Linq; -using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; From 3bffce365f0f796044755f6ce97278d3536f0c00 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 19 Aug 2024 12:52:10 +0000 Subject: [PATCH 125/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240815.3 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24405.2 -> To Version 10.0.0-alpha.1.24415.3 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b9901fbfdc4..4d8fce7e46b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10
- + https://github.com/dotnet/source-build-reference-packages - 0d066e61a30c2599d0ced871ea45acf0e10571af + e9c7c7740133e6e4f92d22d0410a379a8f2d24e7 diff --git a/eng/Versions.props b/eng/Versions.props index ffa20a9acee..02cd78c401b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 9.0.0-alpha.1.24405.2 + 10.0.0-alpha.1.24415.3 8.0.0-beta.24321.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From ede6a1662c5bba29787acaa31bd1480e0c70d7c6 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 19 Aug 2024 09:28:30 -0700 Subject: [PATCH 126/386] Pass IDocumentSnapshot to GetDefinitionAsync instead of DocumentContext --- .../Definition/DefinitionEndpoint.cs | 2 +- .../AbstractRazorComponentDefinitionService.cs | 10 +++++----- .../GoToDefinition/IRazorComponentDefinitionService.cs | 2 +- .../GoToDefinition/RemoteGoToDefinitionService.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs index cc21cc5f15b..dd22142c0ef 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Definition/DefinitionEndpoint.cs @@ -62,7 +62,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V // If single server support is on, then we ignore attributes, as they are better handled by delegating to Roslyn return await _componentDefinitionService - .GetDefinitionAsync(documentContext, positionInfo, ignoreAttributes: SingleServerSupport, cancellationToken) + .GetDefinitionAsync(documentContext.Snapshot, positionInfo, ignoreAttributes: SingleServerSupport, cancellationToken) .ConfigureAwait(false); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/AbstractRazorComponentDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/AbstractRazorComponentDefinitionService.cs index da418ccfe07..737614147f9 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/AbstractRazorComponentDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/AbstractRazorComponentDefinitionService.cs @@ -25,7 +25,7 @@ internal abstract class AbstractRazorComponentDefinitionService( private readonly IDocumentMappingService _documentMappingService = documentMappingService; private readonly ILogger _logger = logger; - public async Task GetDefinitionAsync(DocumentContext documentContext, DocumentPositionInfo positionInfo, bool ignoreAttributes, CancellationToken cancellationToken) + public async Task GetDefinitionAsync(IDocumentSnapshot documentSnapshot, DocumentPositionInfo positionInfo, bool ignoreAttributes, CancellationToken cancellationToken) { // If we're in C# then there is no point checking for a component tag, because there won't be one if (positionInfo.LanguageKind == RazorLanguageKind.CSharp) @@ -33,13 +33,13 @@ internal abstract class AbstractRazorComponentDefinitionService( return null; } - if (!FileKinds.IsComponent(documentContext.FileKind)) + if (!FileKinds.IsComponent(documentSnapshot.FileKind)) { - _logger.LogInformation($"'{documentContext.FileKind}' is not a component type."); + _logger.LogInformation($"'{documentSnapshot.FileKind}' is not a component type."); return null; } - var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + var codeDocument = await documentSnapshot.GetGeneratedOutputAsync().ConfigureAwait(false); if (!RazorComponentDefinitionHelpers.TryGetBoundTagHelpers(codeDocument, positionInfo.HostDocumentIndex, ignoreAttributes, _logger, out var boundTagHelper, out var boundAttribute)) { @@ -47,7 +47,7 @@ internal abstract class AbstractRazorComponentDefinitionService( return null; } - var componentDocument = await _componentSearchEngine.TryLocateComponentAsync(documentContext.Snapshot, boundTagHelper).ConfigureAwait(false); + var componentDocument = await _componentSearchEngine.TryLocateComponentAsync(documentSnapshot, boundTagHelper).ConfigureAwait(false); if (componentDocument is null) { _logger.LogInformation($"Could not locate component document."); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/IRazorComponentDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/IRazorComponentDefinitionService.cs index 21e483e4134..86ebf62d35f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/IRazorComponentDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/GoToDefinition/IRazorComponentDefinitionService.cs @@ -14,5 +14,5 @@ namespace Microsoft.CodeAnalysis.Razor.GoToDefinition; ///
internal interface IRazorComponentDefinitionService { - Task GetDefinitionAsync(DocumentContext documentContext, DocumentPositionInfo positionInfo, bool ignoreAttributes, CancellationToken cancellationToken); + Task GetDefinitionAsync(IDocumentSnapshot documentSnapshot, DocumentPositionInfo positionInfo, bool ignoreAttributes, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs index b50fa8fd3bb..aea8cd65490 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs @@ -56,7 +56,7 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg var positionInfo = _documentMappingService.GetPositionInfo(codeDocument, hostDocumentIndex); // First, see if this is a Razor component. - var componentLocation = await _componentDefinitionService.GetDefinitionAsync(context, positionInfo, ignoreAttributes: false, cancellationToken).ConfigureAwait(false); + var componentLocation = await _componentDefinitionService.GetDefinitionAsync(context.Snapshot, positionInfo, ignoreAttributes: false, cancellationToken).ConfigureAwait(false); if (componentLocation is not null) { // Convert from VS LSP Location to Roslyn. This can be removed when Razor moves fully onto Roslyn's LSP types. From fd09361c51b9f686aceb313323087b007da9d1a4 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 19 Aug 2024 09:41:07 -0700 Subject: [PATCH 127/386] Move IDocumentPositionInfoStrategy and friends to Workspaces layer --- .../CodeActions/Razor/CodeBlockService.cs | 1 + .../Delegation/DelegatedCompletionListProvider.cs | 1 + .../Hover/HoverService.cs | 1 + .../DefaultDocumentPositionInfoStrategy.cs | 9 ++++++--- .../IDocumentPositionInfoStrategy.cs | 3 +-- ...referAttributeNameDocumentPositionInfoStrategy.cs | 9 ++++++--- ...rHtmlInAttributeValuesDocumentPositionStrategy.cs | 9 ++++++--- .../RazorSyntaxFacts.cs | 12 ++++++------ ...ttributeValuesDocumentPositionInfoStrategyTest.cs | 2 +- 9 files changed, 29 insertions(+), 18 deletions(-) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping}/DefaultDocumentPositionInfoStrategy.cs (83%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping}/IDocumentPositionInfoStrategy.cs (85%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping}/PreferAttributeNameDocumentPositionInfoStrategy.cs (91%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert => Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping}/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs (90%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces}/RazorSyntaxFacts.cs (93%) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs index 9cda5df9204..a01cc5ba960 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/Razor/CodeBlockService.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs index 2c8e023b46d..163ec5dad71 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/Delegation/DelegatedCompletionListProvider.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; +using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs index 4fb546a09d6..963f3d96454 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverService.cs @@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Razor.Language.Legacy; using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; +using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DefaultDocumentPositionInfoStrategy.cs similarity index 83% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultDocumentPositionInfoStrategy.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DefaultDocumentPositionInfoStrategy.cs index 976829713ad..5c25a5c7d53 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DefaultDocumentPositionInfoStrategy.cs @@ -3,17 +3,20 @@ using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -namespace Microsoft.AspNetCore.Razor.LanguageServer; +namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; -internal class DefaultDocumentPositionInfoStrategy : IDocumentPositionInfoStrategy +internal sealed class DefaultDocumentPositionInfoStrategy : IDocumentPositionInfoStrategy { public static IDocumentPositionInfoStrategy Instance { get; } = new DefaultDocumentPositionInfoStrategy(); + private DefaultDocumentPositionInfoStrategy() + { + } + public async Task TryGetPositionInfoAsync( IDocumentMappingService documentMappingService, DocumentContext documentContext, diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IDocumentPositionInfoStrategy.cs similarity index 85% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentPositionInfoStrategy.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IDocumentPositionInfoStrategy.cs index dc7b13c4880..97a9ef05c23 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IDocumentPositionInfoStrategy.cs @@ -3,11 +3,10 @@ using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.VisualStudio.LanguageServer.Protocol; -namespace Microsoft.AspNetCore.Razor.LanguageServer; +namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; internal interface IDocumentPositionInfoStrategy { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/PreferAttributeNameDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferAttributeNameDocumentPositionInfoStrategy.cs similarity index 91% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/PreferAttributeNameDocumentPositionInfoStrategy.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferAttributeNameDocumentPositionInfoStrategy.cs index 98b8fcac5d1..48cc790504f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/PreferAttributeNameDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferAttributeNameDocumentPositionInfoStrategy.cs @@ -3,22 +3,25 @@ using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -namespace Microsoft.AspNetCore.Razor.LanguageServer; +namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; /// /// A projection strategy that, when given a position that occurs anywhere in an attribute name, will return the projection /// for the position at the start of the attribute name, ignoring any prefix or suffix. eg given any location within the /// attribute "@bind-Value:after", it will return the projection at the point of the word "Value" therein. /// -internal class PreferAttributeNameDocumentPositionInfoStrategy : IDocumentPositionInfoStrategy +internal sealed class PreferAttributeNameDocumentPositionInfoStrategy : IDocumentPositionInfoStrategy { public static IDocumentPositionInfoStrategy Instance { get; } = new PreferAttributeNameDocumentPositionInfoStrategy(); + private PreferAttributeNameDocumentPositionInfoStrategy() + { + } + public async Task TryGetPositionInfoAsync( IDocumentMappingService documentMappingService, DocumentContext documentContext, diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs similarity index 90% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs index 8df88d48145..32b23566da5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs @@ -4,22 +4,25 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language.Syntax; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.VisualStudio.LanguageServer.Protocol; -namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; +namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; // The main reason for this service is auto-insert of empty double quotes when a user types // equals "=" after Blazor component attribute. We think this is Razor (correctly I guess) // and wouldn't forward auto-insert request to HTML in this case. By essentially overriding // language info here we allow the request to be sent over to HTML where it will insert empty // double-quotes as it would for any other attribute value -internal class PreferHtmlInAttributeValuesDocumentPositionInfoStrategy : IDocumentPositionInfoStrategy +internal sealed class PreferHtmlInAttributeValuesDocumentPositionInfoStrategy : IDocumentPositionInfoStrategy { public static IDocumentPositionInfoStrategy Instance { get; } = new PreferHtmlInAttributeValuesDocumentPositionInfoStrategy(); + private PreferHtmlInAttributeValuesDocumentPositionInfoStrategy() + { + } + public async Task TryGetPositionInfoAsync(IDocumentMappingService documentMappingService, DocumentContext documentContext, Position position, CancellationToken cancellationToken) { var defaultDocumentPositionInfo = await DefaultDocumentPositionInfoStrategy.Instance.TryGetPositionInfoAsync(documentMappingService, documentContext, position, cancellationToken).ConfigureAwait(false); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorSyntaxFacts.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/RazorSyntaxFacts.cs similarity index 93% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorSyntaxFacts.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/RazorSyntaxFacts.cs index 1e8c122d9f1..36a77a23129 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorSyntaxFacts.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/RazorSyntaxFacts.cs @@ -4,8 +4,9 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.CodeAnalysis.Text; +using RazorSyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; -namespace Microsoft.AspNetCore.Razor.LanguageServer; +namespace Microsoft.CodeAnalysis.Razor; internal static class RazorSyntaxFacts { @@ -79,7 +80,7 @@ public static bool TryGetFullAttributeNameSpan(RazorCodeDocument codeDocument, i return attributeNameSpan != default; } - private static TextSpan GetFullAttributeNameSpan(SyntaxNode? node) + private static TextSpan GetFullAttributeNameSpan(RazorSyntaxNode? node) { return node switch { @@ -112,7 +113,7 @@ static TextSpan CalculateFullSpan(MarkupTextLiteralSyntax attributeName, MarkupT } } - public static CSharpCodeBlockSyntax? TryGetCSharpCodeFromCodeBlock(SyntaxNode node) + public static CSharpCodeBlockSyntax? TryGetCSharpCodeFromCodeBlock(RazorSyntaxNode node) { if (node is CSharpCodeBlockSyntax block && block.Children.FirstOrDefault() is RazorDirectiveSyntax directive && @@ -125,10 +126,9 @@ directive.Body is RazorDirectiveBodySyntax directiveBody && return null; } - public static bool IsAnyStartTag(SyntaxNode n) + public static bool IsAnyStartTag(RazorSyntaxNode n) => n.Kind is SyntaxKind.MarkupStartTag or SyntaxKind.MarkupTagHelperStartTag; - - public static bool IsAnyEndTag(SyntaxNode n) + public static bool IsAnyEndTag(RazorSyntaxNode n) => n.Kind is SyntaxKind.MarkupEndTag or SyntaxKind.MarkupTagHelperEndTag; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs index 5b72597e19c..b81070eaa30 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs @@ -3,7 +3,7 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; From f666b2c1e8db9fa577563c4008feff6cece4f9af Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 19 Aug 2024 09:53:33 -0700 Subject: [PATCH 128/386] Add DocumentMappingSerice to RazorDocumentServiceBase --- .../GoToDefinition/RemoteGoToDefinitionService.cs | 11 +++++------ .../InlayHints/RemoteInlayHintService.cs | 8 +++----- .../RazorDocumentServiceBase.cs | 2 ++ .../Rename/RemoteRenameService.cs | 5 ++--- .../SignatureHelp/RemoteSignatureHelpService.cs | 4 +--- .../UriPresentation/RemoteUriPresentationService.cs | 5 +---- 6 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs index aea8cd65490..0ba02d01952 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs @@ -8,6 +8,7 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.GoToDefinition; +using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor.DocumentMapping; @@ -15,11 +16,10 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; using Roslyn.LanguageServer.Protocol; +using static Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; -using static Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; -using Microsoft.CodeAnalysis.Razor.Protocol; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -33,7 +33,6 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg private readonly IRazorComponentDefinitionService _componentDefinitionService = args.ExportProvider.GetExportedValue(); private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); - private readonly IDocumentMappingService _documentMappingService = args.ExportProvider.GetExportedValue(); public ValueTask> GetDefinitionAsync( JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, @@ -53,7 +52,7 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg { var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); var hostDocumentIndex = codeDocument.Source.Text.GetRequiredAbsoluteIndex(position.ToLinePosition()); - var positionInfo = _documentMappingService.GetPositionInfo(codeDocument, hostDocumentIndex); + var positionInfo = DocumentMappingService.GetPositionInfo(codeDocument, hostDocumentIndex); // First, see if this is a Razor component. var componentLocation = await _componentDefinitionService.GetDefinitionAsync(context.Snapshot, positionInfo, ignoreAttributes: false, cancellationToken).ConfigureAwait(false); @@ -69,7 +68,7 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg return CallHtml; } - if (!_documentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), hostDocumentIndex, out var mappedPosition, out _)) + if (!DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), hostDocumentIndex, out var mappedPosition, out _)) { // If we can't map to the generated C# file, we're done. return NoFurtherHandling; @@ -100,7 +99,7 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg { var (uri, range) = location; - var (mappedDocumentUri, mappedRange) = await _documentMappingService + var (mappedDocumentUri, mappedRange) = await DocumentMappingService .MapToHostDocumentUriAndRangeAsync((RemoteDocumentSnapshot)context.Snapshot, uri, range.ToLinePositionSpan(), cancellationToken) .ConfigureAwait(false); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/InlayHints/RemoteInlayHintService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/InlayHints/RemoteInlayHintService.cs index ae06c498c58..2f80dd60b34 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/InlayHints/RemoteInlayHintService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/InlayHints/RemoteInlayHintService.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Protocol.InlayHints; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; @@ -27,7 +26,6 @@ protected override IRemoteInlayHintService CreateService(in ServiceArgs args) => new RemoteInlayHintService(in args); } - private readonly IDocumentMappingService _documentMappingService = args.ExportProvider.GetExportedValue(); private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); public ValueTask GetInlayHintsAsync(JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId razorDocumentId, InlayHintParams inlayHintParams, bool displayAllOverride, CancellationToken cancellationToken) @@ -47,7 +45,7 @@ protected override IRemoteInlayHintService CreateService(in ServiceArgs args) // We are given a range by the client, but our mapping only succeeds if the start and end of the range can both be mapped // to C#. Since that doesn't logically match what we want from inlay hints, we instead get the minimum range of mappable // C# to get hints for. We'll filter that later, to remove the sections that can't be mapped back. - if (!_documentMappingService.TryMapToGeneratedDocumentRange(csharpDocument, span, out var projectedLinePositionSpan) && + if (!DocumentMappingService.TryMapToGeneratedDocumentRange(csharpDocument, span, out var projectedLinePositionSpan) && !codeDocument.TryGetMinimalCSharpRange(span, out projectedLinePositionSpan)) { // There's no C# in the range. @@ -73,7 +71,7 @@ protected override IRemoteInlayHintService CreateService(in ServiceArgs args) foreach (var hint in hints) { if (csharpSourceText.TryGetAbsoluteIndex(hint.Position.ToLinePosition(), out var absoluteIndex) && - _documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteIndex, out var hostDocumentPosition, out var hostDocumentIndex)) + DocumentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteIndex, out var hostDocumentPosition, out var hostDocumentIndex)) { // We know this C# maps to Razor, but does it map to Razor that we like? var node = syntaxTree.Root.FindInnermostNode(hostDocumentIndex); @@ -85,7 +83,7 @@ protected override IRemoteInlayHintService CreateService(in ServiceArgs args) if (hint.TextEdits is not null) { var changes = hint.TextEdits.Select(csharpSourceText.GetTextChange); - var mappedChanges = _documentMappingService.GetHostDocumentEdits(csharpDocument, changes); + var mappedChanges = DocumentMappingService.GetHostDocumentEdits(csharpDocument, changes); hint.TextEdits = mappedChanges.Select(razorSourceText.GetTextEdit).ToArray(); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs index 85b747d60a4..8f0ac39ba17 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs @@ -5,6 +5,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -12,6 +13,7 @@ namespace Microsoft.CodeAnalysis.Remote.Razor; internal abstract class RazorDocumentServiceBase(in ServiceArgs args) : RazorBrokeredServiceBase(in args) { protected DocumentSnapshotFactory DocumentSnapshotFactory { get; } = args.ExportProvider.GetExportedValue(); + protected IDocumentMappingService DocumentMappingService { get; } = args.ExportProvider.GetExportedValue(); protected ValueTask RunServiceAsync( RazorPinnedSolutionInfoWrapper solutionInfo, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Rename/RemoteRenameService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Rename/RemoteRenameService.cs index 7f095247258..e4ebccfe67f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Rename/RemoteRenameService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Rename/RemoteRenameService.cs @@ -11,8 +11,8 @@ using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.VisualStudio.LanguageServer.Protocol; -using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; using static Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; +using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -26,7 +26,6 @@ protected override IRemoteRenameService CreateService(in ServiceArgs args) private readonly IRenameService _renameService = args.ExportProvider.GetExportedValue(); private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); - private readonly IDocumentMappingService _documentMappingService = args.ExportProvider.GetExportedValue(); private readonly IEditMappingService _editMappingService = args.ExportProvider.GetExportedValue(); public ValueTask> GetRenameEditAsync( @@ -51,7 +50,7 @@ protected override IRemoteRenameService CreateService(in ServiceArgs args) var generatedDocument = await context.GetGeneratedDocumentAsync(_filePathService, cancellationToken).ConfigureAwait(false); var hostDocumentIndex = codeDocument.Source.Text.GetRequiredAbsoluteIndex(position); - var positionInfo = _documentMappingService.GetPositionInfo(codeDocument, hostDocumentIndex); + var positionInfo = DocumentMappingService.GetPositionInfo(codeDocument, hostDocumentIndex); var razorEdit = await _renameService.TryGetRazorRenameEditsAsync(context, positionInfo, newName, cancellationToken).ConfigureAwait(false); if (razorEdit is not null) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SignatureHelp/RemoteSignatureHelpService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SignatureHelp/RemoteSignatureHelpService.cs index fb4fa23635a..0aa63984efc 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SignatureHelp/RemoteSignatureHelpService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SignatureHelp/RemoteSignatureHelpService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.ExternalAccess.Razor; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; @@ -26,7 +25,6 @@ protected override IRemoteSignatureHelpService CreateService(in ServiceArgs args } private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); - private readonly IDocumentMappingService _documentMappingService = args.ExportProvider.GetExportedValue(); public ValueTask GetSignatureHelpAsync(JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId documentId, Position position, CancellationToken cancellationToken) => RunServiceAsync( @@ -43,7 +41,7 @@ protected override IRemoteSignatureHelpService CreateService(in ServiceArgs args var generatedDocument = await context.GetGeneratedDocumentAsync(_filePathService, cancellationToken).ConfigureAwait(false); - if (_documentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), absoluteIndex, out var mappedPosition, out _)) + if (DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), absoluteIndex, out var mappedPosition, out _)) { return await ExternalHandlers.SignatureHelp.GetSignatureHelpAsync(generatedDocument, mappedPosition, supportsVisualStudioExtensions: true, cancellationToken).ConfigureAwait(false); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/UriPresentation/RemoteUriPresentationService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/UriPresentation/RemoteUriPresentationService.cs index 393765a7a0a..06dd2c59b0f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/UriPresentation/RemoteUriPresentationService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/UriPresentation/RemoteUriPresentationService.cs @@ -5,7 +5,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.ExternalAccess.Razor; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.DocumentPresentation; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; @@ -25,8 +24,6 @@ protected override IRemoteUriPresentationService CreateService(in ServiceArgs ar => new RemoteUriPresentationService(in args); } - private readonly IDocumentMappingService _documentMappingService = args.ExportProvider.GetExportedValue(); - public ValueTask GetPresentationAsync( RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId razorDocumentId, @@ -54,7 +51,7 @@ private async ValueTask GetPresentationAsync( var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var languageKind = _documentMappingService.GetLanguageKind(codeDocument, index, rightAssociative: true); + var languageKind = DocumentMappingService.GetLanguageKind(codeDocument, index, rightAssociative: true); if (languageKind is not RazorLanguageKind.Html) { // Roslyn doesn't currently support Uri presentation, and whilst it might seem counter intuitive, From e69661cc37213b311dc7a936eaa0b01b983488c3 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 19 Aug 2024 10:32:36 -0700 Subject: [PATCH 129/386] Rework IDocumentPositionInfoStrategy and use correctly in co-hosted GTD --- .../AbstractRazorDelegatingEndpoint.cs | 7 ++-- .../DefaultDocumentPositionInfoStrategy.cs | 22 ++--------- .../DocumentMapping/DocumentPositionInfo.cs | 2 +- .../IDocumentPositionInfoStrategy.cs | 11 +----- ...tributeNameDocumentPositionInfoStrategy.cs | 32 ++++------------ ...AttributeValuesDocumentPositionStrategy.cs | 33 +++++++++-------- .../RoslynLspExtensions_SourceText.cs | 6 +++ .../RemoteGoToDefinitionService.cs | 11 +++++- .../RazorDocumentServiceBase.cs | 37 +++++++++++++++++++ .../Rename/RemoteRenameService.cs | 9 +++-- ...eValuesDocumentPositionInfoStrategyTest.cs | 7 ++-- 11 files changed, 96 insertions(+), 81 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs index dfef778fe71..c84789d378c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs @@ -113,12 +113,14 @@ protected virtual Task HandleDelegatedResponseAsync(TResponse delegat return default; } - var positionInfo = await DocumentPositionInfoStrategy.TryGetPositionInfoAsync(_documentMappingService, documentContext, request.Position, cancellationToken).ConfigureAwait(false); - if (positionInfo is null) + var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + if (!codeDocument.Source.Text.TryGetAbsoluteIndex(request.Position, out var absoluteIndex)) { return default; } + var positionInfo = DocumentPositionInfoStrategy.GetPositionInfo(_documentMappingService, codeDocument, absoluteIndex); + var response = await TryHandleAsync(request, requestContext, positionInfo, cancellationToken).ConfigureAwait(false); if (response is not null && response is not ISumType { Value: null }) { @@ -141,7 +143,6 @@ protected virtual Task HandleDelegatedResponseAsync(TResponse delegat // Sometimes Html can actually be mapped to C#, like for example component attributes, which map to // C# properties, even though they appear entirely in a Html context. Since remapping is pretty cheap // it's easier to just try mapping, and see what happens, rather than checking for specific syntax nodes. - var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); if (_documentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), positionInfo.HostDocumentIndex, out Position? csharpPosition, out _)) { // We're just gonna pretend this mapped perfectly normally onto C#. Moving this logic to the actual position info diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DefaultDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DefaultDocumentPositionInfoStrategy.cs index 5c25a5c7d53..c126e2656f1 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DefaultDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DefaultDocumentPositionInfoStrategy.cs @@ -1,11 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.AspNetCore.Razor.Language; namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; @@ -17,18 +13,6 @@ private DefaultDocumentPositionInfoStrategy() { } - public async Task TryGetPositionInfoAsync( - IDocumentMappingService documentMappingService, - DocumentContext documentContext, - Position position, - CancellationToken cancellationToken) - { - var sourceText = await documentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); - if (!sourceText.TryGetAbsoluteIndex(position, out var absoluteIndex)) - { - return null; - } - - return await documentMappingService.GetPositionInfoAsync(documentContext, absoluteIndex, cancellationToken).ConfigureAwait(false); - } + public DocumentPositionInfo GetPositionInfo(IDocumentMappingService mappingService, RazorCodeDocument codeDocument, int hostDocumentIndex) + => mappingService.GetPositionInfo(codeDocument, hostDocumentIndex); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DocumentPositionInfo.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DocumentPositionInfo.cs index cfc2ad81629..bbb745aea2c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DocumentPositionInfo.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/DocumentPositionInfo.cs @@ -10,4 +10,4 @@ namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; /// Represents a position in a document. If is Razor then the position will be /// in the host document, otherwise it will be in the corresponding generated document. ///
-internal record DocumentPositionInfo(RazorLanguageKind LanguageKind, Position Position, int HostDocumentIndex); +internal readonly record struct DocumentPositionInfo(RazorLanguageKind LanguageKind, Position Position, int HostDocumentIndex); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IDocumentPositionInfoStrategy.cs index 97a9ef05c23..9e257a712a8 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/IDocumentPositionInfoStrategy.cs @@ -1,18 +1,11 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.AspNetCore.Razor.Language; namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; internal interface IDocumentPositionInfoStrategy { - Task TryGetPositionInfoAsync( - IDocumentMappingService documentMappingService, - DocumentContext documentContext, - Position position, - CancellationToken cancellationToken); + DocumentPositionInfo GetPositionInfo(IDocumentMappingService mappingService, RazorCodeDocument codeDocument, int hostDocumentIndex); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferAttributeNameDocumentPositionInfoStrategy.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferAttributeNameDocumentPositionInfoStrategy.cs index 48cc790504f..86c1cf5017a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferAttributeNameDocumentPositionInfoStrategy.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferAttributeNameDocumentPositionInfoStrategy.cs @@ -1,11 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.AspNetCore.Razor.Language; namespace Microsoft.CodeAnalysis.Razor.DocumentMapping; @@ -22,28 +18,16 @@ private PreferAttributeNameDocumentPositionInfoStrategy() { } - public async Task TryGetPositionInfoAsync( - IDocumentMappingService documentMappingService, - DocumentContext documentContext, - Position position, - CancellationToken cancellationToken) + public DocumentPositionInfo GetPositionInfo(IDocumentMappingService mappingService, RazorCodeDocument codeDocument, int hostDocumentIndex) { - var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var sourceText = await documentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); - if (sourceText.TryGetAbsoluteIndex(position, out var absoluteIndex)) + // First, lets see if we should adjust the location to get a better result from C#. For example given + // where | is the cursor, we would be unable to map that location to C#. If we pretend the caret was 3 characters to the right though, + // in the actual component property name, then the C# server would give us a result, so we fake it. + if (RazorSyntaxFacts.TryGetAttributeNameAbsoluteIndex(codeDocument, hostDocumentIndex, out var attributeNameIndex)) { - // First, lets see if we should adjust the location to get a better result from C#. For example given - // where | is the cursor, we would be unable to map that location to C#. If we pretend the caret was 3 characters to the right though, - // in the actual component property name, then the C# server would give us a result, so we fake it. - if (RazorSyntaxFacts.TryGetAttributeNameAbsoluteIndex(codeDocument, absoluteIndex, out var attributeNameIndex)) - { - position = sourceText.GetPosition(attributeNameIndex); - } + hostDocumentIndex = attributeNameIndex; } - // We actually don't need a different projection strategy, we just wanted to move the caret position - return await DefaultDocumentPositionInfoStrategy.Instance - .TryGetPositionInfoAsync(documentMappingService, documentContext, position, cancellationToken) - .ConfigureAwait(false); + return DefaultDocumentPositionInfoStrategy.Instance.GetPositionInfo(mappingService, codeDocument, hostDocumentIndex); } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs index 32b23566da5..7de3f5f7612 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/PreferHtmlInAttributeValuesDocumentPositionStrategy.cs @@ -1,10 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Threading; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Syntax; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -23,31 +22,33 @@ private PreferHtmlInAttributeValuesDocumentPositionInfoStrategy() { } - public async Task TryGetPositionInfoAsync(IDocumentMappingService documentMappingService, DocumentContext documentContext, Position position, CancellationToken cancellationToken) + public DocumentPositionInfo GetPositionInfo(IDocumentMappingService mappingService, RazorCodeDocument codeDocument, int hostDocumentIndex) { - var defaultDocumentPositionInfo = await DefaultDocumentPositionInfoStrategy.Instance.TryGetPositionInfoAsync(documentMappingService, documentContext, position, cancellationToken).ConfigureAwait(false); - if (defaultDocumentPositionInfo is null) - { - return null; - } + var positionInfo = DefaultDocumentPositionInfoStrategy.Instance.GetPositionInfo(mappingService, codeDocument, hostDocumentIndex); - var absolutePosition = defaultDocumentPositionInfo.HostDocumentIndex; - if (defaultDocumentPositionInfo.LanguageKind != RazorLanguageKind.Razor || + var absolutePosition = positionInfo.HostDocumentIndex; + if (positionInfo.LanguageKind != RazorLanguageKind.Razor || absolutePosition < 1) { - return defaultDocumentPositionInfo; + return positionInfo; } // Get the node at previous position to see if we are after markup tag helper attribute, // and more specifically after the EqualsToken of it var previousPosition = absolutePosition - 1; - var owner = await documentContext.GetSyntaxNodeAsync(previousPosition, cancellationToken).ConfigureAwait(false); + + var syntaxTree = codeDocument.GetSyntaxTree().AssumeNotNull(); + + var owner = syntaxTree.Root is RazorSyntaxNode root + ? root.FindInnermostNode(previousPosition) + : null; + if (owner is MarkupTagHelperAttributeSyntax { EqualsToken: { IsMissing: false } equalsToken } && - equalsToken.EndPosition == defaultDocumentPositionInfo.HostDocumentIndex) + equalsToken.EndPosition == positionInfo.HostDocumentIndex) { - return new DocumentPositionInfo(RazorLanguageKind.Html, defaultDocumentPositionInfo.Position, defaultDocumentPositionInfo.HostDocumentIndex); + return positionInfo with { LanguageKind = RazorLanguageKind.Html }; } - return defaultDocumentPositionInfo; + return positionInfo; } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs index fbeb95c1b9f..21b8897a798 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs @@ -11,6 +11,12 @@ internal static partial class RoslynLspExtensions public static Range GetRange(this SourceText text, TextSpan span) => text.GetLinePositionSpan(span).ToRange(); + public static bool TryGetAbsoluteIndex(this SourceText text, Position position, out int absoluteIndex) + => text.TryGetAbsoluteIndex(position.Line, position.Character, out absoluteIndex); + + public static int GetRequiredAbsoluteIndex(this SourceText text, Position position) + => text.GetRequiredAbsoluteIndex(position.Line, position.Character); + public static TextSpan GetTextSpan(this SourceText text, Range range) => text.GetTextSpan(range.Start.Line, range.Start.Character, range.End.Line, range.End.Character); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs index 0ba02d01952..17a33939436 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs @@ -34,6 +34,8 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg private readonly IRazorComponentDefinitionService _componentDefinitionService = args.ExportProvider.GetExportedValue(); private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); + protected override IDocumentPositionInfoStrategy DocumentPositionInfoStrategy => PreferAttributeNameDocumentPositionInfoStrategy.Instance; + public ValueTask> GetDefinitionAsync( JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId documentId, @@ -51,8 +53,13 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg CancellationToken cancellationToken) { var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var hostDocumentIndex = codeDocument.Source.Text.GetRequiredAbsoluteIndex(position.ToLinePosition()); - var positionInfo = DocumentMappingService.GetPositionInfo(codeDocument, hostDocumentIndex); + + if (!codeDocument.Source.Text.TryGetAbsoluteIndex(position, out var hostDocumentIndex)) + { + return NoFurtherHandling; + } + + var positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex); // First, see if this is a Razor component. var componentLocation = await _componentDefinitionService.GetDefinitionAsync(context.Snapshot, positionInfo, ignoreAttributes: false, cancellationToken).ConfigureAwait(false); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs index 8f0ac39ba17..9327d9931e7 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs @@ -4,9 +4,15 @@ using System; using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; +using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; +using VsPosition = Microsoft.VisualStudio.LanguageServer.Protocol.Position; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -15,6 +21,37 @@ internal abstract class RazorDocumentServiceBase(in ServiceArgs args) : RazorBro protected DocumentSnapshotFactory DocumentSnapshotFactory { get; } = args.ExportProvider.GetExportedValue(); protected IDocumentMappingService DocumentMappingService { get; } = args.ExportProvider.GetExportedValue(); + protected virtual IDocumentPositionInfoStrategy DocumentPositionInfoStrategy { get; } = DefaultDocumentPositionInfoStrategy.Instance; + + protected DocumentPositionInfo GetPositionInfo(RazorCodeDocument codeDocument, int hostDocumentIndex) + { + return DocumentPositionInfoStrategy.GetPositionInfo(DocumentMappingService, codeDocument, hostDocumentIndex); + } + + protected bool TryGetDocumentPositionInfo(RazorCodeDocument codeDocument, RoslynPosition position, out DocumentPositionInfo positionInfo) + { + if (!codeDocument.Source.Text.TryGetAbsoluteIndex(position, out var hostDocumentIndex)) + { + positionInfo = default; + return false; + } + + positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex); + return true; + } + + protected bool TryGetDocumentPositionInfo(RazorCodeDocument codeDocument, VsPosition position, out DocumentPositionInfo positionInfo) + { + if (!codeDocument.Source.Text.TryGetAbsoluteIndex(position, out var hostDocumentIndex)) + { + positionInfo = default; + return false; + } + + positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex); + return true; + } + protected ValueTask RunServiceAsync( RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId razorDocumentId, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Rename/RemoteRenameService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Rename/RemoteRenameService.cs index e4ebccfe67f..be31a947509 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Rename/RemoteRenameService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Rename/RemoteRenameService.cs @@ -47,10 +47,13 @@ protected override IRemoteRenameService CreateService(in ServiceArgs args) CancellationToken cancellationToken) { var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var generatedDocument = await context.GetGeneratedDocumentAsync(_filePathService, cancellationToken).ConfigureAwait(false); - var hostDocumentIndex = codeDocument.Source.Text.GetRequiredAbsoluteIndex(position); - var positionInfo = DocumentMappingService.GetPositionInfo(codeDocument, hostDocumentIndex); + if (!TryGetDocumentPositionInfo(codeDocument, position, out var positionInfo)) + { + return NoFurtherHandling; + } + + var generatedDocument = await context.GetGeneratedDocumentAsync(_filePathService, cancellationToken).ConfigureAwait(false); var razorEdit = await _renameService.TryGetRazorRenameEditsAsync(context, positionInfo, newName, cancellationToken).ConfigureAwait(false); if (razorEdit is not null) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs index b81070eaa30..c06d4ba3492 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/PreferHtmlInAttributeValuesDocumentPositionInfoStrategyTest.cs @@ -46,15 +46,14 @@ internal async Task TryGetPositionInfoAsync_AtVariousPosition_ReturnsCorrectLang var position = codeDocument.Source.Text.GetPosition(cursorPosition); var uri = new Uri(razorFilePath); _ = await CreateLanguageServerAsync(codeDocument, razorFilePath); - var documentContext = CreateDocumentContext(uri, codeDocument); // Act - var result = await PreferHtmlInAttributeValuesDocumentPositionInfoStrategy.Instance.TryGetPositionInfoAsync( - DocumentMappingService, documentContext, position, DisposalToken); + var result = PreferHtmlInAttributeValuesDocumentPositionInfoStrategy.Instance.GetPositionInfo(DocumentMappingService, codeDocument, cursorPosition); // Assert - Assert.NotNull(result); + Assert.NotEqual(default, result); Assert.Equal(expectedLanguage, result.LanguageKind); + if (expectedLanguage != RazorLanguageKind.CSharp) { Assert.Equal(cursorPosition, result.HostDocumentIndex); From 9325817b4ede3f8006d8d9c45dd94de28e5045ac Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 19 Aug 2024 12:57:46 -0700 Subject: [PATCH 130/386] Add tests for co-hosted GTD --- .../RoslynLspExtensions_SourceText.cs | 6 + .../RemoteGoToDefinitionService.cs | 16 +- .../Cohost/CohostGoToDefinitionEndpoint.cs | 9 + .../TestCode.cs | 55 ++++ .../CohostGoToDefinitionEndpointTest.cs | 282 ++++++++++++++++++ 5 files changed, 367 insertions(+), 1 deletion(-) create mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs index 21b8897a798..5c5d391316f 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RoslynLspExtensions_SourceText.cs @@ -8,6 +8,12 @@ namespace Roslyn.LanguageServer.Protocol; internal static partial class RoslynLspExtensions { + public static int GetPosition(this SourceText text, Position position) + => text.GetPosition(position.ToLinePosition()); + + public static Position GetPosition(this SourceText text, int position) + => text.GetLinePosition(position).ToPosition(); + public static Range GetRange(this SourceText text, TextSpan span) => text.GetLinePositionSpan(span).ToRange(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs index 17a33939436..02a7aba2217 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs @@ -20,6 +20,7 @@ using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; +using VsPosition = Microsoft.VisualStudio.LanguageServer.Protocol.Position; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -69,13 +70,26 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg return Results([RoslynLspFactory.CreateLocation(componentLocation.Uri, componentLocation.Range.ToLinePositionSpan())]); } + if (positionInfo.LanguageKind == RazorLanguageKind.Html) + { + // Sometimes Html can actually be mapped to C#, like for example component attributes, which map to + // C# properties, even though they appear entirely in a Html context. Since remapping is pretty cheap + // it's easier to just try mapping, and see what happens, rather than checking for specific syntax nodes. + if (DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), positionInfo.HostDocumentIndex, out VsPosition? csharpPosition, out _)) + { + // We're just gonna pretend this mapped perfectly normally onto C#. Moving this logic to the actual position info + // calculating code is possible, but could have untold effects, so opt-in is better (for now?) + positionInfo = positionInfo with { LanguageKind = RazorLanguageKind.CSharp, Position = csharpPosition }; + } + } + // If it isn't a Razor component, and it isn't C#, let the server know to delegate to HTML. if (positionInfo.LanguageKind != RazorLanguageKind.CSharp) { return CallHtml; } - if (!DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), hostDocumentIndex, out var mappedPosition, out _)) + if (!DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), positionInfo.HostDocumentIndex, out var mappedPosition, out _)) { // If we can't map to the generated C# file, we're done. return NoFurtherHandling; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs index bc53ca94a4b..fbab17f6a38 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs @@ -138,4 +138,13 @@ internal sealed class CohostGoToDefinitionEndpoint( return null; } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostGoToDefinitionEndpoint instance) + { + public Task?> HandleRequestAsync( + TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(request, razorDocument, cancellationToken); + } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs new file mode 100644 index 00000000000..d19cbc5281e --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs @@ -0,0 +1,55 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using System.Linq; +using Microsoft.CodeAnalysis.Testing; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.AspNetCore.Razor.Test.Common; + +internal readonly struct TestCode +{ + public string Text { get; } + public ImmutableArray Positions { get; } + + private readonly ImmutableDictionary> _nameToSpanMap; + + public TestCode(string input, bool treatPositionIndicatorsAsCode = false) + { + if (treatPositionIndicatorsAsCode) + { + TestFileMarkupParser.GetSpans(input, treatPositionIndicatorsAsCode, out var text, out var nameToSpanMap); + + Text = text; + Positions = []; + _nameToSpanMap = nameToSpanMap; + } + else + { + TestFileMarkupParser.GetPositionsAndSpans(input, out var text, out var positions, out var spans); + + Text = text; + Positions = positions; + _nameToSpanMap = spans; + } + } + + public int Position + => Positions.Single(); + + public TextSpan Span + => Spans.Single(); + + public ImmutableArray Spans + => GetNamedSpans(string.Empty); + + public ImmutableArray GetNamedSpans(string name) + => _nameToSpanMap[name]; + + public bool TryGetNamedSpans(string name, out ImmutableArray spans) + => _nameToSpanMap.TryGetValue(name, out spans); + + public static implicit operator TestCode(string input) + => new(input); +} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs new file mode 100644 index 00000000000..911176ecc5d --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs @@ -0,0 +1,282 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Xunit; +using Xunit.Abstractions; +using RoslynDocumentLink = Roslyn.LanguageServer.Protocol.DocumentLink; +using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; +using RoslynLspExtensions = Roslyn.LanguageServer.Protocol.RoslynLspExtensions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +public class CohostGoToDefinitionEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +{ + [Fact] + public async Task CSharp_Method() + { + var input = """ +
+ @{ + var x = Ge$$tX(); + } + @functions + { + void [|GetX|]() + { + } + } + """; + + await VerifyGoToDefinitionAsync(input); + } + + [Fact] + public async Task CSharp_Local() + { + var input = """ +
+ @{ + var x = GetX(); + } + @functions + { + private string [|_name|]; + string GetX() + { + return _na$$me; + } + } + """; + + await VerifyGoToDefinitionAsync(input); + } + + [Fact] + public async Task CSharp_MetadataReference() + { + var input = """ +
+ @functions + { + private stri$$ng _name; + } + """; + + var result = await GetGoToDefinitionResultAsync(input); + + Assert.NotNull(result.Value.Second); + var locations = result.Value.Second; + var location = Assert.Single(locations); + Assert.EndsWith("String.cs", location.Uri.ToString()); + + // Note: The location is in a generated C# "metadata-as-source" file, which has a different + // number of using directives in .NET Framework vs. .NET Core, so rather than relying on line + // numbers we do some vague notion of actual navigation and test the actual source line that + // the user would see. + var line = File.ReadLines(location.Uri.LocalPath).ElementAt(location.Range.Start.Line); + Assert.Contains("public sealed class String", line); + } + + [Theory] + [InlineData("$$IncrementCount")] + [InlineData("In$$crementCount")] + [InlineData("IncrementCount$$")] + public async Task Attribute_SameFile(string method) + { + var input = $$""" + \r\n "); EndContext(); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs index 417e4c21079..bd1654c914b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs @@ -60,7 +60,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages WriteLiteral("\r\n

New Customer

\r\n\r\n "); EndContext(); BeginContext(551, 31, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __DivTagHelper = CreateTagHelper(); @@ -78,7 +78,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages WriteLiteral("\r\n "); EndContext(); BeginContext(588, 243, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { BeginContext(612, 48, true); WriteLiteral("\r\n \r\n "); EndContext(); BeginContext(689, 130, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { BeginContext(712, 101, true); WriteLiteral("\r\n \r\n \r\n "); EndContext(); @@ -132,12 +132,12 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages WriteLiteral("\r\n "); EndContext(); BeginContext(837, 174, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { BeginContext(861, 10, true); WriteLiteral("\r\n "); EndContext(); BeginContext(871, 128, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { BeginContext(910, 83, true); WriteLiteral("\r\n \r\n "); EndContext(); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs index 9544b7fdd5f..d6cda67f0f4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs @@ -63,7 +63,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : WriteLiteral("\r\n
This is in Section 1
\r\n "); EndContext(); BeginContext(205, 25, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTestTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs index acca84c3a07..ed19fdfc28c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs @@ -55,7 +55,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon WriteLiteral("\r\n"); EndContext(); BeginContext(61, 50, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __AllTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.codegen.cs index 6812ca87c29..be031f1c937 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.codegen.cs @@ -69,7 +69,7 @@ public class TestFiles_IntegrationTests_InstrumentationPassIntegrationTest_Basic EndContext(); BeginContext(71, 87, false); BeginContext(71, 87, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { BeginContext(91, 6, true); BeginContext(91, 6, true); WriteLiteral("\r\n "); @@ -77,7 +77,7 @@ public class TestFiles_IntegrationTests_InstrumentationPassIntegrationTest_Basic EndContext(); BeginContext(97, 52, false); BeginContext(97, 52, false); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs index 641f07ac3e4..abe84baa4bf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs @@ -44,7 +44,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Incomplete #line default #line hidden #nullable disable - Member_test { get; private set; } + Member___UniqueIdSuppressedForTesting__ { get; private set; } = default!; #nullable restore #line (11,9)-(11,9) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml" diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.codegen.cs index 737f6dc2ace..eed476b253a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.codegen.cs @@ -47,7 +47,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpre { WriteLiteral("\r\n"); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTestTagHelper = CreateTagHelper(); @@ -70,7 +70,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpre Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTestTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.codegen.cs index 67004f5a5e1..29a19e954bd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.codegen.cs @@ -59,7 +59,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : glo #nullable disable WriteLiteral("
\r\n

Welcome

\r\n

Learn about building Web apps with ASP.NET Core.

\r\n
\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("all", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("all", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __AllTagHelper = CreateTagHelper(); @@ -74,7 +74,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : glo Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n"); } ); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs index 22f235cc89d..026dff36502 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs @@ -58,7 +58,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages WriteLiteral("\r\n"); WriteLiteral("\r\n"); WriteLiteral("\r\n

New Customer

\r\n\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __DivTagHelper = CreateTagHelper(); @@ -72,7 +72,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n \r\n "); } ); @@ -112,9 +112,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n "); } ); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs index a029a343a45..4a73f56e094 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs @@ -58,7 +58,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages WriteLiteral("\r\n"); WriteLiteral("\r\n"); WriteLiteral("\r\n

New Customer

\r\n\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __DivTagHelper = CreateTagHelper(); @@ -72,7 +72,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n \r\n "); } ); @@ -112,9 +112,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n "); } ); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.codegen.cs index cd3b23a0f11..0cf08bfd880 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.codegen.cs @@ -59,7 +59,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : glo #nullable disable WriteLiteral("
\r\n

Welcome

\r\n

Learn about building Web apps with ASP.NET Core.

\r\n
\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("all", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("all", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __AllTagHelper = CreateTagHelper(); @@ -74,7 +74,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : glo Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n"); } ); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs index dacf79c54db..cea3d1aee85 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs @@ -59,7 +59,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : WriteLiteral("\r\n
Some body
\r\n\r\n"); DefineSection("Section1", async() => { WriteLiteral("\r\n
This is in Section 1
\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTestTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.codegen.cs index 377646cfe7d..7794ab8fd83 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.codegen.cs @@ -48,7 +48,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalTestViewComponentTagHelper = CreateTagHelper(); @@ -61,7 +61,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalTestViewComponentTagHelper = CreateTagHelper(); @@ -84,7 +84,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test-with-param", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test-with-param", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalTestWithParamViewComponentTagHelper = CreateTagHelper(); @@ -102,7 +102,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test-with-param", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test-with-param", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalTestWithParamViewComponentTagHelper = CreateTagHelper(); @@ -130,7 +130,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); @@ -143,7 +143,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); @@ -186,7 +186,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); @@ -219,7 +219,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); @@ -262,7 +262,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs index 56a0795ba61..9e2e46abc1e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs @@ -57,7 +57,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon #nullable disable WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __AllTagHelper = CreateTagHelper(); 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 d5cabab89c3..3043c54536f 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 @@ -52,9 +52,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeT 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n

"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("strong", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("strong", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("Hello"); } ); @@ -69,7 +69,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeT Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("World

\r\n \r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -98,7 +98,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeT Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); 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 0221050c13c..b2e32e22f4e 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 @@ -50,9 +50,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n

\r\n \r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); 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 1393a8a5025..ec6dc9cebc1 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 @@ -51,9 +51,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_PTagHelper = CreateTagHelper(); @@ -66,7 +66,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -85,7 +85,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); 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 402316266c1..532a0f124ed 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 @@ -53,9 +53,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_PTagHelper = CreateTagHelper(); @@ -69,7 +69,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -102,7 +102,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHe Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); 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 95477dd0bdb..bd80f3c83a2 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 @@ -45,7 +45,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 : #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n"); #nullable restore #line (2,7)-(8,9) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml" 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 513c0353eae..85a29517773 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 @@ -68,7 +68,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag #nullable disable WriteLiteral("
\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_PTagHelper = CreateTagHelper(); @@ -130,7 +130,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n

Set Time:

\r\n"); #nullable restore #line (11,14)-(13,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" @@ -142,9 +142,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag #nullable disable WriteLiteral(" "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("New Time: "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -187,9 +187,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag #nullable disable WriteLiteral(" "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("Current Time: "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -239,7 +239,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -268,7 +268,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -348,7 +348,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n"); #nullable restore #line (23,15)-(23,36) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml" @@ -359,7 +359,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag #nullable disable WriteLiteral(" "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -422,9 +422,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -487,9 +487,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagOnly, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -536,9 +536,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -609,8 +609,8 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag #nullable disable 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -668,7 +668,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTag #nullable disable ); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_PTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.codegen.cs index bfdfcbda387..bea2dc40c02 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.codegen.cs @@ -215,7 +215,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Conditiona ), 289, 25, false); EndWriteAttribute(); WriteLiteral(" />\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper(); 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 c1bbb67fd09..5d39602f9ea 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 @@ -151,7 +151,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Conditiona ), 256, 25, false); EndWriteAttribute(); WriteLiteral(" />\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper(); 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 42a9dffd1e3..d8b78779e99 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 @@ -60,7 +60,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("2 TagHelpers."); } ); @@ -77,7 +77,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("1 TagHelper."); } ); @@ -92,7 +92,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("2 TagHelpers"); } ); @@ -109,7 +109,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("2 TagHelpers"); } ); @@ -138,7 +138,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n0 TagHelpers.\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("1 TagHelper"); } ); @@ -164,7 +164,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("1 TagHelper"); } ); @@ -179,7 +179,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("1 TagHelper"); } ); @@ -205,7 +205,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -227,7 +227,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper2 = CreateTagHelper(); @@ -245,7 +245,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelecto Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper2 = CreateTagHelper(); 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 02d1285c41e..970cd93696c 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 @@ -57,9 +57,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateA 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -79,7 +79,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateA Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -110,7 +110,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateA Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); 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 9187b068bd6..7f3d34603a1 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 @@ -48,7 +48,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateT 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); 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 151e828a910..b23c4b4fa53 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 @@ -46,7 +46,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAtt 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -71,7 +71,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAtt Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -131,7 +131,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAtt Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -172,7 +172,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAtt Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -315,7 +315,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAtt Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -359,7 +359,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAtt Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); 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 172586535bc..04ba3dfb0da 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 @@ -50,7 +50,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttri 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -79,9 +79,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttri Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); 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 34161e8ccd5..8507277ecc7 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 @@ -57,7 +57,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHel #nullable disable WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -82,7 +82,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHel Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -108,7 +108,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHel Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -133,7 +133,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHel Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -168,7 +168,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHel Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.codegen.cs index c752c653108..eb90674c363 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.codegen.cs @@ -46,7 +46,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExp 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTagHelper = CreateTagHelper(); @@ -69,7 +69,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExp Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTagHelper = CreateTagHelper(); @@ -92,7 +92,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExp Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTagHelper = CreateTagHelper(); 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 b97277b2108..2b20a74bbe3 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 @@ -58,7 +58,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIde #line hidden #nullable disable - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTagHelper = CreateTagHelper(); @@ -91,7 +91,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIde Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTagHelper = CreateTagHelper(); @@ -124,7 +124,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIde Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __InputTagHelper = CreateTagHelper(); 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 e2a818c275d..19b047d3be6 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 @@ -62,7 +62,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTag WriteLiteral("input type=\"text\" />\r\n <"); WriteLiteral("em>Not a TagHelper: "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.codegen.cs index 81126e4108e..a7bc9e25980 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.codegen.cs @@ -47,7 +47,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommen public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.codegen.cs index b88b00e29fe..693d546a7ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.codegen.cs @@ -47,7 +47,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommen public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n"); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("img", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs index e279225f6e1..6f8cd813b2b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs @@ -47,7 +47,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Incomplete 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_PTagHelper = CreateTagHelper(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.codegen.cs index 5731be96cfe..2e8972ab128 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.codegen.cs @@ -61,7 +61,7 @@ void PrintName(Person person) #nullable disable WriteLiteral(" "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { Write( #nullable restore #line (10,15)-(10,26) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml" @@ -123,7 +123,7 @@ Task AnnounceBirthday(Person person) #nullable disable WriteLiteral(" "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n

Happy birthday "); Write( #nullable restore diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.cs-diagnostics.txt index 14a65a3b3ed..8abdb160933 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.cs-diagnostics.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.cs-diagnostics.txt @@ -4,9 +4,9 @@ Diagnostic(ErrorCode.ERR_BadAwaitWithoutVoidAsyncMethod, "await __tagHelperRunne // TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml(81,17): error CS4033: The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. // await __tagHelperExecutionContext.SetOutputContentAsync(); Diagnostic(ErrorCode.ERR_BadAwaitWithoutVoidAsyncMethod, "await __tagHelperExecutionContext.SetOutputContentAsync()").WithLocation(81, 17), -// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml(126,165): 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. -// __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { -Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "=>").WithLocation(126, 165), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml(126,193): 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. +// __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { +Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "=>").WithLocation(126, 193), // TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml(142,9): error CS4032: The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. // await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Diagnostic(ErrorCode.ERR_BadAwaitWithoutAsyncMethod, "await __tagHelperRunner.RunAsync(__tagHelperExecutionContext)").WithArguments("System.Threading.Tasks.Task").WithLocation(142, 9), diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.codegen.cs index b50b06f40ef..685f4fa6bdb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.codegen.cs @@ -55,9 +55,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedT 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() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("\r\n \r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_CatchAllTagHelper = CreateTagHelper(); @@ -74,7 +74,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedT Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -98,7 +98,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedT Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -124,7 +124,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedT Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.SelfClosing, "__UniqueIdSuppressedForTesting__", async() => { } ); __TestNamespace_InputTagHelper = CreateTagHelper(); @@ -147,7 +147,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedT Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { } ); __DivTagHelper = CreateTagHelper(); @@ -168,7 +168,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedT Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); - __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { WriteLiteral("Tag helper with unmatched bound boolean attributes."); } ); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs index 31d02abb628..6d3392ac954 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs @@ -51,7 +51,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScri public async override global::System.Threading.Tasks.Task ExecuteAsync() { WriteLiteral("\r\n + + +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/TestFiles/Input/CshtmlWithScript.cshtml b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/TestFiles/Input/CshtmlWithScript.cshtml new file mode 100644 index 00000000000..7cefd6acf19 --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/TestFiles/Input/CshtmlWithScript.cshtml @@ -0,0 +1,54 @@ +@page +@model Model +@{ + ViewBag.Title = "This is a title"; + ViewBag.HeaderTitle = "This is a header title"; + ViewBag.HeaderBackground = "#003459"; + ViewBag.HeaderForeground = "#FFFFFF"; + + if (Model.ChartName.Length == 0) + { + ViewBag.ShowChart = false; + } +} + +@section Scripts { + + + +} \ No newline at end of file From e5160528c353242c81233903e8222fb9d406375a Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 28 Aug 2024 14:21:26 +1000 Subject: [PATCH 233/386] Improve integration tests --- .../Formatting/FormatDocumentTests.cs | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/FormatDocumentTests.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/FormatDocumentTests.cs index 4ffa1015ba4..7d7b23d949a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/FormatDocumentTests.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/FormatDocumentTests.cs @@ -24,27 +24,11 @@ public class FormatDocumentTests(ITestOutputHelper testOutputHelper) : AbstractR // If you want to generate the "after" state simple run the test without // creating the expected file, and it will be generated for you. // - // Things that aren't (yet?) supported: - // * Formatting must change the input state or the test will hang - // ie. these tests cannot be used for pure validation - // * Test input is always placed in a .razor file, so .cshtml specific - // quirks can't be validated - // - // You'll just have to write tests for those ones :P + // NOTE: Formatting must change the input state or the test will hang + // ie. these tests cannot be used for pure validation [IdeTheory] - [InlineData("BadlyFormattedCounter.razor")] - [InlineData("FormatCommentWithKeyword.cshtml")] - [InlineData("FormatDocument.cshtml")] - [InlineData("FormatDocumentAfterEdit.cshtml")] - [InlineData("FormatDocumentWithTextAreaAttributes.cshtml")] - [InlineData("FormatIfBlockInsideForBlock.cshtml")] - [InlineData("FormatOnPaste.cshtml")] - [InlineData("FormatOnPasteContainedLanguageCode.cshtml")] - [InlineData("FormatSelection.cshtml")] - [InlineData("FormatSelectionStartingWithContainedLanguageCode.cshtml")] - [InlineData("FormatSwitchCaseBlock.cshtml")] - [InlineData("RazorInCssClassAttribute.cshtml")] + [MemberData(nameof(GetFormattingTestResourceNames))] public async Task FormattingDocument(string testFileName) { var inputResourceName = GetResourceName(testFileName, "Input"); @@ -92,8 +76,11 @@ public async Task FormattingDocument(string testFileName) AssertEx.EqualOrDiff(expected, actual); } + private static string GetResourceBaseName() + => $"{typeof(FormatDocumentTests).Namespace}.Formatting.TestFiles"; + private static string GetResourceName(string name, string suffix) - => $"{typeof(FormatDocumentTests).Namespace}.Formatting.TestFiles.{suffix}.{name}"; + => $"{GetResourceBaseName()}.{suffix}.{name}"; private static bool TryGetResource(string name, [NotNullWhen(true)] out string? value) { @@ -112,4 +99,21 @@ private static bool TryGetResource(string name, [NotNullWhen(true)] out string? return true; } + + public static TheoryData GetFormattingTestResourceNames() + { + var baseName = $"{GetResourceBaseName()}.Input."; + var data = new TheoryData(); + var names = typeof(FormatDocumentTests).Assembly.GetManifestResourceNames(); + + foreach (var name in names) + { + if (name.StartsWith(baseName)) + { + data.Add(Path.GetFileName(name)[baseName.Length..]); + } + } + + return data; + } } From eba6a6a303e420992b5fbf13ee4e84fa0fa79fbf Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 28 Aug 2024 14:21:37 +1000 Subject: [PATCH 234/386] Test for some edges just in case --- .../Formatting_NetFx/HtmlFormattingTest.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs index 08f596cf0ad..6ef32d08326 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs @@ -211,6 +211,38 @@ This is heavily nested """); } + [Fact] + public async Task FormatAttributeStyles() + { + await RunFormattingTestAsync( + input: """ +
Some Text
+
Some Text
+
Some Text
+
Some Text
+
Some Text
+ +
+
+
+
+
+ """, + expected: """ +
Some Text
+
Some Text
+
Some Text
+
Some Text
+
Some Text
+ +
+
+
+
+
+ """); + } + [Fact] public async Task FormatsMixedRazorBlock() { From acb9a8e19d3a4ac31d422580463c6bccc7c39ded Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 28 Aug 2024 15:01:34 +1000 Subject: [PATCH 235/386] Update compiler test baselines --- ...iveWithViewImports_DesignTime.codegen.html | 2 +- .../BasicComponent_DesignTime.codegen.html | 10 +- .../Basic_DesignTime.codegen.html | 8 +- ...completeDirectives_DesignTime.codegen.html | 22 ++-- .../InheritsViewModel_DesignTime.codegen.html | 4 +- ...itsWithViewImports_DesignTime.codegen.html | 4 +- .../InjectWithModel_DesignTime.codegen.html | 6 +- ...njectWithSemicolon_DesignTime.codegen.html | 10 +- .../Inject_DesignTime.codegen.html | 2 +- ...alidNamespaceAtEOF_DesignTime.codegen.html | 2 +- ...ormedPageDirective_DesignTime.codegen.html | 2 +- ...xpressionTagHelper_DesignTime.codegen.html | 8 +- .../Model_DesignTime.codegen.html | 2 +- .../MultipleModels_DesignTime.codegen.html | 4 +- .../PageWithNamespace_DesignTime.codegen.html | 4 +- ...adingPageDirective_DesignTime.codegen.html | 2 +- ...lableModel_LangNew_DesignTime.codegen.html | 10 +- ...NullableModel_LangNew_Runtime.codegen.html | 10 +- ...lableModel_LangOld_DesignTime.codegen.html | 10 +- ...NullableModel_LangOld_Runtime.codegen.html | 10 +- ...lableModel_LangNew_DesignTime.codegen.html | 10 +- ...NullableModel_LangNew_Runtime.codegen.html | 10 +- ...lableModel_LangOld_DesignTime.codegen.html | 10 +- ...NullableModel_LangOld_Runtime.codegen.html | 10 +- ...sWithRouteTemplate_DesignTime.codegen.html | 14 +-- ...rPagesWithoutModel_DesignTime.codegen.html | 22 ++-- .../RazorPages_DesignTime.codegen.html | 26 ++-- .../Sections_DesignTime.codegen.html | 10 +- .../UsingDirectives_DesignTime.codegen.html | 8 +- ...ComponentTagHelper_DesignTime.codegen.html | 6 +- .../ViewWithNamespace_DesignTime.codegen.html | 2 +- .../_ViewImports_DesignTime.codegen.html | 2 +- ...TagHelperDirective_DesignTime.codegen.html | 2 +- ...AttributeDirective_DesignTime.codegen.html | 8 +- ...argetingTagHelpers_DesignTime.codegen.html | 6 +- .../Await_DesignTime.codegen.html | 30 ++--- .../BasicTagHelpers_DesignTime.codegen.html | 6 +- ...agHelpers_Prefixed_DesignTime.codegen.html | 6 +- ...rs_RemoveTagHelper_DesignTime.codegen.html | 6 +- .../Blocks_DesignTime.codegen.html | 28 ++--- .../CSharp7_DesignTime.codegen.html | 44 +++---- .../CSharp8_DesignTime.codegen.html | 66 +++++----- ...ockWithTextElement_DesignTime.codegen.html | 2 +- .../CodeBlock_DesignTime.codegen.html | 4 +- .../ComplexTagHelpers_DesignTime.codegen.html | 40 +++--- ...itionalAttributes2_DesignTime.codegen.html | 28 ++--- ...ditionalAttributes_DesignTime.codegen.html | 18 +-- ...agHelperAttributes_DesignTime.codegen.html | 6 +- .../DesignTime_DesignTime.codegen.html | 10 +- ...ttributeTagHelpers_DesignTime.codegen.html | 6 +- ...ateTargetTagHelper_DesignTime.codegen.html | 4 +- ...ttributeTagHelpers_DesignTime.codegen.html | 16 +-- ...ttributeTagHelpers_DesignTime.codegen.html | 2 +- .../EnumTagHelpers_DesignTime.codegen.html | 14 +-- .../EscapedExpression_DesignTime.codegen.html | 8 +- .../EscapedIdentifier_DesignTime.codegen.html | 16 +-- .../EscapedTagHelpers_DesignTime.codegen.html | 4 +- ...ExplicitExpression_DesignTime.codegen.html | 2 +- .../ExpressionsInCode_DesignTime.codegen.html | 14 +-- ...ctionsBlockMinimal_DesignTime.codegen.html | 6 +- .../FunctionsBlock_DesignTime.codegen.html | 12 +- .../HiddenSpansInCode_DesignTime.codegen.html | 2 +- .../Implements_DesignTime.codegen.html | 6 +- ...ImplicitExpression_DesignTime.codegen.html | 2 +- ...completeDirectives_DesignTime.codegen.html | 36 +++--- ...ncompleteTagHelper_DesignTime.codegen.html | 2 +- .../Inherits_DesignTime.codegen.html | 4 +- .../InlineBlocks_DesignTime.codegen.html | 4 +- .../Instrumented_DesignTime.codegen.html | 28 ++--- .../MarkupInCodeBlock_DesignTime.codegen.html | 4 +- ...locksWithTagHelper_DesignTime.codegen.html | 38 +++--- ...arkup_InCodeBlocks_DesignTime.codegen.html | 34 ++--- ...inimizedTagHelpers_DesignTime.codegen.html | 2 +- .../NestedCSharp_DesignTime.codegen.html | 4 +- .../NestedCodeBlocks_DesignTime.codegen.html | 4 +- ...criptTagTagHelpers_DesignTime.codegen.html | 6 +- .../NestedTagHelpers_DesignTime.codegen.html | 2 +- .../NoLinePragmas_DesignTime.codegen.html | 30 ++--- ...itionalExpressions_DesignTime.codegen.html | 16 +-- .../OpenedIf_DesignTime.codegen.html | 2 +- .../ParserError_DesignTime.codegen.html | 4 +- ...ttributeTagHelpers_DesignTime.codegen.html | 18 +-- .../RazorComments_DesignTime.codegen.html | 18 +-- ...TagHelperDirective_DesignTime.codegen.html | 2 +- .../Sections_DesignTime.codegen.html | 12 +- .../SimpleTagHelpers_DesignTime.codegen.html | 2 +- .../SimpleUnspacedIf_DesignTime.codegen.html | 2 +- ...trolFlowStatements_DesignTime.codegen.html | 116 +++++++++--------- ...neBeforeAttributes_DesignTime.codegen.html | 4 +- .../SingleTagHelper_DesignTime.codegen.html | 4 +- .../StringLiterals_DesignTime.codegen.html | 4 +- ...n_RecursivePattern_DesignTime.codegen.html | 18 +-- ...bolBoundAttributes_DesignTime.codegen.html | 10 +- ...agHelpersInSection_DesignTime.codegen.html | 12 +- ...ithBoundAttributes_DesignTime.codegen.html | 4 +- ...DataDashAttributes_DesignTime.codegen.html | 4 +- ...gHelpersWithPrefix_DesignTime.codegen.html | 6 +- ...elpersWithTemplate_DesignTime.codegen.html | 18 +-- ...lySpacedAttributes_DesignTime.codegen.html | 8 +- .../Templates_DesignTime.codegen.html | 40 +++--- ...agHelperAttributes_DesignTime.codegen.html | 18 +-- ...edExpressionInCode_DesignTime.codegen.html | 2 +- .../Usings_DesignTime.codegen.html | 20 +-- .../Usings_OutOfOrder_DesignTime.codegen.html | 34 ++--- 104 files changed, 641 insertions(+), 641 deletions(-) diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.codegen.html index 5d66b1d977c..31b236ec01c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.codegen.html @@ -1 +1 @@ -~~~~~~~~~~ ~~~~~~~~~~~~~~ \ No newline at end of file +/*~~~~~~*/ /*~~~~~~~~~~*/ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_DesignTime.codegen.html index 29671e2e94e..d50f0aa7edc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_DesignTime.codegen.html @@ -1,9 +1,9 @@ -~~~~~~~~~~~ ~~~~~~~~~~~ -
+/*~~~~~~~*/ /*~~~~~~~*/ +
Hello world - ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ + /*~~~~~~~~~~~~~~~~~*/ /*~~~~*/
-~~~~~~~~~~ ~ - ~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~ +/*~~~~~~*/ ~ + /**/ /*~~~~~~~~~~~~~~~~~~*/ ~ ~ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.html index 24e2e736663..5ed5d03cb0a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.html @@ -1,8 +1,8 @@ -
+
Hello world - ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ + /*~~~~~~~~~~~~~~~~~*/ /*~~~~*/
~~ - ~~~ ~~~ ~ ~~~~~~ + ~~~ ~~~ ~ /*~~*/ ~ -

+

diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.html index 3b4d82ad8bf..b7aa7c9942e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.html @@ -1,15 +1,15 @@ -~~ ~~~~~ ~~~~ ~~~~~ ~~~~~~~~ ~~~~ ~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~ ~~~~~~ ~~ +~~ /*~*/ /**/ /*~*/ /*~~~~*/ /**/ /*~~~~~~~*/ /*~~~~~~*/ /*~~~~~~*/ /*~*/ /*~~*/ ~~ -~~~~~ -~~~~~ -~~~~~ " +/*~*/ +/*~*/ +/*~*/ " -~~~~~~ -~~~~~~ +/*~~*/ +/*~~*/ -~~~~~~~ -~~~~~~~ -~~~~~~~ ~~~~~~~~~~~~~~~~~ +/*~~~*/ +/*~~~*/ +/*~~~*/ /*~~~~~~~~~~~~~*/ -~~~~~~~~~~ -~~~~~~~~~~ +/*~~~~~~*/ +/*~~~~~~*/ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.codegen.html index d4a60595cdc..91063890b07 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.codegen.html @@ -1,2 +1,2 @@ -~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~ +/*~~~~~*/ /*~~~~~~~~~~~~~~~~~~~~~~*/ +/*~~*/ /*~~~*/ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.codegen.html index 496639ef56f..3bd4c5872cc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.codegen.html @@ -1,2 +1,2 @@ -~~~~~ -~~~~~~ ~~~~~~~ +/*~*/ +/*~~*/ /*~~~*/ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.codegen.html index 981eb0e1f2f..cfb2e63f00b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.codegen.html @@ -1,3 +1,3 @@ -~~~~~~ ~~~~~~~ -~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~ -~~~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~ +/*~~*/ /*~~~*/ +/*~~~*/ /*~*/ /*~~~~~~~~~~*/ +/*~~~*/ /*~~~~~~~~~~~~~*/ /**/ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.codegen.html index ceeac4385ba..d9302bcff03 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.codegen.html @@ -1,5 +1,5 @@ -~~~~~~ ~~~~~~~ -~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~~ -~~~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ -~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~~ ~ -~~~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~ +/*~~*/ /*~~~*/ +/*~~~*/ /*~*/ /*~~~~~~~~~~~*/ +/*~~~*/ /*~~~~~~~~~~~~~*/ /*~*/ +/*~~~*/ /*~*/ /*~~~~~~~~~~~*/ ~ +/*~~~*/ /*~~~~~~~~~~~~~*/ /*~*/ ~ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.codegen.html index 0dc8f50e6be..f4385cddb0e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.codegen.html @@ -1 +1 @@ -~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~ +/*~~~*/ /*~*/ /*~~~~~~~~~~*/ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.codegen.html index 626e2018bdd..76e928baf80 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.codegen.html @@ -1 +1 @@ -~~~~~~~~~~ Test. \ No newline at end of file +/*~~~~~~*/ Test. \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.codegen.html index df04496106b..a7889e3c07e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.codegen.html @@ -1,4 +1,4 @@ -~~~~~ "foo +/*~*/ "foo

About Us

We are awesome.

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.codegen.html index 9ac477264fa..d960ab45c14 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.codegen.html @@ -1,6 +1,6 @@ -~~~~~~ ~~~~~~~~ +/*~~*/ /*~~~~*/ -~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ +/*~~~~~~~~~*/ /*~~~~~~~~~~~~~~~~*/ /*~~~~*/ - - + + diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.codegen.html index a35472a2d2f..2d38dc6a64c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.codegen.html @@ -1 +1 @@ -~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/*~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~*/ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.codegen.html index a707958a381..cdc19a67ddf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.codegen.html @@ -1,2 +1,2 @@ -~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/*~~*/ /*~~~~~~~~~~~~~~~~~*/ +/*~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~*/ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.codegen.html index 62560e0be27..6e90b5c956b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.codegen.html @@ -1,3 +1,3 @@ -~~~~~ -~~~~~~~~~~ ~~~~~~~~~~~~~~ +/*~*/ +/*~~~~~~*/ /*~~~~~~~~~~*/

Hi There!

diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_DesignTime.codegen.html index 236c4e85314..0266c6d5a88 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_DesignTime.codegen.html @@ -1,2 +1,2 @@ 
Some text here.
-~~~~~ +/*~*/ diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.codegen.html index c696270a401..4cbbdb41940 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.codegen.html @@ -1,7 +1,7 @@ -~~~~~ -~~~~~~ ~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~ +/*~*/ +/*~~*/ /*~~~~~~~~~*/ +/*~~*/ /*~~~~~*/ -

~~~~~~~~~~~

+

/*~~~~~~~*/

-

~~~~~~~~~~~~~~~

\ No newline at end of file +

/*~~~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.html index c696270a401..4cbbdb41940 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.html @@ -1,7 +1,7 @@ -~~~~~ -~~~~~~ ~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~ +/*~*/ +/*~~*/ /*~~~~~~~~~*/ +/*~~*/ /*~~~~~*/ -

~~~~~~~~~~~

+

/*~~~~~~~*/

-

~~~~~~~~~~~~~~~

\ No newline at end of file +

/*~~~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.codegen.html index c696270a401..4cbbdb41940 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.codegen.html @@ -1,7 +1,7 @@ -~~~~~ -~~~~~~ ~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~ +/*~*/ +/*~~*/ /*~~~~~~~~~*/ +/*~~*/ /*~~~~~*/ -

~~~~~~~~~~~

+

/*~~~~~~~*/

-

~~~~~~~~~~~~~~~

\ No newline at end of file +

/*~~~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.html index c696270a401..4cbbdb41940 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.html @@ -1,7 +1,7 @@ -~~~~~ -~~~~~~ ~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~ +/*~*/ +/*~~*/ /*~~~~~~~~~*/ +/*~~*/ /*~~~~~*/ -

~~~~~~~~~~~

+

/*~~~~~~~*/

-

~~~~~~~~~~~~~~~

\ No newline at end of file +

/*~~~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.codegen.html index 0de886d9a8d..6db933daefa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.codegen.html @@ -1,7 +1,7 @@ -~~~~~ -~~~~~~ ~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~~ +/*~*/ +/*~~*/ /*~~~~~~~~~*/ +/*~~*/ /*~~~~~~*/ -

~~~~~~~~~~~

+

/*~~~~~~~*/

-

~~~~~~~~~~~~~~~

\ No newline at end of file +

/*~~~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.html index 0de886d9a8d..6db933daefa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.html @@ -1,7 +1,7 @@ -~~~~~ -~~~~~~ ~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~~ +/*~*/ +/*~~*/ /*~~~~~~~~~*/ +/*~~*/ /*~~~~~~*/ -

~~~~~~~~~~~

+

/*~~~~~~~*/

-

~~~~~~~~~~~~~~~

\ No newline at end of file +

/*~~~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.codegen.html index 0de886d9a8d..6db933daefa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.codegen.html @@ -1,7 +1,7 @@ -~~~~~ -~~~~~~ ~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~~ +/*~*/ +/*~~*/ /*~~~~~~~~~*/ +/*~~*/ /*~~~~~~*/ -

~~~~~~~~~~~

+

/*~~~~~~~*/

-

~~~~~~~~~~~~~~~

\ No newline at end of file +

/*~~~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.html index 0de886d9a8d..6db933daefa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.html @@ -1,7 +1,7 @@ -~~~~~ -~~~~~~ ~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~~ +/*~*/ +/*~~*/ /*~~~~~~~~~*/ +/*~~*/ /*~~~~~~*/ -

~~~~~~~~~~~

+

/*~~~~~~~*/

-

~~~~~~~~~~~~~~~

\ No newline at end of file +

/*~~~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.codegen.html index 02367c51f7e..ed8901a2a44 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.codegen.html @@ -1,13 +1,13 @@ -~~~~~ ~~~~~~~~ +/*~*/ /*~~~~*/ -~~~~~~ ~~~~~~~~ -~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/*~~*/ /*~~~~*/ +/*~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -~~~~~~~~~~ ~ - ~~~~~~ ~~~~~ ~~~~~~~~ ~ ~~~~~~~~~ +/*~~~~~~*/ ~ + /*~~*/ /*~*/ /*~~~~*/ ~ /*~~~~~*/ ~ - ~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~ + /*~~*/ /*~~*/ /**/ ~ /**/ /**/ ~ ~ ~ -

New Customer ~~~~~~~~~~~

+

New Customer /*~~~~~~~*/

diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.html index daab158b7d1..56b48a10d01 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.html @@ -1,20 +1,20 @@ -~~~~~ +/*~*/ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~ -~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~*/ +/*~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -~~~~~~~~~~ ~ - ~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~ +/*~~~~~~*/ ~ + /*~~*/ /*~~~~~~~~~*/ /*~~~~~~~~~~~*/ /*~~~~~*/ ~ - ~~~~ ~ ~~~~~~~~~~~~~~ - ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /**/ ~ /*~~~~~~~~~~*/ + /*~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ ~ - ~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~ + /*~~*/ /*~~*/ /**/ ~ /**/ /**/ ~ - ~~~~~~ ~~~~~ ~~~~~~~~ + /*~~*/ /*~*/ /*~~~~*/ ~ - ~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~ + /*~~*/ /*~~*/ /**/ ~ /**/ /**/ ~ ~ ~ @@ -22,7 +22,7 @@

New Customer

- +
diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.html index 64f7eac8c2a..deaa4ef67ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.html @@ -1,24 +1,24 @@ -~~~~~ +/*~*/ -~~~~~~ ~~~~~~~~ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~ -~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/*~~*/ /*~~~~*/ +/*~~~~~~~~~*/ ~~~ /*~~~~*/ +/*~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -~~~~~~~~~~ ~ - ~~~~~~ ~~~~~ ~~~~~~~~ ~ ~~~~~~~~~ +/*~~~~~~*/ ~ + /*~~*/ /*~*/ /*~~~~*/ ~ /*~~~~~*/ ~ - ~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~ + /*~~*/ /*~~~~~~~~~*/ /*~~~~~~~~~~~*/ /*~~~~~*/ ~ - ~~~~ ~ ~~~~~~~~~~~~~~ - ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /**/ ~ /*~~~~~~~~~~*/ + /*~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ ~ - ~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~ + /*~~*/ /*~~*/ /**/ ~ /**/ /**/ ~ ~ - ~~~~~~ ~~~~~ ~~~~~~~~ + /*~~*/ /*~*/ /*~~~~*/ ~ - ~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~ + /*~~*/ /*~~*/ /**/ ~ /**/ /**/ ~ ~ ~ @@ -26,7 +26,7 @@

New Customer

- +
diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.html index dde1bb31217..9e7818b9ab4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.html @@ -1,14 +1,14 @@ -~~~~~~ ~~~~~~~~ +/*~~*/ /*~~~~*/ -~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ +/*~~~~~~~~~*/ /*~~~~~~~~~~~~~~~~*/ /*~~~~*/ ~~ - ~~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /*~~*/ ~ /*~~~~~~~~~~~~~~~~~~~~~~~~*/ ~
Some body
-~~~~~~~~ ~~~~~~~~ ~ +/*~~~~*/ /*~~~~*/ ~
This is in Section 1
- + ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.codegen.html index ade006860ec..0764100ac8d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.codegen.html @@ -1,4 +1,4 @@ -~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~~~~~~~~~~ -~~~~~~ ~~~~~~ -~~~~~~ ~~~~~~ \ No newline at end of file +/*~~*/ /*~~~~~~~~~~~~~~~~~*/ +/*~~*/ /*~~~~~~~~~~~~~~*/ +/*~~*/ /*~~*/ +/*~~*/ /*~~*/ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.codegen.html index 8027d8fb1b8..772a14b598b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.codegen.html @@ -1,6 +1,6 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~*/ ~~ - ~~~ ~~~ ~ ~~~~~~~~ + ~~~ ~~~ ~ /*~~~~*/ ~ - \ No newline at end of file + \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.codegen.html index 63bfdf58d91..1c4043833a8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.codegen.html @@ -1,2 +1,2 @@ -~~~~~~~~~~ ~~~~~~~~~~~~~~ +/*~~~~~~*/ /*~~~~~~~~~~*/

Hi There!

diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.codegen.html index a9823b39aac..b5872a65558 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.codegen.html @@ -1 +1 @@ -~~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~ \ No newline at end of file +/*~~~*/ /*~~~~~~~~~~~~~~~*/ /*~~*/ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.codegen.html index 36ca9ed4def..c29aeeb42f8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_DesignTime.codegen.html @@ -1 +1 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.codegen.html index b0994b12416..4538c8e34a1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective_DesignTime.codegen.html @@ -1,6 +1,6 @@ -~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ -~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ -~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ +/*~~~~~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +/*~~~~~~*/ /*~~~~~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~*/ /*~~~~~~~*/ +/*~~~~~~*/ /*~~~~~~~~~~~~~~~~~~~~*/ /*~~~~~~~~~~~~~~~*/ /*~~~~~~~~~~~~~~~~~*/ +/*~~~~~~*/ /*~~~~~~~~~~~~~~~~~~*/ /*~~~~~~~~~~~~~~~~~*/ Hello World \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.html index 29fdc470b4e..94086a0e60e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers_DesignTime.codegen.html @@ -1,8 +1,8 @@ -~~~~~~~~~~~~~ ~~ ~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~ /*~~~~~~~~*/

HelloWorld

- - + +

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.codegen.html index 2cd2f153d8a..39991e0bcb4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await_DesignTime.codegen.html @@ -1,26 +1,26 @@ -~~~~~~~~~~ ~ - ~~~~~~ ~~~~~ ~~~~~~~~~~~~ ~~~~~ +/*~~~~~~*/ ~ + /*~~*/ /*~*/ /*~~~~~~~~*/ /*~*/ ~ - ~~~~~~ ~~~~~~ + /*~~*/ /*~~*/ ~ ~

Basic Asynchronous Expression Test

-

Basic Asynchronous Expression: ~~~~~~ ~~~~~

-

Basic Asynchronous Template: ~~~~~~~ ~~~~~~

-

Basic Asynchronous Statement: ~~ ~~~~~ ~~~~~~ ~

-

Basic Asynchronous Statement Nested: ~~ ~~~~~~ ~~~~~ ~

-

Basic Incomplete Asynchronous Statement: ~~~~~~

+

Basic Asynchronous Expression: /*~~*/ /*~*/

+

Basic Asynchronous Template: /*~~~*/ /*~~*/

+

Basic Asynchronous Statement: ~~ /*~*/ /*~~*/ ~

+

Basic Asynchronous Statement Nested: ~~ /*~~*/ /*~*/ ~

+

Basic Incomplete Asynchronous Statement: /*~~*/

Advanced Asynchronous Expression Test

-

Advanced Asynchronous Expression: ~~~~~~ ~~~~~~ ~~

-

Advanced Asynchronous Expression Extended: ~~~~~~ ~~~~~~~~~~ ~~

-

Advanced Asynchronous Template: ~~~~~~~ ~~~~~~~~~~ ~~~~~~

-

Advanced Asynchronous Statement: ~~ ~~~~~ ~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~ ~

-

Advanced Asynchronous Statement Extended: ~~ ~~~~~ ~~~~~~~~~~ ~~ ~

-

Advanced Asynchronous Statement Nested: ~~ ~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~ ~

-

Advanced Incomplete Asynchronous Statement: ~~~~~~ ~~~~~~~~~~~~~

+

Advanced Asynchronous Expression: /*~~*/ /*~~*/ ~~

+

Advanced Asynchronous Expression Extended: /*~~*/ /*~~~~~~*/ ~~

+

Advanced Asynchronous Template: /*~~~*/ /*~~~~~~*/ /*~~*/

+

Advanced Asynchronous Statement: ~~ /*~*/ /*~~~~~~~~~~*/ /*~~*/ /*~~~~~*/ ~

+

Advanced Asynchronous Statement Extended: ~~ /*~*/ /*~~~~~~*/ ~~ ~

+

Advanced Asynchronous Statement Nested: ~~ /*~~*/ /*~~~~~~~~~~*/ /*~~*/ ~

+

Advanced Incomplete Asynchronous Statement: /*~~*/ /*~~~~~~~~~*/

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.html index a7977c2f3eb..a1b48a80492 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_DesignTime.codegen.html @@ -1,9 +1,9 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/

- - + +

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.html index 83791946e75..64cc9386aad 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed_DesignTime.codegen.html @@ -1,10 +1,10 @@ -~~~~~~~~~~~~~~~~ ~~~~~ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~~~~*/ /*~*/ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/

- +
\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.codegen.html index 241c86f381f..ed4d8edb834 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper_DesignTime.codegen.html @@ -1,10 +1,10 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ +/*~~~~~~~~~~~~*/ /*~~~~~~~~~~*/ /*~*/

- +

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.codegen.html index c8e3d6d849d..eb6ccef7af1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks_DesignTime.codegen.html @@ -2,36 +2,36 @@ ~~~ ~ ~ ~~ ~ -~~~~~~~~ ~~ ~~~ ~ -

Hello from C#, #~~~~

+/*~~~~*/ ~~ ~~~ ~ +

Hello from C#, #/**/

~ ~~ ~~ ~ -~~~~~ ~~ ~~~ ~ +/*~*/ ~~ ~~~ ~

We wrote 10 lines!

~ -~~~~~~~~~~ ~ - ~~~~ ~~~ +/*~~~~~~*/ ~ + /**/ ~~~

No really, we wrote 10 lines!

- ~~~~~~ - ~~~~~~~~ + /*~~*/ + /*~~~~*/

Actually, we didn't...

- ~~~~~~ + /*~~*/ ~ -~~~~~~~~ ~ ~ ~~ ~ ~~ ~~~ ~ ~~ ~~ ~ -

Hello again from C#, #~~~~

+/*~~~~*/ ~ ~ ~~ ~ ~~ ~~~ ~ ~~ ~~ ~ +

Hello again from C#, #/**/

~ -~~~~ ~ +/**/ ~

That time, we wrote 5 lines!

-~ ~~~~~~~~~~~~~~~ ~~~ ~ -

Oh no! An error occurred: ~~~~~~~~~~~~~

+~ /*~~~~~~~~~~~*/ ~~~ ~ +

Oh no! An error occurred: /*~~~~~~~~~*/

~

i is now ~~

-~~~~~~~~~ ~~~~~~~~~ ~ +/*~~~~~*/ /*~~~~~*/ ~

This block is locked, for your security!

~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.codegen.html index bbfa490f37a..a3f50faa4ee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7_DesignTime.codegen.html @@ -1,43 +1,43 @@  ~~ - ~~~ ~~~~~~~~~~ ~ ~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~ ~~~~~~~~~~ ~~~~~~ ~~~~~~~~~ ~~~~~~ ~~~~~~~~~ + ~~~ /*~~~~~~*/ ~ ~~~ /*~~~~~~~~~~~~~~*/ /*~~~*/ /*~~~~~~*/ /*~~*/ /*~~~~~*/ /*~~*/ /*~~~~~*/ ~ - ~~~~~~ ~~~~~ ~ ~~~~~~~~ ~~~~~~ ~~~~~ + /*~~*/ /*~*/ ~ /*~~~~*/ /*~~*/ /*~*/ ~~ - ~~ ~~~~ ~~ ~~~ ~~ ~ ~~~~ ~~~~ ~~~~~~ ~~~~~ ~~ + ~~ /**/ ~~ ~~~ ~~ ~ /**/ /**/ /*~~*/ /*~*/ ~~ - ~~~ ~~~~~~~ ~ ~~~~~~~~~~~~ - ~~~~ ~~~~~~~~~~~~~~~~~~~ ~ ~~~~~~~~~~~~~~~~ - ~~~~~~ ~~~~~~~~~~~~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~ - ~~~~~~~ ~~~~~~~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ /*~~~*/ ~ /*~~~~~~~~*/ + /**/ /*~~~~~~~~~~~~~~~*/ ~ /*~~~~~~~~~~~~*/ + /*~~*/ /*~~~~~~~~~~~~*/ ~ /*~~~~~~~~~~~~~~~~~~~~~*/ + /*~~~*/ /*~~~~~~~*/ ~ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ ~ - ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ ~~~ ~~~ ~~~~~~~ + ~~~ /*~~~~~~~~~~~~~~~~~~~~~~~~~*/ /*~*/ ~~~ ~~~ /*~~~*/ ~ - ~~ ~~~~~~~~~~~~ ~~ ~~~~ ~~~~~~ + ~~ /*~~~~~~~~*/ ~~ /**/ /*~~*/ ~ - ~~ ~~ ~~~~~~~~~ + ~~ ~~ /*~~~~~*/ ~ ~

- Here's a very unique number: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Here's a very unique number: /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

- ~~~~~~~~~ ~~~~~~~ ~~~~~ ~~~~~~~~~~~~~ ~~ ~~~~~ ~~~~~~ ~~ + /*~~~~~*/ /*~~~*/ /*~*/ /*~~~~~~~~~*/ ~~ /*~*/ /*~~*/ ~~
- ~~~~~~~ ~~~~~~~~~~~~~ + /*~~~*/ /*~~~~~~~~~*/ ~ - ~~~~ ~~~ ~~~~ - ~~ ~~ ~~~~~~~~~ - ~~~~~~ - ~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ - ~~ ~~ ~~~~ ~~~~~~~~~ - ~~~~~~ - ~~~~ ~~~~~ - ~~ ~~ ~~~~ ~~~~ ~~ ~~~~~~~~~ - ~~~~~~ + /**/ ~~~ /**/ + ~~ ~~ /*~~~~~*/ + /*~~*/ + /**/ /*~~~~~~~~~~~~~~~*/ /*~~~~~~~~~~*/ + ~~ ~~ /**/ /*~~~~~*/ + /*~~*/ + /**/ /*~*/ + ~~ ~~ /**/ /**/ ~~ /*~~~~~*/ + /*~~*/ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.codegen.html index b2ada4d5846..aa7e750f48d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8_DesignTime.codegen.html @@ -1,67 +1,67 @@ -~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ +/*~~*/ /*~~~~~~~~~~~~~~~~~~~~~~*/ ~~ - ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ + /*~~~~~~~~~~~~~~~~~~*/ /*~~~~~~~~~~~~~~~~*/ ~ - ~~~~~~ ~~~~~ + /*~~*/ /*~*/ ~ - ~~~~~ ~~~~~~~ ~~~~ ~~~ ~~ ~~~~~~~~~~~~~~~~~~~~~ + /*~*/ /*~~~*/ /**/ ~~~ ~~ /*~~~~~~~~~~~~~~~~~*/ ~ ~ - ~~~~~ ~~~~~ ~ ~~~~~ - ~~~~~ ~~~ ~~~~~~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /*~*/ /*~*/ ~ /*~*/ + /*~*/ ~~~ /*~~~~~~*/ ~ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - ~~~ ~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~ - ~~~ ~~~~~~~~ ~ ~~~~~~~~~~ - ~~~~~~ ~~~~~~~~ ~~~~~~~~~ + ~~~ /*~*/ ~ /*~~~~~~~~~~~~~~~~~~*/ + ~~~ /*~~~~*/ ~ /*~~~~~~*/ + /*~~*/ /*~~~~*/ /*~~~~~*/ ~ - ~~~~~~ ~~~~~~~~~~~~~~~ + /*~~*/ /*~~~~~~~~~~~*/ ~ ~ -~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~ +/*~~~~~~~~*/ +/*~~~~~~~~~~~~*/ -~~~~~~~~~~ ~~~~~~ +/*~~~~~~*/ /*~~*/ ~ - ~~~~~~~~~~~~~~ ~~ ~~~~ ~~~~~~~~ - ~~~~~~~~~~~~~~~ ~~ ~~~~ ~~~~~~~~~ - ~ ~~ ~~~~ ~~~~~~~~ + /*~~~~~~~~~~*/ ~~ /**/ /*~~~~*/ + /*~~~~~~~~~~~*/ ~~ /**/ /*~~~~~*/ + ~ ~~ /**/ /*~~~~*/ ~~ -~~~~~~ ~~~~~~~ ~~~~ ~~~ ~~ ~~~~~~~~~~~~~~~~~~~~~ +/*~~*/ /*~~~*/ /**/ ~~~ ~~ /*~~~~~~~~~~~~~~~~~*/ ~ - ~~~~ + /**/ ~ -~~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~~~~~~~ +/*~~~~~~~~~*/ +/*~~~~~~~~~~~~~~~~~*/ +/*~~~~~~~~~~~~~~~~~~*/ -~~~~~~~~~~ ~ - ~~~~ ~~~~~~~~ +/*~~~~~~*/ ~ + /**/ /*~~~~*/ ~ - ~~~~~~ - ~~~~~~ + /*~~*/ + /*~~*/ ~ - ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ + /*~~~~~~~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /*~~*/ ~ - ~~~ ~~~~~~~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ /*~~~~~~~*/ ~ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + /*~~*/ /*~~~~~~~~~~~~~~~~~~~*/ ~ - ~~~~~~~ ~~~~~~ ~~~~~~ ~ ~~~~ ~~~~ ~ + /*~~~*/ /*~~*/ /*~~*/ ~ /**/ /**/ ~ - ~~~~~~~ ~~~~~~~~~ ~~~~~~ ~ ~~~~ ~~~~ ~ + /*~~~*/ /*~~~~~*/ /*~~*/ ~ /**/ /**/ ~ - ~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~ ~~~~~~~~~~~ ~ ~~~~ ~~~~ ~ + /*~~~*/ /*~~~~~~~*/ /*~~~~*/ /*~~~~~~~*/ ~ /**/ /**/ ~ - ~~~~~~~ ~~~~~ ~~~~~ + /*~~~*/ /*~*/ /*~*/ ~ - ~~~~~~ ~~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~ + /*~~*/ /*~~~*/ /**/ ~ /**/ /**/ ~ ~ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.codegen.html index bc136f506a6..03876c01edf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement_DesignTime.codegen.html @@ -1,4 +1,4 @@ ~~ ~~~ ~ ~ ~~ foo - ~~~ ~ ~ ~~ bar ~~~~~~ + ~~~ ~ ~ ~~ bar /*~~*/ ~ diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.codegen.html index f9dbfc45c01..0a78d260923 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock_DesignTime.codegen.html @@ -1,5 +1,5 @@ ~~ - ~~~~~~~ ~ ~ ~~ ~ ~~ ~~~ ~~~~ ~ - ~~~~~~~~~~~~~~~~~~~~~~ ~~~~ ~~~ ~~ ~ ~~~~~~~~~~~~ ~ ~~~~~~~~ + /*~~~*/ ~ ~ ~~ ~ ~~ ~~~ /**/ ~ + /*~~~~~~~~~~~~~~~~~~*/ /**/ ~~~ ~~ ~ /*~~~~~~~~*/ ~ /*~~~~*/ ~ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.html index a8544403c47..e3c4cd8dade 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers_DesignTime.codegen.html @@ -1,38 +1,38 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ -~~~ ~~~~~~ +~~~ /*~~*/ ~ - ~~~ ~~~~~~~~ ~ ~~~~~~~~~~~ + ~~~ /*~~~~*/ ~ /*~~~~~~~*/
-

-

+

+

Set Time:

- ~~~ ~~~~~~~ + ~~~ /*~~~*/ ~

New Time:

~ - ~~~~ + /**/ ~ -

Current Time:

- - +

Current Time:

+ + ~

-

- ~~ ~~~ ~~~~~~~ ~ ~~~~~~~ - +

+ ~~ ~~~ /*~~~*/ ~ /*~~~*/ +

-

- +

+

-

- +

+

-

- +

+

- ~~~~~~~~~~~~~

~ + /*~~~~~~~~~*/

~

~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.codegen.html index 3981b69f586..afb7b659f30 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.codegen.html @@ -1,22 +1,22 @@ ~~ - ~~~ ~~ ~ ~~~~~ - ~~~ ~~~ ~ ~~~~~~ - ~~~ ~ ~ ~~~~~~ + ~~~ ~~ ~ /*~*/ + ~~~ ~~~ ~ /*~~*/ + ~~~ ~ ~ /*~~*/ -

-

-

+

+

+

-

+

- -

-

+ +

+

-

x

+

x

-

x

-

x

-

x

+

x

+

x

+

x

~ diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.codegen.html index 323da7fe613..15d9955bf53 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes_DesignTime.codegen.html @@ -1,16 +1,16 @@ ~~ - ~~~ ~~ ~ ~~~~~ - ~~~ ~~~ ~ ~~~~~~ + ~~~ ~~ ~ /*~*/ + ~~~ ~~~ ~ /*~~*/
-

-

-

+

+

+

-

+

- - + + -

+

~ diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.codegen.html index d4f55031d2f..8e21e54367e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes_DesignTime.codegen.html @@ -1,13 +1,13 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ 2 TagHelpers. 1 TagHelper. 2 TagHelpers -2 TagHelpers +2 TagHelpers 0 TagHelpers. 1 TagHelper 1 TagHelper -1 TagHelper +1 TagHelper \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.codegen.html index d4fa4e75c16..006ecf00a0e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime_DesignTime.codegen.html @@ -1,15 +1,15 @@ 

- ~~~~~~~~ ~ ~ ~~ ~ ~~ ~~~ ~~~~ ~ + /*~~~~*/ ~ ~ ~~ ~ ~~ ~~~ /**/ ~

This is item #~~

~

-~~~~~~~~~~~~~~~ -~~~~~~

Bar ~~~~ Biz

~ +/*~~~~~~~~~~~*/ +/*~~*/

Bar /**/ Biz

~

-~~~~~~~~ ~~~~~~ ~ +/*~~~~*/ /*~~*/ ~

Foo

- ~~~~ + /**/ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.html index 790e3bed02b..a84297901e6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers_DesignTime.codegen.html @@ -1,7 +1,7 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/

- - + +

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.html index ffcfa6aa75b..07b52c13950 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper_DesignTime.codegen.html @@ -1,3 +1,3 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ - \ No newline at end of file + \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.html index 2ec57a6f889..21503f3ffb2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers_DesignTime.codegen.html @@ -1,14 +1,14 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ - + - + - + - + - + - \ No newline at end of file + \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.html index 1d1a1dccf6e..abb4af9f7da 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers_DesignTime.codegen.html @@ -1,4 +1,4 @@ -~~~~~~~~~~~~~ ~~ ~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~ /*~~~~~~~~*/
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.html index 502b2ba29ce..459ec2118cf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers_DesignTime.codegen.html @@ -1,11 +1,11 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ ~~ - ~~~ ~~~~~~~~~ ~ ~~~~~~~~~~~~~~~ + ~~~ /*~~~~~*/ ~ /*~~~~~~~~~~~*/ ~ - - - - - + + + + + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.codegen.html index ec43fd7f175..c9f6298277c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.codegen.html @@ -1,5 +1,5 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ - - - + + + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.codegen.html index 37e0121757a..a423d0868e6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier_DesignTime.codegen.html @@ -1,11 +1,11 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ ~~ - ~~~ ~~~~~ ~ ~~~~ - ~~~ ~~~~~ ~ ~~~~~ - ~~~ ~~~ ~ ~~~ ~ ~~~ ~ ~~~~~~~~~ ~~ - ~~~ ~~~~ ~ ~~~ ~ ~~~~~ ~ ~~~ ~~~~~~~~~~~~~~~~~~~~~ ~ ~~~~~~ ~~~~~ ~ ~~ + ~~~ /*~*/ ~ /**/ + ~~~ /*~*/ ~ /*~*/ + ~~~ ~~~ ~ ~~~ ~ ~~~ ~ /*~~~~~*/ ~~ + ~~~ /**/ ~ ~~~ ~ /*~*/ ~ ~~~ /*~~~~~~~~~~~~~~~~~*/ ~ /*~~*/ /*~*/ ~ ~~ ~ - - - + + + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.html index 5a7ee1c8e99..330c5968da2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers_DesignTime.codegen.html @@ -1,8 +1,8 @@ -~~~~~~~~~~~~~ ~~ ~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~ /*~~~~~~~~*/ - Not a TagHelper: + Not a TagHelper: \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.codegen.html index de64a85c025..1968612c862 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression_DesignTime.codegen.html @@ -1 +1 @@ -1 + 1 = ~~~~~~ \ No newline at end of file +1 + 1 = /*~~*/ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.codegen.html index 6705095c5a8..7cc8aafa571 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode_DesignTime.codegen.html @@ -1,16 +1,16 @@ ~~ - ~~~~~~ ~~~ ~ ~~~~~ - ~~~~~~ ~~~ ~ ~~~~~~ + /*~~*/ ~~~ ~ /*~*/ + /*~~*/ ~~~ ~ /*~~*/ ~ -~~~~~~~ ~~ ~~~~~ ~ - ~~~~ -~ ~~~~ ~ +/*~~~*/ ~~ /*~*/ ~ + /**/ +~ /**/ ~

Foo is Null!

~

-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ - ~~~~~~~~~~~~~~~~~~ ~~~~~ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ ~ + /*~~~~~~~~~~~~~~*/ /*~*/ ~

\ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.codegen.html index 3b426fe7e50..482708e173a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal_DesignTime.codegen.html @@ -1,7 +1,7 @@  - ~~~~~~~~~~~ -~~~~~~ ~~~~~~~~~~ ~~~~~~ ~ - ~~~~~~ ~~~~~ ~ ~~~~ + /*~~~~~~~*/ +/*~~*/ /*~~~~~~*/ /*~~*/ ~ + /*~~*/ /*~*/ ~ /**/ ~ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.codegen.html index 6486d498a3d..78f2d99505b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock_DesignTime.codegen.html @@ -1,12 +1,12 @@ -~~~~~~~~~~ ~ +/*~~~~~~*/ ~ ~ -~~~~~~~~~~ ~ - ~~~~~~ ~~~~~ ~ ~~~ ~~~~~~~~~ - ~~~~~~~ ~~~ ~~~~~~~~~~~ ~ - ~~~~~~ ~~~~~~~~~~~~~ +/*~~~~~~*/ ~ + /*~~*/ /*~*/ ~ ~~~ /*~~~~~*/ + /*~~~*/ ~~~ /*~~~~~~~*/ ~ + /*~~*/ /*~~~~~~~~~*/ ~ ~ -Here's a random number: ~~~~~~~~~~~~ \ No newline at end of file +Here's a random number: /*~~~~~~~~*/ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.codegen.html index 994e8efc2cc..3cd74d11b6f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode_DesignTime.codegen.html @@ -1,3 +1,3 @@ ~~ - ~~~~ + /**/ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.codegen.html index 86e588c23bd..7490626ee6d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.codegen.html @@ -1,5 +1,5 @@ -~~~~~~~~~~~ ~~~~~~~~~~~ +/*~~~~~~~*/ /*~~~~~~~*/ -~~~~~~~~~~ ~ - ~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~ ~ +/*~~~~~~*/ ~ + /**/ /*~~~~~~~~~~~~~~~~~*/ ~ ~ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.codegen.html index 11d9506a659..575be17a330 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.codegen.html @@ -1,3 +1,3 @@ -~~~~~~~~ ~ ~ ~~ ~ ~~ ~~~ ~~~~ ~ +/*~~~~*/ ~ ~ ~~ ~ ~~ ~~~ /**/ ~

This is item #~~

~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.html index d8a9146ac9b..b8e8517b76c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.html @@ -1,25 +1,25 @@ -~~ ~~~~~ ~~~~ ~~~~~ ~~~~~~~~ ~~~~ ~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~ ~~~~~~ ~~ +~~ /*~*/ /**/ /*~*/ /*~~~~*/ /**/ /*~~~~~~~*/ /*~~~~~~*/ /*~~~~~~*/ /*~*/ /*~~*/ ~~ -~~~~~~~~~~~~~ -~~~~~~~~~~~~~ -~~~~~~~~~~~~~ ~ +/*~~~~~~~~~*/ +/*~~~~~~~~~*/ +/*~~~~~~~~~*/ ~ -~~~~~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~ ~ +/*~~~~~~~~~~~~*/ +/*~~~~~~~~~~~~*/ +/*~~~~~~~~~~~~*/ ~ -~~~~~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~ -~~~~~~~~~~~~~~~~ ~ +/*~~~~~~~~~~~~*/ +/*~~~~~~~~~~~~*/ +/*~~~~~~~~~~~~*/ ~ -~~~~~~~~~ -~~~~~~~~~ +/*~~~~~*/ +/*~~~~~*/ -~~~~~~~~~~ -~~~~~~~~~~ +/*~~~~~~*/ +/*~~~~~~*/ -~~~~~~~~ -~~~~~~~~ +/*~~~~*/ +/*~~~~*/ -~~~~~~~~ { -~~~~~~~~~~ ~ \ No newline at end of file +/*~~~~*/ { +/*~~~~~~*/ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.html index 40b68fd5b19..ba70622d969 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.html @@ -1,3 +1,3 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/

# ~" /> +/*~~~~*/ /**/(string link) { + } \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.codegen.html index 523f914f69d..a89de497f3e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.codegen.html @@ -5,34 +5,34 @@

Hello, World

~ -~~~~~~~~ ~~ ~~~ ~ -

Hello from C#, #~~~~

+/*~~~~*/ ~~ ~~~ ~ +

Hello from C#, #/**/

~ ~~ ~~ ~ -~~~~~ ~~ ~~~ ~ +/*~*/ ~~ ~~~ ~

We wrote 10 lines!

~ -~~~~~~~~~~ ~ - ~~~~ ~~~ +/*~~~~~~*/ ~ + /**/ ~~~

No really, we wrote 10 lines!

- ~~~~~~ - ~~~~~~~~ + /*~~*/ + /*~~~~*/

Actually, we didn't...

- ~~~~~~ + /*~~*/ ~ -~~~~~~~~ ~ ~ ~~ ~ ~~ ~~~ ~ ~~ ~~ ~ -

Hello again from C#, #~~~~

+/*~~~~*/ ~ ~ ~~ ~ ~~ ~~~ ~ ~~ ~~ ~ +

Hello again from C#, #/**/

~ -~~~~ ~ +/**/ ~

That time, we wrote 5 lines!

-~ ~~~~~~~~~~~~~~~ ~~~ ~ -

Oh no! An error occurred: ~~~~~~~~~~~~~

+~ /*~~~~~~~~~~~*/ ~~~ ~ +

Oh no! An error occurred: /*~~~~~~~~~*/

~ -~~~~~~~~~ ~~~~~~~~~ ~ +/*~~~~~*/ /*~~~~~*/ ~

This block is locked, for your security!

~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.codegen.html index cab63f7d85e..c267bf19829 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.codegen.html @@ -1,5 +1,5 @@ ~~ - ~~~~~~~ ~ ~ ~~ ~ ~~ ~~~ ~~~~ ~ -

Hello from C#, #~~~~~~~~~~~~~~~

+ /*~~~*/ ~ ~ ~~ ~ ~~ ~~~ /**/ ~ +

Hello from C#, #/*~~~~~~~~~~~*/

~ ~ diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.codegen.html index 94cb1ec258d..d8704691b59 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.codegen.html @@ -1,47 +1,47 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ ~~ - ~~~ ~~~~~~ ~ ~~~ ~~~~~~~~ + ~~~ /*~~*/ ~ ~~~ /*~~~~*/ ~ - ~~~ ~~~~~~~~ ~ ~~~~ ~ ~~~~~~~~~ ~~~ ~ ~~~ ~~ + ~~~ /*~~~~*/ ~ /**/ ~ /*~~~~~*/ ~~~ ~ ~~~ ~~ ~~ - ~~~~ ~~~~~~~~~~~~~~~~ ~~~~~~~ + /**/ /*~~~~~~~~~~~~*/ /*~~~*/ ~ -
~~~~~~~~~~~~
+
/*~~~~~~~~*/
~ ~ -~~ ~~~~~~~~~~~~~~~~~~~~~ ~ -~~ ~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ +~~ /*~~~~~~~~~~~~~~~~~*/ ~ +~~ /*~*/ /*~~~~~~~~~~~~~~~~~~~~~~~~*/ ~ -~~~~~~~~~~ ~ - ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ +/*~~~~~~*/ ~ + /**/ /*~~~~~~~~~~~~~~~~~~~*/ /*~~~*/ ~ - ~~~ ~~~~~~~~~ ~ ~~~~~ ~~~~~~~~~~~~~~~ + ~~~ /*~~~~~*/ ~ /*~*/ /*~~~~~~~~~~~*/
-

Happy birthday ~~~~~~~~~~~~!

+

Happy birthday /*~~~~~~~~*/!

    - ~~~~ ~~~~ ~ ~ ~~ ~ ~ ~~~~~~~~~~ ~ ~~~ ~~~~ + /**/ /**/ ~ ~ ~~ ~ ~ /*~~~~~~*/ ~ ~~~ /**/ ~ -
  • ~~~~ Happy birthday!
  • +
  • /**/ Happy birthday!
  • ~
- ~~ ~~~~~~~~~~~ ~ ~~~ + ~~ /*~~~~~~~*/ ~ ~~~ ~ - ~~~~~~ ~~~~~~~~~~~~~~~~~~~ + /*~~*/ /*~~~~~~~~~~~~~~~*/ ~

Secret message

- ~~~~~~ ~~~~~~~~~~~~~~~~~~~ + /*~~*/ /*~~~~~~~~~~~~~~~*/ ~ - ~~~~~ ~~~~~~ + /*~*/ /*~~*/ ~ - ~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~ - ~~~~~~ ~~~ ~~~ ~ ~~~~ ~~~~ ~ + /*~~*/ /*~~*/ /**/ ~ /**/ /**/ ~ + /*~~*/ ~~~ ~~~ ~ /**/ /**/ ~ ~ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.codegen.html index ffd8006a48e..557deb22dc2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.codegen.html @@ -1,45 +1,45 @@  ~~ - ~~~ ~~~~~~ ~ ~~~ ~~~~~~~~ + ~~~ /*~~*/ ~ ~~~ /*~~~~*/ ~ - ~~~ ~~~~~~~~ ~ ~~~~ ~ ~~~~~~~~~ ~~~ ~ ~~~ ~ + ~~~ /*~~~~*/ ~ /**/ ~ /*~~~~~*/ ~~~ ~ ~~~ ~ ~~ - ~~~~ ~~~~~~~~~~~~~~~~ ~~~~~~~ + /**/ /*~~~~~~~~~~~~*/ /*~~~*/ ~ -
~~~~~~~~~~~~
+
/*~~~~~~~~*/
~ ~ -~~ ~~~~~~~~~~~~~~~~~~~~ ~ -~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ +~~ /*~~~~~~~~~~~~~~~~*/ ~ +~~ /*~~~~~~~~~~~~~~~~~~~~~~~~*/ ~ -~~~~~~~~~~ ~ - ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ +/*~~~~~~*/ ~ + /**/ /*~~~~~~~~~~~~~~~~~~~*/ /*~~~*/ ~ - ~~~ ~~~~~~~~~ ~ ~~~~~ ~~~~~~~~~~~~~~~ + ~~~ /*~~~~~*/ ~ /*~*/ /*~~~~~~~~~~~*/
-

Happy birthday ~~~~~~~~~~~~!

+

Happy birthday /*~~~~~~~~*/!

    - ~~~~ ~~~~ ~ ~ ~~ ~ ~ ~~~~~~~~~~ ~ ~~~ ~~~~ + /**/ /**/ ~ ~ ~~ ~ ~ /*~~~~~~*/ ~ ~~~ /**/ ~ -
  • ~~~~ Happy birthday!
  • +
  • /**/ Happy birthday!
  • ~
- ~~ ~~~~~~~~~~~ ~ ~~~ + ~~ /*~~~~~~~*/ ~ ~~~ ~ - ~~~~~~~ + /*~~~*/ ~

Secret message

~ - ~~~~~ ~~~~~~ + /*~*/ /*~~*/ ~ - ~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~ - ~~~~~~ ~~~ ~~~ ~ ~~~~ ~~~~ ~ + /*~~*/ /*~~*/ /**/ ~ /**/ /**/ ~ + /*~~*/ ~~~ ~~~ ~ /**/ /**/ ~ ~ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.codegen.html index 1a6335ea467..7e2de8666d2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.codegen.html @@ -1,4 +1,4 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.codegen.html index eed8d5cc3f0..a97a9dfd6bd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.codegen.html @@ -1,8 +1,8 @@ ~~ - ~~~~~~~~ ~~~~ ~~~~~~ ~~ ~~~~~~~~~~~~~ + /*~~~~*/ /**/ /*~~*/ ~~ /*~~~~~~~~~*/ ~

- ~~~~~~~~~~~~~~~~~. + /*~~~~~~~~~~~~~*/.
~ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.codegen.html index 8c9dd15aba7..1307d485615 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.codegen.html @@ -1,4 +1,4 @@ -~~~~~~~~ ~ - ~~~~~~~~ ~ +/*~~~~*/ ~ + /*~~~~*/ ~ ~ ~ \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.html b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.html index 86dd6dcdf7c..de7ee0ff7f9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.html +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.html @@ -1,11 +1,11 @@ -~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~ +/*~~~~~~~~~*/ ~~~ /*~~~~~~~~~*/ ~ } \ No newline at end of file diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/TestFiles/Input/CshtmlWithScript.cshtml b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/TestFiles/Input/CshtmlWithScript.cshtml index 7cefd6acf19..c0f80a29675 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/TestFiles/Input/CshtmlWithScript.cshtml +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/Formatting/TestFiles/Input/CshtmlWithScript.cshtml @@ -48,7 +48,5 @@ urlTwo: "@Request.PathBase/two", @(Model.IncludeData15.HasValue ? FormattableString.Invariant($"data15: {(Model.Data15.Value ? "true" : "false")},") : null) @(Model.IncludeData16.HasValue ? FormattableString.Invariant($"data16: {(Model.Data16.Value ? "true" : "false")},") : null) @(Model.IncludeData17.Length > 0 ? Html.Raw(FormattableString.Invariant($"static: {{ data1: {Json.Serialize(Model.Data1)}, data2: {Json.Serialize(Model.Data2)}, data3: {Json.Serialize(Model.Data3)}, data4: {Json.Serialize(Model.Data4)} }},")) : null) - }).start(); - }; } \ No newline at end of file From ec671dbc8a15dcf9409e06e3711c2b2b66680ce5 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 28 Aug 2024 21:12:33 +1000 Subject: [PATCH 240/386] Fix find all references calls to Roslyn --- ...orCustomMessageTarget_FindAllReferences.cs | 48 +++++++++++++++++++ ...ustomMessageTarget_TextDocumentPosition.cs | 4 -- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_FindAllReferences.cs diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_FindAllReferences.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_FindAllReferences.cs new file mode 100644 index 00000000000..8420acfa157 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_FindAllReferences.cs @@ -0,0 +1,48 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using StreamJsonRpc; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Endpoints; + +internal partial class RazorCustomMessageTarget +{ + [JsonRpcMethod(CustomMessageNames.RazorReferencesEndpointName, UseSingleObjectParameterDeserialization = true)] + public async Task ReferencesAsync(DelegatedPositionParams request, CancellationToken cancellationToken) + { + var delegationDetails = await GetProjectedRequestDetailsAsync(request, cancellationToken).ConfigureAwait(false); + if (delegationDetails is null) + { + return default; + } + + var referenceParams = new ReferenceParams() + { + TextDocument = new VSTextDocumentIdentifier() + { + Uri = delegationDetails.Value.ProjectedUri, + ProjectContext = null, + }, + Position = request.ProjectedPosition, + Context = new ReferenceContext(), + }; + + var response = await _requestInvoker.ReinvokeRequestOnServerAsync( + delegationDetails.Value.TextBuffer, + Methods.TextDocumentReferencesName, + delegationDetails.Value.LanguageServerName, + referenceParams, + cancellationToken).ConfigureAwait(false); + + if (response is null) + { + return default; + } + + return response.Response; + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs index 5c11db83526..31716c290e5 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_TextDocumentPosition.cs @@ -29,10 +29,6 @@ internal partial class RazorCustomMessageTarget public Task> ImplementationAsync(DelegatedPositionParams request, CancellationToken cancellationToken) => DelegateTextDocumentPositionAndProjectContextAsync>(request, Methods.TextDocumentImplementationName, cancellationToken); - [JsonRpcMethod(CustomMessageNames.RazorReferencesEndpointName, UseSingleObjectParameterDeserialization = true)] - public Task ReferencesAsync(DelegatedPositionParams request, CancellationToken cancellationToken) - => DelegateTextDocumentPositionAndProjectContextAsync(request, Methods.TextDocumentReferencesName, cancellationToken); - [JsonRpcMethod(CustomMessageNames.RazorSignatureHelpEndpointName, UseSingleObjectParameterDeserialization = true)] public Task SignatureHelpAsync(DelegatedPositionParams request, CancellationToken cancellationToken) => DelegateTextDocumentPositionAndProjectContextAsync(request, Methods.TextDocumentSignatureHelpName, cancellationToken); From f35b6c6fe964e7d4a9f710ac482364f14267410b Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Wed, 28 Aug 2024 10:11:29 -0700 Subject: [PATCH 241/386] Change UseConsolidatedMvcViews to default to true (#10795) * Change UseConsolidatedMvcViews to default to true * Update baselines * Update LSP test --- ...ctiveWithViewImports_DesignTime.codegen.cs | 4 +- ...DirectiveWithViewImports_DesignTime.ir.txt | 4 +- ...iveWithViewImports_DesignTime.mappings.txt | 2 +- ...irectiveWithViewImports_Runtime.codegen.cs | 6 +- ...uteDirectiveWithViewImports_Runtime.ir.txt | 4 +- .../Basic_DesignTime.codegen.cs | 4 +- .../Basic_DesignTime.ir.txt | 4 +- .../Basic_DesignTime.mappings.txt | 12 +-- .../Basic_Runtime.codegen.cs | 6 +- .../Basic_Runtime.ir.txt | 4 +- ...IncompleteDirectives_DesignTime.codegen.cs | 4 +- .../IncompleteDirectives_DesignTime.ir.txt | 4 +- ...completeDirectives_DesignTime.mappings.txt | 14 +-- .../IncompleteDirectives_Runtime.codegen.cs | 6 +- .../IncompleteDirectives_Runtime.ir.txt | 4 +- .../InheritsViewModel_DesignTime.codegen.cs | 4 +- .../InheritsViewModel_DesignTime.ir.txt | 4 +- .../InheritsViewModel_DesignTime.mappings.txt | 4 +- .../InheritsViewModel_Runtime.codegen.cs | 6 +- .../InheritsViewModel_Runtime.ir.txt | 4 +- ...eritsWithViewImports_DesignTime.codegen.cs | 4 +- .../InheritsWithViewImports_DesignTime.ir.txt | 4 +- ...itsWithViewImports_DesignTime.mappings.txt | 2 +- ...InheritsWithViewImports_Runtime.codegen.cs | 6 +- .../InheritsWithViewImports_Runtime.ir.txt | 4 +- .../InjectWithModel_DesignTime.codegen.cs | 4 +- .../InjectWithModel_DesignTime.ir.txt | 4 +- .../InjectWithModel_DesignTime.mappings.txt | 10 +- .../InjectWithModel_Runtime.codegen.cs | 6 +- .../InjectWithModel_Runtime.ir.txt | 4 +- .../InjectWithModel_Runtime.mappings.txt | 8 +- .../InjectWithSemicolon_DesignTime.codegen.cs | 4 +- .../InjectWithSemicolon_DesignTime.ir.txt | 4 +- ...njectWithSemicolon_DesignTime.mappings.txt | 18 ++-- .../InjectWithSemicolon_Runtime.codegen.cs | 6 +- .../InjectWithSemicolon_Runtime.ir.txt | 4 +- .../InjectWithSemicolon_Runtime.mappings.txt | 16 ++-- .../Inject_DesignTime.codegen.cs | 4 +- .../Inject_DesignTime.ir.txt | 4 +- .../Inject_DesignTime.mappings.txt | 4 +- .../Inject_Runtime.codegen.cs | 6 +- .../Inject_Runtime.ir.txt | 4 +- .../Inject_Runtime.mappings.txt | 4 +- ...nvalidNamespaceAtEOF_DesignTime.codegen.cs | 4 +- .../InvalidNamespaceAtEOF_DesignTime.ir.txt | 4 +- .../InvalidNamespaceAtEOF_Runtime.codegen.cs | 6 +- .../InvalidNamespaceAtEOF_Runtime.ir.txt | 4 +- ...lformedPageDirective_DesignTime.codegen.cs | 4 +- .../MalformedPageDirective_DesignTime.ir.txt | 4 +- .../MalformedPageDirective_Runtime.codegen.cs | 6 +- .../MalformedPageDirective_Runtime.ir.txt | 4 +- ...lExpressionTagHelper_DesignTime.codegen.cs | 4 +- ...ModelExpressionTagHelper_DesignTime.ir.txt | 4 +- ...xpressionTagHelper_DesignTime.mappings.txt | 8 +- ...odelExpressionTagHelper_Runtime.codegen.cs | 6 +- .../ModelExpressionTagHelper_Runtime.ir.txt | 4 +- .../Model_DesignTime.codegen.cs | 4 +- .../Model_DesignTime.ir.txt | 4 +- .../Model_DesignTime.mappings.txt | 2 +- .../Model_Runtime.codegen.cs | 6 +- .../Model_Runtime.ir.txt | 4 +- .../MultipleModels_DesignTime.codegen.cs | 4 +- .../MultipleModels_DesignTime.ir.txt | 4 +- .../MultipleModels_DesignTime.mappings.txt | 4 +- .../PageWithNamespace_DesignTime.codegen.cs | 2 +- .../PageWithNamespace_DesignTime.ir.txt | 2 +- .../PageWithNamespace_DesignTime.mappings.txt | 2 +- .../PageWithNamespace_Runtime.codegen.cs | 2 +- .../PageWithNamespace_Runtime.ir.txt | 2 +- ...LeadingPageDirective_DesignTime.codegen.cs | 4 +- ...thNoLeadingPageDirective_DesignTime.ir.txt | 4 +- ...hNoLeadingPageDirective_Runtime.codegen.cs | 6 +- ...eWithNoLeadingPageDirective_Runtime.ir.txt | 4 +- .../RazorPage_WithCssScope.codegen.cs | 6 +- .../RazorPage_WithCssScope.ir.txt | 4 +- ...ullableModel_LangNew_DesignTime.codegen.cs | 4 +- ...NonNullableModel_LangNew_DesignTime.ir.txt | 4 +- ...lableModel_LangNew_DesignTime.mappings.txt | 8 +- ...onNullableModel_LangNew_Runtime.codegen.cs | 6 +- ...ithNonNullableModel_LangNew_Runtime.ir.txt | 4 +- ...NullableModel_LangNew_Runtime.mappings.txt | 6 +- ...ullableModel_LangOld_DesignTime.codegen.cs | 4 +- ...NonNullableModel_LangOld_DesignTime.ir.txt | 4 +- ...lableModel_LangOld_DesignTime.mappings.txt | 8 +- ...onNullableModel_LangOld_Runtime.codegen.cs | 6 +- ...ithNonNullableModel_LangOld_Runtime.ir.txt | 4 +- ...NullableModel_LangOld_Runtime.mappings.txt | 6 +- ...ullableModel_LangNew_DesignTime.codegen.cs | 4 +- ...ithNullableModel_LangNew_DesignTime.ir.txt | 4 +- ...lableModel_LangNew_DesignTime.mappings.txt | 8 +- ...thNullableModel_LangNew_Runtime.codegen.cs | 6 +- ...e_WithNullableModel_LangNew_Runtime.ir.txt | 4 +- ...NullableModel_LangNew_Runtime.mappings.txt | 6 +- ...ullableModel_LangOld_DesignTime.codegen.cs | 4 +- ...ithNullableModel_LangOld_DesignTime.ir.txt | 4 +- ...lableModel_LangOld_DesignTime.mappings.txt | 8 +- ...thNullableModel_LangOld_Runtime.codegen.cs | 6 +- ...e_WithNullableModel_LangOld_Runtime.ir.txt | 4 +- ...NullableModel_LangOld_Runtime.mappings.txt | 6 +- ...gesWithRouteTemplate_DesignTime.codegen.cs | 4 +- ...orPagesWithRouteTemplate_DesignTime.ir.txt | 4 +- ...sWithRouteTemplate_DesignTime.mappings.txt | 10 +- ...rPagesWithRouteTemplate_Runtime.codegen.cs | 6 +- ...RazorPagesWithRouteTemplate_Runtime.ir.txt | 4 +- ...zorPagesWithoutModel_DesignTime.codegen.cs | 4 +- .../RazorPagesWithoutModel_DesignTime.ir.txt | 4 +- ...rPagesWithoutModel_DesignTime.mappings.txt | 8 +- .../RazorPagesWithoutModel_Runtime.codegen.cs | 6 +- .../RazorPagesWithoutModel_Runtime.ir.txt | 4 +- .../RazorPages_DesignTime.codegen.cs | 4 +- .../RazorPages_DesignTime.ir.txt | 4 +- .../RazorPages_DesignTime.mappings.txt | 10 +- .../RazorPages_Runtime.codegen.cs | 6 +- .../RazorPages_Runtime.ir.txt | 4 +- .../RazorView_Layout_WithCssScope.codegen.cs | 6 +- .../RazorView_Layout_WithCssScope.ir.txt | 4 +- .../RazorView_WithCssScope.codegen.cs | 6 +- .../RazorView_WithCssScope.ir.txt | 4 +- ...bleModel_NullableContextEnabled.codegen.cs | 6 +- ...ullableModel_NullableContextEnabled.ir.txt | 4 +- ...eBaseType_NullableContexEnabled.codegen.cs | 6 +- ...lableBaseType_NullableContexEnabled.ir.txt | 4 +- ...bleModel_NullableContextEnabled.codegen.cs | 6 +- ...ullableModel_NullableContextEnabled.ir.txt | 4 +- ...Model_NullableContextNotEnabled.codegen.cs | 6 +- ...ableModel_NullableContextNotEnabled.ir.txt | 4 +- .../Sections_DesignTime.codegen.cs | 4 +- .../Sections_DesignTime.ir.txt | 4 +- .../Sections_DesignTime.mappings.txt | 10 +- .../Sections_Runtime.codegen.cs | 6 +- .../Sections_Runtime.ir.txt | 4 +- .../UsingDirectives_DesignTime.codegen.cs | 4 +- .../UsingDirectives_DesignTime.ir.txt | 4 +- .../UsingDirectives_DesignTime.mappings.txt | 8 +- .../UsingDirectives_Runtime.codegen.cs | 6 +- .../UsingDirectives_Runtime.ir.txt | 4 +- ...tTagHelperOptionalParam_Runtime.codegen.cs | 30 +++--- ...onentTagHelperOptionalParam_Runtime.ir.txt | 28 +++--- ...ewComponentTagHelper_DesignTime.codegen.cs | 8 +- .../ViewComponentTagHelper_DesignTime.ir.txt | 8 +- ...ComponentTagHelper_DesignTime.mappings.txt | 6 +- .../ViewComponentTagHelper_Runtime.codegen.cs | 10 +- .../ViewComponentTagHelper_Runtime.ir.txt | 8 +- .../ViewWithNamespace_DesignTime.codegen.cs | 2 +- .../ViewWithNamespace_DesignTime.ir.txt | 2 +- .../ViewWithNamespace_DesignTime.mappings.txt | 2 +- .../ViewWithNamespace_Runtime.codegen.cs | 2 +- .../ViewWithNamespace_Runtime.ir.txt | 2 +- .../_ViewImports_DesignTime.codegen.cs | 4 +- .../_ViewImports_DesignTime.ir.txt | 4 +- .../_ViewImports_DesignTime.mappings.txt | 4 +- .../_ViewImports_Runtime.codegen.cs | 6 +- .../_ViewImports_Runtime.ir.txt | 4 +- ...ddTagHelperDirective_DesignTime.codegen.cs | 4 +- .../AddTagHelperDirective_DesignTime.ir.txt | 4 +- ...TagHelperDirective_DesignTime.mappings.txt | 2 +- .../AddTagHelperDirective_Runtime.codegen.cs | 6 +- .../AddTagHelperDirective_Runtime.ir.txt | 4 +- .../AttributeDirective_DesignTime.codegen.cs | 4 +- .../AttributeDirective_DesignTime.ir.txt | 4 +- ...AttributeDirective_DesignTime.mappings.txt | 8 +- .../AttributeDirective_Runtime.codegen.cs | 6 +- .../AttributeDirective_Runtime.ir.txt | 4 +- ...eTargetingTagHelpers_DesignTime.codegen.cs | 4 +- ...ibuteTargetingTagHelpers_DesignTime.ir.txt | 4 +- ...argetingTagHelpers_DesignTime.mappings.txt | 6 +- ...buteTargetingTagHelpers_Runtime.codegen.cs | 6 +- ...ttributeTargetingTagHelpers_Runtime.ir.txt | 4 +- .../Await_DesignTime.codegen.cs | 4 +- .../Await_DesignTime.cs-diagnostics.txt | 4 +- .../Await_DesignTime.ir.txt | 4 +- .../Await_DesignTime.mappings.txt | 34 +++---- .../Await_Runtime.codegen.cs | 6 +- .../Await_Runtime.cs-diagnostics.txt | 4 +- .../Await_Runtime.ir.txt | 4 +- .../BasicTagHelpers_DesignTime.codegen.cs | 4 +- .../BasicTagHelpers_DesignTime.ir.txt | 4 +- .../BasicTagHelpers_DesignTime.mappings.txt | 6 +- ...cTagHelpers_Prefixed_DesignTime.codegen.cs | 4 +- ...BasicTagHelpers_Prefixed_DesignTime.ir.txt | 4 +- ...agHelpers_Prefixed_DesignTime.mappings.txt | 6 +- ...asicTagHelpers_Prefixed_Runtime.codegen.cs | 6 +- .../BasicTagHelpers_Prefixed_Runtime.ir.txt | 4 +- ...pers_RemoveTagHelper_DesignTime.codegen.cs | 4 +- ...gHelpers_RemoveTagHelper_DesignTime.ir.txt | 4 +- ...rs_RemoveTagHelper_DesignTime.mappings.txt | 6 +- ...Helpers_RemoveTagHelper_Runtime.codegen.cs | 6 +- ...cTagHelpers_RemoveTagHelper_Runtime.ir.txt | 4 +- .../BasicTagHelpers_Runtime.codegen.cs | 6 +- .../BasicTagHelpers_Runtime.ir.txt | 4 +- .../Blocks_DesignTime.codegen.cs | 4 +- .../Blocks_DesignTime.ir.txt | 4 +- .../Blocks_DesignTime.mappings.txt | 38 ++++---- .../Blocks_Runtime.codegen.cs | 6 +- .../Blocks_Runtime.ir.txt | 4 +- .../CSharp7_DesignTime.codegen.cs | 4 +- .../CSharp7_DesignTime.ir.txt | 4 +- .../CSharp7_DesignTime.mappings.txt | 12 +-- .../CSharp7_Runtime.codegen.cs | 6 +- .../CSharp7_Runtime.ir.txt | 4 +- .../CSharp8_DesignTime.codegen.cs | 4 +- .../CSharp8_DesignTime.ir.txt | 4 +- .../CSharp8_DesignTime.mappings.txt | 24 ++--- .../CSharp8_Runtime.codegen.cs | 6 +- .../CSharp8_Runtime.ir.txt | 4 +- .../CodeBlockAtEOF_DesignTime.codegen.cs | 4 +- .../CodeBlockAtEOF_DesignTime.ir.txt | 4 +- .../CodeBlockAtEOF_DesignTime.mappings.txt | 2 +- .../CodeBlockAtEOF_Runtime.codegen.cs | 6 +- .../CodeBlockAtEOF_Runtime.ir.txt | 4 +- ...BlockWithTextElement_DesignTime.codegen.cs | 4 +- ...CodeBlockWithTextElement_DesignTime.ir.txt | 4 +- ...ockWithTextElement_DesignTime.mappings.txt | 8 +- ...odeBlockWithTextElement_Runtime.codegen.cs | 6 +- .../CodeBlockWithTextElement_Runtime.ir.txt | 4 +- .../CodeBlock_DesignTime.codegen.cs | 4 +- .../CodeBlock_DesignTime.ir.txt | 4 +- .../CodeBlock_DesignTime.mappings.txt | 2 +- .../CodeBlock_Runtime.codegen.cs | 6 +- .../CodeBlock_Runtime.ir.txt | 4 +- .../ComplexTagHelpers_DesignTime.codegen.cs | 4 +- .../ComplexTagHelpers_DesignTime.ir.txt | 4 +- .../ComplexTagHelpers_DesignTime.mappings.txt | 80 ++++++++-------- .../ComplexTagHelpers_Runtime.codegen.cs | 6 +- .../ComplexTagHelpers_Runtime.ir.txt | 4 +- ...nditionalAttributes2_DesignTime.codegen.cs | 4 +- .../ConditionalAttributes2_DesignTime.ir.txt | 4 +- ...itionalAttributes2_DesignTime.mappings.txt | 92 +++++++++---------- .../ConditionalAttributes2_Runtime.codegen.cs | 6 +- .../ConditionalAttributes2_Runtime.ir.txt | 4 +- ...onditionalAttributes_DesignTime.codegen.cs | 4 +- .../ConditionalAttributes_DesignTime.ir.txt | 4 +- ...ditionalAttributes_DesignTime.mappings.txt | 48 +++++----- .../ConditionalAttributes_Runtime.codegen.cs | 6 +- .../ConditionalAttributes_Runtime.ir.txt | 4 +- ...rTagHelperAttributes_DesignTime.codegen.cs | 4 +- ...ectorTagHelperAttributes_DesignTime.ir.txt | 4 +- ...agHelperAttributes_DesignTime.mappings.txt | 8 +- ...ctorTagHelperAttributes_Runtime.codegen.cs | 6 +- ...SelectorTagHelperAttributes_Runtime.ir.txt | 4 +- .../DesignTime_DesignTime.codegen.cs | 4 +- .../DesignTime_DesignTime.ir.txt | 4 +- .../DesignTime_DesignTime.mappings.txt | 18 ++-- .../DesignTime_Runtime.codegen.cs | 6 +- .../DesignTime_Runtime.ir.txt | 4 +- ...eAttributeTagHelpers_DesignTime.codegen.cs | 4 +- ...icateAttributeTagHelpers_DesignTime.ir.txt | 4 +- ...ttributeTagHelpers_DesignTime.mappings.txt | 8 +- ...cateAttributeTagHelpers_Runtime.codegen.cs | 6 +- ...uplicateAttributeTagHelpers_Runtime.ir.txt | 4 +- ...icateTargetTagHelper_DesignTime.codegen.cs | 4 +- ...DuplicateTargetTagHelper_DesignTime.ir.txt | 4 +- ...ateTargetTagHelper_DesignTime.mappings.txt | 4 +- ...uplicateTargetTagHelper_Runtime.codegen.cs | 6 +- .../DuplicateTargetTagHelper_Runtime.ir.txt | 4 +- ...cAttributeTagHelpers_DesignTime.codegen.cs | 4 +- ...namicAttributeTagHelpers_DesignTime.ir.txt | 4 +- ...ttributeTagHelpers_DesignTime.mappings.txt | 62 ++++++------- ...amicAttributeTagHelpers_Runtime.codegen.cs | 6 +- .../DynamicAttributeTagHelpers_Runtime.ir.txt | 4 +- ...yAttributeTagHelpers_DesignTime.codegen.cs | 4 +- ...EmptyAttributeTagHelpers_DesignTime.ir.txt | 4 +- ...ttributeTagHelpers_DesignTime.mappings.txt | 8 +- ...mptyAttributeTagHelpers_Runtime.codegen.cs | 6 +- .../EmptyAttributeTagHelpers_Runtime.ir.txt | 4 +- .../EmptyCodeBlock_DesignTime.codegen.cs | 4 +- .../EmptyCodeBlock_DesignTime.ir.txt | 4 +- .../EmptyCodeBlock_DesignTime.mappings.txt | 2 +- .../EmptyCodeBlock_Runtime.codegen.cs | 6 +- .../EmptyCodeBlock_Runtime.ir.txt | 4 +- ...tyExplicitExpression_DesignTime.codegen.cs | 4 +- .../EmptyExplicitExpression_DesignTime.ir.txt | 4 +- ...ExplicitExpression_DesignTime.mappings.txt | 2 +- ...EmptyExplicitExpression_Runtime.codegen.cs | 6 +- .../EmptyExplicitExpression_Runtime.ir.txt | 4 +- ...icitExpressionInCode_DesignTime.codegen.cs | 4 +- ...ImplicitExpressionInCode_DesignTime.ir.txt | 4 +- ...itExpressionInCode_DesignTime.mappings.txt | 6 +- ...mplicitExpressionInCode_Runtime.codegen.cs | 6 +- ...ptyImplicitExpressionInCode_Runtime.ir.txt | 4 +- ...tyImplicitExpression_DesignTime.codegen.cs | 4 +- .../EmptyImplicitExpression_DesignTime.ir.txt | 4 +- ...ImplicitExpression_DesignTime.mappings.txt | 2 +- ...EmptyImplicitExpression_Runtime.codegen.cs | 6 +- .../EmptyImplicitExpression_Runtime.ir.txt | 4 +- .../EnumTagHelpers_DesignTime.codegen.cs | 4 +- .../EnumTagHelpers_DesignTime.ir.txt | 4 +- .../EnumTagHelpers_DesignTime.mappings.txt | 18 ++-- .../EnumTagHelpers_Runtime.codegen.cs | 6 +- .../EnumTagHelpers_Runtime.ir.txt | 4 +- .../EscapedExpression_DesignTime.codegen.cs | 4 +- .../EscapedExpression_DesignTime.ir.txt | 4 +- .../EscapedExpression_DesignTime.mappings.txt | 8 +- .../EscapedExpression_Runtime.codegen.cs | 6 +- .../EscapedExpression_Runtime.ir.txt | 4 +- .../EscapedIdentifier_DesignTime.codegen.cs | 4 +- .../EscapedIdentifier_DesignTime.ir.txt | 4 +- .../EscapedIdentifier_DesignTime.mappings.txt | 14 +-- .../EscapedIdentifier_Runtime.codegen.cs | 6 +- .../EscapedIdentifier_Runtime.ir.txt | 4 +- .../EscapedTagHelpers_DesignTime.codegen.cs | 4 +- .../EscapedTagHelpers_DesignTime.ir.txt | 4 +- .../EscapedTagHelpers_DesignTime.mappings.txt | 8 +- .../EscapedTagHelpers_Runtime.codegen.cs | 6 +- .../EscapedTagHelpers_Runtime.ir.txt | 4 +- ...licitExpressionAtEOF_DesignTime.codegen.cs | 4 +- .../ExplicitExpressionAtEOF_DesignTime.ir.txt | 4 +- ...citExpressionAtEOF_DesignTime.mappings.txt | 2 +- ...ExplicitExpressionAtEOF_Runtime.codegen.cs | 6 +- .../ExplicitExpressionAtEOF_Runtime.ir.txt | 4 +- ...ExpressionWithMarkup_DesignTime.codegen.cs | 4 +- ...icitExpressionWithMarkup_DesignTime.ir.txt | 4 +- ...pressionWithMarkup_DesignTime.mappings.txt | 2 +- ...citExpressionWithMarkup_Runtime.codegen.cs | 6 +- ...xplicitExpressionWithMarkup_Runtime.ir.txt | 4 +- .../ExplicitExpression_DesignTime.codegen.cs | 4 +- .../ExplicitExpression_DesignTime.ir.txt | 4 +- ...ExplicitExpression_DesignTime.mappings.txt | 2 +- .../ExplicitExpression_Runtime.codegen.cs | 6 +- .../ExplicitExpression_Runtime.ir.txt | 4 +- .../ExpressionsInCode_DesignTime.codegen.cs | 4 +- .../ExpressionsInCode_DesignTime.ir.txt | 4 +- .../ExpressionsInCode_DesignTime.mappings.txt | 16 ++-- .../ExpressionsInCode_Runtime.codegen.cs | 6 +- .../ExpressionsInCode_Runtime.ir.txt | 4 +- ...unctionsBlockMinimal_DesignTime.codegen.cs | 4 +- .../FunctionsBlockMinimal_DesignTime.ir.txt | 4 +- ...ctionsBlockMinimal_DesignTime.mappings.txt | 2 +- .../FunctionsBlockMinimal_Runtime.codegen.cs | 6 +- .../FunctionsBlockMinimal_Runtime.ir.txt | 4 +- .../FunctionsBlock_DesignTime.codegen.cs | 4 +- .../FunctionsBlock_DesignTime.ir.txt | 4 +- .../FunctionsBlock_DesignTime.mappings.txt | 6 +- .../FunctionsBlock_Runtime.codegen.cs | 6 +- .../FunctionsBlock_Runtime.ir.txt | 4 +- .../HiddenSpansInCode_DesignTime.codegen.cs | 4 +- .../HiddenSpansInCode_DesignTime.ir.txt | 4 +- .../HiddenSpansInCode_DesignTime.mappings.txt | 4 +- .../HiddenSpansInCode_Runtime.codegen.cs | 6 +- .../HiddenSpansInCode_Runtime.ir.txt | 4 +- ...mentWithQuote_Double_DesignTime.codegen.cs | 4 +- ...lCommentWithQuote_Double_DesignTime.ir.txt | 4 +- ...CommentWithQuote_Double_Runtime.codegen.cs | 6 +- ...HtmlCommentWithQuote_Double_Runtime.ir.txt | 4 +- ...mentWithQuote_Single_DesignTime.codegen.cs | 4 +- ...lCommentWithQuote_Single_DesignTime.ir.txt | 4 +- ...CommentWithQuote_Single_Runtime.codegen.cs | 6 +- ...HtmlCommentWithQuote_Single_Runtime.ir.txt | 4 +- .../Implements_DesignTime.codegen.cs | 4 +- .../Implements_DesignTime.ir.txt | 4 +- .../Implements_DesignTime.mappings.txt | 4 +- .../Implements_Runtime.codegen.cs | 6 +- .../Implements_Runtime.ir.txt | 4 +- ...licitExpressionAtEOF_DesignTime.codegen.cs | 4 +- .../ImplicitExpressionAtEOF_DesignTime.ir.txt | 4 +- ...citExpressionAtEOF_DesignTime.mappings.txt | 2 +- ...ImplicitExpressionAtEOF_Runtime.codegen.cs | 6 +- .../ImplicitExpressionAtEOF_Runtime.ir.txt | 4 +- .../ImplicitExpression_DesignTime.codegen.cs | 4 +- .../ImplicitExpression_DesignTime.ir.txt | 4 +- ...ImplicitExpression_DesignTime.mappings.txt | 6 +- .../ImplicitExpression_Runtime.codegen.cs | 6 +- .../ImplicitExpression_Runtime.ir.txt | 4 +- ...IncompleteDirectives_DesignTime.codegen.cs | 4 +- .../IncompleteDirectives_DesignTime.ir.txt | 4 +- ...completeDirectives_DesignTime.mappings.txt | 28 +++--- .../IncompleteDirectives_Runtime.codegen.cs | 6 +- .../IncompleteDirectives_Runtime.ir.txt | 4 +- .../IncompleteTagHelper_DesignTime.codegen.cs | 4 +- .../IncompleteTagHelper_DesignTime.ir.txt | 4 +- ...ncompleteTagHelper_DesignTime.mappings.txt | 2 +- .../IncompleteTagHelper_Runtime.codegen.cs | 6 +- .../IncompleteTagHelper_Runtime.ir.txt | 4 +- .../Inherits_DesignTime.codegen.cs | 4 +- .../Inherits_DesignTime.cs-diagnostics.txt | 18 ++-- .../Inherits_DesignTime.ir.txt | 4 +- .../Inherits_DesignTime.mappings.txt | 4 +- .../Inherits_Runtime.codegen.cs | 6 +- .../Inherits_Runtime.cs-diagnostics.txt | 18 ++-- .../Inherits_Runtime.ir.txt | 4 +- .../InlineBlocks_DesignTime.codegen.cs | 4 +- .../InlineBlocks_DesignTime.ir.txt | 4 +- .../InlineBlocks_DesignTime.mappings.txt | 10 +- .../InlineBlocks_Runtime.codegen.cs | 6 +- .../InlineBlocks_Runtime.ir.txt | 4 +- .../Instrumented_DesignTime.codegen.cs | 4 +- .../Instrumented_DesignTime.ir.txt | 4 +- .../Instrumented_DesignTime.mappings.txt | 42 ++++----- .../Instrumented_Runtime.codegen.cs | 6 +- .../Instrumented_Runtime.ir.txt | 4 +- .../MarkupInCodeBlock_DesignTime.codegen.cs | 4 +- .../MarkupInCodeBlock_DesignTime.ir.txt | 4 +- .../MarkupInCodeBlock_DesignTime.mappings.txt | 6 +- .../MarkupInCodeBlock_Runtime.codegen.cs | 6 +- .../MarkupInCodeBlock_Runtime.ir.txt | 4 +- ...eBlocksWithTagHelper_DesignTime.codegen.cs | 4 +- ...nCodeBlocksWithTagHelper_DesignTime.ir.txt | 4 +- ...locksWithTagHelper_DesignTime.mappings.txt | 28 +++--- ...CodeBlocksWithTagHelper_Runtime.codegen.cs | 6 +- ...p_InCodeBlocksWithTagHelper_Runtime.ir.txt | 4 +- .../Markup_InCodeBlocks_DesignTime.codegen.cs | 4 +- .../Markup_InCodeBlocks_DesignTime.ir.txt | 4 +- ...arkup_InCodeBlocks_DesignTime.mappings.txt | 26 +++--- .../Markup_InCodeBlocks_Runtime.codegen.cs | 6 +- .../Markup_InCodeBlocks_Runtime.ir.txt | 4 +- .../MinimizedTagHelpers_DesignTime.codegen.cs | 4 +- .../MinimizedTagHelpers_DesignTime.ir.txt | 4 +- ...inimizedTagHelpers_DesignTime.mappings.txt | 2 +- .../MinimizedTagHelpers_Runtime.codegen.cs | 6 +- .../MinimizedTagHelpers_Runtime.ir.txt | 4 +- .../NestedCSharp_DesignTime.codegen.cs | 4 +- .../NestedCSharp_DesignTime.ir.txt | 4 +- .../NestedCSharp_DesignTime.mappings.txt | 10 +- .../NestedCSharp_Runtime.codegen.cs | 6 +- .../NestedCSharp_Runtime.ir.txt | 4 +- .../NestedCodeBlocks_DesignTime.codegen.cs | 4 +- .../NestedCodeBlocks_DesignTime.ir.txt | 4 +- .../NestedCodeBlocks_DesignTime.mappings.txt | 6 +- .../NestedCodeBlocks_Runtime.codegen.cs | 6 +- .../NestedCodeBlocks_Runtime.ir.txt | 4 +- ...dScriptTagTagHelpers_DesignTime.codegen.cs | 4 +- ...estedScriptTagTagHelpers_DesignTime.ir.txt | 4 +- ...criptTagTagHelpers_DesignTime.mappings.txt | 10 +- ...stedScriptTagTagHelpers_Runtime.codegen.cs | 6 +- .../NestedScriptTagTagHelpers_Runtime.ir.txt | 4 +- .../NestedTagHelpers_DesignTime.codegen.cs | 4 +- .../NestedTagHelpers_DesignTime.ir.txt | 4 +- .../NestedTagHelpers_DesignTime.mappings.txt | 2 +- .../NestedTagHelpers_Runtime.codegen.cs | 6 +- .../NestedTagHelpers_Runtime.ir.txt | 4 +- .../NoLinePragmas_DesignTime.codegen.cs | 4 +- .../NoLinePragmas_DesignTime.ir.txt | 4 +- .../NoLinePragmas_DesignTime.mappings.txt | 40 ++++---- .../NoLinePragmas_Runtime.codegen.cs | 6 +- .../NoLinePragmas_Runtime.ir.txt | 4 +- ...nditionalExpressions_DesignTime.codegen.cs | 4 +- ...llConditionalExpressions_DesignTime.ir.txt | 4 +- ...itionalExpressions_DesignTime.mappings.txt | 26 +++--- ...lConditionalExpressions_Runtime.codegen.cs | 6 +- .../NullConditionalExpressions_Runtime.ir.txt | 4 +- .../OpenedIf_DesignTime.codegen.cs | 4 +- .../OpenedIf_DesignTime.ir.txt | 4 +- .../OpenedIf_DesignTime.mappings.txt | 6 +- .../OpenedIf_Runtime.codegen.cs | 6 +- .../OpenedIf_Runtime.ir.txt | 4 +- .../ParserError_DesignTime.codegen.cs | 4 +- .../ParserError_DesignTime.ir.txt | 4 +- .../ParserError_DesignTime.mappings.txt | 2 +- .../ParserError_Runtime.codegen.cs | 6 +- .../ParserError_Runtime.ir.txt | 4 +- ...dAttributeTagHelpers_DesignTime.codegen.cs | 4 +- ...fixedAttributeTagHelpers_DesignTime.ir.txt | 4 +- ...ttributeTagHelpers_DesignTime.mappings.txt | 24 ++--- ...ixedAttributeTagHelpers_Runtime.codegen.cs | 6 +- ...PrefixedAttributeTagHelpers_Runtime.ir.txt | 4 +- .../RazorComments_DesignTime.codegen.cs | 4 +- .../RazorComments_DesignTime.ir.txt | 4 +- .../RazorComments_DesignTime.mappings.txt | 14 +-- .../RazorComments_Runtime.codegen.cs | 6 +- .../RazorComments_Runtime.ir.txt | 4 +- ...veTagHelperDirective_DesignTime.codegen.cs | 4 +- ...RemoveTagHelperDirective_DesignTime.ir.txt | 4 +- ...TagHelperDirective_DesignTime.mappings.txt | 2 +- ...emoveTagHelperDirective_Runtime.codegen.cs | 6 +- .../RemoveTagHelperDirective_Runtime.ir.txt | 4 +- .../Sections_DesignTime.codegen.cs | 4 +- .../Sections_DesignTime.ir.txt | 4 +- .../Sections_DesignTime.mappings.txt | 16 ++-- .../Sections_Runtime.codegen.cs | 6 +- .../Sections_Runtime.ir.txt | 4 +- .../SimpleTagHelpers_DesignTime.codegen.cs | 4 +- .../SimpleTagHelpers_DesignTime.ir.txt | 4 +- .../SimpleTagHelpers_DesignTime.mappings.txt | 2 +- .../SimpleTagHelpers_Runtime.codegen.cs | 6 +- .../SimpleTagHelpers_Runtime.ir.txt | 4 +- .../SimpleUnspacedIf_DesignTime.codegen.cs | 4 +- .../SimpleUnspacedIf_DesignTime.ir.txt | 4 +- .../SimpleUnspacedIf_DesignTime.mappings.txt | 4 +- .../SimpleUnspacedIf_Runtime.codegen.cs | 6 +- .../SimpleUnspacedIf_Runtime.ir.txt | 4 +- ...ontrolFlowStatements_DesignTime.codegen.cs | 4 +- ...ineControlFlowStatements_DesignTime.ir.txt | 4 +- ...trolFlowStatements_DesignTime.mappings.txt | 82 ++++++++--------- ...neControlFlowStatements_Runtime.codegen.cs | 6 +- ...leLineControlFlowStatements_Runtime.ir.txt | 4 +- ...lineBeforeAttributes_DesignTime.codegen.cs | 4 +- ...hNewlineBeforeAttributes_DesignTime.ir.txt | 4 +- ...neBeforeAttributes_DesignTime.mappings.txt | 4 +- ...NewlineBeforeAttributes_Runtime.codegen.cs | 6 +- ...WithNewlineBeforeAttributes_Runtime.ir.txt | 4 +- .../SingleTagHelper_DesignTime.codegen.cs | 4 +- .../SingleTagHelper_DesignTime.ir.txt | 4 +- .../SingleTagHelper_DesignTime.mappings.txt | 4 +- .../SingleTagHelper_Runtime.codegen.cs | 6 +- .../SingleTagHelper_Runtime.ir.txt | 4 +- .../StringLiterals_DesignTime.codegen.cs | 4 +- .../StringLiterals_DesignTime.ir.txt | 4 +- .../StringLiterals_DesignTime.mappings.txt | 4 +- .../StringLiterals_Runtime.codegen.cs | 6 +- .../StringLiterals_Runtime.ir.txt | 4 +- ...ion_RecursivePattern_DesignTime.codegen.cs | 4 +- ...ression_RecursivePattern_DesignTime.ir.txt | 4 +- ...n_RecursivePattern_DesignTime.mappings.txt | 4 +- ...ession_RecursivePattern_Runtime.codegen.cs | 6 +- ...Expression_RecursivePattern_Runtime.ir.txt | 4 +- ...ymbolBoundAttributes_DesignTime.codegen.cs | 4 +- .../SymbolBoundAttributes_DesignTime.ir.txt | 4 +- ...bolBoundAttributes_DesignTime.mappings.txt | 10 +- .../SymbolBoundAttributes_Runtime.codegen.cs | 6 +- .../SymbolBoundAttributes_Runtime.ir.txt | 4 +- .../TagHelpersInSection_DesignTime.codegen.cs | 4 +- .../TagHelpersInSection_DesignTime.ir.txt | 4 +- ...agHelpersInSection_DesignTime.mappings.txt | 14 +-- .../TagHelpersInSection_Runtime.codegen.cs | 6 +- .../TagHelpersInSection_Runtime.ir.txt | 4 +- ...sWithBoundAttributes_DesignTime.codegen.cs | 4 +- ...lpersWithBoundAttributes_DesignTime.ir.txt | 4 +- ...ithBoundAttributes_DesignTime.mappings.txt | 4 +- ...persWithBoundAttributes_Runtime.codegen.cs | 6 +- ...gHelpersWithBoundAttributes_Runtime.ir.txt | 4 +- ...thDataDashAttributes_DesignTime.codegen.cs | 4 +- ...rsWithDataDashAttributes_DesignTime.ir.txt | 4 +- ...DataDashAttributes_DesignTime.mappings.txt | 8 +- ...sWithDataDashAttributes_Runtime.codegen.cs | 6 +- ...lpersWithDataDashAttributes_Runtime.ir.txt | 4 +- ...TagHelpersWithPrefix_DesignTime.codegen.cs | 4 +- .../TagHelpersWithPrefix_DesignTime.ir.txt | 4 +- ...gHelpersWithPrefix_DesignTime.mappings.txt | 6 +- .../TagHelpersWithPrefix_Runtime.codegen.cs | 6 +- .../TagHelpersWithPrefix_Runtime.ir.txt | 4 +- ...gHelpersWithTemplate_DesignTime.codegen.cs | 4 +- .../TagHelpersWithTemplate_DesignTime.ir.txt | 4 +- ...elpersWithTemplate_DesignTime.mappings.txt | 10 +- .../TagHelpersWithTemplate_Runtime.codegen.cs | 6 +- .../TagHelpersWithTemplate_Runtime.ir.txt | 4 +- ...rdlySpacedAttributes_DesignTime.codegen.cs | 4 +- ...hWeirdlySpacedAttributes_DesignTime.ir.txt | 4 +- ...lySpacedAttributes_DesignTime.mappings.txt | 8 +- ...WeirdlySpacedAttributes_Runtime.codegen.cs | 6 +- ...WithWeirdlySpacedAttributes_Runtime.ir.txt | 4 +- .../Tags_DesignTime.codegen.cs | 4 +- .../Tags_DesignTime.ir.txt | 4 +- .../Tags_DesignTime.mappings.txt | 6 +- .../Tags_Runtime.codegen.cs | 6 +- .../Tags_Runtime.ir.txt | 4 +- .../Templates_DesignTime.codegen.cs | 4 +- .../Templates_DesignTime.ir.txt | 4 +- .../Templates_DesignTime.mappings.txt | 54 +++++------ .../Templates_Runtime.codegen.cs | 6 +- .../Templates_Runtime.ir.txt | 4 +- ...nTagHelperAttributes_DesignTime.codegen.cs | 4 +- ...onsInTagHelperAttributes_DesignTime.ir.txt | 4 +- ...agHelperAttributes_DesignTime.mappings.txt | 24 ++--- ...nsInTagHelperAttributes_Runtime.codegen.cs | 6 +- ...itionsInTagHelperAttributes_Runtime.ir.txt | 4 +- ...shedExpressionInCode_DesignTime.codegen.cs | 4 +- ...finishedExpressionInCode_DesignTime.ir.txt | 4 +- ...edExpressionInCode_DesignTime.mappings.txt | 6 +- ...inishedExpressionInCode_Runtime.codegen.cs | 6 +- .../UnfinishedExpressionInCode_Runtime.ir.txt | 4 +- .../Usings_DesignTime.codegen.cs | 4 +- .../Usings_DesignTime.ir.txt | 4 +- .../Usings_DesignTime.mappings.txt | 18 ++-- .../Usings_OutOfOrder_DesignTime.codegen.cs | 4 +- .../Usings_OutOfOrder_DesignTime.ir.txt | 4 +- .../Usings_OutOfOrder_DesignTime.mappings.txt | 26 +++--- .../Usings_OutOfOrder_Runtime.codegen.cs | 6 +- .../Usings_OutOfOrder_Runtime.ir.txt | 4 +- .../Usings_Runtime.codegen.cs | 6 +- .../Usings_Runtime.ir.txt | 4 +- .../src/Language/RazorConfiguration.cs | 4 +- .../DocumentSymbolEndpointTest.cs | 2 +- 572 files changed, 1780 insertions(+), 1780 deletions(-) diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.codegen.cs index 72ea10cfae3..3094fa0145d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -34,7 +34,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.ir.txt index f74d046c984..42fe022cab0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [25] ) - global::System.Linq @@ -14,7 +14,7 @@ IntermediateToken - (11:0,11 [14] AttributeDirectiveWithViewImports.cshtml) - CSharp - [Serializable] RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.mappings.txt index d4c610e7d5d..1122df5abb6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (11:0,11 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports.cshtml) |[Serializable]| -Generated Location: (903:28,11 [14] ) +Generated Location: (920:28,11 [14] ) |[Serializable]| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.codegen.cs index 1b6e023a63f..e8c12c22554 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9a963ab17d89a7739e64cf5d94e1dc35aa41cf1004222067bca2328b832666d9" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System.Collections.Generic; @@ -40,7 +40,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.ir.txt index 74fee171927..f6ea905d7be 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument 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 @@ -16,7 +16,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirectiveWithViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.cs index 4db1c047ed4..a50c79314f4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.ir.txt index 7cb303a862a..3adfb0244ee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.mappings.txt index dae7e6e57f7..5648379bb4d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_DesignTime.mappings.txt @@ -1,34 +1,34 @@ Source Location: (13:0,13 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml) |this.ToString()| -Generated Location: (1437:33,13 [15] ) +Generated Location: (1463:33,13 [15] ) |this.ToString()| Source Location: (54:2,5 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml) |string.Format("{0}", "Hello")| -Generated Location: (1611:40,6 [29] ) +Generated Location: (1637:40,6 [29] ) |string.Format("{0}", "Hello")| Source Location: (95:4,2 [25] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml) | var cls = "foo"; | -Generated Location: (1795:47,2 [25] ) +Generated Location: (1821:47,2 [25] ) | var cls = "foo"; | Source Location: (134:7,11 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml) |if(cls != null) { | -Generated Location: (1981:55,11 [18] ) +Generated Location: (2007:55,11 [18] ) |if(cls != null) { | Source Location: (153:7,30 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml) |cls| -Generated Location: (2181:62,30 [3] ) +Generated Location: (2207:62,30 [3] ) |cls| Source Location: (156:7,33 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml) | }| -Generated Location: (2370:69,33 [2] ) +Generated Location: (2396:69,33 [2] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.codegen.cs index 3d2e93a3ba8..6b3e145e2c7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3b732a30f94dc763cbd74d150cca70825dbddec2bddfba4e4d82547d5ced9a82" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt index 56e9bc2e1c6..bb2dfe4d57f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [4] Basic.cshtml) LazyIntermediateToken - (0:0,0 [4] Basic.cshtml) - Html -
#pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.ir.txt index 61e677a4eb7..8a46de8392f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.mappings.txt index 68b99fa9b03..fc357d92584 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.mappings.txt @@ -1,35 +1,35 @@ Source Location: (128:7,7 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (1204:26,0 [0] ) +Generated Location: (1230:26,0 [0] ) || Source Location: (149:10,8 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (1441:36,0 [0] ) +Generated Location: (1467:36,0 [0] ) || Source Location: (159:11,8 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) |MyService| -Generated Location: (1678:46,0 [17] ) +Generated Location: (1704:46,0 [17] ) |MyService| Source Location: (203:14,11 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (1956:56,0 [0] ) +Generated Location: (1982:56,0 [0] ) || Source Location: (119:6,6 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (2454:73,6 [0] ) +Generated Location: (2480:73,6 [0] ) || Source Location: (139:9,7 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (2629:80,7 [0] ) +Generated Location: (2655:80,7 [0] ) || Source Location: (190:13,10 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (2807:87,10 [0] ) +Generated Location: (2833:87,10 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs index 641f07ac3e4..3732d035246 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7afd23f4d24de7b2bec1fb06d0a708e2d98adee36c510f65d3424dfda5445dca" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt index 11e2588b30a..6af247f7569 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (85:1,0 [2] IncompleteDirectives.cshtml) LazyIntermediateToken - (85:1,0 [2] IncompleteDirectives.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.codegen.cs index e97b456f33a..7bcc7e4db5d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel : MyBasePageForViews + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel : MyBasePageForViews #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.ir.txt index 33b5e760949..53cd7044111 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel - MyBasePageForViews - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel - MyBasePageForViews - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.mappings.txt index 49ab8159e50..23d8691b5e8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (10:0,10 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml) |MyBasePageForViews| -Generated Location: (1174:26,0 [26] ) +Generated Location: (1200:26,0 [26] ) |MyBasePageForViews| Source Location: (45:1,7 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml) |MyModel| -Generated Location: (1457:36,0 [7] ) +Generated Location: (1483:36,0 [7] ) |MyModel| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.codegen.cs index 158b2dc8916..7d5e59cc7ec 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1ca5ae8e569aefa6575a68e8d8b2d375ed79deec6565fb893b72b89423f55abd" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel : MyBasePageForViews + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel : MyBasePageForViews #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt index 6a2103779ca..a87252108ee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel - MyBasePageForViews - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel - MyBasePageForViews - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.codegen.cs index 2797f550402..c288744ec5a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports : MyPageModel + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports : MyPageModel #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.ir.txt index 02331d9ea15..1abea22138a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports - MyPageModel - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports - MyPageModel - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.mappings.txt index ad901af4382..eb4779efcf4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (14:1,7 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml) |MyModel| -Generated Location: (1185:26,0 [7] ) +Generated Location: (1211:26,0 [7] ) |MyModel| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.codegen.cs index 68eeb760030..2615dac991c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a652fac42d6a27ace9b45de079bd1bd21d47f29255b96899785aaa55a4a8e354" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -19,7 +19,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports : MyPageModel + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports : MyPageModel #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt index 80d7c75bf5d..78ebbebbdb6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports - MyPageModel - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports - MyPageModel - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.codegen.cs index c522f09d73f..507fdf59594 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.ir.txt index 333382ac822..64e0602a5c2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.mappings.txt index 2aef24850cd..ead29c02167 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_DesignTime.mappings.txt @@ -1,25 +1,25 @@ Source Location: (7:0,7 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |MyModel| -Generated Location: (1198:26,0 [7] ) +Generated Location: (1224:26,0 [7] ) |MyModel| Source Location: (24:1,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |MyApp| -Generated Location: (1460:36,0 [5] ) +Generated Location: (1486:36,0 [5] ) |MyApp| Source Location: (30:1,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |MyPropertyName| -Generated Location: (1742:46,22 [14] ) +Generated Location: (1768:46,22 [14] ) |MyPropertyName| Source Location: (54:2,8 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |MyService| -Generated Location: (1995:56,0 [17] ) +Generated Location: (2021:56,0 [17] ) |MyService| Source Location: (72:2,26 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |Html| -Generated Location: (2289:66,22 [4] ) +Generated Location: (2315:66,22 [4] ) |Html| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.codegen.cs index 0b56e2be1e9..be636240d3d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "319d5fa6f848e64d19bf7eab2f5e3339cdfc75b02a9bc6f2773eed1a40f5e9d0" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt index ea79180b0e6..f3c7bb47cc6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.mappings.txt index 74596acbc18..a8d413833d9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (54:2,8 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |MyService| -Generated Location: (2037:32,0 [9] ) +Generated Location: (2080:32,0 [9] ) |MyService| Source Location: (72:2,26 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |Html| -Generated Location: (2240:40,0 [4] ) +Generated Location: (2283:40,0 [4] ) |Html| Source Location: (24:1,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |MyApp| -Generated Location: (2568:51,0 [5] ) +Generated Location: (2611:51,0 [5] ) |MyApp| Source Location: (30:1,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml) |MyPropertyName| -Generated Location: (2758:59,0 [14] ) +Generated Location: (2801:59,0 [14] ) |MyPropertyName| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.codegen.cs index 0a785bf0448..325edc73996 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.ir.txt index 8cecee2bc1a..82b67dbaac8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.mappings.txt index 296b4548b4e..cb492a0fcca 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_DesignTime.mappings.txt @@ -1,45 +1,45 @@ Source Location: (7:0,7 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyModel| -Generated Location: (1210:26,0 [7] ) +Generated Location: (1236:26,0 [7] ) |MyModel| Source Location: (24:1,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyApp| -Generated Location: (1476:36,0 [5] ) +Generated Location: (1502:36,0 [5] ) |MyApp| Source Location: (30:1,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyPropertyName| -Generated Location: (1762:46,22 [14] ) +Generated Location: (1788:46,22 [14] ) |MyPropertyName| Source Location: (58:2,8 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyService| -Generated Location: (2019:56,0 [17] ) +Generated Location: (2045:56,0 [17] ) |MyService| Source Location: (76:2,26 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |Html| -Generated Location: (2317:66,22 [4] ) +Generated Location: (2343:66,22 [4] ) |Html| Source Location: (93:3,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyApp| -Generated Location: (2564:76,0 [5] ) +Generated Location: (2590:76,0 [5] ) |MyApp| Source Location: (99:3,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyPropertyName2| -Generated Location: (2850:86,22 [15] ) +Generated Location: (2876:86,22 [15] ) |MyPropertyName2| Source Location: (129:4,8 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyService| -Generated Location: (3108:96,0 [17] ) +Generated Location: (3134:96,0 [17] ) |MyService| Source Location: (147:4,26 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |Html2| -Generated Location: (3406:106,22 [5] ) +Generated Location: (3432:106,22 [5] ) |Html2| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.codegen.cs index 8a9e54e83ec..26d47a76b27 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "771acb56660727ab6e4ca50e95bde0cf2a72af8de3e9ec1cd4b72969645cb9af" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt index bde5ff49094..a22e7329218 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.mappings.txt index 8bdc56783f5..56b60c17d77 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.mappings.txt @@ -1,40 +1,40 @@ Source Location: (129:4,8 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyService| -Generated Location: (2065:32,0 [9] ) +Generated Location: (2108:32,0 [9] ) |MyService| Source Location: (147:4,26 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |Html2| -Generated Location: (2272:40,0 [5] ) +Generated Location: (2315:40,0 [5] ) |Html2| Source Location: (93:3,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyApp| -Generated Location: (2605:51,0 [5] ) +Generated Location: (2648:51,0 [5] ) |MyApp| Source Location: (99:3,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyPropertyName2| -Generated Location: (2799:59,0 [15] ) +Generated Location: (2842:59,0 [15] ) |MyPropertyName2| Source Location: (58:2,8 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyService| -Generated Location: (3142:70,0 [9] ) +Generated Location: (3185:70,0 [9] ) |MyService| Source Location: (76:2,26 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |Html| -Generated Location: (3349:78,0 [4] ) +Generated Location: (3392:78,0 [4] ) |Html| Source Location: (24:1,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyApp| -Generated Location: (3681:89,0 [5] ) +Generated Location: (3724:89,0 [5] ) |MyApp| Source Location: (30:1,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml) |MyPropertyName| -Generated Location: (3875:97,0 [14] ) +Generated Location: (3918:97,0 [14] ) |MyPropertyName| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.codegen.cs index 6b3b1d6fe0a..95b744435dd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.ir.txt index 9ddf119a56e..94f6f2ad15b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.mappings.txt index c6395a4a74a..4e939233544 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (8:0,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml) |MyApp| -Generated Location: (1171:26,0 [5] ) +Generated Location: (1197:26,0 [5] ) |MyApp| Source Location: (14:0,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml) |MyPropertyName| -Generated Location: (1444:36,22 [14] ) +Generated Location: (1470:36,22 [14] ) |MyPropertyName| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.codegen.cs index 2aac70d02e7..96e2a2f1399 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "f0ec78e6ab6def57bd9067e564edaa84059a8ecb9a3c1766a148a7df3096b7b0" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt index 847d8453977..cdcb7fbec97 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.mappings.txt index 1922c8947a9..d8c4bcd952e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (8:0,8 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml) |MyApp| -Generated Location: (1974:32,0 [5] ) +Generated Location: (2017:32,0 [5] ) |MyApp| Source Location: (14:0,14 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml) |MyPropertyName| -Generated Location: (2155:40,0 [14] ) +Generated Location: (2198:40,0 [14] ) |MyPropertyName| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.codegen.cs index a8ea985c411..f6e3da8b232 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.ir.txt index ebfd3e3876e..2fb419b34aa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.codegen.cs index ac456620445..e698918c05c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3b8355e6c17c9dc5d6062d64a789a8b5a81db5adec1e9913ff7a7c1565682765" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt index 0ecb4011503..d01e12f9994 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync MalformedDirective - (0:0,0 [11] InvalidNamespaceAtEOF.cshtml) - namespace HtmlContent - (11:0,11 [5] InvalidNamespaceAtEOF.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.codegen.cs index c1d814c2471..17e66eaa399 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.ir.txt index 9512f8a1070..2ee3e356b92 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.codegen.cs index c9689a971e2..1fd1127e0d6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "189450bf29773af1b743c49fb8b24230b292c19db0334d587f0e094856e5218f" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt index fa1d7b2efe5..2ca6219b5d3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync MalformedDirective - (0:0,0 [6] MalformedPageDirective.cshtml) - page HtmlContent - (6:0,6 [49] MalformedPageDirective.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.codegen.cs index d87a23e0538..3bf6b202b36 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.ir.txt index 433f38b5a28..008decced62 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.mappings.txt index 9e03dac2d9d..a80f0177844 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (7:0,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml) |DateTime| -Generated Location: (1700:32,0 [8] ) +Generated Location: (1726:32,0 [8] ) |DateTime| Source Location: (33:2,14 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml) |"InputTestTagHelper, AppCode"| -Generated Location: (2009:42,37 [29] ) +Generated Location: (2035:42,37 [29] ) |"InputTestTagHelper, AppCode"| Source Location: (83:4,17 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml) |Date| -Generated Location: (2719:60,102 [4] ) +Generated Location: (2745:60,102 [4] ) |Date| Source Location: (111:5,18 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml) |Model| -Generated Location: (3149:69,94 [5] ) +Generated Location: (3175:69,94 [5] ) |Model| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.codegen.cs index 737f6dc2ace..6fc3952dab6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "b96e944bd86a2acecd5a176708eedb3cdc8eef05122fd51aa5c4fe58d4069af7" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt index f83f43c30c1..184efec4d89 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.codegen.cs index 2c3a262eed2..8a984eb787c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.ir.txt index c7b21ddcf3b..f486553c060 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.mappings.txt index 7394637419a..bb47d519adf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (7:0,7 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml) |System.Collections.IEnumerable| -Generated Location: (1191:26,0 [30] ) +Generated Location: (1217:26,0 [30] ) |System.Collections.IEnumerable| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.codegen.cs index 9fd9006a420..e789c5db091 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "36b79708f36f3606c2eb7c7eaf383853df55ab030280d5deb8f762fac54fd1c0" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt index 2334402e431..2edaa113a45 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.codegen.cs index 74a617a6104..5d852cb1555 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MultipleModels : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MultipleModels : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.ir.txt index a7e32184d01..211de3d9ff0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MultipleModels - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MultipleModels - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.mappings.txt index 20d5397ea6c..71c30fcdb10 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (7:0,7 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels.cshtml) |ThisShouldBeGenerated| -Generated Location: (1209:26,0 [21] ) +Generated Location: (1235:26,0 [21] ) |ThisShouldBeGenerated| Source Location: (37:1,7 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MultipleModels.cshtml) |System.Collections.IEnumerable| -Generated Location: (1484:36,0 [30] ) +Generated Location: (1510:36,0 [30] ) |System.Collections.IEnumerable| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.codegen.cs index 6c494c79c74..f81e5637974 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.codegen.cs @@ -16,7 +16,7 @@ namespace Test.Namespace [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.ir.txt index b8bd6238d8c..ed9a464951c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.ir.txt @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.mappings.txt index 89f6b504abe..6ddb439deb4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (18:1,11 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace.cshtml) |Test.Namespace| -Generated Location: (1243:26,44 [14] ) +Generated Location: (1252:26,44 [14] ) |Test.Namespace| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.codegen.cs index 88fcd2f08a3..60084b62428 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.codegen.cs @@ -18,7 +18,7 @@ namespace Test.Namespace [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt index 6fa07da4f1c..31ab344447d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (34:2,0 [20] PageWithNamespace.cshtml) LazyIntermediateToken - (34:2,0 [3] PageWithNamespace.cshtml) - Html -

#pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_DesignTime.ir.txt index 4982f6e4002..cae87bb1f87 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.codegen.cs index 2732e3630be..d842ee826ae 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5eaf8fb8900db86500f29c357a6119d29d8639ae7b054b4cc5e00bbdf4882c2d" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt index e45af51cdc0..346b2f28937 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [28] RazorPageWithNoLeadingPageDirective.cshtml) LazyIntermediateToken - (0:0,0 [4] RazorPageWithNoLeadingPageDirective.cshtml) - Html -
#pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("Bar", "Foo", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.ir.txt index 9f0866f81cf..661ce844d18 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - Bar - Foo - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - asp-route - register - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - method - post - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.codegen.cs index 1a6c001424e..5b240502e36 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -21,7 +21,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.ir.txt index 42c3c1e4cd8..e87172ba9ca 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -11,7 +11,7 @@ UsingDirective - (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.mappings.txt index aea33d2ab95..e9450d8ef26 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |using TestNamespace| -Generated Location: (545:15,0 [19] ) +Generated Location: (562:15,0 [19] ) |using TestNamespace| Source Location: (36:2,7 [9] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |TestModel| -Generated Location: (1290:31,0 [9] ) +Generated Location: (1316:31,0 [9] ) |TestModel| Source Location: (54:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (1805:48,6 [10] ) +Generated Location: (1831:48,6 [10] ) |Model.Name| Source Location: (78:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (1973:55,6 [14] ) +Generated Location: (1999:55,6 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.cs index 52d2439f36d..3343a1a9015 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "938aa77e05d0524687967a4964c7424054e2f7b837772fe19895341aa7ef5bda" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.ir.txt index 5179d0b1e19..8efd1b0b509 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (47:3,0 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (47:3,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.mappings.txt index b1ede97e6be..193db25f87d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.mappings.txt @@ -1,17 +1,17 @@ Source Location: (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |using TestNamespace | -Generated Location: (971:16,0 [21] ) +Generated Location: (1005:16,0 [21] ) |using TestNamespace | Source Location: (54:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (2020:36,0 [10] ) +Generated Location: (2063:36,0 [10] ) |Model.Name| Source Location: (78:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (2276:46,0 [14] ) +Generated Location: (2319:46,0 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.codegen.cs index 74b01482d43..70d2d84399c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -21,7 +21,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.ir.txt index 63b5fb776d7..33c19ce8797 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -11,7 +11,7 @@ UsingDirective - (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.mappings.txt index aea33d2ab95..e9450d8ef26 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |using TestNamespace| -Generated Location: (545:15,0 [19] ) +Generated Location: (562:15,0 [19] ) |using TestNamespace| Source Location: (36:2,7 [9] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |TestModel| -Generated Location: (1290:31,0 [9] ) +Generated Location: (1316:31,0 [9] ) |TestModel| Source Location: (54:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (1805:48,6 [10] ) +Generated Location: (1831:48,6 [10] ) |Model.Name| Source Location: (78:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (1973:55,6 [14] ) +Generated Location: (1999:55,6 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.cs index 60fb805e412..5660607b01a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "938aa77e05d0524687967a4964c7424054e2f7b837772fe19895341aa7ef5bda" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.ir.txt index eaf0f2f9770..f937ddd5ef3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (47:3,0 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (47:3,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.mappings.txt index b1ede97e6be..193db25f87d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.mappings.txt @@ -1,17 +1,17 @@ Source Location: (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |using TestNamespace | -Generated Location: (971:16,0 [21] ) +Generated Location: (1005:16,0 [21] ) |using TestNamespace | Source Location: (54:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (2020:36,0 [10] ) +Generated Location: (2063:36,0 [10] ) |Model.Name| Source Location: (78:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (2276:46,0 [14] ) +Generated Location: (2319:46,0 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.codegen.cs index 56e4cec6181..a0592546ba4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -21,7 +21,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.ir.txt index b13cccfd3eb..caecaef2084 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -11,7 +11,7 @@ UsingDirective - (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.mappings.txt index 4ab42af6467..580d99371c0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |using TestNamespace| -Generated Location: (545:15,0 [19] ) +Generated Location: (562:15,0 [19] ) |using TestNamespace| Source Location: (36:2,7 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |TestModel?| -Generated Location: (1290:31,0 [10] ) +Generated Location: (1316:31,0 [10] ) |TestModel?| Source Location: (55:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (1806:48,6 [10] ) +Generated Location: (1832:48,6 [10] ) |Model.Name| Source Location: (79:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (1974:55,6 [14] ) +Generated Location: (2000:55,6 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.cs index c743e8ac9c4..68a1f75cf5f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a0b3df03ac7b0b582a2924ed8f2f85f3df8f906c37a1aa7f1f8255290fbf29a9" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.ir.txt index 1f0b68a5737..1c026c0aef5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (48:3,0 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (48:3,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.mappings.txt index a2df4b7677c..544865bd281 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.mappings.txt @@ -1,17 +1,17 @@ Source Location: (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |using TestNamespace | -Generated Location: (971:16,0 [21] ) +Generated Location: (1005:16,0 [21] ) |using TestNamespace | Source Location: (55:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (2020:36,0 [10] ) +Generated Location: (2063:36,0 [10] ) |Model.Name| Source Location: (79:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (2276:46,0 [14] ) +Generated Location: (2319:46,0 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.codegen.cs index 7c147f6f243..fa4833099f7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -21,7 +21,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.ir.txt index 70413ed61f7..d6dfdd62fd1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -11,7 +11,7 @@ UsingDirective - (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.mappings.txt index 4ab42af6467..580d99371c0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |using TestNamespace| -Generated Location: (545:15,0 [19] ) +Generated Location: (562:15,0 [19] ) |using TestNamespace| Source Location: (36:2,7 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |TestModel?| -Generated Location: (1290:31,0 [10] ) +Generated Location: (1316:31,0 [10] ) |TestModel?| Source Location: (55:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (1806:48,6 [10] ) +Generated Location: (1832:48,6 [10] ) |Model.Name| Source Location: (79:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (1974:55,6 [14] ) +Generated Location: (2000:55,6 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.cs index eadcffb5342..cc5ef0e825e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a0b3df03ac7b0b582a2924ed8f2f85f3df8f906c37a1aa7f1f8255290fbf29a9" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.ir.txt index dc30fcf3e66..7a00e428f85 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (48:3,0 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (48:3,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.mappings.txt index a2df4b7677c..544865bd281 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.mappings.txt @@ -1,17 +1,17 @@ Source Location: (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |using TestNamespace | -Generated Location: (971:16,0 [21] ) +Generated Location: (1005:16,0 [21] ) |using TestNamespace | Source Location: (55:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (2020:36,0 [10] ) +Generated Location: (2063:36,0 [10] ) |Model.Name| Source Location: (79:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (2276:46,0 [14] ) +Generated Location: (2319:46,0 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.codegen.cs index 6d226f0fd46..2984cf4987b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -22,7 +22,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.ir.txt index dd03351f6cb..5350ef031e8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -12,7 +12,7 @@ RazorCompiledItemMetadataAttribute - (6:0,6 [8] RazorPagesWithRouteTemplate.cshtml) RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.mappings.txt index f350890e212..eb719e203ff 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_DesignTime.mappings.txt @@ -1,21 +1,21 @@ Source Location: (36:3,1 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml) |using Microsoft.AspNetCore.Mvc.RazorPages| -Generated Location: (568:15,0 [41] ) +Generated Location: (585:15,0 [41] ) |using Microsoft.AspNetCore.Mvc.RazorPages| Source Location: (6:0,6 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml) |"/About"| -Generated Location: (1572:33,37 [8] ) +Generated Location: (1598:33,37 [8] ) |"/About"| Source Location: (25:2,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml) |NewModel| -Generated Location: (1823:43,0 [8] ) +Generated Location: (1849:43,0 [8] ) |NewModel| Source Location: (213:12,18 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml) |Model.Name| -Generated Location: (2373:60,18 [10] ) +Generated Location: (2399:60,18 [10] ) |Model.Name| Source Location: (93:5,12 [97] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml) @@ -25,7 +25,7 @@ Source Location: (93:5,12 [97] TestFiles/IntegrationTests/CodeGenerationIntegrat public string Name { get; set; } } | -Generated Location: (2619:69,12 [97] ) +Generated Location: (2645:69,12 [97] ) | public class NewModel : PageModel { diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs index 26803a7ec1d..a0be33e7420 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "da9a31551104c58f287a17de26f4a3aa316e7e17fb9ed06e39692c4f45fb133a" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -34,7 +34,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt index 54fb257212b..1ffae76587e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -13,7 +13,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (16:1,0 [2] RazorPagesWithRouteTemplate.cshtml) LazyIntermediateToken - (16:1,0 [2] RazorPagesWithRouteTemplate.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.cs index c4fa3465aee..2d7527b1211 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -21,7 +21,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.ir.txt index eec7011d9bb..50cd6d68233 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -11,7 +11,7 @@ UsingDirective - (38:3,1 [41] RazorPagesWithoutModel.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DefaultTagHelperRuntime - FieldDeclaration - - private - global::DivTagHelper - __DivTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.mappings.txt index e335c60c42a..139ede15cf8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.mappings.txt @@ -1,16 +1,16 @@ Source Location: (38:3,1 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml) |using Microsoft.AspNetCore.Mvc.RazorPages| -Generated Location: (563:15,0 [41] ) +Generated Location: (580:15,0 [41] ) |using Microsoft.AspNetCore.Mvc.RazorPages| Source Location: (23:2,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml) |"*, AppCode"| -Generated Location: (1902:38,37 [12] ) +Generated Location: (1928:38,37 [12] ) |"*, AppCode"| Source Location: (566:24,47 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml) |Name| -Generated Location: (2603:57,47 [4] ) +Generated Location: (2629:57,47 [4] ) |Name| Source Location: (95:5,12 [283] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml) @@ -28,7 +28,7 @@ Source Location: (95:5,12 [283] TestFiles/IntegrationTests/CodeGenerationIntegra public string Name { get; set; } } | -Generated Location: (3426:74,12 [283] ) +Generated Location: (3452:74,12 [283] ) | public IActionResult OnPost(Customer customer) { diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs index 22f235cc89d..b31ece9290d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4d4352438ec54cff935ed10c73f4fb4ce0ea8ffc7c46b467007618dead77f960" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("text-danger"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt index e3d717690e5..8b1129000fc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - text-danger - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - class - col-md-10 - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - class - form-group - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.cs index a7e228168eb..34f4321738d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -21,7 +21,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.ir.txt index 0395753efcf..b60fec33036 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -11,7 +11,7 @@ UsingDirective - (55:4,1 [41] RazorPages.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - DefaultTagHelperRuntime - FieldDeclaration - - private - global::DivTagHelper - __DivTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.mappings.txt index 6d58723a403..461dfa9e38b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.mappings.txt @@ -1,21 +1,21 @@ Source Location: (55:4,1 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml) |using Microsoft.AspNetCore.Mvc.RazorPages| -Generated Location: (551:15,0 [41] ) +Generated Location: (568:15,0 [41] ) |using Microsoft.AspNetCore.Mvc.RazorPages| Source Location: (16:2,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml) |NewModel| -Generated Location: (1798:37,0 [8] ) +Generated Location: (1824:37,0 [8] ) |NewModel| Source Location: (40:3,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml) |"*, AppCode"| -Generated Location: (2112:48,37 [12] ) +Generated Location: (2138:48,37 [12] ) |"*, AppCode"| Source Location: (661:28,47 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml) |Model.Name| -Generated Location: (2801:67,47 [10] ) +Generated Location: (2827:67,47 [10] ) |Model.Name| Source Location: (112:6,12 [360] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml) @@ -36,7 +36,7 @@ Source Location: (112:6,12 [360] TestFiles/IntegrationTests/CodeGenerationIntegr public string Name { get; set; } } | -Generated Location: (3618:84,12 [360] ) +Generated Location: (3644:84,12 [360] ) | public class NewModel : PageModel { diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs index a029a343a45..e6a034a4616 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "676265931c358e22efce0fe9ebd76cc3a7d2a5c12d37384e13aec92aa7667663" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages), @"mvc.1.0.razor-page", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages : global::Microsoft.AspNetCore.Mvc.RazorPages.Page + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages : global::Microsoft.AspNetCore.Mvc.RazorPages.Page #nullable disable { private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("text-danger"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt index 711a257e33e..983fbd7f38b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - text-danger - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - class - col-md-10 - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - class - form-group - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.codegen.cs index 6b5942c13ae..8d5327bb7b4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "ae0459eafa91f6ae24fb2b349577f0dfb20a0e269a8a48888a1285a725191322" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt index da0ffc7897f..181bccc7705 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [164] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.codegen.cs index cd3b23a0f11..f7d7de1bfbf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "693e482257fa9ef37bc202b83d2bd2e6f8475e8f4d328f07e18a689f4f68c917" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : 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("Bar", "Foo", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.ir.txt index c17f79100e0..e9a136bd4b2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - Bar - Foo - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - asp-route - register - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - method - post - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.codegen.cs index 6b9da69c452..a83bb4b85aa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "d0420b910fa2a6f0119a96ffb534fee225ca66e96b3b1741cf04c7ebd9525f62" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.ir.txt index 5368db952de..36bc7b80611 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.codegen.cs index e7eb993196d..a043bb2314a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "714936b16425e1b5a49883c3e910ed43c30422ebc564f54651880695133a3b4b" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : MyBasePage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : MyBasePage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.ir.txt index 4c81d1f15e7..6a1136c45a7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - MyBasePage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - MyBasePage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.codegen.cs index 78af829efa1..8ff9736d1a7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "b354ee3595811e9701f9c464ddf35ccb31360a3799b7bb4279192f084591a4fe" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.ir.txt index 38a57ff69d2..676d1e370ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.codegen.cs index 78af829efa1..8ff9736d1a7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "b354ee3595811e9701f9c464ddf35ccb31360a3799b7bb4279192f084591a4fe" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -24,7 +24,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/test.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.ir.txt index 38a57ff69d2..676d1e370ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -12,7 +12,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs index 81077af8977..8c7dd05d49e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt index cc0aa1a3871..04d308dc6fe 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt index cb8e50488d6..744d86e6e84 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt @@ -1,29 +1,29 @@ Source Location: (7:0,7 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |DateTime| -Generated Location: (1652:32,0 [8] ) +Generated Location: (1678:32,0 [8] ) |DateTime| Source Location: (33:2,14 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |"InputTestTagHelper, AppCode"| -Generated Location: (1945:42,37 [29] ) +Generated Location: (1971:42,37 [29] ) |"InputTestTagHelper, AppCode"| Source Location: (152:10,9 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |Section1| -Generated Location: (2221:52,22 [8] ) +Generated Location: (2247:52,22 [8] ) |Section1| Source Location: (68:4,2 [46] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) | Layout = "_SectionTestLayout.cshtml"; | -Generated Location: (2719:69,2 [46] ) +Generated Location: (2745:69,2 [46] ) | Layout = "_SectionTestLayout.cshtml"; | Source Location: (222:12,21 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |Date| -Generated Location: (3182:79,102 [4] ) +Generated Location: (3208:79,102 [4] ) |Date| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs index dacf79c54db..1f7e752cf29 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1ed96a957fe000fd0c80cc511def19ab692563eb64f3349a4c87c524e2ecbd60" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt index 53f5abfb6ee..8f0184c644c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTestTagHelper - __InputTestTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.codegen.cs index 624e21b46c6..e6ee941687c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -35,7 +35,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.ir.txt index f3331e380a8..fcf408db474 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [25] ) - global::System.Linq @@ -13,7 +13,7 @@ UsingDirective - (73:3,1 [12] UsingDirectives.cshtml) - System RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.mappings.txt index a22a7e8ae05..406be5361cf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (1:0,1 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml) |using System.ComponentModel| -Generated Location: (529:14,0 [27] ) +Generated Location: (546:14,0 [27] ) |using System.ComponentModel| Source Location: (31:1,1 [24] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml) |using System.Collections| -Generated Location: (690:19,0 [24] ) +Generated Location: (707:19,0 [24] ) |using System.Collections| Source Location: (58:2,1 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml) |using System| -Generated Location: (848:24,0 [12] ) +Generated Location: (865:24,0 [12] ) |using System| Source Location: (73:3,1 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml) |using System| -Generated Location: (994:29,0 [12] ) +Generated Location: (1011:29,0 [12] ) |using System| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs index 8a8ffe366b1..44a2a7ae909 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9194971d2fb7908a02b02841f18655ccc0908a204c2fa948e8dc7e947269da86" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System.Collections.Generic; @@ -41,7 +41,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt index a679c25ed02..882893e7b82 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument 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 @@ -14,7 +14,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.codegen.cs index 377646cfe7d..8be96b61c8d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "83aa72bbe254ff67d9ee42878d80c6403361bcbb777a50d8b3d718cba176d15c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden @@ -41,9 +41,9 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon return __backed__tagHelperScopeManager; } } - private global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestViewComponentTagHelper __OptionalTestViewComponentTagHelper; - private global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestWithParamViewComponentTagHelper __OptionalTestWithParamViewComponentTagHelper; - private global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper __OptionalWithMultipleTypesViewComponentTagHelper; + private global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestViewComponentTagHelper __OptionalTestViewComponentTagHelper; + private global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestWithParamViewComponentTagHelper __OptionalTestWithParamViewComponentTagHelper; + private global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper __OptionalWithMultipleTypesViewComponentTagHelper; #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { @@ -51,7 +51,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalTestViewComponentTagHelper = CreateTagHelper(); + __OptionalTestViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalTestViewComponentTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) @@ -64,7 +64,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalTestViewComponentTagHelper = CreateTagHelper(); + __OptionalTestViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalTestViewComponentTagHelper); __OptionalTestViewComponentTagHelper.showSecret = #nullable restore @@ -87,7 +87,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test-with-param", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalTestWithParamViewComponentTagHelper = CreateTagHelper(); + __OptionalTestWithParamViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalTestWithParamViewComponentTagHelper); BeginWriteTagHelperAttribute(); WriteLiteral("mysecret"); @@ -105,7 +105,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-test-with-param", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalTestWithParamViewComponentTagHelper = CreateTagHelper(); + __OptionalTestWithParamViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalTestWithParamViewComponentTagHelper); BeginWriteTagHelperAttribute(); WriteLiteral("mysecret"); @@ -133,7 +133,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); + __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalWithMultipleTypesViewComponentTagHelper); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) @@ -146,7 +146,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); + __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalWithMultipleTypesViewComponentTagHelper); __OptionalWithMultipleTypesViewComponentTagHelper.age = #nullable restore @@ -189,7 +189,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); + __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalWithMultipleTypesViewComponentTagHelper); __OptionalWithMultipleTypesViewComponentTagHelper.age = #nullable restore @@ -222,7 +222,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); + __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalWithMultipleTypesViewComponentTagHelper); __OptionalWithMultipleTypesViewComponentTagHelper.age = #nullable restore @@ -265,7 +265,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon __tagHelperExecutionContext = __tagHelperScopeManager.Begin("vc:optional-with-multiple-types", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "test", async() => { } ); - __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); + __OptionalWithMultipleTypesViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__OptionalWithMultipleTypesViewComponentTagHelper); __OptionalWithMultipleTypesViewComponentTagHelper.age = #nullable restore diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.ir.txt index 4f08e19b817..45573d87c08 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,23 +11,23 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - - FieldDeclaration - - private - global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestViewComponentTagHelper - __OptionalTestViewComponentTagHelper - FieldDeclaration - - private - global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestWithParamViewComponentTagHelper - __OptionalTestWithParamViewComponentTagHelper - FieldDeclaration - - private - global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper - __OptionalWithMultipleTypesViewComponentTagHelper + FieldDeclaration - - private - global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestViewComponentTagHelper - __OptionalTestViewComponentTagHelper + FieldDeclaration - - private - global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestWithParamViewComponentTagHelper - __OptionalTestWithParamViewComponentTagHelper + FieldDeclaration - - private - global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper - __OptionalWithMultipleTypesViewComponentTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (28:1,0 [2] ViewComponentTagHelperOptionalParam.cshtml) LazyIntermediateToken - (28:1,0 [2] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n TagHelper - (30:2,0 [37] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-test - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestViewComponentTagHelper DefaultTagHelperExecute - HtmlContent - (67:2,37 [2] ViewComponentTagHelperOptionalParam.cshtml) LazyIntermediateToken - (67:2,37 [2] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n TagHelper - (69:3,0 [57] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-test - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestViewComponentTagHelper DefaultTagHelperProperty - (100:3,31 [5] ViewComponentTagHelperOptionalParam.cshtml) - show-secret - bool OptionalTestViewComponentTagHelper.showSecret - HtmlAttributeValueStyle.DoubleQuotes CSharpExpression - (101:3,32 [4] ViewComponentTagHelperOptionalParam.cshtml) LazyIntermediateToken - (101:3,32 [4] ViewComponentTagHelperOptionalParam.cshtml) - CSharp - true @@ -36,7 +36,7 @@ LazyIntermediateToken - (126:3,57 [4] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n\n TagHelper - (130:5,0 [77] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-test-with-param - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestWithParamViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestWithParamViewComponentTagHelper DefaultTagHelperProperty - (167:5,37 [8] ViewComponentTagHelperOptionalParam.cshtml) - secret - string OptionalTestWithParamViewComponentTagHelper.secret - HtmlAttributeValueStyle.DoubleQuotes HtmlContent - (167:5,37 [8] ViewComponentTagHelperOptionalParam.cshtml) LazyIntermediateToken - (167:5,37 [8] ViewComponentTagHelperOptionalParam.cshtml) - Html - mysecret @@ -45,7 +45,7 @@ LazyIntermediateToken - (207:5,77 [2] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n TagHelper - (209:6,0 [97] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-test-with-param - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestWithParamViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalTestWithParamViewComponentTagHelper DefaultTagHelperProperty - (246:6,37 [8] ViewComponentTagHelperOptionalParam.cshtml) - secret - string OptionalTestWithParamViewComponentTagHelper.secret - HtmlAttributeValueStyle.DoubleQuotes HtmlContent - (246:6,37 [8] ViewComponentTagHelperOptionalParam.cshtml) LazyIntermediateToken - (246:6,37 [8] ViewComponentTagHelperOptionalParam.cshtml) - Html - mysecret @@ -57,13 +57,13 @@ LazyIntermediateToken - (306:6,97 [4] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n\n TagHelper - (310:8,0 [67] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-with-multiple-types - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper DefaultTagHelperExecute - HtmlContent - (377:8,67 [2] ViewComponentTagHelperOptionalParam.cshtml) LazyIntermediateToken - (377:8,67 [2] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n TagHelper - (379:9,0 [122] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-with-multiple-types - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper DefaultTagHelperProperty - (417:9,38 [2] ViewComponentTagHelperOptionalParam.cshtml) - age - int OptionalWithMultipleTypesViewComponentTagHelper.age - HtmlAttributeValueStyle.DoubleQuotes LazyIntermediateToken - (417:9,38 [2] ViewComponentTagHelperOptionalParam.cshtml) - CSharp - 12 DefaultTagHelperProperty - (439:9,60 [4] ViewComponentTagHelperOptionalParam.cshtml) - favorite-decimal - double OptionalWithMultipleTypesViewComponentTagHelper.favoriteDecimal - HtmlAttributeValueStyle.DoubleQuotes @@ -75,7 +75,7 @@ LazyIntermediateToken - (501:9,122 [2] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n TagHelper - (503:10,0 [100] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-with-multiple-types - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper DefaultTagHelperProperty - (541:10,38 [2] ViewComponentTagHelperOptionalParam.cshtml) - age - int OptionalWithMultipleTypesViewComponentTagHelper.age - HtmlAttributeValueStyle.DoubleQuotes LazyIntermediateToken - (541:10,38 [2] ViewComponentTagHelperOptionalParam.cshtml) - CSharp - 12 DefaultTagHelperProperty - (563:10,60 [4] ViewComponentTagHelperOptionalParam.cshtml) - favorite-decimal - double OptionalWithMultipleTypesViewComponentTagHelper.favoriteDecimal - HtmlAttributeValueStyle.DoubleQuotes @@ -85,7 +85,7 @@ LazyIntermediateToken - (603:10,100 [2] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n TagHelper - (605:11,0 [126] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-with-multiple-types - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper DefaultTagHelperProperty - (643:11,38 [2] ViewComponentTagHelperOptionalParam.cshtml) - age - int OptionalWithMultipleTypesViewComponentTagHelper.age - HtmlAttributeValueStyle.DoubleQuotes LazyIntermediateToken - (643:11,38 [2] ViewComponentTagHelperOptionalParam.cshtml) - CSharp - 12 DefaultTagHelperProperty - (665:11,60 [4] ViewComponentTagHelperOptionalParam.cshtml) - favorite-decimal - double OptionalWithMultipleTypesViewComponentTagHelper.favoriteDecimal - HtmlAttributeValueStyle.DoubleQuotes @@ -97,7 +97,7 @@ LazyIntermediateToken - (731:11,126 [2] ViewComponentTagHelperOptionalParam.cshtml) - Html - \n TagHelper - (733:12,0 [126] ViewComponentTagHelperOptionalParam.cshtml) - vc:optional-with-multiple-types - TagMode.StartTagAndEndTag DefaultTagHelperBody - - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelperOptionalParam.__Generated__OptionalWithMultipleTypesViewComponentTagHelper DefaultTagHelperProperty - (771:12,38 [2] ViewComponentTagHelperOptionalParam.cshtml) - age - int OptionalWithMultipleTypesViewComponentTagHelper.age - HtmlAttributeValueStyle.DoubleQuotes LazyIntermediateToken - (771:12,38 [2] ViewComponentTagHelperOptionalParam.cshtml) - CSharp - 12 DefaultTagHelperProperty - (793:12,60 [4] ViewComponentTagHelperOptionalParam.cshtml) - favorite-decimal - double OptionalWithMultipleTypesViewComponentTagHelper.favoriteDecimal - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.codegen.cs index eb19091d31e..3ff1d5ee76c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden @@ -25,7 +25,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon #pragma warning restore 0649 private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); private global::AllTagHelper __AllTagHelper; - private global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper __TestViewComponentTagHelper; + private global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper __TestViewComponentTagHelper; #pragma warning disable 219 private void __RazorDirectiveTokenHelpers__() { ((global::System.Action)(() => { @@ -55,7 +55,7 @@ private void __RazorDirectiveTokenHelpers__() { #line hidden #nullable disable __AllTagHelper = CreateTagHelper(); - __TestViewComponentTagHelper = CreateTagHelper(); + __TestViewComponentTagHelper = CreateTagHelper(); #nullable restore #line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml" __o = foo; diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.ir.txt index ef059352dae..a9c80f4be8b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,10 +10,10 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::AllTagHelper - __AllTagHelper - FieldDeclaration - - private - global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper - __TestViewComponentTagHelper + FieldDeclaration - - private - global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper - __TestViewComponentTagHelper DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html @@ -45,7 +45,7 @@ TagHelper - (61:5,0 [50] ViewComponentTagHelper.cshtml) - vc:test - TagMode.StartTagAndEndTag DefaultTagHelperBody - DefaultTagHelperCreate - - AllTagHelper - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper DefaultTagHelperProperty - (82:5,21 [4] ViewComponentTagHelper.cshtml) - first-name - string TestViewComponentTagHelper.firstName - HtmlAttributeValueStyle.DoubleQuotes CSharpExpression - (83:5,22 [3] ViewComponentTagHelper.cshtml) LazyIntermediateToken - (83:5,22 [3] ViewComponentTagHelper.cshtml) - CSharp - foo diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.mappings.txt index 057088936b2..2a460b44375 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_DesignTime.mappings.txt @@ -1,19 +1,19 @@ Source Location: (14:0,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml) |"*, AppCode"| -Generated Location: (1904:33,37 [12] ) +Generated Location: (1947:33,37 [12] ) |"*, AppCode"| Source Location: (30:1,2 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml) | var foo = "Hello"; | -Generated Location: (2412:50,2 [26] ) +Generated Location: (2455:50,2 [26] ) | var foo = "Hello"; | Source Location: (83:5,22 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml) |foo| -Generated Location: (2901:60,22 [3] ) +Generated Location: (2961:60,22 [3] ) |foo| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs index 56a0795ba61..6a736639fb4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9ef17a17b6e1fedefe92b2dd4e87273d3ae73d9b1f8b2ad44ce57c5611f991d3" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,10 +18,10 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { - private global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper __TestViewComponentTagHelper; + private global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper __TestViewComponentTagHelper; private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("bar", " World", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); #line hidden #pragma warning disable 0649 @@ -62,7 +62,7 @@ public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewCompon ); __AllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__AllTagHelper); - __TestViewComponentTagHelper = CreateTagHelper(); + __TestViewComponentTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestViewComponentTagHelper); BeginWriteTagHelperAttribute(); WriteLiteral( diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt index 3a580f4bcfd..dbd7497bf4e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,8 +11,8 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - - FieldDeclaration - - private - global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper - __TestViewComponentTagHelper + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + FieldDeclaration - - private - global::AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper - __TestViewComponentTagHelper PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - bar - World - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::AllTagHelper - __AllTagHelper @@ -24,7 +24,7 @@ TagHelper - (61:5,0 [50] ViewComponentTagHelper.cshtml) - vc:test - TagMode.StartTagAndEndTag DefaultTagHelperBody - DefaultTagHelperCreate - - AllTagHelper - DefaultTagHelperCreate - - AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper + DefaultTagHelperCreate - - AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper DefaultTagHelperProperty - (82:5,21 [4] ViewComponentTagHelper.cshtml) - first-name - string TestViewComponentTagHelper.firstName - HtmlAttributeValueStyle.DoubleQuotes CSharpExpression - (83:5,22 [3] ViewComponentTagHelper.cshtml) LazyIntermediateToken - (83:5,22 [3] ViewComponentTagHelper.cshtml) - CSharp - foo diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.codegen.cs index 7b7b1d9c1d8..cf9a098e8f9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.codegen.cs @@ -16,7 +16,7 @@ namespace Test.Namespace [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.ir.txt index f3b8c4bf6a0..127368efc61 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.ir.txt @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.mappings.txt index 9bc576597c0..e262a3df658 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (11:0,11 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace.cshtml) |Test.Namespace| -Generated Location: (1252:26,44 [14] ) +Generated Location: (1261:26,44 [14] ) |Test.Namespace| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.codegen.cs index 9f90d820011..703910bc92e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.codegen.cs @@ -18,7 +18,7 @@ namespace Test.Namespace [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt index 08028a66683..0084d515daa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (27:1,0 [20] ViewWithNamespace.cshtml) LazyIntermediateToken - (27:1,0 [3] ViewWithNamespace.cshtml) - Html -

#pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.ir.txt index de86e512705..ba2f901ea93 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.mappings.txt index 157f736942d..3462c072be6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (8:0,8 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml) |IHtmlHelper| -Generated Location: (1189:26,0 [19] ) +Generated Location: (1215:26,0 [19] ) |IHtmlHelper| Source Location: (28:0,28 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml) |Helper| -Generated Location: (1482:36,22 [6] ) +Generated Location: (1508:36,22 [6] ) |Helper| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.codegen.cs index e1b5f94bf16..a59ed4b4c39 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "d62f98eaaf5b78af8d93afeee3b564ac056a55d715d72361969351a6dd2ca3b2" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt index 5fb9225a6c9..d617143dc64 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - 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 6f587dfcbe1..8cde3aae0e6 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 e071424669a..9a44b9c2446 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 07c4a5e920b..35a8de78307 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: (1253:26,37 [17] ) +Generated Location: (1279: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 d8ffd3b95f5..243ebcf2aa9 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 405b5c6d5c4..42a48cc7afb 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,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync 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 b75ad02d02d..70f39b825c2 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -44,7 +44,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 bac57b386b6..f4414203409 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,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -18,7 +18,7 @@ IntermediateToken - (223:3,11 [44] AttributeDirective.cshtml) - CSharp - [Conditional("DEBUG"), Conditional("TEST1")] RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 006aec03078..299aedb346b 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: (607:17,11 [56] ) +Generated Location: (624: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: (839:24,11 [51] ) +Generated Location: (856: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: (1066:31,11 [66] ) +Generated Location: (1083: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: (1308:38,11 [44] ) +Generated Location: (1325: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 dc610f6d6d0..24e72f5cd86 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirective.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -50,7 +50,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 b6d17d80ca9..35d72f241bb 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,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -19,7 +19,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 ccb654f6366..ea08f7afb36 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 2242a48e869..229a19759b0 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 3b747b7422b..7643f998ef9 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: (2027:35,38 [15] ) +Generated Location: (2053:35,38 [15] ) |*, TestAssembly| Source Location: (187:5,36 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml) |true| -Generated Location: (3130:58,42 [4] ) +Generated Location: (3156:58,42 [4] ) |true| Source Location: (233:6,36 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml) |true| -Generated Location: (3897:71,42 [4] ) +Generated Location: (3923: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 d5cabab89c3..fdd69b41d50 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeTargetingTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 0add2b2b0b7..1b143bcc8ec 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AttributeTargetingTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 5408bce08b8..0dfdaadb33b 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 index a513815d442..17925588265 100644 --- 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 @@ -9,7 +9,7 @@ Diagnostic(ErrorCode.ERR_InvalidExprTerm, ";").WithArguments(";").WithLocation(1 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), +Diagnostic(ErrorCode.ERR_BadSKunknown, "Foo").WithArguments("AspNetCoreGeneratedDocument.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), @@ -18,7 +18,7 @@ Diagnostic(ErrorCode.ERR_BadArgCount, "Foo").WithArguments("Foo", "2").WithLocat 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), +Diagnostic(ErrorCode.ERR_BadSKunknown, "Foo").WithArguments("AspNetCoreGeneratedDocument.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), 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 bc12cfc2123..fb37c7848d0 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 f982a971eb6..6af791b25a6 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: (1464:33,39 [11] ) +Generated Location: (1490:33,39 [11] ) |await Foo()| Source Location: (247:10,38 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo()| -Generated Location: (1667:40,38 [11] ) +Generated Location: (1693:40,38 [11] ) |await Foo()| Source Location: (304:11,39 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | await Foo(); | -Generated Location: (1871:47,39 [14] ) +Generated Location: (1897:47,39 [14] ) | await Foo(); | Source Location: (371:12,46 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | | -Generated Location: (2084:54,46 [1] ) +Generated Location: (2110:54,46 [1] ) | | Source Location: (376:12,51 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo()| -Generated Location: (2289:61,51 [11] ) +Generated Location: (2315:61,51 [11] ) |await Foo()| Source Location: (391:12,66 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | | -Generated Location: (2520:68,66 [1] ) +Generated Location: (2546:68,66 [1] ) | | Source Location: (448:13,49 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await| -Generated Location: (2723:75,49 [5] ) +Generated Location: (2749:75,49 [5] ) |await| Source Location: (578:18,42 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo(1, 2)| -Generated Location: (2924:82,42 [15] ) +Generated Location: (2950: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: (3144:89,51 [19] ) +Generated Location: (3170: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: (3358:96,41 [22] ) +Generated Location: (3384: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: (3576:103,42 [39] ) +Generated Location: (3602: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: (3819:110,51 [21] ) +Generated Location: (3845:110,51 [21] ) | await Foo.Bar(1, 2) | Source Location: (961:23,49 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | | -Generated Location: (4042:117,49 [1] ) +Generated Location: (4068:117,49 [1] ) | | Source Location: (966:23,54 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await Foo(boolValue: false)| -Generated Location: (4250:124,54 [27] ) +Generated Location: (4276:124,54 [27] ) |await Foo(boolValue: false)| Source Location: (997:23,85 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) | | -Generated Location: (4516:131,85 [1] ) +Generated Location: (4542:131,85 [1] ) | | Source Location: (1057:24,52 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml) |await ("wrrronggg")| -Generated Location: (4722:138,52 [19] ) +Generated Location: (4748: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: (4955:147,12 [76] ) +Generated Location: (4981: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 b14ba777995..1c0297867fa 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 index 689f9027e75..2a1cc187c52 100644 --- 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 @@ -9,7 +9,7 @@ Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments(")").WithLocation(14 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), +Diagnostic(ErrorCode.ERR_BadSKunknown, "Foo").WithArguments("AspNetCoreGeneratedDocument.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), @@ -18,7 +18,7 @@ Diagnostic(ErrorCode.ERR_BadArgCount, "Foo").WithArguments("Foo", "2").WithLocat 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), +Diagnostic(ErrorCode.ERR_BadSKunknown, "Foo").WithArguments("AspNetCoreGeneratedDocument.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), 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 dc8a7217ddb..0ec037d4b56 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 813abd42c27..4cedf81e7ad 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 dd8c964d897..e0c5eb50cef 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 1e0fdaa5abf..e1decd1dc69 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: (1895:34,37 [17] ) +Generated Location: (1921:34,37 [17] ) |"*, TestAssembly"| Source Location: (220:5,38 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml) |ViewBag.DefaultInterval| -Generated Location: (2816:55,38 [23] ) +Generated Location: (2842:55,38 [23] ) |ViewBag.DefaultInterval| Source Location: (303:6,40 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml) |true| -Generated Location: (3628:69,42 [4] ) +Generated Location: (3654: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 bce2a46e832..a59d14a5a71 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 616179e17be..0c8fd38c72d 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ 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 - + ClassDeclaration - - internal sealed - 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 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 b31f7e030d7..b853caca4ce 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: (1922:34,37 [5] ) +Generated Location: (1948:34,37 [5] ) |"THS"| Source Location: (38:1,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml) |"*, TestAssembly"| -Generated Location: (2204:44,37 [17] ) +Generated Location: (2230:44,37 [17] ) |"*, TestAssembly"| Source Location: (226:7,43 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml) |true| -Generated Location: (3120:65,43 [4] ) +Generated Location: (3146: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 0221050c13c..efb984760a1 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_Prefixed.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 5328116dfee..52f73ff911e 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_Prefixed - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 - 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 567029faed2..7fd152a6938 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 0b5c468e147..a99dc8eff04 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ 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 - + ClassDeclaration - - internal sealed - 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 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 293d9af037a..a9fdd47debb 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: (1943:34,37 [17] ) +Generated Location: (1969:34,37 [17] ) |"*, TestAssembly"| Source Location: (50:1,17 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml) |"doesntmatter, nice"| -Generated Location: (2244:44,37 [20] ) +Generated Location: (2270:44,37 [20] ) |"doesntmatter, nice"| Source Location: (234:7,40 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml) |true| -Generated Location: (3772:72,42 [4] ) +Generated Location: (3798: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 1393a8a5025..d31e52b4fe3 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers_RemoveTagHelper.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 786f4e2e2c1..9225bc581ae 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers_RemoveTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 402316266c1..c4b86a40a45 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 5285dd66289..4914fe4eb63 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_BasicTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 a35459d6ee6..eb50361ca56 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 1f837ad032c..b9a6925378a 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 aaa647893d2..4210dc29750 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: (1429:33,2 [18] ) +Generated Location: (1455:33,2 [18] ) | int i = 1; | @@ -10,20 +10,20 @@ Generated Location: (1429:33,2 [18] ) Source Location: (26:4,1 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |while(i <= 10) { | -Generated Location: (1599:41,1 [22] ) +Generated Location: (1625:41,1 [22] ) |while(i <= 10) { | Source Location: (69:5,25 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |i| -Generated Location: (1799:49,25 [1] ) +Generated Location: (1825:49,25 [1] ) |i| Source Location: (75:5,31 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | i += 1; }| -Generated Location: (1985:56,31 [16] ) +Generated Location: (2011:56,31 [16] ) | i += 1; }| @@ -31,14 +31,14 @@ Generated Location: (1985:56,31 [16] ) Source Location: (96:9,1 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |if(i == 11) { | -Generated Location: (2156:65,1 [19] ) +Generated Location: (2182:65,1 [19] ) |if(i == 11) { | Source Location: (140:10,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | }| -Generated Location: (2358:73,29 [3] ) +Generated Location: (2384:73,29 [3] ) | }| @@ -46,7 +46,7 @@ Source Location: (148:13,1 [35] TestFiles/IntegrationTests/CodeGenerationIntegra |switch(i) { case 11: | -Generated Location: (2516:81,1 [35] ) +Generated Location: (2542:81,1 [35] ) |switch(i) { case 11: | @@ -56,7 +56,7 @@ Source Location: (219:15,44 [40] TestFiles/IntegrationTests/CodeGenerationIntegr break; default: | -Generated Location: (2749:90,44 [40] ) +Generated Location: (2775:90,44 [40] ) | break; default: @@ -66,7 +66,7 @@ Source Location: (288:18,37 [19] TestFiles/IntegrationTests/CodeGenerationIntegr | break; }| -Generated Location: (2980:100,37 [19] ) +Generated Location: (3006:100,37 [19] ) | break; }| @@ -74,26 +74,26 @@ Generated Location: (2980:100,37 [19] ) Source Location: (312:22,1 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |for(int j = 1; j <= 10; j += 2) { | -Generated Location: (3154:109,1 [39] ) +Generated Location: (3180: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: (3378:117,31 [1] ) +Generated Location: (3404:117,31 [1] ) |j| Source Location: (384:23,37 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | }| -Generated Location: (3571:124,37 [3] ) +Generated Location: (3597:124,37 [3] ) | }| Source Location: (392:26,1 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |try { | -Generated Location: (3729:132,1 [11] ) +Generated Location: (3755:132,1 [11] ) |try { | @@ -101,39 +101,39 @@ Source Location: (438:27,39 [31] TestFiles/IntegrationTests/CodeGenerationIntegr | } catch(Exception ex) { | -Generated Location: (3933:140,39 [31] ) +Generated Location: (3959:140,39 [31] ) | } catch(Exception ex) { | Source Location: (500:29,35 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |ex.Message| -Generated Location: (4153:149,35 [10] ) +Generated Location: (4179:149,35 [10] ) |ex.Message| Source Location: (515:29,50 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | }| -Generated Location: (4368:156,50 [3] ) +Generated Location: (4394:156,50 [3] ) | }| Source Location: (535:32,13 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |i| -Generated Location: (4538:164,13 [1] ) +Generated Location: (4564:164,13 [1] ) |i| Source Location: (545:34,1 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) |lock(new object()) { | -Generated Location: (4695:171,1 [26] ) +Generated Location: (4721:171,1 [26] ) |lock(new object()) { | Source Location: (618:35,51 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml) | }| -Generated Location: (4926:179,51 [3] ) +Generated Location: (4952: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 4c9c14d6453..152f3fba272 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 229a4bc4796..c8d18bd5e40 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 3cc09bc5ca0..0097ccd496b 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 8308b1d58cd..c5bbb5cf5fd 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper DesignTimeDirective - 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 e9fbf19e162..19c393663d0 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: (1984:39,6 [187] ) +Generated Location: (2010:39,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: (2378:52,53 [253] ) +Generated Location: (2404:52,53 [253] ) | int Sixteen = 0b0001_0000; @@ -40,7 +40,7 @@ Source Location: (509:15,5 [159] TestFiles/IntegrationTests/CodeGenerationIntegr // Do Something } }| -Generated Location: (2791:65,5 [159] ) +Generated Location: (2817:65,5 [159] ) |if (nameLookup.TryGetValue("John Doe", out var entry)) { if (entry.Extra is bool alive) @@ -51,12 +51,12 @@ Generated Location: (2791:65,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: (3144:78,39 [62] ) +Generated Location: (3170:78,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: (3372:85,10 [34] ) +Generated Location: (3398:85,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: (3567:92,5 [291] ) +Generated Location: (3593:92,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 95477dd0bdb..78e407e146a 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp7.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 648473989c3..94404ac098b 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp7 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync 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 f969d0fd6c2..7ffd58a7ca1 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -20,7 +20,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 b373f7b031a..f48c4d06729 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (67:2,1 [25] ) - global::System.Linq @@ -10,7 +10,7 @@ UsingDirective - (1:0,1 [32] CSharp8.cshtml) - System.Collections.Generic RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 4f44d6d810c..25a1fcb62ae 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: (501:14,0 [32] ) +Generated Location: (518: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: (1535:37,2 [396] ) +Generated Location: (1561:37,2 [396] ) | IAsyncEnumerable GetAsyncEnumerable() { @@ -50,12 +50,12 @@ Generated Location: (1535:37,2 [396] ) Source Location: (441:24,1 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |words[1..2]| -Generated Location: (2090:63,6 [11] ) +Generated Location: (2116:63,6 [11] ) |words[1..2]| Source Location: (456:25,2 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |words[^2..^0]| -Generated Location: (2263:70,6 [13] ) +Generated Location: (2289: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: (2438:77,6 [121] ) +Generated Location: (2464: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: (2716:89,1 [56] ) +Generated Location: (2742:89,1 [56] ) |await foreach (var val in GetAsyncEnumerable()) { | Source Location: (660:36,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |val| -Generated Location: (2933:98,6 [3] ) +Generated Location: (2959:98,6 [3] ) |val| Source Location: (663:36,8 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) | }| -Generated Location: (3100:105,8 [3] ) +Generated Location: (3126:105,8 [3] ) | }| Source Location: (671:39,1 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |Person!.Name| -Generated Location: (3264:113,6 [12] ) +Generated Location: (3290:113,6 [12] ) |Person!.Name| Source Location: (686:40,1 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |People![0]!.Name![1]| -Generated Location: (3438:120,6 [20] ) +Generated Location: (3464:120,6 [20] ) |People![0]!.Name![1]| Source Location: (709:41,1 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml) |DoSomething!(Person!)| -Generated Location: (3620:127,6 [21] ) +Generated Location: (3646: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: (3858:136,12 [480] ) +Generated Location: (3884: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 f8268b0cd78..7e11f565e73 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -23,7 +23,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 07cef4d143d..bb528f13498 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (67:2,1 [27] ) - global::System.Linq UsingDirective - (95:3,1 [38] ) - global::System.Threading.Tasks @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CSharp8 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 55930c96a43..ac3817a6e41 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 92a30b69fac..f9f02115c98 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 6e5397874cf..69db1115a6a 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: (1453:33,2 [0] ) +Generated Location: (1479: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 43761ebc530..1ea22d8d369 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 46ed83af606..b59b9bac1d8 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 - 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 1dce3d1b292..116237cce97 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 0b3b55dff00..bf304bf85e7 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 3199ac454f0..4cec43ff035 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: (1483:33,2 [17] ) +Generated Location: (1509:33,2 [17] ) | var a = 1; | Source Location: (35:1,31 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml) | var b = 1; | -Generated Location: (1702:41,31 [22] ) +Generated Location: (1728:41,31 [22] ) | var b = 1; | Source Location: (69:2,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml) |a+b| -Generated Location: (1924:49,29 [3] ) +Generated Location: (1950:49,29 [3] ) |a+b| Source Location: (80:2,40 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml) | | -Generated Location: (2139:56,40 [2] ) +Generated Location: (2165: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 7f668787152..217b68c331c 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 8f487442e4c..b3d714dc1dd 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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; 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 96aef18f567..4684c3b37fc 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 288c22a3821..dcfcf916fca 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 3f70eea5943..55124aae89b 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: (1438:33,2 [115] ) +Generated Location: (1464: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 2ff6258f254..a4af83b4488 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 863496486a1..5fb10616cde 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 0764134d992..9ee02ac7722 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 5629bcc9adb..37adc76a699 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 084d1f475d6..1e00f4f822d 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: (1901:34,37 [17] ) +Generated Location: (1927: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: (2408:51,1 [52] ) +Generated Location: (2434:51,1 [52] ) |if (true) { var checkbox = "checkbox"; @@ -18,39 +18,39 @@ Generated Location: (2408:51,1 [52] ) Source Location: (147:7,16 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |@| -Generated Location: (2752:63,33 [1] ) +Generated Location: (2778:63,33 [1] ) |@| Source Location: (149:7,18 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) || -Generated Location: (2753:63,34 [0] ) +Generated Location: (2779:63,34 [0] ) || Source Location: (149:7,18 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |@| -Generated Location: (2753:63,34 [1] ) +Generated Location: (2779:63,34 [1] ) |@| Source Location: (150:7,19 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (2754:63,35 [1] ) +Generated Location: (2780:63,35 [1] ) |(| Source Location: (151:7,20 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |1+2| -Generated Location: (2755:63,36 [3] ) +Generated Location: (2781:63,36 [3] ) |1+2| Source Location: (154:7,23 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (2758:63,39 [1] ) +Generated Location: (2784:63,39 [1] ) |)| Source Location: (273:10,13 [43] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |if (false) { | -Generated Location: (3014:71,13 [43] ) +Generated Location: (3040:71,13 [43] ) |if (false) { | @@ -61,7 +61,7 @@ Source Location: (399:12,99 [66] TestFiles/IntegrationTests/CodeGenerationIntegr else { | -Generated Location: (3924:87,99 [66] ) +Generated Location: (3950:87,99 [66] ) | } else @@ -70,159 +70,159 @@ Generated Location: (3924:87,99 [66] ) Source Location: (495:16,46 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |checkbox| -Generated Location: (4409:100,46 [8] ) +Generated Location: (4435:100,46 [8] ) |checkbox| Source Location: (512:16,63 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |true| -Generated Location: (4800:109,63 [4] ) +Generated Location: (4826:109,63 [4] ) |true| Source Location: (523:16,74 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | | -Generated Location: (5291:119,74 [18] ) +Generated Location: (5317:119,74 [18] ) | | Source Location: (556:17,31 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |true ? "checkbox" : "anything"| -Generated Location: (5713:129,31 [30] ) +Generated Location: (5739:129,31 [30] ) |true ? "checkbox" : "anything"| Source Location: (591:17,66 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | | -Generated Location: (6205:139,66 [18] ) +Generated Location: (6231:139,66 [18] ) | | Source Location: (623:18,30 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |if(true) { | -Generated Location: (6626:149,30 [11] ) +Generated Location: (6652:149,30 [11] ) |if(true) { | Source Location: (655:18,62 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | } else { | -Generated Location: (6864:156,62 [10] ) +Generated Location: (6890:156,62 [10] ) | } else { | Source Location: (686:18,93 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | }| -Generated Location: (7132:163,93 [2] ) +Generated Location: (7158:163,93 [2] ) | }| Source Location: (690:18,97 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | }| -Generated Location: (7626:173,97 [15] ) +Generated Location: (7652:173,97 [15] ) | }| Source Location: (212:8,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTime.Now| -Generated Location: (7932:182,32 [12] ) +Generated Location: (7958:182,32 [12] ) |DateTime.Now| Source Location: (832:22,14 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | var @object = false;| -Generated Location: (8200:190,14 [21] ) +Generated Location: (8226:190,14 [21] ) | var @object = false;| Source Location: (885:23,29 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (8636:199,42 [1] ) +Generated Location: (8662:199,42 [1] ) |(| Source Location: (886:23,30 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |@object| -Generated Location: (8637:199,43 [7] ) +Generated Location: (8663:199,43 [7] ) |@object| Source Location: (893:23,37 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (8644:199,50 [1] ) +Generated Location: (8670:199,50 [1] ) |)| Source Location: (760:21,39 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTimeOffset.Now.Year - 1970| -Generated Location: (9020:208,38 [30] ) +Generated Location: (9046:208,38 [30] ) |DateTimeOffset.Now.Year - 1970| Source Location: (1025:26,61 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (9560:218,60 [1] ) +Generated Location: (9586:218,60 [1] ) |(| Source Location: (1026:26,62 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTimeOffset.Now.Year > 2014| -Generated Location: (9561:218,61 [30] ) +Generated Location: (9587:218,61 [30] ) |DateTimeOffset.Now.Year > 2014| Source Location: (1056:26,92 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (9591:218,91 [1] ) +Generated Location: (9617:218,91 [1] ) |)| Source Location: (928:25,16 [32] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |-1970 + @DateTimeOffset.Now.Year| -Generated Location: (9962:227,33 [32] ) +Generated Location: (9988:227,33 [32] ) |-1970 + @DateTimeOffset.Now.Year| Source Location: (1155:29,28 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTimeOffset.Now.Year > 2014| -Generated Location: (10486:237,42 [30] ) +Generated Location: (10512:237,42 [30] ) |DateTimeOffset.Now.Year > 2014| Source Location: (1093:28,16 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |DateTimeOffset.Now.Year - 1970| -Generated Location: (10886:246,33 [30] ) +Generated Location: (10912:246,33 [30] ) |DateTimeOffset.Now.Year - 1970| Source Location: (1283:32,28 [43] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | @( DateTimeOffset.Now.Year ) > 2014 | -Generated Location: (11408:256,42 [43] ) +Generated Location: (11434:256,42 [43] ) | @( DateTimeOffset.Now.Year ) > 2014 | Source Location: (1220:31,17 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |(| -Generated Location: (11821:265,33 [1] ) +Generated Location: (11847:265,33 [1] ) |(| Source Location: (1221:31,18 [29] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |"My age is this long.".Length| -Generated Location: (11822:265,34 [29] ) +Generated Location: (11848:265,34 [29] ) |"My age is this long.".Length| Source Location: (1250:31,47 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (11851:265,63 [1] ) +Generated Location: (11877:265,63 [1] ) |)| Source Location: (1355:34,9 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |someMethod(| -Generated Location: (12103:273,9 [11] ) +Generated Location: (12129:273,9 [11] ) |someMethod(| Source Location: (1410:34,64 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |checked| -Generated Location: (12583:278,63 [7] ) +Generated Location: (12609:278,63 [7] ) |checked| Source Location: (1375:34,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |123| -Generated Location: (12944:287,33 [3] ) +Generated Location: (12970:287,33 [3] ) |123| Source Location: (1424:34,78 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) |)| -Generated Location: (13072:294,1 [1] ) +Generated Location: (13098:294,1 [1] ) |)| Source Location: (1469:36,10 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml) | }| -Generated Location: (13619:310,10 [3] ) +Generated Location: (13645: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 513c0353eae..2231a483d54 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 43dfcf928a3..dffaa409027 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ComplexTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.codegen.cs index d91b68b31f0..d8e2ad4f31a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.ir.txt index 1e6a91531c1..652d1a3c1a8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.mappings.txt index 6351ea88ec2..d5cd59517f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_DesignTime.mappings.txt @@ -4,7 +4,7 @@ var cls = "bar"; var s = "str"; | -Generated Location: (2043:39,2 [68] ) +Generated Location: (2069:39,2 [68] ) | var ch = true; var cls = "bar"; @@ -13,260 +13,260 @@ Generated Location: (2043:39,2 [68] ) Source Location: (74:4,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (2288:50,8 [1] ) +Generated Location: (2314:50,8 [1] ) |s| Source Location: (87:4,21 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (2480:57,21 [6] ) +Generated Location: (2506:57,21 [6] ) | | Source Location: (97:5,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (2663:65,8 [1] ) +Generated Location: (2689:65,8 [1] ) |s| Source Location: (107:5,18 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |cls| -Generated Location: (2852:72,18 [3] ) +Generated Location: (2878:72,18 [3] ) |cls| Source Location: (114:5,25 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (3050:79,25 [6] ) +Generated Location: (3076:79,25 [6] ) | | Source Location: (124:6,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (3233:87,8 [1] ) +Generated Location: (3259:87,8 [1] ) |s| Source Location: (136:6,20 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |cls| -Generated Location: (3424:94,20 [3] ) +Generated Location: (3450:94,20 [3] ) |cls| Source Location: (143:6,27 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (3624:101,27 [6] ) +Generated Location: (3650:101,27 [6] ) | | Source Location: (153:7,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (3807:109,8 [1] ) +Generated Location: (3833:109,8 [1] ) |s| Source Location: (163:7,18 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |cls| -Generated Location: (3996:116,18 [3] ) +Generated Location: (4022:116,18 [3] ) |cls| Source Location: (172:7,27 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (4196:123,27 [6] ) +Generated Location: (4222:123,27 [6] ) | | Source Location: (202:8,28 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (4399:131,28 [1] ) +Generated Location: (4425:131,28 [1] ) |s| Source Location: (214:8,40 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |ch| -Generated Location: (4610:138,40 [2] ) +Generated Location: (4636:138,40 [2] ) |ch| Source Location: (220:8,46 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (4828:145,46 [6] ) +Generated Location: (4854:145,46 [6] ) | | Source Location: (250:9,28 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (5032:153,28 [1] ) +Generated Location: (5058:153,28 [1] ) |s| Source Location: (264:9,42 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |ch| -Generated Location: (5246:160,42 [2] ) +Generated Location: (5272:160,42 [2] ) |ch| Source Location: (270:9,48 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (5467:167,48 [6] ) +Generated Location: (5493:167,48 [6] ) | | Source Location: (280:10,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (5651:175,8 [1] ) +Generated Location: (5677:175,8 [1] ) |s| Source Location: (290:10,18 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |if(cls != null) { | -Generated Location: (5841:182,18 [18] ) +Generated Location: (5867:182,18 [18] ) |if(cls != null) { | Source Location: (309:10,37 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |cls| -Generated Location: (6066:189,37 [3] ) +Generated Location: (6092:189,37 [3] ) |cls| Source Location: (312:10,40 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | }| -Generated Location: (6280:196,40 [2] ) +Generated Location: (6306:196,40 [2] ) | }| Source Location: (318:10,46 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (6498:203,46 [6] ) +Generated Location: (6524:203,46 [6] ) | | Source Location: (343:11,23 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (6948:213,23 [6] ) +Generated Location: (6974:213,23 [6] ) | | Source Location: (358:12,13 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (7137:221,13 [1] ) +Generated Location: (7163:221,13 [1] ) |s| Source Location: (366:12,21 [44] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |Url.Content("~/Scripts/jquery-1.6.2.min.js")| -Generated Location: (7330:228,21 [44] ) +Generated Location: (7356:228,21 [44] ) |Url.Content("~/Scripts/jquery-1.6.2.min.js")| Source Location: (444:12,99 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (7644:235,99 [6] ) +Generated Location: (7670:235,99 [6] ) | | Source Location: (454:13,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (7828:243,8 [1] ) +Generated Location: (7854:243,8 [1] ) |s| Source Location: (464:13,18 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |null| -Generated Location: (8018:250,18 [4] ) +Generated Location: (8044:250,18 [4] ) |null| Source Location: (472:13,26 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (8219:257,26 [6] ) +Generated Location: (8245:257,26 [6] ) | | Source Location: (489:14,15 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |null| -Generated Location: (8410:265,15 [4] ) +Generated Location: (8436:265,15 [4] ) |null| Source Location: (496:14,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (8607:272,22 [1] ) +Generated Location: (8633:272,22 [1] ) |s| Source Location: (500:14,26 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (8805:279,26 [8] ) +Generated Location: (8831:279,26 [8] ) | | Source Location: (526:16,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (9005:288,22 [1] ) +Generated Location: (9031:288,22 [1] ) |s| Source Location: (536:16,32 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |null| -Generated Location: (9209:295,32 [4] ) +Generated Location: (9235:295,32 [4] ) |null| Source Location: (547:16,43 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (9427:302,43 [8] ) +Generated Location: (9453:302,43 [8] ) | | Source Location: (560:18,9 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s + s| -Generated Location: (9614:311,9 [5] ) +Generated Location: (9640:311,9 [5] ) |s + s| Source Location: (575:18,24 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |null| -Generated Location: (9814:318,24 [4] ) +Generated Location: (9840:318,24 [4] ) |null| Source Location: (586:18,35 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (10024:325,35 [6] ) +Generated Location: (10050:325,35 [6] ) | | Source Location: (597:19,9 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |if (s.Length != 0) { | -Generated Location: (10209:333,9 [21] ) +Generated Location: (10235:333,9 [21] ) |if (s.Length != 0) { | Source Location: (619:19,31 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |s| -Generated Location: (10431:340,31 [1] ) +Generated Location: (10457:340,31 [1] ) |s| Source Location: (620:19,32 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | }| -Generated Location: (10635:347,32 [2] ) +Generated Location: (10661:347,32 [2] ) | }| Source Location: (632:19,44 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |null| -Generated Location: (10851:354,44 [4] ) +Generated Location: (10877:354,44 [4] ) |null| Source Location: (643:19,55 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (11081:361,55 [6] ) +Generated Location: (11107:361,55 [6] ) | | Source Location: (664:20,19 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) |null| -Generated Location: (11276:369,19 [4] ) +Generated Location: (11302:369,19 [4] ) |null| Source Location: (675:20,30 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml) | | -Generated Location: (11481:376,30 [2] ) +Generated Location: (11507:376,30 [2] ) | | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.codegen.cs index bfdfcbda387..153ac8d223e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "ee976c57374bafda343bd6b2086b223381f842016566d5a83498a6d0cbec2f54" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2 : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.ir.txt index a3910916ddd..3d7276f2fd7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes2 - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync 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 569b502fc05..4718cc66817 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 bcdf748d694..a4919b59b3c 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper DesignTimeDirective - 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 46e2d14236f..5f732519386 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: (2040:39,2 [48] ) +Generated Location: (2066:39,2 [48] ) | var ch = true; var cls = "bar"; @@ -12,139 +12,139 @@ Generated Location: (2040:39,2 [48] ) Source Location: (66:3,20 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (2276:49,20 [6] ) +Generated Location: (2302:49,20 [6] ) | | Source Location: (83:4,15 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |cls| -Generated Location: (2465:57,15 [3] ) +Generated Location: (2491:57,15 [3] ) |cls| Source Location: (90:4,22 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (2659:64,22 [6] ) +Generated Location: (2685:64,22 [6] ) | | Source Location: (111:5,19 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |cls| -Generated Location: (2852:72,19 [3] ) +Generated Location: (2878:72,19 [3] ) |cls| Source Location: (118:5,26 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (3050:79,26 [6] ) +Generated Location: (3076:79,26 [6] ) | | Source Location: (135:6,15 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |cls| -Generated Location: (3239:87,15 [3] ) +Generated Location: (3265:87,15 [3] ) |cls| Source Location: (146:6,26 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (3437:94,26 [6] ) +Generated Location: (3463:94,26 [6] ) | | Source Location: (185:7,37 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |ch| -Generated Location: (3648:102,37 [2] ) +Generated Location: (3674:102,37 [2] ) |ch| Source Location: (191:7,43 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (3862:109,43 [6] ) +Generated Location: (3888:109,43 [6] ) | | Source Location: (234:8,41 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |ch| -Generated Location: (4077:117,41 [2] ) +Generated Location: (4103:117,41 [2] ) |ch| Source Location: (240:8,47 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (4295:124,47 [6] ) +Generated Location: (4321:124,47 [6] ) | | Source Location: (257:9,15 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |if(cls != null) { | -Generated Location: (4485:132,15 [18] ) +Generated Location: (4511:132,15 [18] ) |if(cls != null) { | Source Location: (276:9,34 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |cls| -Generated Location: (4706:139,34 [3] ) +Generated Location: (4732:139,34 [3] ) |cls| Source Location: (279:9,37 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | }| -Generated Location: (4916:146,37 [2] ) +Generated Location: (4942:146,37 [2] ) | }| Source Location: (285:9,43 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (5130:153,43 [6] ) +Generated Location: (5156:153,43 [6] ) | | Source Location: (309:10,22 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (5578:163,22 [6] ) +Generated Location: (5604:163,22 [6] ) | | Source Location: (329:11,18 [44] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |Url.Content("~/Scripts/jquery-1.6.2.min.js")| -Generated Location: (5771:171,18 [44] ) +Generated Location: (5797:171,18 [44] ) |Url.Content("~/Scripts/jquery-1.6.2.min.js")| Source Location: (407:11,96 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (6081:178,96 [6] ) +Generated Location: (6107:178,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: (6274:186,18 [60] ) +Generated Location: (6300:186,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: (6616:193,112 [6] ) +Generated Location: (6642:193,112 [6] ) | | Source Location: (638:13,115 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (6906:201,115 [6] ) +Generated Location: (6932:201,115 [6] ) | | Source Location: (655:14,15 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) |null| -Generated Location: (7096:209,15 [4] ) +Generated Location: (7122:209,15 [4] ) |null| Source Location: (663:14,23 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml) | | -Generated Location: (7293:216,23 [2] ) +Generated Location: (7319:216,23 [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 c1bbb67fd09..7352b7eef17 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,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "ea68cb71b106404af0072bb70c04f6d73d165cf4aabc5d838b668d681625b53c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes : 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("~/Foo"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); 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 5e343b65339..5537c044784 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - href - ~/Foo - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper 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 6b8b6332059..460df69b0ac 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 d1e1b7b2bbb..a41230d2a4c 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 c9ac98daec0..45c8500c3a6 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: (2238:37,37 [17] ) +Generated Location: (2264:37,37 [17] ) |"*, TestAssembly"| Source Location: (156:5,12 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml) |false| -Generated Location: (3786:64,12 [5] ) +Generated Location: (3812:64,12 [5] ) |false| Source Location: (237:7,11 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml) |false| -Generated Location: (4165:73,11 [5] ) +Generated Location: (4191:73,11 [5] ) |false| Source Location: (333:9,25 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml) |false| -Generated Location: (4744:84,25 [5] ) +Generated Location: (4770: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 42a9dffd1e3..57b193b8358 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CssSelectorTagHelperAttributes.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 3468d006363..3800a207ac7 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CssSelectorTagHelperAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 0cee17ac0f8..dd6691489c0 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 869b681ff3f..8f81b39d924 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 90e59b7be2d..e2c5e7cf3dc 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: (1206:26,22 [6] ) +Generated Location: (1232:26,22 [6] ) |Footer| Source Location: (20:1,13 [36] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |for(int i = 1; i <= 10; i++) { | -Generated Location: (1715:43,13 [36] ) +Generated Location: (1741:43,13 [36] ) |for(int i = 1; i <= 10; i++) { | Source Location: (74:2,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |i| -Generated Location: (1930:51,22 [1] ) +Generated Location: (1956:51,22 [1] ) |i| Source Location: (79:2,27 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) | }| -Generated Location: (2116:58,27 [15] ) +Generated Location: (2142:58,27 [15] ) | }| Source Location: (113:7,2 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |Foo(Bar.Baz)| -Generated Location: (2294:66,6 [12] ) +Generated Location: (2320:66,6 [12] ) |Foo(Bar.Baz)| Source Location: (129:8,1 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |Foo(| -Generated Location: (2470:73,6 [4] ) +Generated Location: (2496:73,6 [4] ) |Foo(| Source Location: (142:8,14 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |baz| -Generated Location: (2694:76,14 [3] ) +Generated Location: (2720:76,14 [3] ) |baz| Source Location: (153:8,25 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |)| -Generated Location: (2754:82,1 [1] ) +Generated Location: (2780:82,1 [1] ) |)| Source Location: (204:13,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml) |bar| -Generated Location: (2992:90,6 [3] ) +Generated Location: (3018: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 3e4d5adae63..38d5316861c 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 bcade08ec7c..d9c96bec741 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 -
#pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 d9f2bbc2f60..0c716bae0fa 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 9fa8793cc23..8f0e77bc16c 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: (1934:34,37 [17] ) +Generated Location: (1960:34,37 [17] ) |"*, TestAssembly"| Source Location: (146:4,34 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) |true| -Generated Location: (3285:60,42 [4] ) +Generated Location: (3311:60,42 [4] ) |true| Source Location: (222:5,34 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) |true| -Generated Location: (3941:72,42 [4] ) +Generated Location: (3967:72,42 [4] ) |true| Source Location: (43:2,8 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml) |3| -Generated Location: (4325:81,33 [1] ) +Generated Location: (4351: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 02d1285c41e..2535b9757c7 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateAttributeTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 574b02ba84b..19d2527db62 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 a943f1ac1d7..1a68fb4fde6 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 c152eb2adf9..fb07d41cd6c 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 484e1c1bd98..ed02bd13a35 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: (1848:33,37 [17] ) +Generated Location: (1874:33,37 [17] ) |"*, TestAssembly"| Source Location: (67:2,32 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml) |true| -Generated Location: (2768:54,41 [4] ) +Generated Location: (2794: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 9187b068bd6..e9136ccf8e3 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DuplicateTargetTagHelper.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 4c64ca624b4..f65e29ebcdd 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DuplicateTargetTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 ec0a31f34c0..e705fa17878 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 446cdaa397b..df9640abd44 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper DesignTimeDirective - 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 fbb4920baee..82ee2fb1c8a 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: (1762:32,37 [17] ) +Generated Location: (1788:32,37 [17] ) |"*, TestAssembly"| Source Location: (59:2,24 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |DateTime.Now| -Generated Location: (2404:50,24 [12] ) +Generated Location: (2430:50,24 [12] ) |DateTime.Now| Source Location: (96:4,17 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |if (true) { | -Generated Location: (2786:59,17 [12] ) +Generated Location: (2812:59,17 [12] ) |if (true) { | Source Location: (109:4,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |string.Empty| -Generated Location: (3001:66,30 [12] ) +Generated Location: (3027:66,30 [12] ) |string.Empty| Source Location: (121:4,42 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | } else { | -Generated Location: (3229:73,42 [10] ) +Generated Location: (3255:73,42 [10] ) | } else { | Source Location: (132:4,53 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |false| -Generated Location: (3465:80,53 [5] ) +Generated Location: (3491:80,53 [5] ) |false| Source Location: (137:4,58 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | }| -Generated Location: (3702:87,58 [2] ) +Generated Location: (3728:87,58 [2] ) | }| Source Location: (176:6,22 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |DateTime.Now| -Generated Location: (4078:96,22 [12] ) +Generated Location: (4104:96,22 [12] ) |DateTime.Now| Source Location: (214:6,60 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |DateTime.Now| -Generated Location: (4390:104,60 [12] ) +Generated Location: (4416:104,60 [12] ) |DateTime.Now| Source Location: (256:8,15 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |long.MinValue| -Generated Location: (4770:113,15 [13] ) +Generated Location: (4796:113,15 [13] ) |long.MinValue| Source Location: (271:8,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |if (true) { | -Generated Location: (4987:120,30 [12] ) +Generated Location: (5013:120,30 [12] ) |if (true) { | Source Location: (284:8,43 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |string.Empty| -Generated Location: (5215:127,43 [12] ) +Generated Location: (5241:127,43 [12] ) |string.Empty| Source Location: (296:8,55 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | } else { | -Generated Location: (5456:134,55 [10] ) +Generated Location: (5482:134,55 [10] ) | } else { | Source Location: (307:8,66 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |false| -Generated Location: (5705:141,66 [5] ) +Generated Location: (5731:141,66 [5] ) |false| Source Location: (312:8,71 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | }| -Generated Location: (5955:148,71 [2] ) +Generated Location: (5981:148,71 [2] ) | }| Source Location: (316:8,75 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |int.MaxValue| -Generated Location: (6205:155,75 [12] ) +Generated Location: (6231:155,75 [12] ) |int.MaxValue| Source Location: (348:9,17 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |long.MinValue| -Generated Location: (6475:163,17 [13] ) +Generated Location: (6501:163,17 [13] ) |long.MinValue| Source Location: (363:9,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |if (true) { | -Generated Location: (6695:170,32 [12] ) +Generated Location: (6721:170,32 [12] ) |if (true) { | Source Location: (376:9,45 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |string.Empty| -Generated Location: (6926:177,45 [12] ) +Generated Location: (6952:177,45 [12] ) |string.Empty| Source Location: (388:9,57 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | } else { | -Generated Location: (7170:184,57 [10] ) +Generated Location: (7196:184,57 [10] ) | } else { | Source Location: (399:9,68 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |false| -Generated Location: (7422:191,68 [5] ) +Generated Location: (7448:191,68 [5] ) |false| Source Location: (404:9,73 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | }| -Generated Location: (7675:198,73 [2] ) +Generated Location: (7701:198,73 [2] ) | }| Source Location: (408:9,77 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |int.MaxValue| -Generated Location: (7928:205,77 [12] ) +Generated Location: (7954:205,77 [12] ) |int.MaxValue| Source Location: (445:11,17 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |long.MinValue| -Generated Location: (8311:214,17 [13] ) +Generated Location: (8337:214,17 [13] ) |long.MinValue| Source Location: (460:11,32 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |DateTime.Now| -Generated Location: (8531:221,32 [12] ) +Generated Location: (8557:221,32 [12] ) |DateTime.Now| Source Location: (492:11,64 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |int.MaxValue| -Generated Location: (8782:228,64 [12] ) +Generated Location: (8808:228,64 [12] ) |int.MaxValue| Source Location: (529:13,17 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |if (true) { | -Generated Location: (9165:237,17 [12] ) +Generated Location: (9191:237,17 [12] ) |if (true) { | Source Location: (542:13,30 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |string.Empty| -Generated Location: (9381:244,30 [12] ) +Generated Location: (9407:244,30 [12] ) |string.Empty| Source Location: (554:13,42 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | } else { | -Generated Location: (9610:251,42 [10] ) +Generated Location: (9636:251,42 [10] ) | } else { | Source Location: (565:13,53 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) |false| -Generated Location: (9847:258,53 [5] ) +Generated Location: (9873:258,53 [5] ) |false| Source Location: (570:13,58 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml) | }| -Generated Location: (10085:265,58 [2] ) +Generated Location: (10111: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 151e828a910..81377e037e7 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DynamicAttributeTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 b7fcc6f58bf..267b78e1983 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DynamicAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync 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 226b64fc72f..28908b71ba5 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 904b2f9d7c2..4dbc2c08726 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 958efd00e64..76535bef739 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: (1923:34,38 [15] ) +Generated Location: (1949:34,38 [15] ) |*, TestAssembly| Source Location: (66:3,26 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) || -Generated Location: (2829:55,42 [0] ) +Generated Location: (2855:55,42 [0] ) || Source Location: (126:5,30 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) || -Generated Location: (3471:67,42 [0] ) +Generated Location: (3497:67,42 [0] ) || Source Location: (92:4,12 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml) || -Generated Location: (3847:76,33 [0] ) +Generated Location: (3873: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 172586535bc..47532ab4c99 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyAttributeTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed 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); 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 8576c78b969..703dc6dde0b 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - type - - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - class - - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - 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 5bea3a23350..550c145c6a2 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 461556fa047..93e01fddb1b 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 e6735cb40f1..e636f88cf1c 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: (1453:33,2 [0] ) +Generated Location: (1479: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 e4108a2bec7..2c439670fa6 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 01291b49098..e427287c554 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 6cab863c365..639b66b487d 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 8e71bfcab23..29bcd1fe25f 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 3819be7ae9e..71c7b3da6cd 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: (1484:33,6 [0] ) +Generated Location: (1510: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 3885320435c..5da11f24b59 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 9f1792bdc67..b6249f71638 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 54002fc43c8..9d5c0d4c77a 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 5cd13e99059..22ad9da3b97 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 9147bf1a63d..a3e71fbcd1b 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: (1498:33,2 [6] ) +Generated Location: (1524:33,2 [6] ) | | Source Location: (9:1,5 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml) || -Generated Location: (1686:41,6 [0] ) +Generated Location: (1712:41,6 [0] ) || Source Location: (9:1,5 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml) | | -Generated Location: (1868:48,5 [2] ) +Generated Location: (1894: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 05789d9df8d..caec95f7a73 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 0b72a52b1b2..11f58107e2c 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 2d5fcca8d19..92fafd86bd2 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 d2e8477cebc..f328d60f2e7 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 faf46353bbc..618f7b466d0 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: (1484:33,6 [0] ) +Generated Location: (1510: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 40120aee815..195230c8308 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 35e11fc00c0..ee8555695bf 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 9e17c235572..c3faf60048d 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 682576e5ec7..3bd1127535b 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 6784cb1636d..723af2531c7 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: (1818:33,37 [17] ) +Generated Location: (1844:33,37 [17] ) |"*, TestAssembly"| Source Location: (37:2,2 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) | var enumValue = MyEnum.MyValue; | -Generated Location: (2323:50,2 [39] ) +Generated Location: (2349:50,2 [39] ) | var enumValue = MyEnum.MyValue; | Source Location: (96:6,15 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MyEnum.MyValue| -Generated Location: (2772:60,39 [14] ) +Generated Location: (2798:60,39 [14] ) |MyEnum.MyValue| Source Location: (131:7,15 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MyEnum.MySecondValue| -Generated Location: (3251:70,15 [20] ) +Generated Location: (3277:70,15 [20] ) |MyEnum.MySecondValue| Source Location: (171:8,14 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MyValue| -Generated Location: (3853:80,132 [7] ) +Generated Location: (3879:80,132 [7] ) |MyValue| Source Location: (198:9,14 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MySecondValue| -Generated Location: (4443:90,132 [13] ) +Generated Location: (4469:90,132 [13] ) |MySecondValue| Source Location: (224:9,40 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |MyValue| -Generated Location: (4757:97,138 [7] ) +Generated Location: (4783:97,138 [7] ) |MyValue| Source Location: (251:10,15 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |enumValue| -Generated Location: (5254:107,39 [9] ) +Generated Location: (5280:107,39 [9] ) |enumValue| Source Location: (274:10,38 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml) |enumValue| -Generated Location: (5471:114,45 [9] ) +Generated Location: (5497: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 34161e8ccd5..232a196a398 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EnumTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 8a79d57bf54..f5017c5096b 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EnumTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.codegen.cs index 19702e4b4d3..51eea673edd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.ir.txt index 3ee270e2db6..5906dc0ac97 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.mappings.txt index 83511484f63..ede2743a1c6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml) |"*, TestAssembly"| -Generated Location: (1707:32,37 [17] ) +Generated Location: (1733:32,37 [17] ) |"*, TestAssembly"| Source Location: (48:2,13 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml) |new string("1, 2")| -Generated Location: (2315:50,27 [18] ) +Generated Location: (2341:50,27 [18] ) |new string("1, 2")| Source Location: (84:3,12 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml) |new string("1, 2")| -Generated Location: (2676:59,27 [18] ) +Generated Location: (2702:59,27 [18] ) |new string("1, 2")| Source Location: (120:4,12 [24] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml) |"0" + new @String("1 2")| -Generated Location: (3037:68,27 [24] ) +Generated Location: (3063:68,27 [24] ) |"0" + new @String("1 2")| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.codegen.cs index c752c653108..4efc9b94f06 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "e4df6041980536333164e3380678ce837699cd137aff68cc9358167dcaafba83" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.ir.txt index edd8d1f9c18..fd56752764d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync 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 cf4e5e36ebf..a419af478f5 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 c6046b8773f..3d40be628b4 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper DesignTimeDirective - 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 f32e9f0cae4..22d6efb6abf 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,6 +1,6 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |"*, TestAssembly"| -Generated Location: (1707:32,37 [17] ) +Generated Location: (1733:32,37 [17] ) |"*, TestAssembly"| Source Location: (37:2,2 [163] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) @@ -10,7 +10,7 @@ Source Location: (37:2,2 [163] TestFiles/IntegrationTests/CodeGenerationIntegrat var obj = new { age = (object)1 }; var item = new { Items = new System.List() { "one", "two" } }; | -Generated Location: (2215:49,2 [163] ) +Generated Location: (2241:49,2 [163] ) | var count = "1"; var alive = true; @@ -20,26 +20,26 @@ Generated Location: (2215:49,2 [163] ) Source Location: (215:8,12 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |Convert.ToInt32(@count)| -Generated Location: (2642:61,27 [23] ) +Generated Location: (2668:61,27 [23] ) |Convert.ToInt32(@count)| Source Location: (247:8,44 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |!@alive| -Generated Location: (2874:68,44 [7] ) +Generated Location: (2900:68,44 [7] ) |!@alive| Source Location: (272:9,12 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |(int)@obj.age| -Generated Location: (3225:77,27 [13] ) +Generated Location: (3251:77,27 [13] ) |(int)@obj.age| Source Location: (292:9,32 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |new { @params = 1 }| -Generated Location: (3436:84,32 [19] ) +Generated Location: (3462:84,32 [19] ) |new { @params = 1 }| Source Location: (343:10,26 [124] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml) |(@item. Items.Where(i=>i.Contains("one")). Count()>0, @item. Items.FirstOrDefault(i=>i.Contains("one"))?. Replace("one",""))| -Generated Location: (3838:93,66 [124] ) +Generated Location: (3864:93,66 [124] ) |(@item. Items.Where(i=>i.Contains("one")). Count()>0, @item. Items.FirstOrDefault(i=>i.Contains("one"))?. Replace("one",""))| 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 b97277b2108..b66bf880cca 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,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "8fc172b55ced462a1746f1082869701d161cf36fd24dacd8d9fa98cc66d744ad" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedIdentifier.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 c8898d923fe..83388c3f1b1 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedIdentifier - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync 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 c71d28813bd..9e69f9f5952 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 81c25965b2f..7e66b754497 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 17ed97342eb..c6a1605a4ef 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: (1824:33,38 [15] ) +Generated Location: (1850:33,38 [15] ) |*, TestAssembly| Source Location: (106:3,29 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) |DateTime.Now| -Generated Location: (2358:50,29 [12] ) +Generated Location: (2384:50,29 [12] ) |DateTime.Now| Source Location: (204:5,51 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) |DateTime.Now| -Generated Location: (2794:59,51 [12] ) +Generated Location: (2820:59,51 [12] ) |DateTime.Now| Source Location: (227:5,74 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml) |true| -Generated Location: (3199:68,74 [4] ) +Generated Location: (3225: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 e2a818c275d..f8540d50f2f 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 340e6c5aae1..c8aef1bcb8e 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EscapedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 414aec818d3..2c34634b8da 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 40a90bb5cdf..fbef1cc35bc 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 3e3ed234a2c..d5137abad3b 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: (1484:33,6 [0] ) +Generated Location: (1510: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 c89b963cd18..3e5132077de 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 3ec37e6097b..527966f5c29 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 2ac3883efaa..8dcdd3620af 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 374999b63c4..d3c672320d5 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 e571b69ca9f..97e36eed7ba 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: (1606:35,1 [0] ) +Generated Location: (1632: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 980633f89fd..280ffcd6db8 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 c5be1147976..ccb93547bd8 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 -
#pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 ae7b489a819..a90513cbdf7 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 4a36f0b924f..d20d160807b 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: (1473:33,10 [3] ) +Generated Location: (1499: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 d3b33f67196..3676d6ece1f 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 1eeaa7edc17..3efb69e7414 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 = 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 fd65c220d47..4e180f5a809 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 2872b891b6e..337df7737a6 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 844305443a9..6a6ea24f261 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: (1462:33,2 [51] ) +Generated Location: (1488:33,2 [51] ) | object foo = null; string bar = "Foo"; @@ -12,20 +12,20 @@ Generated Location: (1462:33,2 [51] ) Source Location: (59:5,1 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) |if(foo != null) { | -Generated Location: (1676:42,1 [23] ) +Generated Location: (1702:42,1 [23] ) |if(foo != null) { | Source Location: (83:6,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) |foo| -Generated Location: (1869:50,6 [3] ) +Generated Location: (1895:50,6 [3] ) |foo| Source Location: (86:6,8 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) | } else { | -Generated Location: (2045:57,8 [16] ) +Generated Location: (2071:57,8 [16] ) | } else { | @@ -33,26 +33,26 @@ Generated Location: (2045:57,8 [16] ) Source Location: (121:8,23 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) | }| -Generated Location: (2248:66,23 [3] ) +Generated Location: (2274:66,23 [3] ) | }| Source Location: (134:12,1 [38] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) |if(!String.IsNullOrEmpty(bar)) { | -Generated Location: (2417:74,1 [38] ) +Generated Location: (2443:74,1 [38] ) |if(!String.IsNullOrEmpty(bar)) { | Source Location: (174:13,6 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) |bar.Replace("F", "B")| -Generated Location: (2626:82,6 [21] ) +Generated Location: (2652:82,6 [21] ) |bar.Replace("F", "B")| Source Location: (196:13,28 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml) | }| -Generated Location: (2841:89,28 [3] ) +Generated Location: (2867: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 9ec272bb776..5033d43fda0 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 d5677645b4e..52e6fac4718 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 8c747a197f2..dea191752cf 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 6c4a32046c5..30b7218368c 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 9c3dce835be..e0f664757d1 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: (1533:35,12 [55] ) +Generated Location: (1559: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 f1d1aa5a210..820f83e5671 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 67bc1c2d297..b2091f476a1 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 ee2143678a2..349f53a914b 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 3c830d841ec..8fa7fe03939 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 42c5eeb452c..5dd526ec510 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: (1477:33,25 [11] ) +Generated Location: (1503:33,25 [11] ) |RandomInt()| Source Location: (12:0,12 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml) | | -Generated Location: (1711:42,12 [4] ) +Generated Location: (1737:42,12 [4] ) | | @@ -19,7 +19,7 @@ Source Location: (33:4,12 [104] TestFiles/IntegrationTests/CodeGenerationIntegra return _rand.Next(); } | -Generated Location: (1886:50,12 [104] ) +Generated Location: (1912: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 31228bf1917..d82a603126e 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 ec88a1948dd..4fa36b8f439 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 e82bc796b51..d6ad1397883 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 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 959e6765dd3..55a0f83aa61 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 6ef7c1f39ba..608aac72830 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: (1462:33,2 [6] ) +Generated Location: (1488:33,2 [6] ) | | Source Location: (9:1,5 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml) |@Da | -Generated Location: (1637:41,5 [5] ) +Generated Location: (1663: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 687f861d929..ab0bc0232aa 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,8 +1,8 @@ #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(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 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 263870234ea..929394c228e 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - 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 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 9b1cfc015e5..16d6ef39aa7 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,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden 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 2d897baddc7..e78cd9b7063 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,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ 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 - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.codegen.cs index 81126e4108e..f7abc1d3221 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "27a85171d5a386c4f1b5ff7df75346b702207bfa961bbf3b5418584132a09c45" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [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 + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double : 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("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/images/submit.png"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); 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 1b51c61a054..e4654c94a1f 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - src - ~/images/submit.png - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_DesignTime.codegen.cs index e61df7570d9..3e18757d068 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_DesignTime.ir.txt index 9ed95001eae..8d278471394 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.codegen.cs index b88b00e29fe..b5459d7a2f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "88d08131b744c1b898ea33808f9b0ed6339ccaab3836730b144161c70d193e61" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single : 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("src", new global::Microsoft.AspNetCore.Html.HtmlString("~/images/submit.png"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); 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 2ab5c3cbf12..134680c52ef 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,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - src - ~/images/submit.png - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_UrlResolutionTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.codegen.cs index 4a0caf4adb8..0cfe4b54156 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage, IDisposable + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage, IDisposable #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.ir.txt index 66b9e8d4bf6..cab993cd2a3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - IDisposable + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - IDisposable DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.mappings.txt index d35dc5551cb..5bb82ae1446 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_DesignTime.mappings.txt @@ -1,13 +1,13 @@ Source Location: (12:0,12 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements.cshtml) |IDisposable| -Generated Location: (1196:26,0 [11] ) +Generated Location: (1222:26,0 [11] ) |IDisposable| Source Location: (39:2,12 [38] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements.cshtml) | void IDisposable.Dispose() { } | -Generated Location: (1774:45,12 [38] ) +Generated Location: (1800:45,12 [38] ) | void IDisposable.Dispose() { } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.codegen.cs index 78674d755a5..32c9e48e122 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "668986313132d43ea69290e3a9fa026efcdd9b84e34b0fe6ef95f8096bd84385" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage, IDisposable + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage, IDisposable #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.ir.txt index 2ef71d6d5cf..4b58651fc9b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - IDisposable + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Implements - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - IDisposable MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (25:1,0 [2] Implements.cshtml) LazyIntermediateToken - (25:1,0 [2] Implements.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.codegen.cs index 1342f541587..b3ec3672d80 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.ir.txt index f48c7b4e954..94746ecc0c6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.mappings.txt index ab19a0ce624..a1f0e38e90c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (19:2,1 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF.cshtml) || -Generated Location: (1484:33,6 [0] ) +Generated Location: (1510:33,6 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.codegen.cs index 7bb72dc5082..c065446ece7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "c51c63579e91e34ccd7908daa20ee621d57df811c127c4675d2c49479e67358c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.ir.txt index 309d0b5718e..539ac7bb2c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [18] ImplicitExpressionAtEOF.cshtml) LazyIntermediateToken - (0:0,0 [18] ImplicitExpressionAtEOF.cshtml) - Html - This is markup\n\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.codegen.cs index 51fd4390be3..efab73b7b9f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.ir.txt index 2e6a3381dfd..39c19dcb1ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.mappings.txt index da632e401d2..eea01762490 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_DesignTime.mappings.txt @@ -1,19 +1,19 @@ Source Location: (1:0,1 [36] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml) |for(int i = 1; i <= 10; i++) { | -Generated Location: (1464:33,1 [36] ) +Generated Location: (1490:33,1 [36] ) |for(int i = 1; i <= 10; i++) { | Source Location: (55:1,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml) |i| -Generated Location: (1687:41,22 [1] ) +Generated Location: (1713:41,22 [1] ) |i| Source Location: (60:1,27 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml) | }| -Generated Location: (1881:48,27 [3] ) +Generated Location: (1907:48,27 [3] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.codegen.cs index 92a056800f6..a5c779d4f19 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a9ffb11684d26004cfb4c9d3c57f6e1b1ecfce9046379ae96dc044b20960a06c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.ir.txt index 1ffcfd3f3ea..6735e6751cc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (1:0,1 [32] ImplicitExpression.cshtml) LazyIntermediateToken - (1:0,1 [32] ImplicitExpression.cshtml) - CSharp - for(int i = 1; i <= 10; i++) {\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.cs index 2f78e9c6151..27f3a9b0858 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.ir.txt index e5c52cc4a0f..5748fd781a6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.mappings.txt index 3592e35d473..df9147119c3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_DesignTime.mappings.txt @@ -1,70 +1,70 @@ Source Location: (100:2,13 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (1251:26,38 [0] ) +Generated Location: (1277:26,38 [0] ) || Source Location: (116:3,14 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (1526:36,38 [0] ) +Generated Location: (1552:36,38 [0] ) || Source Location: (132:4,14 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) |"| -Generated Location: (1800:46,37 [1] ) +Generated Location: (1826:46,37 [1] ) |"| Source Location: (153:6,16 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (2075:56,38 [0] ) +Generated Location: (2101:56,38 [0] ) || Source Location: (172:7,17 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (2350:66,38 [0] ) +Generated Location: (2376:66,38 [0] ) || Source Location: (191:8,17 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) |"| -Generated Location: (2624:76,37 [1] ) +Generated Location: (2650:76,37 [1] ) |"| Source Location: (212:10,16 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (2900:86,38 [0] ) +Generated Location: (2926:86,38 [0] ) || Source Location: (231:11,17 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (3176:96,38 [0] ) +Generated Location: (3202:96,38 [0] ) || Source Location: (250:12,17 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) |"| -Generated Location: (3451:106,37 [1] ) +Generated Location: (3477:106,37 [1] ) |"| Source Location: (276:15,10 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (3689:116,0 [0] ) +Generated Location: (3715:116,0 [0] ) || Source Location: (326:21,9 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (3926:126,0 [0] ) +Generated Location: (3952:126,0 [0] ) || Source Location: (264:14,9 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (4428:143,9 [0] ) +Generated Location: (4454:143,9 [0] ) || Source Location: (315:20,8 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (4604:150,8 [0] ) +Generated Location: (4630:150,8 [0] ) || Source Location: (354:24,12 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml) || -Generated Location: (4784:157,12 [0] ) +Generated Location: (4810:157,12 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs index a76c039ab73..c9c21931222 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "eb06c7c88327837013a4b8bbc01e69455dd31e066c651c88da5da9887b37f4d9" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt index a4a712b6eaa..382efa77cf1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (85:1,0 [2] IncompleteDirectives.cshtml) LazyIntermediateToken - (85:1,0 [2] IncompleteDirectives.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.cs index b1665ab5c50..6d762434b2f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.ir.txt index cd6441f37bf..b9dfbff67d1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.mappings.txt index 084a27d11d7..4f74c5c66aa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper.cshtml) |"*, TestAssembly"| -Generated Location: (1733:32,37 [17] ) +Generated Location: (1759:32,37 [17] ) |"*, TestAssembly"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs index e279225f6e1..e6dc0ec271f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a6b7468c33484ceae637f17ae6158b1c7c2616a22178d1fe8cb48f2e85f5295c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper : 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("class", new global::Microsoft.AspNetCore.Html.HtmlString(""), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.ir.txt index fd71f41bf09..6697abe38fa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.codegen.cs index 037caca0dec..4ecd293dd78 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.cs-diagnostics.txt index b8a831fb568..aa306a32a06 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.cs-diagnostics.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.cs-diagnostics.txt @@ -10,12 +10,12 @@ Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "biz").WithArguments("biz").Wit // TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(3,7): error CS0103: The name 'foo' does not exist in the current context // __o = foo(); Diagnostic(ErrorCode.ERR_NameNotInContext, "foo").WithArguments("foo").WithLocation(3, 7), -// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(19,86): error CS0246: The type or namespace name 'foo' could not be found (are you missing a using directive or an assembly reference?) -// public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz -Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "foo").WithArguments("foo").WithLocation(19, 86), -// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(19,94): error CS0246: The type or namespace name 'baz<>' could not be found (are you missing a using directive or an assembly reference?) -// public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz -Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "baz").WithArguments("baz<>").WithLocation(19, 94), -// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(19,98): error CS0246: The type or namespace name 'biz' could not be found (are you missing a using directive or an assembly reference?) -// public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz -Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "biz").WithArguments("biz").WithLocation(19, 98) \ No newline at end of file +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(19,95): error CS0246: The type or namespace name 'foo' could not be found (are you missing a using directive or an assembly reference?) +// internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "foo").WithArguments("foo").WithLocation(19, 95), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(19,103): error CS0246: The type or namespace name 'baz<>' could not be found (are you missing a using directive or an assembly reference?) +// internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "baz").WithArguments("baz<>").WithLocation(19, 103), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(19,107): error CS0246: The type or namespace name 'biz' could not be found (are you missing a using directive or an assembly reference?) +// internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "biz").WithArguments("biz").WithLocation(19, 107) \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.ir.txt index 0befe19386a..92d236e6f5e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits - foo.bar>.boz - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits - foo.bar>.boz - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.mappings.txt index 37840d94cda..d40e6fc3abc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (10:0,10 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml) |foo.bar>.boz| -Generated Location: (1141:26,0 [21] ) +Generated Location: (1167:26,0 [21] ) |foo.bar>.boz| Source Location: (36:2,1 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml) |foo()| -Generated Location: (1672:43,6 [5] ) +Generated Location: (1698:43,6 [5] ) |foo()| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.codegen.cs index 02607f6274f..7894a068a68 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "f2e8261f6a1dc47ca6ea0cb9335f0a2b8b0b18bc9f1fc43b6c3a7764e3ac7f75" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.cs-diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.cs-diagnostics.txt index cfba402fdec..bf21394ac74 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.cs-diagnostics.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.cs-diagnostics.txt @@ -1,15 +1,15 @@ // TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(3,2): error CS0103: The name 'foo' does not exist in the current context // foo() Diagnostic(ErrorCode.ERR_NameNotInContext, "foo").WithArguments("foo").WithLocation(3, 2), -// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(21,86): error CS0246: The type or namespace name 'foo' could not be found (are you missing a using directive or an assembly reference?) -// public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz -Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "foo").WithArguments("foo").WithLocation(21, 86), -// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(21,94): error CS0246: The type or namespace name 'baz<>' could not be found (are you missing a using directive or an assembly reference?) -// public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz -Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "baz").WithArguments("baz<>").WithLocation(21, 94), -// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(21,98): error CS0246: The type or namespace name 'biz' could not be found (are you missing a using directive or an assembly reference?) -// public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz -Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "biz").WithArguments("biz").WithLocation(21, 98), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(21,95): error CS0246: The type or namespace name 'foo' could not be found (are you missing a using directive or an assembly reference?) +// internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "foo").WithArguments("foo").WithLocation(21, 95), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(21,103): error CS0246: The type or namespace name 'baz<>' could not be found (are you missing a using directive or an assembly reference?) +// internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "baz").WithArguments("baz<>").WithLocation(21, 103), +// TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(21,107): error CS0246: The type or namespace name 'biz' could not be found (are you missing a using directive or an assembly reference?) +// internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits : foo.bar>.boz +Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "biz").WithArguments("biz").WithLocation(21, 107), // TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits.cshtml(27,13): error CS0103: The name 'WriteLiteral' does not exist in the current context // WriteLiteral("\r\n"); Diagnostic(ErrorCode.ERR_NameNotInContext, "WriteLiteral").WithArguments("WriteLiteral").WithLocation(27, 13), diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.ir.txt index bcda0ccbb52..2e6bf46ae2c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits - foo.bar>.boz - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inherits - foo.bar>.boz - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (33:1,0 [2] Inherits.cshtml) LazyIntermediateToken - (33:1,0 [2] Inherits.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.codegen.cs index 09e8c2776b4..d2eafe6c0dd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.ir.txt index 5f61fc6cb42..7fe620ea765 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.mappings.txt index 2e328813770..c32278526e9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_DesignTime.mappings.txt @@ -1,25 +1,25 @@ Source Location: (9:0,9 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml) |Link| -Generated Location: (1211:26,22 [4] ) +Generated Location: (1237:26,22 [4] ) |Link| Source Location: (44:1,14 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml) |if(link != null) { | -Generated Location: (1721:43,14 [19] ) +Generated Location: (1747:43,14 [19] ) |if(link != null) { | Source Location: (64:1,34 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml) |link| -Generated Location: (1933:50,34 [4] ) +Generated Location: (1959:50,34 [4] ) |link| Source Location: (68:1,38 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml) | } else { | -Generated Location: (2135:57,38 [10] ) +Generated Location: (2161:57,38 [10] ) | } else { | Source Location: (92:1,62 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml) | }| -Generated Location: (2366:64,62 [2] ) +Generated Location: (2392:64,62 [2] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.codegen.cs index e8192805b25..35ab012a071 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "d7855bb65d3e6db02c3a0fb02972366eb41151f780bf5b52f5c72a44a4591587" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.ir.txt index 7d92d9337a1..cfc241aa1ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InlineBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync MalformedDirective - (0:0,0 [13] InlineBlocks.cshtml) - section DirectiveToken - (9:0,9 [4] InlineBlocks.cshtml) - Link diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.codegen.cs index fcc56226630..a03a3a7522b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.ir.txt index 3bc691ae609..a2ae4a6f8b2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.mappings.txt index cd2fb2f7173..20095dd1784 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_DesignTime.mappings.txt @@ -2,7 +2,7 @@ | int i = 1; var foo = | -Generated Location: (1447:33,2 [32] ) +Generated Location: (1473:33,2 [32] ) | int i = 1; var foo = | @@ -10,39 +10,39 @@ Generated Location: (1447:33,2 [32] ) Source Location: (45:2,25 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |; | -Generated Location: (1806:45,25 [7] ) +Generated Location: (1832:45,25 [7] ) |; | Source Location: (68:4,0 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) | | -Generated Location: (1972:53,0 [4] ) +Generated Location: (1998:53,0 [4] ) | | Source Location: (91:4,23 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) | | -Generated Location: (2158:60,23 [2] ) +Generated Location: (2184:60,23 [2] ) | | Source Location: (99:7,1 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |while(i <= 10) { | -Generated Location: (2318:67,1 [22] ) +Generated Location: (2344:67,1 [22] ) |while(i <= 10) { | Source Location: (142:8,25 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |i| -Generated Location: (2524:75,25 [1] ) +Generated Location: (2550:75,25 [1] ) |i| Source Location: (148:8,31 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) | i += 1; }| -Generated Location: (2716:82,31 [16] ) +Generated Location: (2742:82,31 [16] ) | i += 1; }| @@ -50,14 +50,14 @@ Generated Location: (2716:82,31 [16] ) Source Location: (169:12,1 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |if(i == 11) { | -Generated Location: (2893:91,1 [19] ) +Generated Location: (2919:91,1 [19] ) |if(i == 11) { | Source Location: (213:13,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) | }| -Generated Location: (3101:99,29 [3] ) +Generated Location: (3127:99,29 [3] ) | }| @@ -65,7 +65,7 @@ Source Location: (221:16,1 [35] TestFiles/IntegrationTests/CodeGenerationIntegra |switch(i) { case 11: | -Generated Location: (3265:107,1 [35] ) +Generated Location: (3291:107,1 [35] ) |switch(i) { case 11: | @@ -75,7 +75,7 @@ Source Location: (292:18,44 [40] TestFiles/IntegrationTests/CodeGenerationIntegr break; default: | -Generated Location: (3504:116,44 [40] ) +Generated Location: (3530:116,44 [40] ) | break; default: @@ -85,7 +85,7 @@ Source Location: (361:21,37 [19] TestFiles/IntegrationTests/CodeGenerationIntegr | break; }| -Generated Location: (3741:126,37 [19] ) +Generated Location: (3767:126,37 [19] ) | break; }| @@ -93,26 +93,26 @@ Generated Location: (3741:126,37 [19] ) Source Location: (385:25,1 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |for(int j = 1; j <= 10; j += 2) { | -Generated Location: (3921:135,1 [39] ) +Generated Location: (3947:135,1 [39] ) |for(int j = 1; j <= 10; j += 2) { | Source Location: (451:26,31 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |j| -Generated Location: (4151:143,31 [1] ) +Generated Location: (4177:143,31 [1] ) |j| Source Location: (457:26,37 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) | }| -Generated Location: (4350:150,37 [3] ) +Generated Location: (4376:150,37 [3] ) | }| Source Location: (465:29,1 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |try { | -Generated Location: (4514:158,1 [11] ) +Generated Location: (4540:158,1 [11] ) |try { | @@ -120,34 +120,34 @@ Source Location: (511:30,39 [31] TestFiles/IntegrationTests/CodeGenerationIntegr | } catch(Exception ex) { | -Generated Location: (4724:166,39 [31] ) +Generated Location: (4750:166,39 [31] ) | } catch(Exception ex) { | Source Location: (573:32,35 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |ex.Message| -Generated Location: (4950:175,35 [10] ) +Generated Location: (4976:175,35 [10] ) |ex.Message| Source Location: (588:32,50 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) | }| -Generated Location: (5171:182,50 [3] ) +Generated Location: (5197:182,50 [3] ) | }| Source Location: (596:35,1 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) |lock(new object()) { | -Generated Location: (5335:190,1 [26] ) +Generated Location: (5361:190,1 [26] ) |lock(new object()) { | Source Location: (669:36,51 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml) | }| -Generated Location: (5572:198,51 [3] ) +Generated Location: (5598:198,51 [3] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.codegen.cs index 40e2e0643f1..ab9a0c410f9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "995eb60d7343e6b2916ae503c3fc313ad9fc919ca39dcd50b386d27d2b53f80e" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.ir.txt index 0a87315d8ce..0b8cbc6282e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Instrumented - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [32] Instrumented.cshtml) LazyIntermediateToken - (2:0,2 [32] Instrumented.cshtml) - CSharp - \n int i = 1;\n var foo = diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.codegen.cs index c179a22082f..75a4260c698 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.ir.txt index c7c6de0377f..1913a74d92a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.mappings.txt index f0a2f64bc89..eaf9d729129 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_DesignTime.mappings.txt @@ -2,21 +2,21 @@ | for(int i = 1; i <= 10; i++) { | -Generated Location: (1462:33,2 [46] ) +Generated Location: (1488:33,2 [46] ) | for(int i = 1; i <= 10; i++) { | Source Location: (69:2,29 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock.cshtml) |i.ToString()| -Generated Location: (1701:42,29 [12] ) +Generated Location: (1727:42,29 [12] ) |i.ToString()| Source Location: (86:2,46 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock.cshtml) | } | -Generated Location: (1924:49,46 [9] ) +Generated Location: (1950:49,46 [9] ) | } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.codegen.cs index 88b8940ba0b..d3c5f67937b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "8d4533fb0fc90f8228aa0b0c9ec2d1cb53d3ef9b2018884e3e906a63b2e7ec39" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.ir.txt index 05d608baca2..4184ab65086 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MarkupInCodeBlock - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [38] MarkupInCodeBlock.cshtml) LazyIntermediateToken - (2:0,2 [38] MarkupInCodeBlock.cshtml) - CSharp - \n for(int i = 1; i <= 10; i++) {\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.codegen.cs index 9e4ce6fb3f3..2dde3aac494 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.ir.txt index 9d3e37d7020..e9de58a8aba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::DivTagHelper - __DivTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.mappings.txt index 2aa9e3b440a..9077efe7449 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_DesignTime.mappings.txt @@ -1,6 +1,6 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) |"*, TestAssembly"| -Generated Location: (1748:32,37 [17] ) +Generated Location: (1774:32,37 [17] ) |"*, TestAssembly"| Source Location: (35:1,2 [154] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) @@ -13,7 +13,7 @@ Source Location: (35:1,2 [154] TestFiles/IntegrationTests/CodeGenerationIntegrat void PrintName(Person person) { | -Generated Location: (2271:49,2 [154] ) +Generated Location: (2297:49,2 [154] ) | var people = new Person[] { @@ -26,26 +26,26 @@ Generated Location: (2271:49,2 [154] ) Source Location: (195:9,14 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) |person.Name| -Generated Location: (2619:64,14 [11] ) +Generated Location: (2645:64,14 [11] ) |person.Name| Source Location: (212:9,31 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) | } | -Generated Location: (2989:73,31 [9] ) +Generated Location: (3015:73,31 [9] ) | } | Source Location: (228:13,2 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) | PrintName(people[0]); | -Generated Location: (3178:81,2 [23] ) +Generated Location: (3204:81,2 [23] ) | PrintName(people[0]); | Source Location: (256:14,2 [36] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) | await AnnounceBirthday(people[0]); | -Generated Location: (3383:88,2 [36] ) +Generated Location: (3409:88,2 [36] ) | await AnnounceBirthday(people[0]); | Source Location: (309:16,12 [106] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) @@ -54,7 +54,7 @@ Source Location: (309:16,12 [106] TestFiles/IntegrationTests/CodeGenerationInteg { var formatted = $"Mr. {person.Name}"; | -Generated Location: (3660:97,12 [106] ) +Generated Location: (3686:97,12 [106] ) | Task AnnounceBirthday(Person person) { @@ -63,14 +63,14 @@ Generated Location: (3660:97,12 [106] ) Source Location: (455:21,33 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) |formatted| -Generated Location: (3979:108,33 [9] ) +Generated Location: (4005:108,33 [9] ) |formatted| Source Location: (487:22,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) | | -Generated Location: (4322:117,14 [12] ) +Generated Location: (4348:117,14 [12] ) | | @@ -79,20 +79,20 @@ Source Location: (514:25,9 [66] TestFiles/IntegrationTests/CodeGenerationIntegra |for (var i = 0; i < person.Age / 10; i++) { | -Generated Location: (4523:126,9 [66] ) +Generated Location: (4549:126,9 [66] ) |for (var i = 0; i < person.Age / 10; i++) { | Source Location: (586:27,18 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) |i| -Generated Location: (4787:135,18 [1] ) +Generated Location: (4813:135,18 [1] ) |i| Source Location: (609:27,41 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml) | }| -Generated Location: (5010:142,41 [11] ) +Generated Location: (5036:142,41 [11] ) | }| @@ -105,7 +105,7 @@ Source Location: (635:29,13 [106] TestFiles/IntegrationTests/CodeGenerationInteg } | -Generated Location: (5214:150,13 [106] ) +Generated Location: (5240:150,13 [106] ) | if (person.Age < 20) @@ -127,7 +127,7 @@ Source Location: (764:36,31 [161] TestFiles/IntegrationTests/CodeGenerationInteg public int Age { get; set; } } | -Generated Location: (5531:164,31 [161] ) +Generated Location: (5557:164,31 [161] ) | return Task.CompletedTask; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.codegen.cs index 5731be96cfe..1d5994e1799 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1d96ed32230877fcfe7acc2e22d4b1c519eb0ccd0599053409543ce8c5f65fa7" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.ir.txt index 675776b967d..bf538d697e7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocksWithTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::DivTagHelper - __DivTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.codegen.cs index cd0e88519d9..674c1816c46 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.ir.txt index 4848082fc28..d10664be4af 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.mappings.txt index 113696b3432..aab1dffa975 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_DesignTime.mappings.txt @@ -8,7 +8,7 @@ void PrintName(Person person) { | -Generated Location: (1468:33,2 [153] ) +Generated Location: (1494:33,2 [153] ) | var people = new Person[] { @@ -21,26 +21,26 @@ Generated Location: (1468:33,2 [153] ) Source Location: (163:9,14 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) |person.Name| -Generated Location: (1802:48,14 [11] ) +Generated Location: (1828:48,14 [11] ) |person.Name| Source Location: (180:9,31 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) | } | -Generated Location: (2012:55,31 [9] ) +Generated Location: (2038:55,31 [9] ) | } | Source Location: (196:13,2 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) | PrintName(people[0]) | -Generated Location: (2188:63,2 [22] ) +Generated Location: (2214:63,2 [22] ) | PrintName(people[0]) | Source Location: (223:14,2 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) | AnnounceBirthday(people[0]); | -Generated Location: (2379:70,2 [30] ) +Generated Location: (2405:70,2 [30] ) | AnnounceBirthday(people[0]); | Source Location: (270:16,12 [106] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) @@ -49,7 +49,7 @@ Source Location: (270:16,12 [106] TestFiles/IntegrationTests/CodeGenerationInteg { var formatted = $"Mr. {person.Name}"; | -Generated Location: (2637:79,12 [106] ) +Generated Location: (2663:79,12 [106] ) | void AnnounceBirthday(Person person) { @@ -58,14 +58,14 @@ Generated Location: (2637:79,12 [106] ) Source Location: (416:21,33 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) |formatted| -Generated Location: (2943:90,33 [9] ) +Generated Location: (2969:90,33 [9] ) |formatted| Source Location: (448:22,14 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) | | -Generated Location: (3134:97,14 [12] ) +Generated Location: (3160:97,14 [12] ) | | @@ -74,20 +74,20 @@ Source Location: (475:25,9 [66] TestFiles/IntegrationTests/CodeGenerationIntegra |for (var i = 0; i < person.Age / 10; i++) { | -Generated Location: (3322:106,9 [66] ) +Generated Location: (3348:106,9 [66] ) |for (var i = 0; i < person.Age / 10; i++) { | Source Location: (547:27,18 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) |i| -Generated Location: (3573:115,18 [1] ) +Generated Location: (3599:115,18 [1] ) |i| Source Location: (570:27,41 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml) | }| -Generated Location: (3783:122,41 [11] ) +Generated Location: (3809:122,41 [11] ) | }| @@ -100,7 +100,7 @@ Source Location: (596:29,13 [87] TestFiles/IntegrationTests/CodeGenerationIntegr } | -Generated Location: (3974:130,13 [87] ) +Generated Location: (4000:130,13 [87] ) | if (person.Age < 20) @@ -120,7 +120,7 @@ Source Location: (706:36,31 [123] TestFiles/IntegrationTests/CodeGenerationInteg public int Age { get; set; } } | -Generated Location: (4259:144,31 [123] ) +Generated Location: (4285:144,31 [123] ) | } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.codegen.cs index 77cd0a8c861..c3477be6c52 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "c38f4efc9c710292c9fc20d2f5c4cc6e8a91f4fa3ee60ec96c16617f506312b8" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.ir.txt index 02571af85bf..0c2f37c479e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Markup_InCodeBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [2] Markup_InCodeBlocks.cshtml) LazyIntermediateToken - (0:0,0 [2] Markup_InCodeBlocks.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.codegen.cs index 873e8ac6fe6..aab5e594d80 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.ir.txt index 0d7a5cd634a..a3cdb435212 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.mappings.txt index 5a601c794e1..ae8ed32dc80 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers.cshtml) |"*, TestAssembly"| -Generated Location: (1887:34,37 [17] ) +Generated Location: (1913:34,37 [17] ) |"*, TestAssembly"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.codegen.cs index b50b06f40ef..ba5a565e288 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "87fe59d78f3e03370f30b0eb9f80c503873502b116dbdb3beff6cd9fc190f718" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers : 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("class", new global::Microsoft.AspNetCore.Html.HtmlString("btn"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.ir.txt index 625051d43ca..f312c1235f2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MinimizedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - btn - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_1 - input-bound-required-string - hello - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_2 - catchall-bound-string - world - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.codegen.cs index e15283b1037..cc83672596c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.ir.txt index 7c34b7cedbb..259ae720db2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.mappings.txt index 62f2a807b71..0aee8a2131f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_DesignTime.mappings.txt @@ -1,7 +1,7 @@ Source Location: (2:0,2 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml) | | -Generated Location: (1447:33,2 [6] ) +Generated Location: (1473:33,2 [6] ) | | @@ -9,27 +9,27 @@ Source Location: (9:1,5 [53] TestFiles/IntegrationTests/CodeGenerationIntegratio |foreach (var result in (dynamic)Url) { | -Generated Location: (1617:41,5 [53] ) +Generated Location: (1643:41,5 [53] ) |foreach (var result in (dynamic)Url) { | Source Location: (82:4,13 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml) |result.SomeValue| -Generated Location: (1842:50,13 [16] ) +Generated Location: (1868:50,13 [16] ) |result.SomeValue| Source Location: (115:5,14 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml) | }| -Generated Location: (2032:57,14 [7] ) +Generated Location: (2058:57,14 [7] ) | }| Source Location: (122:6,5 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml) | | -Generated Location: (2203:65,5 [2] ) +Generated Location: (2229:65,5 [2] ) | | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.codegen.cs index e15cf32a54d..4f7e209358b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "c1273eb7fee44c32ab00da03db6ac9a1bf83c1c3b09f32fb242db42978fc4d17" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.ir.txt index 9bc4e74122e..96ff78d1d44 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCSharp - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [6] NestedCSharp.cshtml) LazyIntermediateToken - (2:0,2 [6] NestedCSharp.cshtml) - CSharp - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.codegen.cs index d8e34503130..5471dc97123 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.ir.txt index 479d622b168..1f5dcd77898 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.mappings.txt index b39b05aa8b1..aa75a4345e9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_DesignTime.mappings.txt @@ -1,21 +1,21 @@ Source Location: (1:0,1 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks.cshtml) |if(foo) { | -Generated Location: (1458:33,1 [15] ) +Generated Location: (1484:33,1 [15] ) |if(foo) { | Source Location: (17:1,5 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks.cshtml) |if(bar) { }| -Generated Location: (1641:41,5 [16] ) +Generated Location: (1667:41,5 [16] ) |if(bar) { }| Source Location: (33:2,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks.cshtml) | }| -Generated Location: (1825:49,5 [3] ) +Generated Location: (1851:49,5 [3] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.codegen.cs index c842d7e180b..55a466d78b1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "13a85602fed2597baf956e658c5cf96a52e1734ae6cd4674854366bf90b84fb7" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.ir.txt index 03dfaeb62a8..391ddbd747b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedCodeBlocks - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (1:0,1 [15] NestedCodeBlocks.cshtml) LazyIntermediateToken - (1:0,1 [15] NestedCodeBlocks.cshtml) - CSharp - if(foo) {\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.cs index 1186f4f7467..13d75ef1727 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.ir.txt index ed28aa6924a..36f8e5d6a76 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.mappings.txt index eb235a44560..60c32e9c2be 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_DesignTime.mappings.txt @@ -1,29 +1,29 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) |"*, TestAssembly"| -Generated Location: (1925:34,37 [17] ) +Generated Location: (1951:34,37 [17] ) |"*, TestAssembly"| Source Location: (195:5,13 [46] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) |for(var i = 0; i < 5; i++) { | -Generated Location: (2452:51,13 [46] ) +Generated Location: (2478:51,13 [46] ) |for(var i = 0; i < 5; i++) { | Source Location: (339:7,50 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) |ViewBag.DefaultInterval| -Generated Location: (2928:61,50 [23] ) +Generated Location: (2954:61,50 [23] ) |ViewBag.DefaultInterval| Source Location: (389:7,100 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) |true| -Generated Location: (3372:70,100 [4] ) +Generated Location: (3398:70,100 [4] ) |true| Source Location: (422:8,25 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml) | }| -Generated Location: (3650:78,25 [15] ) +Generated Location: (3676:78,25 [15] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs index 31d02abb628..76f87cd8769 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "b9d3f6bab7b7ca5370c7dfdbb23e59170c95a39498a14d92a3821296aaf9dba2" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers : 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); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.ir.txt index 9b3b3b9980d..45b4d2c478f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedScriptTagTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - type - text - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - class - Hello World - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - data-delay - 1000 - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.codegen.cs index 075b9db1a57..10e49125914 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.ir.txt index ebe381ddd7f..7ded8231849 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::SpanTagHelper - __SpanTagHelper FieldDeclaration - - private - global::DivTagHelper - __DivTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.mappings.txt index eb3034aa72d..d9081e33c78 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers.cshtml) |*, TestAssembly| -Generated Location: (1815:34,38 [15] ) +Generated Location: (1841:34,38 [15] ) |*, TestAssembly| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.codegen.cs index 365a283c546..95e694a4651 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "b70a83d84fae87fa6d03261b1a7b2f7cadddf84ab4b9ca15836fe03a1a38b59c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers : 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("value", "Hello", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.ir.txt index da62924f023..5b54da81c19 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NestedTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - value - Hello - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - type - text - HtmlAttributeValueStyle.SingleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - unbound - foo - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.codegen.cs index 781297722d9..127724064ae 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.ir.txt index 5b81ae13b99..8cfe2c38506 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.mappings.txt index a045d59b3cc..c8a52a88748 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_DesignTime.mappings.txt @@ -2,7 +2,7 @@ | int i = 1; | -Generated Location: (1450:33,2 [18] ) +Generated Location: (1476:33,2 [18] ) | int i = 1; | @@ -10,20 +10,20 @@ Generated Location: (1450:33,2 [18] ) Source Location: (26:4,1 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |while(i <= 10) { | -Generated Location: (1627:41,1 [22] ) +Generated Location: (1653:41,1 [22] ) |while(i <= 10) { | Source Location: (69:5,25 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |i| -Generated Location: (1834:49,25 [1] ) +Generated Location: (1860:49,25 [1] ) |i| Source Location: (75:5,31 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) | i += 1; }| -Generated Location: (2027:56,31 [16] ) +Generated Location: (2053:56,31 [16] ) | i += 1; }| @@ -31,14 +31,14 @@ Generated Location: (2027:56,31 [16] ) Source Location: (96:9,1 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |if(i == 11) { | -Generated Location: (2205:65,1 [19] ) +Generated Location: (2231:65,1 [19] ) |if(i == 11) { | Source Location: (140:10,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) | }| -Generated Location: (2414:73,29 [3] ) +Generated Location: (2440:73,29 [3] ) | }| @@ -46,7 +46,7 @@ Source Location: (148:13,1 [35] TestFiles/IntegrationTests/CodeGenerationIntegra |switch(i) { case 11: | -Generated Location: (2579:81,1 [35] ) +Generated Location: (2605:81,1 [35] ) |switch(i) { case 11: | @@ -56,7 +56,7 @@ Source Location: (219:15,44 [40] TestFiles/IntegrationTests/CodeGenerationIntegr break; default: | -Generated Location: (2819:90,44 [40] ) +Generated Location: (2845:90,44 [40] ) | break; default: @@ -66,7 +66,7 @@ Source Location: (288:18,37 [19] TestFiles/IntegrationTests/CodeGenerationIntegr | break; }| -Generated Location: (3057:100,37 [19] ) +Generated Location: (3083:100,37 [19] ) | break; }| @@ -74,26 +74,26 @@ Generated Location: (3057:100,37 [19] ) Source Location: (312:22,1 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |for(int j = 1; j <= 10; j += 2) { | -Generated Location: (3238:109,1 [39] ) +Generated Location: (3264:109,1 [39] ) |for(int j = 1; j <= 10; j += 2) { | Source Location: (378:23,31 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |j| -Generated Location: (3469:117,31 [1] ) +Generated Location: (3495:117,31 [1] ) |j| Source Location: (384:23,37 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) | }| -Generated Location: (3669:124,37 [3] ) +Generated Location: (3695:124,37 [3] ) | }| Source Location: (392:26,1 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |try { | -Generated Location: (3834:132,1 [11] ) +Generated Location: (3860:132,1 [11] ) |try { | @@ -101,14 +101,14 @@ Source Location: (438:27,39 [31] TestFiles/IntegrationTests/CodeGenerationIntegr | } catch(Exception ex) { | -Generated Location: (4045:140,39 [31] ) +Generated Location: (4071:140,39 [31] ) | } catch(Exception ex) { | Source Location: (500:29,35 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |ex.Message| -Generated Location: (4272:149,35 [10] ) +Generated Location: (4298:149,35 [10] ) |ex.Message| Source Location: (515:29,50 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) @@ -116,7 +116,7 @@ Source Location: (515:29,50 [7] TestFiles/IntegrationTests/CodeGenerationIntegra } | -Generated Location: (4494:156,50 [7] ) +Generated Location: (4520:156,50 [7] ) | } @@ -124,25 +124,25 @@ Generated Location: (4494:156,50 [7] ) Source Location: (556:32,34 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) || -Generated Location: (4694:165,34 [0] ) +Generated Location: (4720:165,34 [0] ) || Source Location: (571:33,13 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |i| -Generated Location: (4868:172,13 [1] ) +Generated Location: (4894:172,13 [1] ) |i| Source Location: (581:35,1 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) |lock(new object()) { | -Generated Location: (5032:179,1 [26] ) +Generated Location: (5058:179,1 [26] ) |lock(new object()) { | Source Location: (654:36,51 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml) | }| -Generated Location: (5270:187,51 [3] ) +Generated Location: (5296:187,51 [3] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.codegen.cs index 8f8acad959a..ffce9a306a8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5d359099ffaf3096190a7267378a546e5814b6a10f2691fdce13ec7577332aec" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.ir.txt index 94e1d3900e9..30142d2dd68 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NoLinePragmas - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [18] NoLinePragmas.cshtml) LazyIntermediateToken - (2:0,2 [18] NoLinePragmas.cshtml) - CSharp - \n int i = 1;\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.codegen.cs index a0696ffeda0..bc71f0295d1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.ir.txt index 93da393ff63..b9b1062d69d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.mappings.txt index 0330ff17c9d..38bb7262277 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_DesignTime.mappings.txt @@ -1,75 +1,75 @@ Source Location: (2:0,2 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) | | -Generated Location: (1489:33,2 [6] ) +Generated Location: (1515:33,2 [6] ) | | Source Location: (9:1,5 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) |ViewBag?.Data| -Generated Location: (1674:41,6 [13] ) +Generated Location: (1700:41,6 [13] ) |ViewBag?.Data| Source Location: (22:1,18 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) | | -Generated Location: (1879:48,18 [6] ) +Generated Location: (1905:48,18 [6] ) | | Source Location: (29:2,5 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) |ViewBag.IntIndexer?[0]| -Generated Location: (2064:56,6 [22] ) +Generated Location: (2090:56,6 [22] ) |ViewBag.IntIndexer?[0]| Source Location: (51:2,27 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) | | -Generated Location: (2287:63,27 [6] ) +Generated Location: (2313:63,27 [6] ) | | Source Location: (58:3,5 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) |ViewBag.StrIndexer?["key"]| -Generated Location: (2472:71,6 [26] ) +Generated Location: (2498:71,6 [26] ) |ViewBag.StrIndexer?["key"]| Source Location: (84:3,31 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) | | -Generated Location: (2703:78,31 [6] ) +Generated Location: (2729:78,31 [6] ) | | Source Location: (91:4,5 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) |ViewBag?.Method(Value?[23]?.More)?["key"]| -Generated Location: (2888:86,6 [41] ) +Generated Location: (2914:86,6 [41] ) |ViewBag?.Method(Value?[23]?.More)?["key"]| Source Location: (132:4,46 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) | | -Generated Location: (3149:93,46 [2] ) +Generated Location: (3175:93,46 [2] ) | | Source Location: (140:7,1 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) |ViewBag?.Data| -Generated Location: (3328:100,6 [13] ) +Generated Location: (3354:100,6 [13] ) |ViewBag?.Data| Source Location: (156:8,1 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) |ViewBag.IntIndexer?[0]| -Generated Location: (3521:107,6 [22] ) +Generated Location: (3547:107,6 [22] ) |ViewBag.IntIndexer?[0]| Source Location: (181:9,1 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) |ViewBag.StrIndexer?["key"]| -Generated Location: (3724:114,6 [26] ) +Generated Location: (3750:114,6 [26] ) |ViewBag.StrIndexer?["key"]| Source Location: (210:10,1 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml) |ViewBag?.Method(Value?[23]?.More)?["key"]| -Generated Location: (3931:121,6 [41] ) +Generated Location: (3957:121,6 [41] ) |ViewBag?.Method(Value?[23]?.More)?["key"]| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.codegen.cs index 85eac013619..0ec12b4d474 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "bb8d8c34e68ddf6c5aaf34e0f1c5f319f48c57e4ba3661228c4eeeb8bb9b79ce" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.ir.txt index 45a0ebb4e8f..1c153641b76 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_NullConditionalExpressions - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [6] NullConditionalExpressions.cshtml) LazyIntermediateToken - (2:0,2 [6] NullConditionalExpressions.cshtml) - CSharp - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.codegen.cs index cdd496becc9..de895f73c52 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.ir.txt index 260117e7542..fdba2522af3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.mappings.txt index c7fd22841d9..0408e3d1b76 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_DesignTime.mappings.txt @@ -1,19 +1,19 @@ Source Location: (17:2,1 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml) |if (true) { | -Generated Location: (1982:39,1 [14] ) +Generated Location: (2008:39,1 [14] ) |if (true) { | Source Location: (38:3,7 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml) | | -Generated Location: (2156:46,7 [2] ) +Generated Location: (2182:46,7 [2] ) | | Source Location: (47:4,7 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml) || -Generated Location: (2318:53,7 [0] ) +Generated Location: (2344:53,7 [0] ) || diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.codegen.cs index dab52a101c2..d3340b2d5a2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "88878cf1ea054aeb74300eb51cb951ede03552e4df20742a94bc2d437e248274" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.ir.txt index 3004f057472..473b9648415 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_OpenedIf - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.codegen.cs index e028f4d2489..347d347b308 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.ir.txt index 1d2c6ef0d5d..aa1f5fd4023 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.mappings.txt index 91160670a46..05d52d55ee3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_DesignTime.mappings.txt @@ -4,7 +4,7 @@ int i =10; int j =20; }| -Generated Location: (1444:33,2 [31] ) +Generated Location: (1470:33,2 [31] ) | /* int i =10; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.codegen.cs index bcd60d5d038..22df09ada55 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2ea704d333b7a4d377b389409cc282c6500f60cbc098fd01acffeac4b61d150b" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.ir.txt index 9edd6cad57e..9c0f61420b5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ParserError - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [31] ParserError.cshtml) LazyIntermediateToken - (2:0,2 [31] ParserError.cshtml) - CSharp - \n/*\nint i =10;\nint j =20;\n} diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.codegen.cs index 05988623c7f..20f1105bbcf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.ir.txt index f077a61cf89..5cd2766446a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.InputTagHelper1 - __TestNamespace_InputTagHelper1 FieldDeclaration - - private - global::TestNamespace.InputTagHelper2 - __TestNamespace_InputTagHelper2 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.mappings.txt index c89df5a1c68..23d767d3da4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_DesignTime.mappings.txt @@ -1,6 +1,6 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |"*, TestAssembly"| -Generated Location: (1855:33,37 [17] ) +Generated Location: (1881:33,37 [17] ) |"*, TestAssembly"| Source Location: (37:2,2 [242] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) @@ -15,7 +15,7 @@ Source Location: (37:2,2 [242] TestFiles/IntegrationTests/CodeGenerationIntegrat { "name", "value" }, }; | -Generated Location: (2373:50,2 [242] ) +Generated Location: (2399:50,2 [242] ) | var literate = "or illiterate"; var intDictionary = new Dictionary @@ -30,51 +30,51 @@ Generated Location: (2373:50,2 [242] ) Source Location: (370:15,43 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |intDictionary| -Generated Location: (3054:68,56 [13] ) +Generated Location: (3080:68,56 [13] ) |intDictionary| Source Location: (404:15,77 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |stringDictionary| -Generated Location: (3444:76,77 [16] ) +Generated Location: (3470:76,77 [16] ) |stringDictionary| Source Location: (468:16,43 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |intDictionary| -Generated Location: (4108:87,56 [13] ) +Generated Location: (4134:87,56 [13] ) |intDictionary| Source Location: (502:16,77 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |37| -Generated Location: (4498:95,77 [2] ) +Generated Location: (4524:95,77 [2] ) |37| Source Location: (526:16,101 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |42| -Generated Location: (4921:103,101 [2] ) +Generated Location: (4947:103,101 [2] ) |42| Source Location: (590:18,31 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |42| -Generated Location: (5556:114,46 [2] ) +Generated Location: (5582:114,46 [2] ) |42| Source Location: (611:18,52 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |37| -Generated Location: (5923:122,64 [2] ) +Generated Location: (5949:122,64 [2] ) |37| Source Location: (634:18,75 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |98| -Generated Location: (6316:130,75 [2] ) +Generated Location: (6342:130,75 [2] ) |98| Source Location: (783:20,42 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |literate| -Generated Location: (7136:142,42 [8] ) +Generated Location: (7162:142,42 [8] ) |literate| Source Location: (826:21,29 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml) |37| -Generated Location: (7914:154,65 [2] ) +Generated Location: (7940:154,65 [2] ) |37| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.codegen.cs index 7b948c4d155..d3168b292b9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "28f23e39ed667ea15fc4af5b51ee4ad399519e7dd4dbddb840b8b70c29baf0e5" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers : 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", new global::Microsoft.AspNetCore.Html.HtmlString("checkbox"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.ir.txt index 8423dd65388..fe7c85c4681 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PrefixedAttributeTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - type - password - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - type - radio - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.codegen.cs index 7e4c9770598..7b6c78c5720 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.ir.txt index e1680c41e3d..b51a5ea39fa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.mappings.txt index 4f30421ebe1..fe2be405d9c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_DesignTime.mappings.txt @@ -1,14 +1,14 @@ Source Location: (81:3,2 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml) | | -Generated Location: (1450:33,2 [6] ) +Generated Location: (1476:33,2 [6] ) | | Source Location: (122:4,39 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml) | Exception foo = | -Generated Location: (1655:41,39 [22] ) +Generated Location: (1681:41,39 [22] ) | Exception foo = | @@ -18,7 +18,7 @@ Source Location: (173:5,49 [58] TestFiles/IntegrationTests/CodeGenerationIntegra throw foo; } | -Generated Location: (1886:49,49 [58] ) +Generated Location: (1912:49,49 [58] ) | null; if(foo != null) { throw foo; @@ -27,21 +27,21 @@ Generated Location: (1886:49,49 [58] ) Source Location: (238:11,2 [24] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml) | var bar = "@* bar *@"; | -Generated Location: (2105:59,2 [24] ) +Generated Location: (2131:59,2 [24] ) | var bar = "@* bar *@"; | Source Location: (310:12,45 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml) |bar| -Generated Location: (2335:66,45 [3] ) +Generated Location: (2361:66,45 [3] ) |bar| Source Location: (323:14,2 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml) |a| -Generated Location: (2506:73,6 [1] ) +Generated Location: (2532:73,6 [1] ) |a| Source Location: (328:14,7 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml) |b| -Generated Location: (2507:73,7 [1] ) +Generated Location: (2533:73,7 [1] ) |b| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.codegen.cs index 38b59d46c5b..f539cc7203b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a9d16af76d3b638c489fe4ce4511816619e1713e1515ec0ce13b898e140dde7d" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.ir.txt index 931613bfaf4..160886a6763 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorComments - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (38:1,0 [15] RazorComments.cshtml) LazyIntermediateToken - (38:1,0 [2] RazorComments.cshtml) - Html -

#pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_DesignTime.ir.txt index b2490b90085..d5ac9236574 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_DesignTime.mappings.txt index 9dd822ad066..b65af31345d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (17:0,17 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective.cshtml) |*, TestAssembly| -Generated Location: (1263:26,38 [15] ) +Generated Location: (1289:26,38 [15] ) |*, TestAssembly| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.codegen.cs index fa612a6507c..6f7e93ca4a6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "66adeb0c482cc6a637c59000352e67b637c2f01d476e877553f414561d86016c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.ir.txt index f5d7162589f..82c6e13c4b9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RemoveTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync Inject - Inject - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs index e5ab174b090..f6fcb8a39a3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt index 516dd0b17ca..11abba1fe2d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt index 180bf3fb650..c855ae03328 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_DesignTime.mappings.txt @@ -1,44 +1,44 @@ Source Location: (89:6,9 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |Section2| -Generated Location: (1199:26,22 [8] ) +Generated Location: (1225:26,22 [8] ) |Section2| Source Location: (172:10,9 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |Section1| -Generated Location: (1462:36,22 [8] ) +Generated Location: (1488:36,22 [8] ) |Section1| Source Location: (235:14,9 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |NestedDelegates| -Generated Location: (1725:46,22 [15] ) +Generated Location: (1751:46,22 [15] ) |NestedDelegates| Source Location: (2:0,2 [44] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) | Layout = "_SectionTestLayout.cshtml" | -Generated Location: (2230:63,2 [44] ) +Generated Location: (2256:63,2 [44] ) | Layout = "_SectionTestLayout.cshtml" | Source Location: (123:7,22 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |thing| -Generated Location: (2523:72,22 [5] ) +Generated Location: (2549:72,22 [5] ) |thing| Source Location: (260:15,6 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) | Func f = | -Generated Location: (2908:85,6 [27] ) +Generated Location: (2934:85,6 [27] ) | Func f = | Source Location: (295:15,41 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |item| -Generated Location: (3249:93,41 [4] ) +Generated Location: (3275:93,41 [4] ) |item| Source Location: (306:15,52 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml) |; | -Generated Location: (3500:102,52 [2] ) +Generated Location: (3526:102,52 [2] ) |; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs index e3100e5e2cf..eafa4743dd4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0e3bbd637055ed3caa71a09baf3eb8ab5fc1f8057091dcd2c2adbfa3de691076" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt index d5d878ffa2f..8541321a79b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [44] Sections.cshtml) LazyIntermediateToken - (2:0,2 [44] Sections.cshtml) - CSharp - \n Layout = "_SectionTestLayout.cshtml"\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.codegen.cs index dfa27ebac0c..4b3af1ea35c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.ir.txt index c16f21af6ef..4d6b4ee172b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.mappings.txt index 9e334179661..2e6e5659a87 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_DesignTime.mappings.txt @@ -1,5 +1,5 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers.cshtml) |*, TestAssembly| -Generated Location: (1705:32,38 [15] ) +Generated Location: (1731:32,38 [15] ) |*, TestAssembly| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.codegen.cs index 85573f6035e..9afced309db 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "cc678f2e7fe9415c8275fdb0aa72ebab925dcf86a98dcdcfcb8939af2a5f2a9e" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers : 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("value", "Hello", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.SingleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.ir.txt index 5522ec595d5..43d6897a07f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleTagHelpers - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - value - Hello - HtmlAttributeValueStyle.SingleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - type - text - HtmlAttributeValueStyle.SingleQuotes DefaultTagHelperRuntime - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.codegen.cs index 76e7d8ca04c..89bf4df8213 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.ir.txt index d5ff76e612c..51b30c8b69d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.mappings.txt index 9741f1f4134..4cba94c1349 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_DesignTime.mappings.txt @@ -2,7 +2,7 @@ |if (true) { | -Generated Location: (1458:33,1 [15] ) +Generated Location: (1484:33,1 [15] ) |if (true) { | @@ -10,7 +10,7 @@ Generated Location: (1458:33,1 [15] ) Source Location: (27:2,12 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf.cshtml) | }| -Generated Location: (1648:42,12 [3] ) +Generated Location: (1674:42,12 [3] ) | }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.codegen.cs index 26f0e9af95a..59517fa892e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6c2fffb4b344ac4d9af24dc64c830fcfcba50e2ae9c69a95e54910b4c9225820" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.ir.txt index 828c1e151d1..2811d9aca1f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SimpleUnspacedIf - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (1:0,1 [14] SimpleUnspacedIf.cshtml) LazyIntermediateToken - (1:0,1 [14] SimpleUnspacedIf.cshtml) - CSharp - if (true)\n{\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.codegen.cs index d8ee96ba3a0..e1ff3f6cf6f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.ir.txt index a6a881fda8f..79a28126563 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.mappings.txt index af7664ee49e..88f868ff1d9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_DesignTime.mappings.txt @@ -1,23 +1,23 @@ Source Location: (24:2,2 [44] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) | if (DateTime.Now.ToBinary() % 2 == 0) | -Generated Location: (1504:33,2 [44] ) +Generated Location: (1530:33,2 [44] ) | if (DateTime.Now.ToBinary() % 2 == 0) | Source Location: (70:3,44 [32] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |"Current time is divisible by 2"| -Generated Location: (1770:41,44 [32] ) +Generated Location: (1796:41,44 [32] ) |"Current time is divisible by 2"| Source Location: (103:3,77 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) | else | -Generated Location: (2058:48,77 [6] ) +Generated Location: (2084:48,77 [6] ) | else | Source Location: (110:3,84 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |DateTime.Now| -Generated Location: (2326:55,84 [12] ) +Generated Location: (2352:55,84 [12] ) |DateTime.Now| Source Location: (122:3,96 [381] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) @@ -38,7 +38,7 @@ Source Location: (122:3,96 [381] TestFiles/IntegrationTests/CodeGenerationIntegr i--; | -Generated Location: (2613:62,96 [381] ) +Generated Location: (2639:62,96 [381] ) | object Bar() @@ -60,18 +60,18 @@ Generated Location: (2613:62,96 [381] ) Source Location: (504:19,5 [47] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |foreach (var item in new[] {"hello"}) | -Generated Location: (3178:85,5 [47] ) +Generated Location: (3204:85,5 [47] ) |foreach (var item in new[] {"hello"}) | Source Location: (552:20,9 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |item| -Generated Location: (3413:93,9 [4] ) +Generated Location: (3439:93,9 [4] ) |item| Source Location: (556:20,13 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) || -Generated Location: (3610:100,13 [0] ) +Generated Location: (3636:100,13 [0] ) || Source Location: (556:20,13 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) @@ -79,7 +79,7 @@ Source Location: (556:20,13 [20] TestFiles/IntegrationTests/CodeGenerationIntegr do | -Generated Location: (3802:107,13 [20] ) +Generated Location: (3828:107,13 [20] ) | do @@ -87,7 +87,7 @@ Generated Location: (3802:107,13 [20] ) Source Location: (577:23,9 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |currentCount| -Generated Location: (4010:117,9 [12] ) +Generated Location: (4036:117,9 [12] ) |currentCount| Source Location: (589:23,21 [174] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) @@ -99,7 +99,7 @@ Source Location: (589:23,21 [174] TestFiles/IntegrationTests/CodeGenerationInteg using (var reader = new System.IO.StreamReader("/something")) | -Generated Location: (4223:124,21 [174] ) +Generated Location: (4249:124,21 [174] ) | while (--currentCount >= 0); @@ -111,14 +111,14 @@ Generated Location: (4223:124,21 [174] ) Source Location: (764:30,9 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |reader.ReadToEnd()| -Generated Location: (4585:138,9 [18] ) +Generated Location: (4611:138,9 [18] ) |reader.ReadToEnd()| Source Location: (782:30,27 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) | | -Generated Location: (4810:145,27 [8] ) +Generated Location: (4836:145,27 [8] ) | | @@ -126,74 +126,74 @@ Generated Location: (4810:145,27 [8] ) Source Location: (791:32,5 [36] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |lock (this) currentCount++;| -Generated Location: (5002:154,5 [36] ) +Generated Location: (5028:154,5 [36] ) |lock (this) currentCount++;| Source Location: (827:33,23 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) | | -Generated Location: (5240:162,23 [2] ) +Generated Location: (5266:162,23 [2] ) | | Source Location: (1674:76,1 [34] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |for (var i = 0; i < 10; i++) | -Generated Location: (5420:169,1 [34] ) +Generated Location: (5446:169,1 [34] ) |for (var i = 0; i < 10; i++) | Source Location: (1709:77,5 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |i| -Generated Location: (5639:177,6 [1] ) +Generated Location: (5665:177,6 [1] ) |i| Source Location: (1710:77,6 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) || -Generated Location: (5826:184,6 [0] ) +Generated Location: (5852:184,6 [0] ) || Source Location: (1715:79,1 [43] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |foreach (var item in new[] {"hello"}) | -Generated Location: (6006:191,1 [43] ) +Generated Location: (6032:191,1 [43] ) |foreach (var item in new[] {"hello"}) | Source Location: (1759:80,5 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |item| -Generated Location: (6234:199,6 [4] ) +Generated Location: (6260:199,6 [4] ) |item| Source Location: (1763:80,9 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) || -Generated Location: (6427:206,9 [0] ) +Generated Location: (6453:206,9 [0] ) || Source Location: (1768:82,1 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |do | -Generated Location: (6607:213,1 [8] ) +Generated Location: (6633:213,1 [8] ) |do | Source Location: (1777:83,5 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |currentCount| -Generated Location: (6800:221,6 [12] ) +Generated Location: (6826:221,6 [12] ) |currentCount| Source Location: (1789:83,17 [30] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) | while (--currentCount >= 0);| -Generated Location: (7009:228,17 [30] ) +Generated Location: (7035:228,17 [30] ) | while (--currentCount >= 0);| Source Location: (1824:86,1 [49] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |while (--currentCount <= 10) currentCount++;| -Generated Location: (7219:236,1 [49] ) +Generated Location: (7245:236,1 [49] ) |while (--currentCount <= 10) currentCount++;| @@ -201,38 +201,38 @@ Source Location: (1878:89,1 [99] TestFiles/IntegrationTests/CodeGenerationIntegr |using (var reader = new System.IO.StreamReader("/something")) // Reading the entire file | -Generated Location: (7448:244,1 [99] ) +Generated Location: (7474:244,1 [99] ) |using (var reader = new System.IO.StreamReader("/something")) // Reading the entire file | Source Location: (1978:91,5 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |reader.ReadToEnd()| -Generated Location: (7732:253,6 [18] ) +Generated Location: (7758:253,6 [18] ) |reader.ReadToEnd()| Source Location: (1996:91,23 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) || -Generated Location: (7953:260,23 [0] ) +Generated Location: (7979:260,23 [0] ) || Source Location: (2001:93,1 [32] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |lock (this) currentCount++;| -Generated Location: (8133:267,1 [32] ) +Generated Location: (8159:267,1 [32] ) |lock (this) currentCount++;| Source Location: (2038:96,1 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |if (true) | -Generated Location: (8345:275,1 [10] ) +Generated Location: (8371:275,1 [10] ) |if (true) | Source Location: (2049:96,12 [33] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |@GitHubUserName

Hello!

| -Generated Location: (8546:282,12 [33] ) +Generated Location: (8572:282,12 [33] ) |@GitHubUserName

Hello!

| @@ -240,18 +240,18 @@ Generated Location: (8546:282,12 [33] ) Source Location: (2083:98,1 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |if (true) | -Generated Location: (8757:290,1 [16] ) +Generated Location: (8783:290,1 [16] ) |if (true) | Source Location: (2118:99,23 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |DateTime.Now| -Generated Location: (8976:298,23 [12] ) +Generated Location: (9002:298,23 [12] ) |DateTime.Now| Source Location: (2136:100,0 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) || -Generated Location: (9169:305,0 [0] ) +Generated Location: (9195:305,0 [0] ) || Source Location: (846:36,12 [386] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) @@ -271,7 +271,7 @@ Source Location: (846:36,12 [386] TestFiles/IntegrationTests/CodeGenerationInteg foreach (var item in new[] {"hello"}) | -Generated Location: (9407:313,12 [386] ) +Generated Location: (9433:313,12 [386] ) | public string Foo() { @@ -291,7 +291,7 @@ Generated Location: (9407:313,12 [386] ) Source Location: (1233:51,13 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |item| -Generated Location: (9985:335,13 [4] ) +Generated Location: (10011:335,13 [4] ) |item| Source Location: (1237:51,17 [28] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) @@ -299,7 +299,7 @@ Source Location: (1237:51,17 [28] TestFiles/IntegrationTests/CodeGenerationInteg do | -Generated Location: (10186:342,17 [28] ) +Generated Location: (10212:342,17 [28] ) | do @@ -307,7 +307,7 @@ Generated Location: (10186:342,17 [28] ) Source Location: (1266:54,13 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |currentCount| -Generated Location: (10406:352,13 [12] ) +Generated Location: (10432:352,13 [12] ) |currentCount| Source Location: (1278:54,25 [194] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) @@ -319,7 +319,7 @@ Source Location: (1278:54,25 [194] TestFiles/IntegrationTests/CodeGenerationInte using (var reader = new System.IO.StreamReader("/something")) | -Generated Location: (10623:359,25 [194] ) +Generated Location: (10649:359,25 [194] ) | while (--currentCount >= 0); @@ -331,7 +331,7 @@ Generated Location: (10623:359,25 [194] ) Source Location: (1473:61,13 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) |reader.ReadToEnd()| -Generated Location: (11009:373,13 [18] ) +Generated Location: (11035:373,13 [18] ) |reader.ReadToEnd()| Source Location: (1491:61,31 [177] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml) @@ -349,7 +349,7 @@ Source Location: (1491:61,31 [177] TestFiles/IntegrationTests/CodeGenerationInte } | -Generated Location: (11238:380,31 [177] ) +Generated Location: (11264:380,31 [177] ) | lock (this) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.codegen.cs index 7e716f7ea42..ed2da220f72 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a66d420fecd4b03184392e5ffae1b5cbd3050be4e5c1a1d641eb271a35d9099d" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.ir.txt index e9c7fa72f17..91f0e1309b0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleLineControlFlowStatements - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [22] SingleLineControlFlowStatements.cshtml) LazyIntermediateToken - (0:0,0 [2] SingleLineControlFlowStatements.cshtml) - Html -

#pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.ir.txt index d89a1e77f7a..11b34d1f5d3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.mappings.txt index 87ee93f6caa..bd2332ebd08 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml) |"*, TestAssembly"| -Generated Location: (1802:32,37 [17] ) +Generated Location: (1828:32,37 [17] ) |"*, TestAssembly"| Source Location: (67:3,28 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml) |1337| -Generated Location: (2461:50,33 [4] ) +Generated Location: (2487:50,33 [4] ) |1337| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.codegen.cs index 5095900078d..88ba9502a23 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "911da9fbec044f6d3567d334c5ef47d9311c69940873e9ceb6ba007b65164b71" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes : 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("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.ir.txt index f8242412415..5b09edff084 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelperWithNewlineBeforeAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - Hello World - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.codegen.cs index 8a600625958..23f5bcac2c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.ir.txt index 29e78d928b7..2364c72da6b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.mappings.txt index d78b043a4f3..fc44f126ca6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml) |"*, TestAssembly"| -Generated Location: (1721:32,37 [17] ) +Generated Location: (1747:32,37 [17] ) |"*, TestAssembly"| Source Location: (63:2,28 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml) |1337| -Generated Location: (2353:50,33 [4] ) +Generated Location: (2379:50,33 [4] ) |1337| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.codegen.cs index 5d33bd05fe5..f782f32a44c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "07221c920388e192f27500b1efb178559390c71d91890dc7624909ff0a7e62a0" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper : 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("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.ir.txt index f1dea66c897..21781c9f6d4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SingleTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - Hello World - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.codegen.cs index 2be5e93240e..37045db077c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.ir.txt index 9cdf9b9a8ea..3005c7a5ab2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.mappings.txt index 547965436a9..887f794170a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (2022:85,9 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals.cshtml) |WriteLiteralsToInHere| -Generated Location: (1218:26,22 [21] ) +Generated Location: (1244:26,22 [21] ) |WriteLiteralsToInHere| Source Location: (5701:205,9 [25] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals.cshtml) |WriteLiteralsToInHereAlso| -Generated Location: (1501:36,22 [25] ) +Generated Location: (1527:36,22 [25] ) |WriteLiteralsToInHereAlso| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.codegen.cs index c86e63f3e41..1ca6da65524 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "69f3680900f8c303ec50c37449fea720166f0f13b35f665d03575ab725ccabe0" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.ir.txt index b605d37fcc7..d722c24d0b4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_StringLiterals - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (0:0,0 [2013] StringLiterals.cshtml) LazyIntermediateToken - (0:0,0 [2] StringLiterals.cshtml) - Html -

#pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_DesignTime.ir.txt index 05bb964db21..ff8e91b22e6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_DesignTime.mappings.txt index 836a67568e9..c635c0be02b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_DesignTime.mappings.txt @@ -3,7 +3,7 @@ { case { Year: 2022 }: | -Generated Location: (1509:33,1 [69] ) +Generated Location: (1535:33,1 [69] ) |switch (DateTimeOffset.UtcNow) { case { Year: 2022 }: @@ -19,7 +19,7 @@ Source Location: (159:3,97 [180] TestFiles/IntegrationTests/CodeGenerationIntegr case global::Test: break; }| -Generated Location: (1855:43,97 [180] ) +Generated Location: (1881:43,97 [180] ) | break; case [{ Test: true }]: diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.codegen.cs index 73fc9577339..5aa3b37ceff 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9168a1bd59651e5e083cf79f3271ea80436a9539f637069ba388b14b675f3b39" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.ir.txt index e91c0995e2e..6df0b582b3a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SwitchExpression_RecursivePattern - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (1:0,1 [61] SwitchExpression_RecursivePattern.cshtml) LazyIntermediateToken - (1:0,1 [61] SwitchExpression_RecursivePattern.cshtml) - CSharp - switch (DateTimeOffset.UtcNow)\n{\n case { Year: 2022 }:\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.codegen.cs index e09633c3bf6..71645b32c64 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.ir.txt index 1969f772019..f7fac4b18e0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.CatchAllTagHelper - __TestNamespace_CatchAllTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.mappings.txt index 2920c2cdfec..7bfa98ed10b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_DesignTime.mappings.txt @@ -1,25 +1,25 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) |*, TestAssembly| -Generated Location: (1754:32,38 [15] ) +Generated Location: (1780:32,38 [15] ) |*, TestAssembly| Source Location: (302:11,18 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) |items| -Generated Location: (2419:50,46 [5] ) +Generated Location: (2445:50,46 [5] ) |items| Source Location: (351:12,20 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) |items| -Generated Location: (2826:59,47 [5] ) +Generated Location: (2852:59,47 [5] ) |items| Source Location: (405:13,23 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) |doSomething()| -Generated Location: (3229:68,43 [13] ) +Generated Location: (3255:68,43 [13] ) |doSomething()| Source Location: (487:14,24 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml) |doSomething()| -Generated Location: (3640:77,43 [13] ) +Generated Location: (3666:77,43 [13] ) |doSomething()| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.codegen.cs index 9fccf013742..b7c9124e5f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6670062036b3e25775cee4af27e2b53b638aff4fd93c3087d0cfb1947fd5e738" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes : 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("[item]", new global::Microsoft.AspNetCore.Html.HtmlString("items"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.ir.txt index 11b5af7e683..ebb3fe58432 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_SymbolBoundAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - [item] - items - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - [(item)] - items - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - (click) - doSomething() - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.codegen.cs index 60674114429..4922b3c6244 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.ir.txt index ec2d23a0973..160465d71ef 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.MyTagHelper - __TestNamespace_MyTagHelper FieldDeclaration - - private - global::TestNamespace.NestedTagHelper - __TestNamespace_NestedTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.mappings.txt index 8686ec967fb..38e534426cc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_DesignTime.mappings.txt @@ -1,39 +1,39 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml) |"*, TestAssembly"| -Generated Location: (1823:33,37 [17] ) +Generated Location: (1849:33,37 [17] ) |"*, TestAssembly"| Source Location: (82:6,9 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml) |MySection| -Generated Location: (2097:43,22 [9] ) +Generated Location: (2123:43,22 [9] ) |MySection| Source Location: (388:14,13 [13] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml) |nestedsection| -Generated Location: (2372:53,22 [13] ) +Generated Location: (2398:53,22 [13] ) |nestedsection| Source Location: (37:2,2 [31] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml) | var code = "some code"; | -Generated Location: (2886:70,2 [31] ) +Generated Location: (2912:70,2 [31] ) | var code = "some code"; | Source Location: (313:10,56 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml) |code| -Generated Location: (3213:79,56 [4] ) +Generated Location: (3239:79,56 [4] ) |code| Source Location: (157:8,51 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml) |DateTime.Now| -Generated Location: (3725:89,51 [12] ) +Generated Location: (3751:89,51 [12] ) |DateTime.Now| Source Location: (203:8,97 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml) |DateTime.Now| -Generated Location: (4076:97,97 [12] ) +Generated Location: (4102:97,97 [12] ) |DateTime.Now| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.codegen.cs index 15bf9ec2b29..8d49de1065f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "66a1fd3b9b40b304a7d1864845d2b7ab0f5f5c8a98d810ff8f97a245644661a9" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt index 3a0e62a7b4c..e46cbc8a484 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersInSection - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.MyTagHelper - __TestNamespace_MyTagHelper FieldDeclaration - - private - global::TestNamespace.NestedTagHelper - __TestNamespace_NestedTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.codegen.cs index 8c0ebff4477..5053a538c73 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.ir.txt index 7bf14af9334..d87a9e04b84 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.mappings.txt index c04d4923d0d..c5cfdf91938 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_DesignTime.mappings.txt @@ -1,10 +1,10 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml) |*, TestAssembly| -Generated Location: (1744:32,38 [15] ) +Generated Location: (1770:32,38 [15] ) |*, TestAssembly| Source Location: (57:2,18 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml) |Hello| -Generated Location: (2354:50,18 [5] ) +Generated Location: (2380:50,18 [5] ) |Hello| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs index 2979924754d..145f118001a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "13f5d05e90dce1e87481ae84a605a64f0292501f08d4449df1105d14bd068161" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes : 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", new global::Microsoft.AspNetCore.Html.HtmlString("text"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.SingleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.ir.txt index c65bdc4ddf2..301a41abc2d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithBoundAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - type - text - HtmlAttributeValueStyle.SingleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.codegen.cs index f19f4b6cf7a..dd71e4d44ee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.ir.txt index c606b65b561..a82c21cc4e4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper FieldDeclaration - - private - global::DivTagHelper - __DivTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.mappings.txt index 453d5fe0416..ec28e82a2e3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml) |*, TestAssembly| -Generated Location: (1807:33,38 [15] ) +Generated Location: (1833:33,38 [15] ) |*, TestAssembly| Source Location: (111:3,15 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml) |foo| -Generated Location: (2615:54,15 [3] ) +Generated Location: (2641:54,15 [3] ) |foo| Source Location: (126:3,30 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml) |bar| -Generated Location: (2828:61,30 [3] ) +Generated Location: (2854:61,30 [3] ) |bar| Source Location: (225:4,61 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml) |foo| -Generated Location: (3148:69,61 [3] ) +Generated Location: (3174:69,61 [3] ) |foo| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.codegen.cs index de62361e52c..5d10f1a5f56 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "07dfad59bc192742aea1638b2d08142a1c9a2201583a31cd0ea0ad5342acffca" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes : 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("bound", "hello", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.ir.txt index e528482375a..9d9a92f7113 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithDataDashAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - bound - hello - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - data-one - 1 - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - data-two - 2 - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.codegen.cs index 70ee5fcfabc..4f732ca20f2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.ir.txt index 28c97f25235..d71fe2bc71d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.mappings.txt index c2be32a5cae..d601ec59a75 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_DesignTime.mappings.txt @@ -1,15 +1,15 @@ Source Location: (14:0,14 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix.cshtml) |*, TestAssembly| -Generated Location: (1717:32,38 [15] ) +Generated Location: (1743:32,38 [15] ) |*, TestAssembly| Source Location: (48:1,17 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix.cshtml) |cool:| -Generated Location: (2007:42,38 [5] ) +Generated Location: (2033:42,38 [5] ) |cool:| Source Location: (86:3,23 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix.cshtml) |Hello| -Generated Location: (2603:60,23 [5] ) +Generated Location: (2629:60,23 [5] ) |Hello| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.codegen.cs index f1c99f01501..2fc39350b72 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4073ac6b7d09e02c4f015f3b452a099682d34b86878f507ef1a6e8585c0d6e96" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix : 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", new global::Microsoft.AspNetCore.Html.HtmlString("text"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.SingleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.ir.txt index f6037d9acf3..d4e6fec2952 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithPrefix - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - type - text - HtmlAttributeValueStyle.SingleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.codegen.cs index 5bc212beab5..ff75b745ddf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.ir.txt index 2083da92fd8..e205f62ac64 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::DivTagHelper - __DivTagHelper FieldDeclaration - - private - global::InputTagHelper - __InputTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.mappings.txt index a080090424f..b25e804087a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_DesignTime.mappings.txt @@ -1,6 +1,6 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) |"*, TestAssembly"| -Generated Location: (1776:33,37 [17] ) +Generated Location: (1802:33,37 [17] ) |"*, TestAssembly"| Source Location: (333:12,6 [66] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) @@ -8,7 +8,7 @@ Source Location: (333:12,6 [66] TestFiles/IntegrationTests/CodeGenerationIntegra RenderTemplate( "Template: ", | -Generated Location: (2294:50,6 [66] ) +Generated Location: (2320:50,6 [66] ) | RenderTemplate( "Template: ", @@ -16,13 +16,13 @@ Generated Location: (2294:50,6 [66] ) Source Location: (427:15,40 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) |item| -Generated Location: (2683:61,40 [4] ) +Generated Location: (2709:61,40 [4] ) |item| Source Location: (482:15,95 [8] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml) |); | -Generated Location: (3297:74,95 [8] ) +Generated Location: (3323:74,95 [8] ) |); | @@ -35,7 +35,7 @@ Source Location: (47:2,12 [268] TestFiles/IntegrationTests/CodeGenerationIntegra helperResult.WriteTo(Output, HtmlEncoder); } | -Generated Location: (3682:86,12 [268] ) +Generated Location: (3708:86,12 [268] ) | public void RenderTemplate(string title, Func template) { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.codegen.cs index 6f2062f3f18..cda7aec589b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "ad0a6817d6431c932ff123cbd5e19efc157aa4994025b91acf744cf1a5d02dd5" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate : 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", new global::Microsoft.AspNetCore.Html.HtmlString("checkbox"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt index 28f96034d86..b8f63b7a76f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithTemplate - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - type - checkbox - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_1 - checked - true - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - condition - true - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.codegen.cs index 72cba17d65b..55ca1b9f78c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.ir.txt index 769c880e7f2..51db26f9ae2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper FieldDeclaration - - private - global::TestNamespace.InputTagHelper - __TestNamespace_InputTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.mappings.txt index 8ecc40f9f2f..9d1245a1263 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_DesignTime.mappings.txt @@ -1,20 +1,20 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml) |"*, TestAssembly"| -Generated Location: (1961:34,37 [17] ) +Generated Location: (1987:34,37 [17] ) |"*, TestAssembly"| Source Location: (74:5,21 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml) |1337| -Generated Location: (2615:52,33 [4] ) +Generated Location: (2641:52,33 [4] ) |1337| Source Location: (99:6,19 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml) |true| -Generated Location: (2823:59,19 [4] ) +Generated Location: (2849:59,19 [4] ) |true| Source Location: (186:10,11 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml) |1234| -Generated Location: (3649:73,33 [4] ) +Generated Location: (3675:73,33 [4] ) |1234| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.codegen.cs index f77e9c33806..db86c83c3f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "d9b84e2f98477223e105fd1bb35f0717dea379bb406844d36d35a9220d093ff3" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes : 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("class", new global::Microsoft.AspNetCore.Html.HtmlString("Hello World"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.ir.txt index 94d36b268d8..be570989777 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TagHelpersWithWeirdlySpacedAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - Hello World - HtmlAttributeValueStyle.DoubleQuotes PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_1 - type - text - HtmlAttributeValueStyle.SingleQuotes PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_2 - data-content - hello - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.codegen.cs index 3c3ff9fc50d..97c1d4aafd7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.ir.txt index 813a2146079..d77bbb5c394 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.mappings.txt index df99f1c6f3e..9033e7db672 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_DesignTime.mappings.txt @@ -1,19 +1,19 @@ Source Location: (2:0,2 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml) | | -Generated Location: (1423:33,2 [6] ) +Generated Location: (1449:33,2 [6] ) | | Source Location: (41:1,37 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml) || -Generated Location: (1617:41,37 [0] ) +Generated Location: (1643:41,37 [0] ) || Source Location: (59:1,55 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml) | | -Generated Location: (1823:48,55 [2] ) +Generated Location: (1849:48,55 [2] ) | | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.codegen.cs index 26cfa5227f6..ab5730700bf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "d02f15e5b65cbcc2185f5f77ae6e69a01492b23120b97f0ffe06d4f34412b670" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.ir.txt index 0fb8dc617b2..2fff147dd8e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Tags - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [2] Tags.cshtml) LazyIntermediateToken - (2:0,2 [2] Tags.cshtml) - CSharp - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.codegen.cs index e4a36991214..d6ea66c42d9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.ir.txt index 8edd1dd567c..1ae5ece059d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.mappings.txt index bddf6b26c60..141b5fd4dbe 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_DesignTime.mappings.txt @@ -1,149 +1,149 @@ Source Location: (284:10,2 [34] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) | Func foo = | -Generated Location: (1439:33,2 [34] ) +Generated Location: (1465:33,2 [34] ) | Func foo = | Source Location: (337:11,51 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |item| -Generated Location: (1794:42,51 [4] ) +Generated Location: (1820:42,51 [4] ) |item| Source Location: (349:11,63 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |; | -Generated Location: (2049:51,63 [7] ) +Generated Location: (2075:51,63 [7] ) |; | Source Location: (357:12,5 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |foo("")| -Generated Location: (2219:59,6 [7] ) +Generated Location: (2245:59,6 [7] ) |foo("")| Source Location: (364:12,12 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) | | -Generated Location: (2396:66,12 [2] ) +Generated Location: (2422:66,12 [2] ) | | Source Location: (373:15,2 [35] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) | Func bar = | -Generated Location: (2555:73,2 [35] ) +Generated Location: (2581:73,2 [35] ) | Func bar = | Source Location: (420:16,44 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |item| -Generated Location: (2904:82,44 [4] ) +Generated Location: (2930:82,44 [4] ) |item| Source Location: (435:16,59 [7] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |; | -Generated Location: (3155:91,59 [7] ) +Generated Location: (3181:91,59 [7] ) |; | Source Location: (443:17,5 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |bar("myclass")| -Generated Location: (3325:99,6 [14] ) +Generated Location: (3351:99,6 [14] ) |bar("myclass")| Source Location: (457:17,19 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) | | -Generated Location: (3516:106,19 [2] ) +Generated Location: (3542:106,19 [2] ) | | Source Location: (472:21,2 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |Repeat(10, | -Generated Location: (3679:113,6 [11] ) +Generated Location: (3705:113,6 [11] ) |Repeat(10, | Source Location: (495:21,25 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |item| -Generated Location: (3921:116,25 [4] ) +Generated Location: (3947:116,25 [4] ) |item| Source Location: (504:21,34 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |)| -Generated Location: (3982:122,1 [1] ) +Generated Location: (4008:122,1 [1] ) |)| Source Location: (523:25,1 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |Repeat(10, | -Generated Location: (4147:129,6 [16] ) +Generated Location: (4173:129,6 [16] ) |Repeat(10, | Source Location: (556:26,21 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |item| -Generated Location: (4390:133,21 [4] ) +Generated Location: (4416:133,21 [4] ) |item| Source Location: (577:27,0 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |)| -Generated Location: (4451:139,1 [1] ) +Generated Location: (4477:139,1 [1] ) |)| Source Location: (594:31,1 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |Repeat(10, | -Generated Location: (4616:146,6 [16] ) +Generated Location: (4642:146,6 [16] ) |Repeat(10, | Source Location: (628:32,22 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |item| -Generated Location: (4860:150,22 [4] ) +Generated Location: (4886:150,22 [4] ) |item| Source Location: (650:33,0 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |)| -Generated Location: (4921:156,1 [1] ) +Generated Location: (4947:156,1 [1] ) |)| Source Location: (667:37,1 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |Repeat(10, | -Generated Location: (5086:163,6 [16] ) +Generated Location: (5112:163,6 [16] ) |Repeat(10, | Source Location: (702:38,23 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |item| -Generated Location: (5331:167,23 [4] ) +Generated Location: (5357:167,23 [4] ) |item| Source Location: (724:39,0 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |)| -Generated Location: (5392:173,1 [1] ) +Generated Location: (5418:173,1 [1] ) |)| Source Location: (748:44,5 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |Repeat(10, | -Generated Location: (5557:180,6 [11] ) +Generated Location: (5583:180,6 [11] ) |Repeat(10, | Source Location: (781:45,15 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |item| -Generated Location: (5789:183,15 [4] ) +Generated Location: (5815:183,15 [4] ) |item| Source Location: (797:46,10 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |var parent = item;| -Generated Location: (5961:190,10 [18] ) +Generated Location: (5987:190,10 [18] ) |var parent = item;| Source Location: (956:51,9 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) |)| -Generated Location: (6035:196,1 [1] ) +Generated Location: (6061:196,1 [1] ) |)| Source Location: (12:0,12 [265] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml) @@ -156,7 +156,7 @@ Source Location: (12:0,12 [265] TestFiles/IntegrationTests/CodeGenerationIntegra }); } | -Generated Location: (6254:205,12 [265] ) +Generated Location: (6280:205,12 [265] ) | public HelperResult Repeat(int times, Func template) { return new HelperResult((writer) => { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.codegen.cs index a3203a7bd16..136795030c7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "695d7f5579e84a072c03d019783c98e393c52ec6a24e022eb8ecb663955abd5c" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.ir.txt index c283b786e9c..0f21f41483a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Templates - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (280:9,0 [2] Templates.cshtml) LazyIntermediateToken - (280:9,0 [2] Templates.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.codegen.cs index bbc2e4fc300..c64ef00b8e8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #line hidden diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.ir.txt index 57515ffd583..bc5d5f0e465 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper DesignTimeDirective - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.mappings.txt index 054f953d977..93712abbcf3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_DesignTime.mappings.txt @@ -1,6 +1,6 @@ Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |"*, TestAssembly"| -Generated Location: (1772:32,37 [17] ) +Generated Location: (1798:32,37 [17] ) |"*, TestAssembly"| Source Location: (35:1,2 [59] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) @@ -8,7 +8,7 @@ Source Location: (35:1,2 [59] TestFiles/IntegrationTests/CodeGenerationIntegrati var @class = "container-fluid"; var @int = 1; | -Generated Location: (2295:49,2 [59] ) +Generated Location: (2321:49,2 [59] ) | var @class = "container-fluid"; var @int = 1; @@ -16,51 +16,51 @@ Generated Location: (2295:49,2 [59] ) Source Location: (122:6,23 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |1337| -Generated Location: (2659:59,33 [4] ) +Generated Location: (2685:59,33 [4] ) |1337| Source Location: (157:7,12 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |@class| -Generated Location: (3026:68,12 [6] ) +Generated Location: (3052:68,12 [6] ) |@class| Source Location: (171:7,26 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |42| -Generated Location: (3245:75,33 [2] ) +Generated Location: (3271:75,33 [2] ) |42| Source Location: (202:8,21 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |42 + @int| -Generated Location: (3631:84,33 [9] ) +Generated Location: (3657:84,33 [9] ) |42 + @int| Source Location: (241:9,22 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |int| -Generated Location: (4025:93,33 [3] ) +Generated Location: (4051:93,33 [3] ) |int| Source Location: (274:10,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |(| -Generated Location: (4413:102,33 [1] ) +Generated Location: (4439:102,33 [1] ) |(| Source Location: (275:10,23 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |@int| -Generated Location: (4414:102,34 [4] ) +Generated Location: (4440:102,34 [4] ) |@int| Source Location: (279:10,27 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |)| -Generated Location: (4418:102,38 [1] ) +Generated Location: (4444:102,38 [1] ) |)| Source Location: (307:11,19 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |@class| -Generated Location: (4790:111,19 [6] ) +Generated Location: (4816:111,19 [6] ) |@class| Source Location: (321:11,33 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml) |4 * @(@int + 2)| -Generated Location: (5010:118,33 [15] ) +Generated Location: (5036:118,33 [15] ) |4 * @(@int + 2)| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.codegen.cs index f61e73f3e37..9403c0aa521 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "5cd388817ab99fffd9510eac1fcdd90cdd85ca2fdd2eea07bb546d13df0501ec" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes : 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("class", new global::Microsoft.AspNetCore.Html.HtmlString("test"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.ir.txt index 0df5432621b..205ae49b0ff 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_TransitionsInTagHelperAttributes - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - test - HtmlAttributeValueStyle.DoubleQuotes DefaultTagHelperRuntime - FieldDeclaration - - private - global::TestNamespace.PTagHelper - __TestNamespace_PTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.codegen.cs index 9ca1fc448e4..cc79a14e325 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -16,7 +16,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.ir.txt index 77a00644652..a1e409f94ee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (1:0,1 [20] ) - global::System UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic @@ -10,7 +10,7 @@ UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.mappings.txt index 562ac5e6d14..2e3186e571b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_DesignTime.mappings.txt @@ -1,19 +1,19 @@ Source Location: (2:0,2 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode.cshtml) | | -Generated Location: (1489:33,2 [2] ) +Generated Location: (1515:33,2 [2] ) | | Source Location: (5:1,1 [9] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode.cshtml) |DateTime.| -Generated Location: (1668:40,6 [9] ) +Generated Location: (1694:40,6 [9] ) |DateTime.| Source Location: (14:1,10 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode.cshtml) | | -Generated Location: (1861:47,10 [2] ) +Generated Location: (1887:47,10 [2] ) | | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.codegen.cs index 3c252d76ce9..040c8d41b43 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9e0927882a39a700cb088e5a915bfe7c1f8b99c1859555ad2263383bac549511" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System; @@ -18,7 +18,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.ir.txt index e3000d9d916..c4fd3bfd7ac 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - (1:0,1 [22] ) - global::System UsingDirective - (24:1,1 [42] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [27] ) - global::System.Linq @@ -11,7 +11,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UnfinishedExpressionInCode - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync CSharpCode - (2:0,2 [2] UnfinishedExpressionInCode.cshtml) LazyIntermediateToken - (2:0,2 [2] UnfinishedExpressionInCode.cshtml) - CSharp - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.codegen.cs index b85b3188239..fb1f6c69ecb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -45,7 +45,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.ir.txt index 0cc9b7d0304..00c805a43fc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [25] ) - global::System.Linq @@ -15,7 +15,7 @@ UsingDirective - (123:6,1 [41] Usings.cshtml) - static global::System.Text.Encoding RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.mappings.txt index 49e5b4e7a7b..8fb5bc02ce6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_DesignTime.mappings.txt @@ -1,31 +1,31 @@ Source Location: (1:0,1 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) |using System.IO| -Generated Location: (520:14,0 [15] ) +Generated Location: (537:14,0 [15] ) |using System.IO| Source Location: (19:1,1 [32] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) |using Foo = System.Text.Encoding| -Generated Location: (660:19,0 [32] ) +Generated Location: (677:19,0 [32] ) |using Foo = System.Text.Encoding| Source Location: (54:2,1 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) |using System| -Generated Location: (817:24,0 [12] ) +Generated Location: (834:24,0 [12] ) |using System| Source Location: (71:4,1 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) |using static System| -Generated Location: (954:29,0 [19] ) +Generated Location: (971:29,0 [19] ) |using static System| Source Location: (93:5,1 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) |using static System.Console| -Generated Location: (1098:34,0 [27] ) +Generated Location: (1115:34,0 [27] ) |using static System.Console| Source Location: (123:6,1 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) |using static global::System.Text.Encoding| -Generated Location: (1250:39,0 [41] ) +Generated Location: (1267:39,0 [41] ) |using static global::System.Text.Encoding| Source Location: (170:8,2 [158] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) @@ -33,7 +33,7 @@ Source Location: (170:8,2 [158] TestFiles/IntegrationTests/CodeGenerationIntegra using var disposable = (IDisposable)ViewData["disposable"]; using System.IDisposable otherDisposable = (IDisposable)ViewData["otherdisposable"]; | -Generated Location: (2290:62,2 [158] ) +Generated Location: (2316:62,2 [158] ) | using var disposable = (IDisposable)ViewData["disposable"]; using System.IDisposable otherDisposable = (IDisposable)ViewData["otherdisposable"]; @@ -41,11 +41,11 @@ Generated Location: (2290:62,2 [158] ) Source Location: (362:13,29 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) |typeof(Path).FullName| -Generated Location: (2629:71,29 [21] ) +Generated Location: (2655:71,29 [21] ) |typeof(Path).FullName| Source Location: (424:14,35 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml) |typeof(Foo).FullName| -Generated Location: (2840:78,35 [20] ) +Generated Location: (2866:78,35 [20] ) |typeof(Foo).FullName| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.codegen.cs index 7e460943928..714f3fe5d77 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.codegen.cs @@ -1,6 +1,6 @@ // #pragma warning disable 1591 -namespace AspNetCore +namespace AspNetCoreGeneratedDocument { #line default using TModel = global::System.Object; @@ -50,7 +50,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 219 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.ir.txt index da36f385ec9..44e536ca30a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.ir.txt @@ -1,5 +1,5 @@ Document - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument UsingDirective - - TModel = global::System.Object UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic UsingDirective - (67:2,1 [25] ) - global::System.Linq @@ -16,7 +16,7 @@ UsingDirective - (576:31,1 [17] Usings_OutOfOrder.cshtml) - System.Text RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DesignTimeDirective - DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper DirectiveToken - (350:7,71 [4] ) - Html diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.mappings.txt index 724da265177..9082f2f3e43 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_DesignTime.mappings.txt @@ -1,36 +1,36 @@ Source Location: (1:0,1 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |using System.IO| -Generated Location: (531:14,0 [15] ) +Generated Location: (548:14,0 [15] ) |using System.IO| Source Location: (60:6,1 [32] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |using Foo = System.Text.Encoding| -Generated Location: (682:19,0 [32] ) +Generated Location: (699:19,0 [32] ) |using Foo = System.Text.Encoding| Source Location: (136:12,1 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |using System| -Generated Location: (851:24,0 [12] ) +Generated Location: (868:24,0 [12] ) |using System| Source Location: (153:14,1 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |using static System| -Generated Location: (1000:29,0 [19] ) +Generated Location: (1017:29,0 [19] ) |using static System| Source Location: (175:15,1 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |using static System.Console| -Generated Location: (1156:34,0 [27] ) +Generated Location: (1173:34,0 [27] ) |using static System.Console| Source Location: (246:21,1 [41] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |using static global::System.Text.Encoding| -Generated Location: (1320:39,0 [41] ) +Generated Location: (1337:39,0 [41] ) |using static global::System.Text.Encoding| Source Location: (576:31,1 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |using System.Text| -Generated Location: (1498:44,0 [17] ) +Generated Location: (1515:44,0 [17] ) |using System.Text| Source Location: (293:23,2 [158] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) @@ -38,7 +38,7 @@ Source Location: (293:23,2 [158] TestFiles/IntegrationTests/CodeGenerationIntegr using var disposable = (IDisposable)ViewData["disposable"]; using System.IDisposable otherDisposable = (IDisposable)ViewData["otherdisposable"]; | -Generated Location: (2548:67,2 [158] ) +Generated Location: (2574:67,2 [158] ) | using var disposable = (IDisposable)ViewData["disposable"]; using System.IDisposable otherDisposable = (IDisposable)ViewData["otherdisposable"]; @@ -46,19 +46,19 @@ Generated Location: (2548:67,2 [158] ) Source Location: (485:28,29 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |typeof(Path).FullName| -Generated Location: (2898:76,29 [21] ) +Generated Location: (2924:76,29 [21] ) |typeof(Path).FullName| Source Location: (547:29,35 [20] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) |typeof(Foo).FullName| -Generated Location: (3120:83,35 [20] ) +Generated Location: (3146:83,35 [20] ) |typeof(Foo).FullName| Source Location: (32:2,12 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml) | // functions 1 | -Generated Location: (3366:92,12 [22] ) +Generated Location: (3392:92,12 [22] ) | // functions 1 | @@ -67,7 +67,7 @@ Source Location: (108:8,12 [22] TestFiles/IntegrationTests/CodeGenerationIntegra | // functions 2 | -Generated Location: (3562:100,12 [22] ) +Generated Location: (3588:100,12 [22] ) | // functions 2 | @@ -76,7 +76,7 @@ Source Location: (218:17,12 [22] TestFiles/IntegrationTests/CodeGenerationIntegr | // functions 3 | -Generated Location: (3759:108,12 [22] ) +Generated Location: (3785:108,12 [22] ) | // functions 3 | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.codegen.cs index 89753dcb72d..582e12e504c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "a3144fef15024ccbbb19682bfb110b149c637f2ae64b4499962195e7612ba274" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System.Collections.Generic; @@ -59,7 +59,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.ir.txt index fd87db2bf1d..3d5b44cc8d4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument 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 @@ -17,7 +17,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings_OutOfOrder - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (18:1,0 [2] Usings_OutOfOrder.cshtml) LazyIntermediateToken - (18:1,0 [2] Usings_OutOfOrder.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.codegen.cs index 7548535a8a6..11aba447b73 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.codegen.cs @@ -1,8 +1,8 @@ #pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "f52e72ba69034334ab681d1f5e91cd50788cbfc0d1390104ee1e60d95d4ca443" // #pragma warning disable 1591 -[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml")] -namespace AspNetCore +[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCoreGeneratedDocument.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings), @"mvc.1.0.view", @"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml")] +namespace AspNetCoreGeneratedDocument { #line default using global::System.Collections.Generic; @@ -53,7 +53,7 @@ namespace AspNetCore [global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemMetadataAttribute("Identifier", "/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml")] [global::System.Runtime.CompilerServices.CreateNewOnMetadataUpdateAttribute] #nullable restore - public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage + internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { #pragma warning disable 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.ir.txt index 1f87045e8c9..26b0208ef5b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.ir.txt @@ -1,6 +1,6 @@ Document - RazorCompiledItemAttribute - - NamespaceDeclaration - - AspNetCore + NamespaceDeclaration - - AspNetCoreGeneratedDocument 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 @@ -16,7 +16,7 @@ RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Usings - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync HtmlContent - (68:3,0 [2] Usings.cshtml) LazyIntermediateToken - (68:3,0 [2] Usings.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorConfiguration.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorConfiguration.cs index 33f6e744b0e..a1b1ba4b487 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorConfiguration.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorConfiguration.cs @@ -12,14 +12,14 @@ public sealed record class RazorConfiguration( string ConfigurationName, ImmutableArray Extensions, LanguageServerFlags? LanguageServerFlags = null, - bool UseConsolidatedMvcViews = false) + bool UseConsolidatedMvcViews = true) { public static readonly RazorConfiguration Default = new( RazorLanguageVersion.Latest, ConfigurationName: "unnamed", Extensions: [], LanguageServerFlags: null, - UseConsolidatedMvcViews: false); + UseConsolidatedMvcViews: true); public bool Equals(RazorConfiguration? other) => other is not null && diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs index aa245a725be..0925b7d4aeb 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentSymbols/DocumentSymbolEndpointTest.cs @@ -25,7 +25,7 @@ public Task DocumentSymbols_CSharpClassWithMethods(bool hierarchical) => VerifyDocumentSymbolsAsync( """ @functions { - class {|AspNetCore.test.C:C|} + class {|AspNetCoreGeneratedDocument.test.C:C|} { private void {|HandleString(string s):HandleString|}(string s) { From 27a338b0a6a7337b5e94033a512507ba0c2e2c13 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Wed, 28 Aug 2024 11:56:48 -0700 Subject: [PATCH 242/386] Global namespace component bind (#10798) * Don't create a taghelper with no matching rules * Add test --------- Co-authored-by: Jan Jones --- .../ComponentCodeGenerationTestBase.cs | 30 ++++++++ .../TestComponent.codegen.cs | 71 +++++++++++++++++++ .../TestComponent.ir.txt | 27 +++++++ .../TestComponent.mappings.txt | 19 +++++ .../TestComponent.codegen.cs | 53 ++++++++++++++ .../TestComponent.ir.txt | 18 +++++ .../TestComponent.mappings.txt | 19 +++++ .../ComponentTagHelperDescriptorProvider.cs | 17 +++-- 8 files changed, 249 insertions(+), 5 deletions(-) create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs index 22fe140d289..57040aebbad 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs @@ -2743,6 +2743,36 @@ public class MyComponent : ComponentBase CompileToAssembly(generated); } + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/10609")] + public void BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent() + { + // Arrange + AdditionalSyntaxTrees.Add(Parse(@" +using System; +using Microsoft.AspNetCore.Components; + +public class MyComponent : ComponentBase +{ + [Parameter] + public int Value { get; set; } + + [Parameter] + public Action ValueChanged { get; set; } +}")); + + // Act + var generated = CompileToCSharp(@" + +@code { + public int ParentValue { get; set; } = 42; +}"); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + [IntegrationTestFact] public void BindToElement_WritesAttributes() { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs new file mode 100644 index 00000000000..e57b3f7c0f9 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs @@ -0,0 +1,71 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" + ParentValue + +#line default +#line hidden +#nullable disable + ); + __o = new global::System.Action( + __value => ParentValue = __value); + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { + } + )); + #pragma warning disable BL0005 + ((global::MyComponent)default). +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" + Value + +#line default +#line hidden +#nullable disable + = default; + #pragma warning restore BL0005 +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::MyComponent); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" + + public int ParentValue { get; set; } = 42; + +#line default +#line hidden +#nullable disable + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt new file mode 100644 index 00000000000..09117fc51f6 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt @@ -0,0 +1,27 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent + ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes + CSharpExpression - + LazyIntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue + ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes + CSharpExpression - + IntermediateToken - - CSharp - __value => ParentValue = __value + HtmlContent - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (41:0,41 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n + CSharpCode - (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt new file mode 100644 index 00000000000..d69e5ca5733 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt @@ -0,0 +1,19 @@ +Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) +|ParentValue| +Generated Location: (1135:29,26 [11] ) +|ParentValue| + +Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1663:44,19 [5] ) +|Value| + +Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) +| + public int ParentValue { get; set; } = 42; +| +Generated Location: (2071:62,7 [50] ) +| + public int ParentValue { get; set; } = 42; +| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs new file mode 100644 index 00000000000..d8baebfd6df --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs @@ -0,0 +1,53 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __builder.OpenComponent(0); + __builder.AddComponentParameter(1, nameof(global::MyComponent. +#nullable restore +#line (1,20)-(1,25) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck( +#nullable restore +#line (1,27)-(1,38) "x:\dir\subdir\Test\TestComponent.cshtml" +ParentValue + +#line default +#line hidden +#nullable disable + )); + __builder.AddComponentParameter(2, nameof(global::MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.CloseComponent(); + } + #pragma warning restore 1998 +#nullable restore +#line (2,8)-(4,1) "x:\dir\subdir\Test\TestComponent.cshtml" + + public int ParentValue { get; set; } = 42; + +#line default +#line hidden +#nullable disable + + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt new file mode 100644 index 00000000000..f52f54e66eb --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt @@ -0,0 +1,18 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [22] ) - global::System + UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [27] ) - global::System.Linq + UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree + Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent + ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Value - Value - AttributeStructure.DoubleQuotes + CSharpExpression - + LazyIntermediateToken - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ParentValue + ComponentAttribute - (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) - ValueChanged - ValueChanged - AttributeStructure.DoubleQuotes + CSharpExpression - + IntermediateToken - - CSharp - __value => ParentValue = __value + CSharpCode - (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n public int ParentValue { get; set; } = 42;\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt new file mode 100644 index 00000000000..1e7397b4f77 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt @@ -0,0 +1,19 @@ +Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (874:23,0 [5] ) +|Value| + +Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) +|ParentValue| +Generated Location: (1134:31,0 [11] ) +|ParentValue| + +Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) +| + public int ParentValue { get; set; } = 42; +| +Generated Location: (1548:43,0 [50] ) +| + public int ParentValue { get; set; } = 42; +| + diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/ComponentTagHelperDescriptorProvider.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/ComponentTagHelperDescriptorProvider.cs index 99c6e5e6943..7edbd71fb75 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/ComponentTagHelperDescriptorProvider.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/ComponentTagHelperDescriptorProvider.cs @@ -55,14 +55,22 @@ protected override void Collect(ISymbol symbol, ICollection var shortNameMatchingDescriptor = CreateShortNameMatchingDescriptor(type, properties); results.Add(shortNameMatchingDescriptor); - var fullyQualifiedNameMatchingDescriptor = CreateFullyQualifiedNameMatchingDescriptor(type, properties); - results.Add(fullyQualifiedNameMatchingDescriptor); + // If the component is in the global namespace, skip adding this descriptor which will be the same as the short name one. + TagHelperDescriptor? fullyQualifiedNameMatchingDescriptor = null; + if (!type.ContainingNamespace.IsGlobalNamespace) + { + fullyQualifiedNameMatchingDescriptor = CreateFullyQualifiedNameMatchingDescriptor(type, properties); + results.Add(fullyQualifiedNameMatchingDescriptor); + } foreach (var childContent in shortNameMatchingDescriptor.GetChildContentProperties()) { // Synthesize a separate tag helper for each child content property that's declared. results.Add(CreateChildContentDescriptor(shortNameMatchingDescriptor, childContent)); - results.Add(CreateChildContentDescriptor(fullyQualifiedNameMatchingDescriptor, childContent)); + if (fullyQualifiedNameMatchingDescriptor is not null) + { + results.Add(CreateChildContentDescriptor(fullyQualifiedNameMatchingDescriptor, childContent)); + } } } } @@ -111,8 +119,7 @@ private static TagHelperDescriptor CreateNameMatchingDescriptor( metadata.Add(ComponentMetadata.Component.NameMatchKey, ComponentMetadata.Component.FullyQualifiedNameMatch); } - // If the component is in the global namespace, skip adding this rule which is the same as the fully qualified one. - else if (!type.ContainingNamespace.IsGlobalNamespace) + else { builder.TagMatchingRule(r => { From b650ceebd791c9d1aaae4577d25002516183ce48 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 29 Aug 2024 09:55:50 +1000 Subject: [PATCH 243/386] Cleanup and rename files to bring them to modern standards Purely mechanical changes here - using primary constructors, interfaces over abstract classes, etc. --- .../Debugging/RazorBreakpointSpanEndpoint.cs | 25 ++----- .../RazorProximityExpressionsEndpoint.cs | 28 ++------ ...esolver.cs => IRazorBreakpointResolver.cs} | 4 +- ...s => IRazorProximityExpressionResolver.cs} | 4 +- .../DefaultLSPBreakpointSpanProvider.cs | 66 ------------------ .../DefaultLSPProximityExpressionsProvider.cs | 67 ------------------- .../Debugging/ILSPBreakpointSpanProvider.cs | 14 ++++ .../ILSPProximityExpressionsProvider.cs | 15 +++++ .../Debugging/LSPBreakpointSpanProvider.cs | 39 ++++++++++- .../LSPProximityExpressionsProvider.cs | 38 ++++++++++- ...Resolver.cs => RazorBreakpointResolver.cs} | 58 +++++----------- ...cs => RazorProximityExpressionResolver.cs} | 58 +++++----------- ...zorLanguageService_IVsLanguageDebugInfo.cs | 8 +-- .../RazorPackage.cs | 4 +- ...Test.cs => RazorBreakpointResolverTest.cs} | 32 ++++----- ...> RazorProximityExpressionResolverTest.cs} | 22 +++--- .../TestLSPBreakpointSpanProvider.cs | 4 +- ...anguageService_IVsLanguageDebugInfoTest.cs | 12 ++-- 18 files changed, 188 insertions(+), 310 deletions(-) rename src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/{RazorBreakpointResolver.cs => IRazorBreakpointResolver.cs} (63%) rename src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/{RazorProximityExpressionResolver.cs => IRazorProximityExpressionResolver.cs} (58%) delete mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs delete mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPProximityExpressionsProvider.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPBreakpointSpanProvider.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPProximityExpressionsProvider.cs rename src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/{DefaultRazorBreakpointResolver.cs => RazorBreakpointResolver.cs} (64%) rename src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/{DefaultRazorProximityExpressionResolver.cs => RazorProximityExpressionResolver.cs} (63%) rename src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/{DefaultRazorBreakpointResolverTest.cs => RazorBreakpointResolverTest.cs} (86%) rename src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/{DefaultRazorProximityExpressionResolverTest.cs => RazorProximityExpressionResolverTest.cs} (83%) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs index 1bcb7c82ec0..578010056e2 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs @@ -19,30 +19,17 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; [RazorLanguageServerEndpoint(LanguageServerConstants.RazorBreakpointSpanEndpoint)] -internal class RazorBreakpointSpanEndpoint : IRazorDocumentlessRequestHandler, ITextDocumentIdentifierHandler +internal class RazorBreakpointSpanEndpoint( + IDocumentMappingService documentMappingService, + ILoggerFactory loggerFactory) : IRazorDocumentlessRequestHandler, ITextDocumentIdentifierHandler { - private readonly IDocumentMappingService _documentMappingService; - private readonly ILogger _logger; + private readonly IDocumentMappingService _documentMappingService = documentMappingService; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); public bool MutatesSolutionState => false; - public RazorBreakpointSpanEndpoint( - IDocumentMappingService documentMappingService, - ILoggerFactory loggerFactory) - { - if (loggerFactory is null) - { - throw new ArgumentNullException(nameof(loggerFactory)); - } - - _documentMappingService = documentMappingService ?? throw new ArgumentNullException(nameof(documentMappingService)); - _logger = loggerFactory.GetOrCreateLogger(); - } - public Uri GetTextDocumentIdentifier(RazorBreakpointSpanParams request) - { - return request.Uri; - } + => request.Uri; public async Task HandleRequestAsync(RazorBreakpointSpanParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs index 844da19f1a8..a908dd8c8e4 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs @@ -20,35 +20,17 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; [RazorLanguageServerEndpoint(LanguageServerConstants.RazorProximityExpressionsEndpoint)] -internal class RazorProximityExpressionsEndpoint : IRazorDocumentlessRequestHandler, ITextDocumentIdentifierHandler -{ - private readonly IDocumentMappingService _documentMappingService; - private readonly ILogger _logger; - - public RazorProximityExpressionsEndpoint( +internal class RazorProximityExpressionsEndpoint( IDocumentMappingService documentMappingService, - ILoggerFactory loggerFactory) + ILoggerFactory loggerFactory) : IRazorDocumentlessRequestHandler, ITextDocumentIdentifierHandler { - if (documentMappingService is null) - { - throw new ArgumentNullException(nameof(documentMappingService)); - } - - if (loggerFactory is null) - { - throw new ArgumentNullException(nameof(loggerFactory)); - } - - _documentMappingService = documentMappingService; - _logger = loggerFactory.GetOrCreateLogger(); - } + private readonly IDocumentMappingService _documentMappingService = documentMappingService; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); public bool MutatesSolutionState => false; public Uri GetTextDocumentIdentifier(RazorProximityExpressionsParams request) - { - return request.Uri; - } + => request.Uri; public async Task HandleRequestAsync(RazorProximityExpressionsParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) { diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/IRazorBreakpointResolver.cs similarity index 63% rename from src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs rename to src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/IRazorBreakpointResolver.cs index a9dfe15d5bc..62d9ec22964 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorBreakpointResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/IRazorBreakpointResolver.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.Razor.Debugging; -internal abstract class RazorBreakpointResolver +internal interface IRazorBreakpointResolver { - public abstract Task TryResolveBreakpointRangeAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken); + Task TryResolveBreakpointRangeAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorProximityExpressionResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/IRazorProximityExpressionResolver.cs similarity index 58% rename from src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorProximityExpressionResolver.cs rename to src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/IRazorProximityExpressionResolver.cs index 20ea51fa8c4..29ab08313b9 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/RazorProximityExpressionResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Debugging/IRazorProximityExpressionResolver.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.Razor.Debugging; -internal abstract class RazorProximityExpressionResolver +internal interface IRazorProximityExpressionResolver { - public abstract Task?> TryResolveProximityExpressionsAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken); + Task?> TryResolveProximityExpressionsAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs deleted file mode 100644 index ee9438b506f..00000000000 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPBreakpointSpanProvider.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using System.ComponentModel.Composition; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Razor.Logging; -using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; -using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; - -namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; - -[Export(typeof(LSPBreakpointSpanProvider))] -internal class DefaultLSPBreakpointSpanProvider : LSPBreakpointSpanProvider -{ - private readonly LSPRequestInvoker _requestInvoker; - private readonly ILogger _logger; - - [ImportingConstructor] - public DefaultLSPBreakpointSpanProvider( - LSPRequestInvoker requestInvoker, - ILoggerFactory loggerFactory) - { - _requestInvoker = requestInvoker; - _logger = loggerFactory.GetOrCreateLogger(); - } - - public async override Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) - { - if (documentSnapshot is null) - { - throw new ArgumentNullException(nameof(documentSnapshot)); - } - - if (position is null) - { - throw new ArgumentNullException(nameof(position)); - } - - var languageQueryParams = new RazorBreakpointSpanParams() - { - Position = position, - Uri = documentSnapshot.Uri - }; - - var response = await _requestInvoker.ReinvokeRequestOnServerAsync( - documentSnapshot.Snapshot.TextBuffer, - LanguageServerConstants.RazorBreakpointSpanEndpoint, - RazorLSPConstants.RazorLanguageServerName, - languageQueryParams, - cancellationToken).ConfigureAwait(false); - - var languageResponse = response?.Response; - if (languageResponse is null) - { - _logger.LogInformation($"The breakpoint position could not be mapped to a valid range."); - return null; - } - - return languageResponse.Range; - } -} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPProximityExpressionsProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPProximityExpressionsProvider.cs deleted file mode 100644 index 1452ca9f165..00000000000 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultLSPProximityExpressionsProvider.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Razor.Logging; -using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; -using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; -using Microsoft.VisualStudio.LanguageServer.Protocol; - -namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; - -[Export(typeof(LSPProximityExpressionsProvider))] -internal class DefaultLSPProximityExpressionsProvider : LSPProximityExpressionsProvider -{ - private readonly LSPRequestInvoker _requestInvoker; - - private readonly ILogger _logger; - - [ImportingConstructor] - public DefaultLSPProximityExpressionsProvider( - LSPRequestInvoker requestInvoker, - ILoggerFactory loggerFactory) - { - _requestInvoker = requestInvoker; - _logger = loggerFactory.GetOrCreateLogger(); - } - - public async override Task?> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) - { - if (documentSnapshot is null) - { - throw new ArgumentNullException(nameof(documentSnapshot)); - } - - if (position is null) - { - throw new ArgumentNullException(nameof(position)); - } - - var proximityExpressionsParams = new RazorProximityExpressionsParams() - { - Position = position, - Uri = documentSnapshot.Uri - }; - - var response = await _requestInvoker.ReinvokeRequestOnServerAsync( - documentSnapshot.Snapshot.TextBuffer, - LanguageServerConstants.RazorProximityExpressionsEndpoint, - RazorLSPConstants.RazorLanguageServerName, - proximityExpressionsParams, - cancellationToken).ConfigureAwait(false); - - var languageResponse = response?.Response; - if (languageResponse is null) - { - _logger.LogInformation($"The proximity expressions could not be resolved."); - return null; - } - - return languageResponse.Expressions; - } -} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPBreakpointSpanProvider.cs new file mode 100644 index 00000000000..b25618a797b --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPBreakpointSpanProvider.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; + +internal interface ILSPBreakpointSpanProvider +{ + Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPProximityExpressionsProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPProximityExpressionsProvider.cs new file mode 100644 index 00000000000..37ab22b8039 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPProximityExpressionsProvider.cs @@ -0,0 +1,15 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; + +internal interface ILSPProximityExpressionsProvider +{ + Task?> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs index 0c1a05b4b7b..cd2b7bd4efd 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs @@ -1,14 +1,49 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System.ComponentModel.Composition; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.LanguageServer.Protocol; +using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; -internal abstract class LSPBreakpointSpanProvider +[Export(typeof(ILSPBreakpointSpanProvider))] +[method: ImportingConstructor] +internal class LSPBreakpointSpanProvider( + LSPRequestInvoker requestInvoker, + ILoggerFactory loggerFactory) : ILSPBreakpointSpanProvider { - public abstract Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken); + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); + + public async Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + { + var languageQueryParams = new RazorBreakpointSpanParams() + { + Position = position, + Uri = documentSnapshot.Uri + }; + + var response = await _requestInvoker.ReinvokeRequestOnServerAsync( + documentSnapshot.Snapshot.TextBuffer, + LanguageServerConstants.RazorBreakpointSpanEndpoint, + RazorLSPConstants.RazorLanguageServerName, + languageQueryParams, + cancellationToken).ConfigureAwait(false); + + var languageResponse = response?.Response; + if (languageResponse is null) + { + _logger.LogInformation($"The breakpoint position could not be mapped to a valid range."); + return null; + } + + return languageResponse.Range; + } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs index 20747767e8a..b209798513d 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs @@ -2,14 +2,48 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Collections.Generic; +using System.ComponentModel.Composition; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.Protocol.Debugging; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; -internal abstract class LSPProximityExpressionsProvider +[Export(typeof(ILSPProximityExpressionsProvider))] +[method: ImportingConstructor] +internal class LSPProximityExpressionsProvider( + LSPRequestInvoker requestInvoker, + ILoggerFactory loggerFactory) : ILSPProximityExpressionsProvider { - public abstract Task?> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken); + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); + + public async Task?> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + { + var proximityExpressionsParams = new RazorProximityExpressionsParams() + { + Position = position, + Uri = documentSnapshot.Uri + }; + + var response = await _requestInvoker.ReinvokeRequestOnServerAsync( + documentSnapshot.Snapshot.TextBuffer, + LanguageServerConstants.RazorProximityExpressionsEndpoint, + RazorLSPConstants.RazorLanguageServerName, + proximityExpressionsParams, + cancellationToken).ConfigureAwait(false); + + var languageResponse = response?.Response; + if (languageResponse is null) + { + _logger.LogInformation($"The proximity expressions could not be resolved."); + return null; + } + + return languageResponse.Expressions; + } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorBreakpointResolver.cs similarity index 64% rename from src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs rename to src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorBreakpointResolver.cs index 84dd82b1dea..35a47306657 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorBreakpointResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorBreakpointResolver.cs @@ -15,52 +15,26 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; -[Export(typeof(RazorBreakpointResolver))] -internal class DefaultRazorBreakpointResolver : RazorBreakpointResolver +[Export(typeof(IRazorBreakpointResolver))] +[method: ImportingConstructor] +internal class RazorBreakpointResolver( + FileUriProvider fileUriProvider, + LSPDocumentManager documentManager, + ILSPBreakpointSpanProvider breakpointSpanProvider) : IRazorBreakpointResolver { - private readonly FileUriProvider _fileUriProvider; - private readonly LSPDocumentManager _documentManager; - private readonly LSPBreakpointSpanProvider _breakpointSpanProvider; - private readonly MemoryCache _cache; - - [ImportingConstructor] - public DefaultRazorBreakpointResolver( - FileUriProvider fileUriProvider, - LSPDocumentManager documentManager, - LSPBreakpointSpanProvider breakpointSpanProvider) - { - if (fileUriProvider is null) - { - throw new ArgumentNullException(nameof(fileUriProvider)); - } - - if (documentManager is null) - { - throw new ArgumentNullException(nameof(documentManager)); - } - - if (breakpointSpanProvider is null) - { - throw new ArgumentNullException(nameof(breakpointSpanProvider)); - } + private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Character); - _fileUriProvider = fileUriProvider; - _documentManager = documentManager; - _breakpointSpanProvider = breakpointSpanProvider; + private readonly FileUriProvider _fileUriProvider = fileUriProvider; + private readonly LSPDocumentManager _documentManager = documentManager; + private readonly ILSPBreakpointSpanProvider _breakpointSpanProvider = breakpointSpanProvider; - // 4 is a magic number that was determined based on the functionality of VisualStudio. Currently when you set or edit a breakpoint - // we get called with two different locations for the same breakpoint. Because of this 2 time call our size must be at least 2, - // we grow it to 4 just to be safe for lesser known scenarios. - _cache = new MemoryCache(sizeLimit: 4); - } + // 4 is a magic number that was determined based on the functionality of VisualStudio. Currently when you set or edit a breakpoint + // we get called with two different locations for the same breakpoint. Because of this 2 time call our size must be at least 2, + // we grow it to 4 just to be safe for lesser known scenarios. + private readonly MemoryCache _cache = new(sizeLimit: 4); - public override async Task TryResolveBreakpointRangeAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken) + public async Task TryResolveBreakpointRangeAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken) { - if (textBuffer is null) - { - throw new ArgumentNullException(nameof(textBuffer)); - } - if (!_fileUriProvider.TryGet(textBuffer, out var documentUri)) { // Not an addressable Razor document. Do not allow a breakpoint here. In practice this shouldn't happen, just being defensive. @@ -111,6 +85,4 @@ public DefaultRazorBreakpointResolver( return hostDocumentRange; } - - private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Character); } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorProximityExpressionResolver.cs similarity index 63% rename from src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs rename to src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorProximityExpressionResolver.cs index 1b129fef497..32583d77b20 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/DefaultRazorProximityExpressionResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorProximityExpressionResolver.cs @@ -15,51 +15,25 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; -[Export(typeof(RazorProximityExpressionResolver))] -internal class DefaultRazorProximityExpressionResolver : RazorProximityExpressionResolver +[Export(typeof(IRazorProximityExpressionResolver))] +[method: ImportingConstructor] +internal class RazorProximityExpressionResolver( + FileUriProvider fileUriProvider, + LSPDocumentManager documentManager, + ILSPProximityExpressionsProvider proximityExpressionsProvider) : IRazorProximityExpressionResolver { - private readonly FileUriProvider _fileUriProvider; - private readonly LSPDocumentManager _documentManager; - private readonly LSPProximityExpressionsProvider _proximityExpressionsProvider; - private readonly MemoryCache> _cache; - - [ImportingConstructor] - public DefaultRazorProximityExpressionResolver( - FileUriProvider fileUriProvider, - LSPDocumentManager documentManager, - LSPProximityExpressionsProvider proximityExpressionsProvider) - { - if (fileUriProvider is null) - { - throw new ArgumentNullException(nameof(fileUriProvider)); - } - - if (documentManager is null) - { - throw new ArgumentNullException(nameof(documentManager)); - } - - if (proximityExpressionsProvider is null) - { - throw new ArgumentNullException(nameof(proximityExpressionsProvider)); - } + private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Character); - _fileUriProvider = fileUriProvider; - _documentManager = documentManager; - _proximityExpressionsProvider = proximityExpressionsProvider; + private readonly FileUriProvider _fileUriProvider = fileUriProvider; + private readonly LSPDocumentManager _documentManager = documentManager; + private readonly ILSPProximityExpressionsProvider _proximityExpressionsProvider = proximityExpressionsProvider; - // 10 is a magic number where this effectively represents our ability to cache the last 10 "hit" breakpoint locations - // corresponding proximity expressions which enables us not to go "async" in those re-hit scenarios. - _cache = new MemoryCache>(sizeLimit: 10); - } + // 10 is a magic number where this effectively represents our ability to cache the last 10 "hit" breakpoint locations + // corresponding proximity expressions which enables us not to go "async" in those re-hit scenarios. + private readonly MemoryCache> _cache = new(sizeLimit: 10); - public override async Task?> TryResolveProximityExpressionsAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken) + public async Task?> TryResolveProximityExpressionsAsync(ITextBuffer textBuffer, int lineIndex, int characterIndex, CancellationToken cancellationToken) { - if (textBuffer is null) - { - throw new ArgumentNullException(nameof(textBuffer)); - } - if (!_fileUriProvider.TryGet(textBuffer, out var documentUri)) { // Not an addressable Razor document. Do not allow expression resolution here. In practice this shouldn't happen, just being defensive. @@ -100,10 +74,8 @@ public DefaultRazorProximityExpressionResolver( // Cache range so if we're asked again for this document/line/character we don't have to go async. // Note: If we didn't get any proximity expressions back--likely due to an error--we cache an empty array. - _cache.Set(cacheKey, proximityExpressions ?? Array.Empty()); + _cache.Set(cacheKey, proximityExpressions ?? []); return proximityExpressions; } - - private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Character); } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/RazorLanguageService_IVsLanguageDebugInfo.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/RazorLanguageService_IVsLanguageDebugInfo.cs index 233def0b2af..4386df4d33b 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/RazorLanguageService_IVsLanguageDebugInfo.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/RazorLanguageService_IVsLanguageDebugInfo.cs @@ -16,16 +16,16 @@ namespace Microsoft.VisualStudio.Razor; internal partial class RazorLanguageService : IVsLanguageDebugInfo { - private readonly RazorBreakpointResolver _breakpointResolver; - private readonly RazorProximityExpressionResolver _proximityExpressionResolver; + private readonly IRazorBreakpointResolver _breakpointResolver; + private readonly IRazorProximityExpressionResolver _proximityExpressionResolver; private readonly ILspServerActivationTracker _lspServerActivationTracker; private readonly IUIThreadOperationExecutor _uiThreadOperationExecutor; private readonly IVsEditorAdaptersFactoryService _editorAdaptersFactory; private readonly JoinableTaskFactory _joinableTaskFactory; public RazorLanguageService( - RazorBreakpointResolver breakpointResolver, - RazorProximityExpressionResolver proximityExpressionResolver, + IRazorBreakpointResolver breakpointResolver, + IRazorProximityExpressionResolver proximityExpressionResolver, ILspServerActivationTracker lspServerActivationTracker, IUIThreadOperationExecutor uiThreadOperationExecutor, IVsEditorAdaptersFactoryService editorAdaptersFactory, diff --git a/src/Razor/src/Microsoft.VisualStudio.RazorExtension/RazorPackage.cs b/src/Razor/src/Microsoft.VisualStudio.RazorExtension/RazorPackage.cs index acb9099758a..6c9708a4f60 100644 --- a/src/Razor/src/Microsoft.VisualStudio.RazorExtension/RazorPackage.cs +++ b/src/Razor/src/Microsoft.VisualStudio.RazorExtension/RazorPackage.cs @@ -64,8 +64,8 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke container.AddService(typeof(RazorLanguageService), (container, type) => { var componentModel = (IComponentModel)GetGlobalService(typeof(SComponentModel)); - var breakpointResolver = componentModel.GetService(); - var proximityExpressionResolver = componentModel.GetService(); + var breakpointResolver = componentModel.GetService(); + var proximityExpressionResolver = componentModel.GetService(); var uiThreadOperationExecutor = componentModel.GetService(); var editorAdaptersFactory = componentModel.GetService(); var lspServerActivationTracker = componentModel.GetService(); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorBreakpointResolverTest.cs similarity index 86% rename from src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs rename to src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorBreakpointResolverTest.cs index f52c195fd07..139aea88ed2 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorBreakpointResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorBreakpointResolverTest.cs @@ -19,7 +19,7 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; -public class DefaultRazorBreakpointResolverTest : ToolingTestBase +public class RazorBreakpointResolverTest : ToolingTestBase { private const string ValidBreakpointCSharp = "private int foo = 123;"; private const string InvalidBreakpointCSharp = "private int bar;"; @@ -27,9 +27,9 @@ public class DefaultRazorBreakpointResolverTest : ToolingTestBase private readonly ITextBuffer _csharpTextBuffer; private readonly Uri _documentUri; private readonly Uri _csharpDocumentUri; - private readonly ITextBuffer _hostTextbuffer; + private readonly ITextBuffer _hostTextBuffer; - public DefaultRazorBreakpointResolverTest(ITestOutputHelper testOutput) + public RazorBreakpointResolverTest(ITestOutputHelper testOutput) : base(testOutput) { _documentUri = new Uri("file://C:/path/to/file.razor", UriKind.Absolute); @@ -51,7 +51,7 @@ public class SomeRazorFile {{InvalidBreakpointCSharp}} } """); - _hostTextbuffer = new TestTextBuffer(textBufferSnapshot); + _hostTextBuffer = new TestTextBuffer(textBufferSnapshot); } [Fact] @@ -77,7 +77,7 @@ public async Task TryResolveBreakpointRangeAsync_UnknownRazorDocument_ReturnsNul var resolver = CreateResolverWith(documentManager: documentManager); // Act - var result = await resolver.TryResolveBreakpointRangeAsync(_hostTextbuffer, lineIndex: 0, characterIndex: 1, DisposalToken); + var result = await resolver.TryResolveBreakpointRangeAsync(_hostTextBuffer, lineIndex: 0, characterIndex: 1, DisposalToken); // Assert Assert.Null(result); @@ -94,7 +94,7 @@ public async Task TryResolveBreakpointRangeAsync_UnsynchronizedCSharpDocument_Re var resolver = CreateResolverWith(documentManager: documentManager); // Act - var expressions = await resolver.TryResolveBreakpointRangeAsync(_hostTextbuffer, lineIndex: 0, characterIndex: 1, DisposalToken); + var expressions = await resolver.TryResolveBreakpointRangeAsync(_hostTextBuffer, lineIndex: 0, characterIndex: 1, DisposalToken); // Assert Assert.Null(expressions); @@ -107,7 +107,7 @@ public async Task TryResolveBreakpointRangeAsync_UnprojectedLocation_ReturnsNull var resolver = CreateResolverWith(); // Act - var breakpointRange = await resolver.TryResolveBreakpointRangeAsync(_hostTextbuffer, lineIndex: 0, characterIndex: 1, DisposalToken); + var breakpointRange = await resolver.TryResolveBreakpointRangeAsync(_hostTextBuffer, lineIndex: 0, characterIndex: 1, DisposalToken); // Assert Assert.Null(breakpointRange); @@ -117,11 +117,11 @@ public async Task TryResolveBreakpointRangeAsync_UnprojectedLocation_ReturnsNull public async Task TryResolveBreakpointRangeAsync_NotValidBreakpointLocation_ReturnsNull() { // Arrange - var hostDocumentPosition = GetPosition(InvalidBreakpointCSharp, _hostTextbuffer); + var hostDocumentPosition = GetPosition(InvalidBreakpointCSharp, _hostTextBuffer); var resolver = CreateResolverWith(); // Act - var breakpointRange = await resolver.TryResolveBreakpointRangeAsync(_hostTextbuffer, hostDocumentPosition.Line, hostDocumentPosition.Character, DisposalToken); + var breakpointRange = await resolver.TryResolveBreakpointRangeAsync(_hostTextBuffer, hostDocumentPosition.Line, hostDocumentPosition.Character, DisposalToken); // Assert Assert.Null(breakpointRange); @@ -131,7 +131,7 @@ public async Task TryResolveBreakpointRangeAsync_NotValidBreakpointLocation_Retu public async Task TryResolveBreakpointRangeAsync_MappableCSharpBreakpointLocation_ReturnsHostBreakpointLocation() { // Arrange - var hostDocumentPosition = GetPosition(ValidBreakpointCSharp, _hostTextbuffer); + var hostDocumentPosition = GetPosition(ValidBreakpointCSharp, _hostTextBuffer); var hostBreakpointRange = VsLspFactory.CreateSingleLineRange(start: hostDocumentPosition, length: ValidBreakpointCSharp.Length); var projectionProvider = new TestLSPBreakpointSpanProvider( _documentUri, @@ -142,25 +142,25 @@ public async Task TryResolveBreakpointRangeAsync_MappableCSharpBreakpointLocatio var resolver = CreateResolverWith(projectionProvider: projectionProvider); // Act - var breakpointRange = await resolver.TryResolveBreakpointRangeAsync(_hostTextbuffer, hostDocumentPosition.Line, hostDocumentPosition.Character, DisposalToken); + var breakpointRange = await resolver.TryResolveBreakpointRangeAsync(_hostTextBuffer, hostDocumentPosition.Line, hostDocumentPosition.Character, DisposalToken); // Assert Assert.Equal(hostBreakpointRange, breakpointRange); } - private RazorBreakpointResolver CreateResolverWith( + private IRazorBreakpointResolver CreateResolverWith( FileUriProvider uriProvider = null, LSPDocumentManager documentManager = null, - LSPBreakpointSpanProvider projectionProvider = null) + ILSPBreakpointSpanProvider projectionProvider = null) { var documentUri = _documentUri; - uriProvider ??= Mock.Of(provider => provider.TryGet(_hostTextbuffer, out documentUri) == true && provider.TryGet(It.IsNotIn(_hostTextbuffer), out It.Ref.IsAny) == false, MockBehavior.Strict); + uriProvider ??= Mock.Of(provider => provider.TryGet(_hostTextBuffer, out documentUri) == true && provider.TryGet(It.IsNotIn(_hostTextBuffer), out It.Ref.IsAny) == false, MockBehavior.Strict); var csharpVirtualDocumentSnapshot = new CSharpVirtualDocumentSnapshot(projectKey: default, _csharpDocumentUri, _csharpTextBuffer.CurrentSnapshot, hostDocumentSyncVersion: 0); LSPDocumentSnapshot documentSnapshot = new TestLSPDocumentSnapshot(_documentUri, 0, csharpVirtualDocumentSnapshot); documentManager ??= Mock.Of(manager => manager.TryGetDocument(_documentUri, out documentSnapshot) == true, MockBehavior.Strict); if (projectionProvider is null) { - projectionProvider = new Mock(MockBehavior.Strict).Object; + projectionProvider = new Mock(MockBehavior.Strict).Object; Mock.Get(projectionProvider) .Setup(projectionProvider => projectionProvider.GetBreakpointSpanAsync( It.IsAny(), @@ -169,7 +169,7 @@ private RazorBreakpointResolver CreateResolverWith( .ReturnsAsync(value: null); } - var razorBreakpointResolver = new DefaultRazorBreakpointResolver(uriProvider, documentManager, projectionProvider); + var razorBreakpointResolver = new RazorBreakpointResolver(uriProvider, documentManager, projectionProvider); return razorBreakpointResolver; } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorProximityExpressionResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs similarity index 83% rename from src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorProximityExpressionResolverTest.cs rename to src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs index b107a2fb3fc..33597a4a0d1 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/DefaultRazorProximityExpressionResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs @@ -20,16 +20,16 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; -public class DefaultRazorProximityExpressionResolverTest : ToolingTestBase +public class RazorProximityExpressionResolverTest : ToolingTestBase { private readonly string _validProximityExpressionRoot; private readonly string _invalidProximityExpressionRoot; private readonly ITextBuffer _csharpTextBuffer; private readonly Uri _documentUri; private readonly Uri _csharpDocumentUri; - private readonly ITextBuffer _hostTextbuffer; + private readonly ITextBuffer _hostTextBuffer; - public DefaultRazorProximityExpressionResolverTest(ITestOutputHelper testOutput) + public RazorProximityExpressionResolverTest(ITestOutputHelper testOutput) : base(testOutput) { _documentUri = new Uri("file://C:/path/to/file.razor", UriKind.Absolute); @@ -51,7 +51,7 @@ public void Render() _csharpTextBuffer = new TestTextBuffer(csharpTextSnapshot); var textBufferSnapshot = new StringTextSnapshot($$"""@{{{_invalidProximityExpressionRoot}}} @code {{{_validProximityExpressionRoot}}}"""); - _hostTextbuffer = new TestTextBuffer(textBufferSnapshot); + _hostTextBuffer = new TestTextBuffer(textBufferSnapshot); } [Fact] @@ -79,7 +79,7 @@ public async Task TryResolveProximityExpressionsAsync_UnknownRazorDocument_Retur var resolver = CreateResolverWith(documentManager: documentManager); // Act - var result = await resolver.TryResolveProximityExpressionsAsync(_hostTextbuffer, lineIndex: 0, characterIndex: 1, DisposalToken); + var result = await resolver.TryResolveProximityExpressionsAsync(_hostTextBuffer, lineIndex: 0, characterIndex: 1, DisposalToken); // Assert Assert.Null(result); @@ -96,25 +96,25 @@ public async Task TryResolveProximityExpressionsAsync_UnsynchronizedCSharpDocume var resolver = CreateResolverWith(documentManager: documentManager); // Act - var expressions = await resolver.TryResolveProximityExpressionsAsync(_hostTextbuffer, lineIndex: 0, characterIndex: 1, DisposalToken); + var expressions = await resolver.TryResolveProximityExpressionsAsync(_hostTextBuffer, lineIndex: 0, characterIndex: 1, DisposalToken); // Assert Assert.Null(expressions); } - private RazorProximityExpressionResolver CreateResolverWith( + private IRazorProximityExpressionResolver CreateResolverWith( FileUriProvider uriProvider = null, LSPDocumentManager documentManager = null) { var documentUri = _documentUri; - uriProvider ??= Mock.Of(provider => provider.TryGet(_hostTextbuffer, out documentUri) == true && provider.TryGet(It.IsNotIn(_hostTextbuffer), out It.Ref.IsAny) == false, MockBehavior.Strict); + uriProvider ??= Mock.Of(provider => provider.TryGet(_hostTextBuffer, out documentUri) == true && provider.TryGet(It.IsNotIn(_hostTextBuffer), out It.Ref.IsAny) == false, MockBehavior.Strict); var csharpVirtualDocumentSnapshot = new CSharpVirtualDocumentSnapshot(projectKey: default, _csharpDocumentUri, _csharpTextBuffer.CurrentSnapshot, hostDocumentSyncVersion: 0); LSPDocumentSnapshot documentSnapshot = new TestLSPDocumentSnapshot(_documentUri, 0, csharpVirtualDocumentSnapshot); documentManager ??= Mock.Of( manager => manager.TryGetDocument(_documentUri, out documentSnapshot) == true, MockBehavior.Strict); - var razorProximityExpressionResolver = new DefaultRazorProximityExpressionResolver( + var razorProximityExpressionResolver = new RazorProximityExpressionResolver( uriProvider, documentManager, TestLSPProximityExpressionProvider.Instance); @@ -122,7 +122,7 @@ private RazorProximityExpressionResolver CreateResolverWith( return razorProximityExpressionResolver; } - private class TestLSPProximityExpressionProvider : LSPProximityExpressionsProvider + private class TestLSPProximityExpressionProvider : ILSPProximityExpressionsProvider { public static readonly TestLSPProximityExpressionProvider Instance = new(); @@ -130,7 +130,7 @@ private TestLSPProximityExpressionProvider() { } - public override Task> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + public Task> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) { return SpecializedTasks.Null>(); } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs index b594365bdd2..f582e72739a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs @@ -15,7 +15,7 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; -internal class TestLSPBreakpointSpanProvider : LSPBreakpointSpanProvider +internal class TestLSPBreakpointSpanProvider : ILSPBreakpointSpanProvider { private readonly Uri _documentUri; private readonly IReadOnlyDictionary _mappings; @@ -36,7 +36,7 @@ public TestLSPBreakpointSpanProvider(Uri documentUri, IReadOnlyDictionary GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + public Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) { if (documentSnapshot.Uri != _documentUri) { diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs index 4dd8aa8e590..b4509b4df5f 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/RazorLanguageService_IVsLanguageDebugInfoTest.cs @@ -70,7 +70,7 @@ public void ValidateBreakpointLocation_ValidBreakpointRange_ReturnsSOK() { // Arrange var breakpointRange = VsLspFactory.CreateRange(2, 4, 3, 5); - var breakpointResolver = Mock.Of(resolver => resolver.TryResolveBreakpointRangeAsync(It.IsAny(), 0, 0, It.IsAny()) == System.Threading.Tasks.Task.FromResult(breakpointRange), MockBehavior.Strict); + var breakpointResolver = Mock.Of(resolver => resolver.TryResolveBreakpointRangeAsync(It.IsAny(), 0, 0, It.IsAny()) == System.Threading.Tasks.Task.FromResult(breakpointRange), MockBehavior.Strict); var languageService = CreateLanguageServiceWith(breakpointResolver); // Act @@ -146,7 +146,7 @@ public void GetProximityExpressions_ValidRange_ReturnsSOK() { // Arrange IReadOnlyList expressions = new[] { "something" }; - var resolver = Mock.Of(resolver => resolver.TryResolveProximityExpressionsAsync(It.IsAny(), 0, 0, It.IsAny()) == System.Threading.Tasks.Task.FromResult(expressions), MockBehavior.Strict); + var resolver = Mock.Of(resolver => resolver.TryResolveProximityExpressionsAsync(It.IsAny(), 0, 0, It.IsAny()) == System.Threading.Tasks.Task.FromResult(expressions), MockBehavior.Strict); var languageService = CreateLanguageServiceWith(proximityExpressionResolver: resolver); // Act @@ -174,14 +174,14 @@ public void GetProximityExpressions_CanNotCreateDialog_ReturnsEFail() } private RazorLanguageService CreateLanguageServiceWith( - RazorBreakpointResolver breakpointResolver = null, - RazorProximityExpressionResolver proximityExpressionResolver = null, + IRazorBreakpointResolver breakpointResolver = null, + IRazorProximityExpressionResolver proximityExpressionResolver = null, IUIThreadOperationExecutor uiThreadOperationExecutor = null, IVsEditorAdaptersFactoryService editorAdaptersFactory = null) { if (breakpointResolver is null) { - breakpointResolver = new Mock(MockBehavior.Strict).Object; + breakpointResolver = new Mock(MockBehavior.Strict).Object; Mock.Get(breakpointResolver) .Setup(r => r.TryResolveBreakpointRangeAsync( It.IsAny(), @@ -193,7 +193,7 @@ private RazorLanguageService CreateLanguageServiceWith( if (proximityExpressionResolver is null) { - proximityExpressionResolver = new Mock(MockBehavior.Strict).Object; + proximityExpressionResolver = new Mock(MockBehavior.Strict).Object; Mock.Get(proximityExpressionResolver) .Setup(r => r.TryResolveProximityExpressionsAsync( It.IsAny(), From a05f9e64c0dd6834d0599acbe86bdce63f1880be Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 29 Aug 2024 12:26:14 +1000 Subject: [PATCH 244/386] Pass virtual document version through, and validate --- .../Debugging/RazorBreakpointSpanEndpoint.cs | 6 ++++++ .../RazorProximityExpressionsEndpoint.cs | 10 ++++++++-- .../Debugging/RazorBreakpointSpanParams.cs | 3 +++ .../RazorProximityExpressionsParams.cs | 3 +++ .../Debugging/ILSPBreakpointSpanProvider.cs | 2 +- .../ILSPProximityExpressionsProvider.cs | 2 +- .../Debugging/LSPBreakpointSpanProvider.cs | 5 +++-- .../LSPProximityExpressionsProvider.cs | 5 +++-- .../Debugging/RazorBreakpointResolver.cs | 18 +++++------------- .../RazorProximityExpressionResolver.cs | 18 +++++------------- .../Debugging/RazorBreakpointResolverTest.cs | 1 + .../RazorProximityExpressionResolverTest.cs | 2 +- .../Debugging/TestLSPBreakpointSpanProvider.cs | 2 +- 13 files changed, 41 insertions(+), 36 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs index 578010056e2..e2bdd2dc6d3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs @@ -39,6 +39,12 @@ public Uri GetTextDocumentIdentifier(RazorBreakpointSpanParams request) return null; } + if (documentContext.Snapshot.Version != request.HostDocumentSyncVersion) + { + // Whether we are being asked about an old version of the C# document, or somehow a future one, we can't rely on the result. + return null; + } + var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); var sourceText = await documentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); var hostDocumentIndex = sourceText.GetPosition(request.Position); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs index a908dd8c8e4..525b0059eb9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs @@ -21,9 +21,9 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Debugging; [RazorLanguageServerEndpoint(LanguageServerConstants.RazorProximityExpressionsEndpoint)] internal class RazorProximityExpressionsEndpoint( - IDocumentMappingService documentMappingService, + IDocumentMappingService documentMappingService, ILoggerFactory loggerFactory) : IRazorDocumentlessRequestHandler, ITextDocumentIdentifierHandler - { +{ private readonly IDocumentMappingService _documentMappingService = documentMappingService; private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); @@ -40,6 +40,12 @@ public Uri GetTextDocumentIdentifier(RazorProximityExpressionsParams request) return null; } + if (documentContext.Snapshot.Version != request.HostDocumentSyncVersion) + { + // Whether we are being asked about an old version of the C# document, or somehow a future one, we can't rely on the result. + return null; + } + var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); var sourceText = await documentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); var hostDocumentIndex = sourceText.GetPosition(request.Position); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanParams.cs index f486bc6230f..fdf956fc7f4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorBreakpointSpanParams.cs @@ -14,4 +14,7 @@ internal class RazorBreakpointSpanParams [JsonPropertyName("position")] public required Position Position { get; init; } + + [JsonPropertyName("hostDocumentSyncVersion")] + public required long HostDocumentSyncVersion { get; init; } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorProximityExpressionsParams.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorProximityExpressionsParams.cs index d56edee55b7..8f20b3ff8ac 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorProximityExpressionsParams.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/Debugging/RazorProximityExpressionsParams.cs @@ -14,4 +14,7 @@ internal class RazorProximityExpressionsParams [JsonPropertyName("position")] public required Position Position { get; init; } + + [JsonPropertyName("hostDocumentSyncVersion")] + public required long HostDocumentSyncVersion { get; init; } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPBreakpointSpanProvider.cs index b25618a797b..cdd2d28822a 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPBreakpointSpanProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPBreakpointSpanProvider.cs @@ -10,5 +10,5 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; internal interface ILSPBreakpointSpanProvider { - Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken); + Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, long hostDocumentSyncVersion, Position position, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPProximityExpressionsProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPProximityExpressionsProvider.cs index 37ab22b8039..990d58f6db3 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPProximityExpressionsProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/ILSPProximityExpressionsProvider.cs @@ -11,5 +11,5 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Debugging; internal interface ILSPProximityExpressionsProvider { - Task?> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken); + Task?> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, long hostDocumentSyncVersion, Position position, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs index cd2b7bd4efd..c8adfc7df4c 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPBreakpointSpanProvider.cs @@ -22,12 +22,13 @@ internal class LSPBreakpointSpanProvider( private readonly LSPRequestInvoker _requestInvoker = requestInvoker; private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); - public async Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + public async Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, long hostDocumentSyncVersion, Position position, CancellationToken cancellationToken) { var languageQueryParams = new RazorBreakpointSpanParams() { Position = position, - Uri = documentSnapshot.Uri + Uri = documentSnapshot.Uri, + HostDocumentSyncVersion = hostDocumentSyncVersion }; var response = await _requestInvoker.ReinvokeRequestOnServerAsync( diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs index b209798513d..955dc901129 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/LSPProximityExpressionsProvider.cs @@ -22,12 +22,13 @@ internal class LSPProximityExpressionsProvider( private readonly LSPRequestInvoker _requestInvoker = requestInvoker; private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); - public async Task?> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + public async Task?> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, long hostDocumentSyncVersion, Position position, CancellationToken cancellationToken) { var proximityExpressionsParams = new RazorProximityExpressionsParams() { Position = position, - Uri = documentSnapshot.Uri + Uri = documentSnapshot.Uri, + HostDocumentSyncVersion = hostDocumentSyncVersion }; var response = await _requestInvoker.ReinvokeRequestOnServerAsync( diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorBreakpointResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorBreakpointResolver.cs index 35a47306657..edc30f795f9 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorBreakpointResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorBreakpointResolver.cs @@ -22,7 +22,7 @@ internal class RazorBreakpointResolver( LSPDocumentManager documentManager, ILSPBreakpointSpanProvider breakpointSpanProvider) : IRazorBreakpointResolver { - private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Character); + private record CacheKey(Uri DocumentUri, long? HostDocumentSyncVersion, int Line, int Character); private readonly FileUriProvider _fileUriProvider = fileUriProvider; private readonly LSPDocumentManager _documentManager = documentManager; @@ -48,22 +48,14 @@ private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Char } // TODO: Support multiple C# documents per Razor document. - if (!documentSnapshot.TryGetVirtualDocument(out var virtualDocument)) + if (!documentSnapshot.TryGetVirtualDocument(out var virtualDocument) || + virtualDocument.HostDocumentSyncVersion is not { } hostDocumentSyncVersion) { Debug.Fail($"Some how there's no C# document associated with the host Razor document {documentUri.OriginalString} when validating breakpoint locations."); return null; } - if (virtualDocument.HostDocumentSyncVersion != documentSnapshot.Version) - { - // C# document isn't up-to-date with the Razor document. Because VS' debugging tech is synchronous on the UI thread we have to bail. Ideally we'd wait - // for the C# document to become "updated"; however, that'd require the UI thread to see that the C# buffer is updated. Because this call path blocks - // the UI thread the C# document will never update until this path has exited. This means as a user types around the point of interest data may get stale - // but will re-adjust later. - return null; - } - - var cacheKey = new CacheKey(documentSnapshot.Uri, documentSnapshot.Version, lineIndex, characterIndex); + var cacheKey = new CacheKey(documentSnapshot.Uri, virtualDocument.HostDocumentSyncVersion, lineIndex, characterIndex); if (_cache.TryGetValue(cacheKey, out var cachedRange)) { // We've seen this request before, no need to go async. @@ -71,7 +63,7 @@ private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Char } var position = VsLspFactory.CreatePosition(lineIndex, characterIndex); - var hostDocumentRange = await _breakpointSpanProvider.GetBreakpointSpanAsync(documentSnapshot, position, cancellationToken).ConfigureAwait(false); + var hostDocumentRange = await _breakpointSpanProvider.GetBreakpointSpanAsync(documentSnapshot, hostDocumentSyncVersion, position, cancellationToken).ConfigureAwait(false); if (hostDocumentRange is null) { // can't map the position, invalid breakpoint location. diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorProximityExpressionResolver.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorProximityExpressionResolver.cs index 32583d77b20..143fac97e94 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorProximityExpressionResolver.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Debugging/RazorProximityExpressionResolver.cs @@ -22,7 +22,7 @@ internal class RazorProximityExpressionResolver( LSPDocumentManager documentManager, ILSPProximityExpressionsProvider proximityExpressionsProvider) : IRazorProximityExpressionResolver { - private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Character); + private record CacheKey(Uri DocumentUri, long? HostDocumentSyncVersion, int Line, int Character); private readonly FileUriProvider _fileUriProvider = fileUriProvider; private readonly LSPDocumentManager _documentManager = documentManager; @@ -47,22 +47,14 @@ private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Char } // TODO: Support multiple C# documents per Razor document. - if (!documentSnapshot.TryGetVirtualDocument(out var virtualDocument)) + if (!documentSnapshot.TryGetVirtualDocument(out var virtualDocument) || + virtualDocument.HostDocumentSyncVersion is not { } hostDocumentSyncVersion) { Debug.Fail($"Some how there's no C# document associated with the host Razor document {documentUri.OriginalString} when resolving proximity expressions."); return null; } - if (virtualDocument.HostDocumentSyncVersion != documentSnapshot.Version) - { - // C# document isn't up-to-date with the Razor document. Because VS' debugging tech is synchronous on the UI thread we have to bail. Ideally we'd wait - // for the C# document to become "updated"; however, that'd require the UI thread to see that the C# buffer is updated. Because this call path blocks - // the UI thread the C# document will never update until this path has exited. This means as a user types around the point of interest data may get stale - // but will re-adjust later. - return null; - } - - var cacheKey = new CacheKey(documentSnapshot.Uri, documentSnapshot.Version, lineIndex, characterIndex); + var cacheKey = new CacheKey(documentSnapshot.Uri, virtualDocument.HostDocumentSyncVersion, lineIndex, characterIndex); if (_cache.TryGetValue(cacheKey, out var cachedExpressions)) { // We've seen this request before, no need to go async. @@ -70,7 +62,7 @@ private record CacheKey(Uri DocumentUri, int DocumentVersion, int Line, int Char } var position = VsLspFactory.CreatePosition(lineIndex, characterIndex); - var proximityExpressions = await _proximityExpressionsProvider.GetProximityExpressionsAsync(documentSnapshot, position, cancellationToken).ConfigureAwait(false); + var proximityExpressions = await _proximityExpressionsProvider.GetProximityExpressionsAsync(documentSnapshot, hostDocumentSyncVersion, position, cancellationToken).ConfigureAwait(false); // Cache range so if we're asked again for this document/line/character we don't have to go async. // Note: If we didn't get any proximity expressions back--likely due to an error--we cache an empty array. diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorBreakpointResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorBreakpointResolverTest.cs index 139aea88ed2..5116954c420 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorBreakpointResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorBreakpointResolverTest.cs @@ -164,6 +164,7 @@ private IRazorBreakpointResolver CreateResolverWith( Mock.Get(projectionProvider) .Setup(projectionProvider => projectionProvider.GetBreakpointSpanAsync( It.IsAny(), + It.IsAny(), It.IsAny(), DisposalToken)) .ReturnsAsync(value: null); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs index 33597a4a0d1..23bc07fd62c 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/RazorProximityExpressionResolverTest.cs @@ -130,7 +130,7 @@ private TestLSPProximityExpressionProvider() { } - public Task> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + public Task> GetProximityExpressionsAsync(LSPDocumentSnapshot documentSnapshot, long hostDocumentSyncVersion, Position position, CancellationToken cancellationToken) { return SpecializedTasks.Null>(); } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs index f582e72739a..dc7e3527557 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/Debugging/TestLSPBreakpointSpanProvider.cs @@ -36,7 +36,7 @@ public TestLSPBreakpointSpanProvider(Uri documentUri, IReadOnlyDictionary GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, Position position, CancellationToken cancellationToken) + public Task GetBreakpointSpanAsync(LSPDocumentSnapshot documentSnapshot, long hostDocumentSyncVersion, Position position, CancellationToken cancellationToken) { if (documentSnapshot.Uri != _documentUri) { From 744e9e32426360e532c821812d738d4a9e972ef8 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 29 Aug 2024 12:27:03 +1000 Subject: [PATCH 245/386] Fix integration tests to validate the change --- .../BreakpointSpanTests.cs | 46 +++++++++++-------- .../InProcess/DebuggerInProcess.cs | 2 +- .../InProcess/RazorProjectSystemInProcess.cs | 39 ++++++++++++++++ 3 files changed, 67 insertions(+), 20 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/BreakpointSpanTests.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/BreakpointSpanTests.cs index 81eb2aa6601..7cacf5c1d96 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/BreakpointSpanTests.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/BreakpointSpanTests.cs @@ -17,13 +17,15 @@ public async Task SetBreakpoint_FirstCharacter_SpanAdjusts() // Wait for classifications to indicate Razor LSP is up and running await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken); - await TestServices.Editor.SetTextAsync("

@{ var abc = 123; }

", ControlledHangMitigatingCancellationToken); - // Act - await TestServices.Debugger.SetBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 1, character: 1, ControlledHangMitigatingCancellationToken); + await TestServices.RazorProjectSystem.WaitForCSharpVirtualDocumentUpdateAsync(RazorProjectConstants.BlazorProjectName, RazorProjectConstants.CounterRazorFile, async () => + { + await TestServices.Editor.SetTextAsync("

@{ var abc = 123; }

", ControlledHangMitigatingCancellationToken); + }, ControlledHangMitigatingCancellationToken); - // Assert - await TestServices.Debugger.VerifyBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 1, character: 7, ControlledHangMitigatingCancellationToken); + Assert.True(await TestServices.Debugger.SetBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 1, character: 1, ControlledHangMitigatingCancellationToken)); + + Assert.True(await TestServices.Debugger.VerifyBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 1, character: 7, ControlledHangMitigatingCancellationToken)); } [IdeFact] @@ -34,15 +36,17 @@ public async Task SetBreakpoint_FirstCharacter_InvalidLine() // Wait for classifications to indicate Razor LSP is up and running await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken); - await TestServices.Editor.SetTextAsync(@"

@{ - var abc = 123; -}

", ControlledHangMitigatingCancellationToken); - // Act - var result = await TestServices.Debugger.SetBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 1, character: 1, ControlledHangMitigatingCancellationToken); + await TestServices.RazorProjectSystem.WaitForCSharpVirtualDocumentUpdateAsync(RazorProjectConstants.BlazorProjectName, RazorProjectConstants.CounterRazorFile, async () => + { + await TestServices.Editor.SetTextAsync(""" +

@{ + var abc = 123; + }

+ """, ControlledHangMitigatingCancellationToken); + }, ControlledHangMitigatingCancellationToken); - // Assert - Assert.False(result); + Assert.False(await TestServices.Debugger.SetBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 1, character: 1, ControlledHangMitigatingCancellationToken)); } [IdeFact] @@ -53,14 +57,18 @@ public async Task SetBreakpoint_FirstCharacter_ValidLine() // Wait for classifications to indicate Razor LSP is up and running await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken); - await TestServices.Editor.SetTextAsync(@"

@{ - var abc = 123; -}

", ControlledHangMitigatingCancellationToken); - // Act - await TestServices.Debugger.SetBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 2, character: 1, ControlledHangMitigatingCancellationToken); + await TestServices.RazorProjectSystem.WaitForCSharpVirtualDocumentUpdateAsync(RazorProjectConstants.BlazorProjectName, RazorProjectConstants.CounterRazorFile, async () => + { + await TestServices.Editor.SetTextAsync(""" +

@{ + var abc = 123; + }

+ """, ControlledHangMitigatingCancellationToken); + }, ControlledHangMitigatingCancellationToken); + + Assert.True(await TestServices.Debugger.SetBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 2, character: 1, ControlledHangMitigatingCancellationToken)); - // Assert - await TestServices.Debugger.VerifyBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 2, character: 4, ControlledHangMitigatingCancellationToken); + Assert.True(await TestServices.Debugger.VerifyBreakpointAsync(RazorProjectConstants.CounterRazorFile, line: 2, character: 5, ControlledHangMitigatingCancellationToken)); } } diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/DebuggerInProcess.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/DebuggerInProcess.cs index d8c08224a56..4d8c7f45290 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/DebuggerInProcess.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/DebuggerInProcess.cs @@ -39,7 +39,7 @@ public async Task VerifyBreakpointAsync(string fileName, int line, int cha foreach (EnvDTE.Breakpoint breakpoint in debugger.Breakpoints) { - if (breakpoint.File == fileName && + if (breakpoint.File.EndsWith(fileName) && breakpoint.FileLine == line && breakpoint.FileColumn == character) { diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/RazorProjectSystemInProcess.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/RazorProjectSystemInProcess.cs index 04f8659b0f8..98b4f5c7534 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/RazorProjectSystemInProcess.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/RazorProjectSystemInProcess.cs @@ -127,4 +127,43 @@ await Helper.RetryAsync(ct => }, TimeSpan.FromMilliseconds(100), cancellationToken); } + + public async Task WaitForCSharpVirtualDocumentUpdateAsync(string projectName, string relativeFilePath, Func updater, CancellationToken cancellationToken) + { + var filePath = await TestServices.SolutionExplorer.GetAbsolutePathForProjectRelativeFilePathAsync(projectName, relativeFilePath, cancellationToken); + + var documentManager = await TestServices.Shell.GetComponentModelServiceAsync(cancellationToken); + + var uri = new Uri(filePath, UriKind.Absolute); + + long? desiredVersion = null; + + await Helper.RetryAsync(async ct => + { + if (documentManager.TryGetDocument(uri, out var snapshot)) + { + if (snapshot.TryGetVirtualDocument(out var virtualDocument)) + { + if (!virtualDocument.ProjectKey.IsUnknown && + virtualDocument.Snapshot.Length > 0) + { + if (desiredVersion is null) + { + desiredVersion = virtualDocument.HostDocumentSyncVersion + 1; + await updater(); + } + else if (virtualDocument.HostDocumentSyncVersion == desiredVersion) + { + return true; + } + } + + return false; + } + } + + return false; + + }, TimeSpan.FromMilliseconds(100), cancellationToken); + } } From ebe38785444605a8354f9a020d00e5622f22444e Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 29 Aug 2024 13:31:43 +1000 Subject: [PATCH 246/386] Update existing tests --- .../RazorBreakpointSpanEndpointTest.cs | 29 ++++++++++++------- .../RazorProximityExpressionsEndpointTest.cs | 5 ++++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs index 718cbcfc0d5..7fa3f0ae3e8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorBreakpointSpanEndpointTest.cs @@ -39,7 +39,8 @@ public async Task Handle_UnsupportedDocument_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; codeDocument.SetUnsupported(); var requestContext = CreateRazorRequestContext(documentContext); @@ -64,7 +65,8 @@ public async Task Handle_StartsInHtml_BreakpointMoved() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 5, length: 14); var requestContext = CreateRazorRequestContext(documentContext); @@ -89,7 +91,8 @@ public async Task Handle_ImplicitExpression_StartsInHtml_BreakpointMoved() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 4, length: 12); var requestContext = CreateRazorRequestContext(documentContext); @@ -114,7 +117,8 @@ public async Task Handle_StartsInHtml_BreakpointMoved_Razor() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 5, length: 14); var requestContext = CreateRazorRequestContext(documentContext); @@ -139,7 +143,8 @@ public async Task Handle_ImplicitExpression_StartsInHtml_BreakpointMoved_Razor() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var expectedRange = VsLspFactory.CreateSingleLineRange(line: 1, character: 4, length: 12); var requestContext = CreateRazorRequestContext(documentContext); @@ -165,7 +170,8 @@ public async Task Handle_StartsInHtml_InvalidBreakpointSpan_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -189,7 +195,8 @@ public async Task Handle_StartInHtml_NoCSharpOnLine_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -216,7 +223,8 @@ public async Task Handle_StartInHtml_NoActualCSharp_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(1, 0) + Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -243,7 +251,8 @@ public async Task Handle_InvalidBreakpointSpan_ReturnsNull() var request = new RazorBreakpointSpanParams() { Uri = documentPath, - Position = VsLspFactory.CreatePosition(2, 0) + Position = VsLspFactory.CreatePosition(2, 0), + HostDocumentSyncVersion = 0, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -258,7 +267,7 @@ private static RazorCodeDocument CreateCodeDocument(string text, string? fileKin { var sourceDocument = TestRazorSourceDocument.Create(text); var projectEngine = RazorProjectEngine.Create(builder => { }); - var codeDocument = projectEngine.ProcessDesignTime(sourceDocument, fileKind ?? FileKinds.Legacy, importSources: default, Array.Empty()); + var codeDocument = projectEngine.ProcessDesignTime(sourceDocument, fileKind ?? FileKinds.Legacy, importSources: default, tagHelpers: []); return codeDocument; } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs index 66f45a89fc0..092d8731e68 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Debugging/RazorProximityExpressionsEndpointTest.cs @@ -40,6 +40,7 @@ public async Task Handle_UnsupportedDocument_ReturnsNull() { Uri = documentPath, Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; codeDocument.SetUnsupported(); var requestContext = CreateRazorRequestContext(documentContext); @@ -65,6 +66,7 @@ public async Task Handle_ReturnsValidExpressions() { Uri = documentPath, Position = VsLspFactory.CreatePosition(1, 8), + HostDocumentSyncVersion = 0, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -90,6 +92,7 @@ public async Task Handle_StartsInHtml_ReturnsValidExpressions() { Uri = documentPath, Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -115,6 +118,7 @@ public async Task Handle_StartInHtml_NoCSharpOnLine_ReturnsNull() { Uri = documentPath, Position = VsLspFactory.CreatePosition(1, 0), + HostDocumentSyncVersion = 0, }; var requestContext = CreateRazorRequestContext(documentContext); @@ -142,6 +146,7 @@ public async Task Handle_InvalidLocation_ReturnsNull() { Uri = documentPath, Position = VsLspFactory.DefaultPosition, + HostDocumentSyncVersion = 0, }; var requestContext = CreateRazorRequestContext(documentContext); From 12f51941849327c7368c65901da01bf7bf2c6890 Mon Sep 17 00:00:00 2001 From: Alex Gavrilov Date: Thu, 29 Aug 2024 11:27:56 -0700 Subject: [PATCH 247/386] Cohosting OnAutoInsert endpoint (#10776) * Factoring out AutoInsertService * Switch non-cohost endpoint to use new AutoInsertService * Adding Remote and OOB AutoInsertService classes and OnAutoInsertProviders * Add common code for capabilities * Add cohost OnAutoInsert endpoint * Parameter rename * Update src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs Co-authored-by: David Wengier * Update src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IAutoInsertService.cs Co-authored-by: David Wengier * Update src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/InsertTextEdit.cs Co-authored-by: David Wengier * Fixup after rebase * More post-build cleanup * Move common HTML and C# auto-insert trigger chars per CR suggestion * More cleanup after rebase * Add IOnAutoInsertTiggerCharacterProvider per CR suggestion * Removing trigger characters property from RemoteAutoInsertService per CR suggestion * Switch to using RemoteResponse * Fixup bad resolve after rebase, and extra whitespace in RazorLangaugeServer * Complete capabilities check in CohostingOnAutoInsertEndpoing registration * Change input position type to serializable :LinePosition * Fixing RemoteInsertTextEdit to use properly annotated (for serialization) types only * Support for delegating auto-insert to C# * Fixup after rebase * Fixup AutoClosingTagOnAutoInsertProviderTest tests * Fixinfg up CloseTextTagOnAutoInsertProviderTest tests * Fixing up OnAutoInsertEndpointTest (which also tests the new AutoInsertService) * Fixing duplicate OnAutoInsert handler registration (bad merge after rebate) * Fixes to MEF composition issue and capabilities check - IDocumentMappingService was not needed (and not available via MEF), so removed that - TextDocument does not implmement VSInternalTextDocumentClientCapabilities * Fixing incorrect export type * Minor cleanup per CR suggestions * Switching parameters to RazorCodeDocument and removing async in a lot of places per CR suggestion * Fixing build - removing unneeded using * Fix RemoteAutoInsertService logic to follow existing code (always prefer our own AutoInsertService first) * Check allowed trigger characters before delegating to other languages/servers * Plumbing through actual option values we need and using them * Fixup After Rebase * Consuming RazorFormattingService in remote OnAutoInsert service * Fixing exception in RemoteProjectSnapshot.Configuration Moving GetFormatterCodeDocumentAsync() into IDocumentSnapshot (and implementations of that) to allow eaiser differentiation of behavior in remote (cohosting) case where we don't need to check the flag on Project.Configuration. Also AddUsingStatementsIfNeeded *always* gets called, even in cases when they are not actually needed, so we can't Debug.Fail there. * Switch to PreferHtmlInAttributeValuesDocumentPositionInfoStrategy as the original code does That allows the code insert double-quotes by delegating to HTML language server after attribute name and equals. * Cleanup usings * More usings cleanup * PR feedback - minor cleanup and removal of InsertTextEdit type in favor of VSInternalDocumentOnAutoInsertResponseItem * PR feedback - removing MEF usage from RemoteAdhocWorkspaceFactory, minor cleanup * PR feedback * Type and method renames, minor cleanup per PR feedback * Renaming interface methods, removing unnecessary usage of FrozenSet * Use ImmutableArray to store providers * Switching to bool and out on IAutoInsertService and implementation * Cleaned up document position info calculation per PR feedback * Minor cleanup in RemoteAutoInsertService * Cleanup trigger character calculation in CohostOnAutoInsertEndpoint * Formatting changes, VsLspFactory usage * Revert to MEF DI in RemoteAdhocWorkspaceFactory/RemoteRazorFormattingService * Removing Rolsyn to VS LSP extension methods * Switch to raw strings in tests and minor whitespace cleanup * Rename per PR feedback suggestion to better indicate the purpose * Cleanup formatting code document acquisition per PR feedback Creating IFormattingCodeDocumentProvider service with seprate LSP and Remote implementations to provide code document appropriate for formatting. * Removing redundant assert as compiler is already doing the check * Unnecessary assignment cleanup * Misc PR feedback cleanup * Made GetGeneratedOutputAsync an extension method per PR feedback * Remaining MEF parameter attrivute formatting changes * Last of the PR feedback. * Fixing most unit test failures. Extension methods can't be used for Mock setups, so since I made GetGeneratedOutputAsync() with no parameter an extension method, I had to switch unit tests to use GeGeneratedOutputAsync(It.Any()) * Fixing last 4 unit test failures We still had non-parameter GetGeneratedOutputAsycnc in DocumentSnapshot (even though it wasn't in IDocumentSnapshot) which was getting called internally. That was both messy (since there is now no-parameter extension method on IDocumentSnapshot) and was causing issues in tests --------- Co-authored-by: David Wengier --- eng/targets/Services.props | 1 + .../CloseTextTagOnAutoInsertProvider.cs | 71 -- .../AutoInsert/IOnAutoInsertProvider.cs | 16 - .../AutoInsert/OnAutoInsertEndpoint.cs | 64 +- .../LspFormattingCodeDocumentProvider.cs | 18 + ...ensions.cs => LspInitializationHelpers.cs} | 21 +- .../InlineCompletionEndPoint.cs | 10 +- .../Mapping/RazorLanguageQueryEndpoint.cs | 1 + .../RazorLanguageServer.cs | 17 +- .../AutoClosingTagOnAutoInsertProvider.cs | 94 +- .../AutoInsert/AutoInsertService.cs | 80 ++ .../CloseTextTagOnAutoInsertProvider.cs | 68 ++ .../AutoInsert/IAutoInsertService.cs | 21 + .../AutoInsert/IOnAutoInsertProvider.cs | 17 + .../IOnAutoInsertTriggerCharacterProvider.cs | 9 + .../Formatting/CSharpFormattingPass.cs | 2 +- .../FormattingContentValidationPass.cs | 2 +- .../Formatting/FormattingContext.cs | 48 +- .../FormattingDiagnosticValidationPass.cs | 2 +- .../IFormattingCodeDocumentProvider.cs | 13 + .../Formatting/RazorFormattingService.cs | 24 +- .../ProjectSystem/DocumentSnapshot.cs | 27 +- .../ProjectSystem/IDocumentSnapshot.cs | 2 +- .../IDocumentSnapshotExtensions.cs | 24 +- .../ProjectSystem/ImportDocumentSnapshot.cs | 6 +- .../AutoInsert/RemoteAutoInsertTextEdit.cs | 36 + .../Remote/IRemoteAutoInsertService.cs | 24 + .../Remote/RazorServices.cs | 1 + .../AutoInsert/OOPAutoInsertService.cs | 14 + .../AutoInsert/RemoteAutoInsertService.cs | 212 ++++ .../AutoInsert/RemoteOnAutoInsertProviders.cs | 17 + .../RemoteDocumentMappingService.cs | 1 + .../RemoteCSharpOnTypeFormattingPass.cs | 7 +- .../RemoteFormattingCodeDocumentProvider.cs | 19 + .../Formatting/RemoteFormattingPasses.cs | 30 + .../Formatting/RemoteRazorFormattingPass.cs | 5 +- .../RemoteRazorFormattingService.cs | 22 + .../ProjectSystem/RemoteDocumentSnapshot.cs | 2 +- .../RemoteAdhocWorkspaceFactory.cs | 7 +- .../Cohost/CohostOnAutoInsertEndpoint.cs | 176 +++ ...stOnAutoInsertTriggerCharacterProviders.cs | 16 + .../AutoClosingTagOnAutoInsertProviderTest.cs | 1017 ++++++++--------- .../CloseTextTagOnAutoInsertProviderTest.cs | 45 +- .../OnAutoInsertEndpointTest.NetFx.cs | 71 +- .../AutoInsert/OnAutoInsertEndpointTest.cs | 53 +- .../RazorOnAutoInsertProviderTestBase.cs | 20 +- .../DefaultCSharpCodeActionProviderTest.cs | 2 +- ...TypeAccessibilityCodeActionProviderTest.cs | 2 +- .../Html/DefaultHtmlCodeActionProviderTest.cs | 2 +- ...nentAccessibilityCodeActionProviderTest.cs | 2 +- ...tractToCodeBehindCodeActionProviderTest.cs | 2 +- ...extDocumentUriPresentationEndpointTests.cs | 14 +- .../FormattingContentValidationPassTest.cs | 10 +- .../FormattingDiagnosticValidationPassTest.cs | 8 +- .../Formatting_NetFx/FormattingTestBase.cs | 2 +- .../TestRazorFormattingService.cs | 5 +- .../Hover/HoverServiceTest.cs | 2 +- .../Semantic/SemanticTokensTest.cs | 2 +- .../ProjectSystem/TestDocumentSnapshot.cs | 2 +- .../RazorComponentDefinitionServiceTest.cs | 1 + 60 files changed, 1684 insertions(+), 825 deletions(-) delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/IOnAutoInsertProvider.cs create mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/LspFormattingCodeDocumentProvider.cs rename src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/{VSInternalServerCapabilitiesExtensions.cs => LspInitializationHelpers.cs} (76%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces}/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs (74%) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoInsertService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/CloseTextTagOnAutoInsertProvider.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IAutoInsertService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IOnAutoInsertProvider.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IOnAutoInsertTriggerCharacterProvider.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/IFormattingCodeDocumentProvider.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/AutoInsert/RemoteAutoInsertTextEdit.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteAutoInsertService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/OOPAutoInsertService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteAutoInsertService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteOnAutoInsertProviders.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingCodeDocumentProvider.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingPasses.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertTriggerCharacterProviders.cs diff --git a/eng/targets/Services.props b/eng/targets/Services.props index 6d9d80ecd5e..b2476eab94a 100644 --- a/eng/targets/Services.props +++ b/eng/targets/Services.props @@ -28,5 +28,6 @@ + diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs deleted file mode 100644 index f6ff6ff95e1..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/CloseTextTagOnAutoInsertProvider.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Legacy; -using Microsoft.AspNetCore.Razor.Language.Syntax; -using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -using Microsoft.CodeAnalysis.Razor.Formatting; -using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; - -namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; - -internal sealed class CloseTextTagOnAutoInsertProvider(RazorLSPOptionsMonitor optionsMonitor) : IOnAutoInsertProvider -{ - private readonly RazorLSPOptionsMonitor _optionsMonitor = optionsMonitor; - - public string TriggerCharacter => ">"; - - public bool TryResolveInsertion(Position position, FormattingContext context, [NotNullWhen(true)] out TextEdit? edit, out InsertTextFormat format) - { - if (!_optionsMonitor.CurrentValue.AutoClosingTags) - { - // We currently only support auto-closing tags our onType formatter. - format = default; - edit = default; - return false; - } - - if (!IsAtTextTag(context, position)) - { - format = default; - edit = default; - return false; - } - - // This is a text tag. - format = InsertTextFormat.Snippet; - edit = VsLspFactory.CreateTextEdit(position, $"$0"); - - return true; - } - - private static bool IsAtTextTag(FormattingContext context, Position position) - { - var syntaxTree = context.CodeDocument.GetSyntaxTree(); - - if (!context.SourceText.TryGetAbsoluteIndex(position, out var absoluteIndex)) - { - return false; - } - - var owner = syntaxTree.Root.FindToken(absoluteIndex - 1); - // Make sure the end tag doesn't already exist - if (owner?.Parent is MarkupStartTagSyntax - { - IsMarkupTransition: true, - Parent: MarkupElementSyntax { EndTag: null } - } startTag) - { - Debug.Assert(string.Equals(startTag.Name.Content, SyntaxConstants.TextTagName, StringComparison.Ordinal), "MarkupTransition that is not a tag."); - - return true; - } - - return false; - } -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/IOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/IOnAutoInsertProvider.cs deleted file mode 100644 index d45bfe02d8d..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/IOnAutoInsertProvider.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System.Diagnostics.CodeAnalysis; -using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -using Microsoft.CodeAnalysis.Razor.Formatting; -using Microsoft.VisualStudio.LanguageServer.Protocol; - -namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; - -internal interface IOnAutoInsertProvider -{ - string TriggerCharacter { get; } - - bool TryResolveInsertion(Position position, FormattingContext context, [NotNullWhen(true)] out TextEdit? edit, out InsertTextFormat format); -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs index cbcef4ece99..93dd2e890e8 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/OnAutoInsertEndpoint.cs @@ -2,7 +2,9 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; +using System.Collections.Frozen; using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -12,6 +14,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.Threading; +using Microsoft.CodeAnalysis.Razor.AutoInsert; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.Logging; @@ -26,21 +29,18 @@ internal class OnAutoInsertEndpoint( LanguageServerFeatureOptions languageServerFeatureOptions, IDocumentMappingService documentMappingService, IClientConnection clientConnection, - IEnumerable onAutoInsertProvider, + IAutoInsertService autoInsertService, RazorLSPOptionsMonitor optionsMonitor, IAdhocWorkspaceFactory workspaceFactory, IRazorFormattingService razorFormattingService, ILoggerFactory loggerFactory) : AbstractRazorDelegatingEndpoint(languageServerFeatureOptions, documentMappingService, clientConnection, loggerFactory.GetOrCreateLogger()), ICapabilitiesProvider { - private static readonly HashSet s_htmlAllowedTriggerCharacters = new(StringComparer.Ordinal) { "=", }; - private static readonly HashSet s_cSharpAllowedTriggerCharacters = new(StringComparer.Ordinal) { "'", "/", "\n" }; - private readonly LanguageServerFeatureOptions _languageServerFeatureOptions = languageServerFeatureOptions; private readonly RazorLSPOptionsMonitor _optionsMonitor = optionsMonitor; private readonly IAdhocWorkspaceFactory _workspaceFactory = workspaceFactory; private readonly IRazorFormattingService _razorFormattingService = razorFormattingService; - private readonly List _onAutoInsertProviders = onAutoInsertProvider.ToList(); + private readonly IAutoInsertService _autoInsertService = autoInsertService; protected override string CustomMessageTarget => CustomMessageNames.RazorOnAutoInsertEndpointName; @@ -53,17 +53,17 @@ internal class OnAutoInsertEndpoint( public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, VSInternalClientCapabilities clientCapabilities) { - var triggerCharacters = _onAutoInsertProviders.Select(provider => provider.TriggerCharacter); + var triggerCharacters = _autoInsertService.TriggerCharacters; if (_languageServerFeatureOptions.SingleServerSupport) { - triggerCharacters = triggerCharacters.Concat(s_htmlAllowedTriggerCharacters).Concat(s_cSharpAllowedTriggerCharacters); + triggerCharacters = [ + .. triggerCharacters, + .. AutoInsertService.HtmlAllowedAutoInsertTriggerCharacters, + .. AutoInsertService.CSharpAllowedAutoInsertTriggerCharacters]; } - serverCapabilities.OnAutoInsertProvider = new VSInternalDocumentOnAutoInsertOptions() - { - TriggerCharacters = triggerCharacters.Distinct().ToArray() - }; + serverCapabilities.EnableOnAutoInsert(triggerCharacters); } protected override async Task TryHandleAsync(VSInternalDocumentOnAutoInsertParams request, RazorRequestContext requestContext, DocumentPositionInfo positionInfo, CancellationToken cancellationToken) @@ -84,36 +84,18 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V var character = request.Character; - using var applicableProviders = new PooledArrayBuilder(); - foreach (var provider in _onAutoInsertProviders) - { - if (provider.TriggerCharacter == character) - { - applicableProviders.Add(provider); - } - } - - if (applicableProviders.Count == 0) + if (_autoInsertService.TryResolveInsertion( + codeDocument, + request.Position, + character, + _optionsMonitor.CurrentValue.AutoClosingTags, + out var insertTextEdit)) { - // There's currently a bug in the LSP platform where other language clients OnAutoInsert trigger characters influence every language clients trigger characters. - // To combat this we need to preemptively return so we don't try having our providers handle characters that they can't. - return null; - } - - var uri = request.TextDocument.Uri; - var position = request.Position; - - using var formattingContext = FormattingContext.Create(uri, documentContext.Snapshot, codeDocument, request.Options, _workspaceFactory); - foreach (var provider in applicableProviders) - { - if (provider.TryResolveInsertion(position, formattingContext, out var textEdit, out var format)) + return new VSInternalDocumentOnAutoInsertResponseItem() { - return new VSInternalDocumentOnAutoInsertResponseItem() - { - TextEdit = textEdit, - TextEditFormat = format, - }; - } + TextEdit = insertTextEdit.TextEdit, + TextEditFormat = insertTextEdit.TextEditFormat, + }; } // No provider could handle the text edit. @@ -130,7 +112,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V if (positionInfo.LanguageKind == RazorLanguageKind.Html) { - if (!s_htmlAllowedTriggerCharacters.Contains(request.Character)) + if (!AutoInsertService.HtmlAllowedAutoInsertTriggerCharacters.Contains(request.Character)) { Logger.LogInformation($"Inapplicable HTML trigger char {request.Character}."); return SpecializedTasks.Null(); @@ -146,7 +128,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V } else if (positionInfo.LanguageKind == RazorLanguageKind.CSharp) { - if (!s_cSharpAllowedTriggerCharacters.Contains(request.Character)) + if (!AutoInsertService.CSharpAllowedAutoInsertTriggerCharacters.Contains(request.Character)) { Logger.LogInformation($"Inapplicable C# trigger char {request.Character}."); return SpecializedTasks.Null(); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/LspFormattingCodeDocumentProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/LspFormattingCodeDocumentProvider.cs new file mode 100644 index 00000000000..eaf9bfa091b --- /dev/null +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/LspFormattingCodeDocumentProvider.cs @@ -0,0 +1,18 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; + +namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; + +internal sealed class LspFormattingCodeDocumentProvider : IFormattingCodeDocumentProvider +{ + public Task GetCodeDocumentAsync(IDocumentSnapshot snapshot) + { + var useDesignTimeGeneratedOutput = snapshot.Project.Configuration.LanguageServerFlags?.ForceRuntimeCodeGeneration ?? false; + return snapshot.GetGeneratedOutputAsync(useDesignTimeGeneratedOutput); + } +} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/LspInitializationHelpers.cs similarity index 76% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs rename to src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/LspInitializationHelpers.cs index cb9f96cecb3..ac141c81680 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/VSInternalServerCapabilitiesExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/LspInitializationHelpers.cs @@ -1,12 +1,14 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System.Collections.Generic; +using System.Linq; using Microsoft.CodeAnalysis.Razor.SemanticTokens; using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -internal static class VSInternalServerCapabilitiesExtensions +internal static class LspInitializationHelpers { public static void EnableInlayHints(this VSInternalServerCapabilities serverCapabilities) { @@ -65,4 +67,21 @@ public static void EnableMapCodeProvider(this VSInternalServerCapabilities serve { serverCapabilities.MapCodeProvider = true; } + + public static void EnableOnAutoInsert( + this VSInternalServerCapabilities serverCapabilities, + IEnumerable triggerCharacters) + { + serverCapabilities.OnAutoInsertProvider = new VSInternalDocumentOnAutoInsertOptions() + .EnableOnAutoInsert(triggerCharacters); + } + + public static VSInternalDocumentOnAutoInsertOptions EnableOnAutoInsert( + this VSInternalDocumentOnAutoInsertOptions options, + IEnumerable triggerCharacters) + { + options.TriggerCharacters = triggerCharacters.Distinct().ToArray(); + + return options; + } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs index 0993fac51f9..76d61ba0eb8 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs @@ -28,6 +28,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.InlineCompletion; internal sealed class InlineCompletionEndpoint( IDocumentMappingService documentMappingService, IClientConnection clientConnection, + IFormattingCodeDocumentProvider formattingCodeDocumentProvider, IAdhocWorkspaceFactory adhocWorkspaceFactory, ILoggerFactory loggerFactory) : IRazorRequestHandler, ICapabilitiesProvider @@ -39,6 +40,7 @@ internal sealed class InlineCompletionEndpoint( private readonly IDocumentMappingService _documentMappingService = documentMappingService ?? throw new ArgumentNullException(nameof(documentMappingService)); private readonly IClientConnection _clientConnection = clientConnection ?? throw new ArgumentNullException(nameof(clientConnection)); + private readonly IFormattingCodeDocumentProvider _formattingCodeDocumentProvider = formattingCodeDocumentProvider; private readonly IAdhocWorkspaceFactory _adhocWorkspaceFactory = adhocWorkspaceFactory ?? throw new ArgumentNullException(nameof(adhocWorkspaceFactory)); private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); @@ -123,7 +125,13 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalInlineCompleti continue; } - using var formattingContext = FormattingContext.Create(request.TextDocument.Uri, documentContext.Snapshot, codeDocument, request.Options, _adhocWorkspaceFactory); + using var formattingContext = FormattingContext.Create( + request.TextDocument.Uri, + documentContext.Snapshot, + codeDocument, + request.Options, + _formattingCodeDocumentProvider, + _adhocWorkspaceFactory); if (!TryGetSnippetWithAdjustedIndentation(formattingContext, item.Text, hostDocumentIndex, out var newSnippetText)) { continue; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs index 7c7bc03cc47..2ef39d5ab1f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Mapping/RazorLanguageQueryEndpoint.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index d542644a9c8..d3162a0e5b1 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Extensions; using Microsoft.AspNetCore.Razor.LanguageServer.FindAllReferences; using Microsoft.AspNetCore.Razor.LanguageServer.Folding; +using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.LanguageServer.Implementation; using Microsoft.AspNetCore.Razor.LanguageServer.InlayHints; @@ -24,7 +25,9 @@ using Microsoft.AspNetCore.Razor.LanguageServer.SignatureHelp; using Microsoft.AspNetCore.Razor.LanguageServer.WrapWithTag; using Microsoft.AspNetCore.Razor.Telemetry; +using Microsoft.CodeAnalysis.Razor.AutoInsert; using Microsoft.CodeAnalysis.Razor.FoldingRanges; +using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.GoToDefinition; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol.DocumentSymbols; @@ -119,6 +122,8 @@ protected override ILspServices ConstructLspServices() services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); + var featureOptions = _featureOptions ?? new DefaultLanguageServerFeatureOptions(); services.AddSingleton(featureOptions); @@ -136,12 +141,14 @@ protected override ILspServices ConstructLspServices() services.AddHoverServices(); services.AddTextDocumentServices(featureOptions); - // Auto insert - services.AddSingleton(); - services.AddSingleton(); - if (!featureOptions.UseRazorCohostServer) { + // Auto insert + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(); + // Folding Range Providers services.AddSingleton(); services.AddSingleton(); @@ -178,7 +185,6 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption services.AddTransient(sp => sp.GetRequiredService()); services.AddHandlerWithCapabilities(); - services.AddHandlerWithCapabilities(); if (!featureOptions.UseRazorCohostServer) { @@ -188,6 +194,7 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption services.AddSingleton(); services.AddHandlerWithCapabilities(); + services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs similarity index 74% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs index ae288e14de1..e5e9febc604 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoClosingTagOnAutoInsertProvider.cs @@ -7,14 +7,13 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Syntax; -using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -using Microsoft.CodeAnalysis.Razor.Formatting; -using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; +using RazorSyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; -internal sealed class AutoClosingTagOnAutoInsertProvider(RazorLSPOptionsMonitor optionsMonitor) : IOnAutoInsertProvider +namespace Microsoft.CodeAnalysis.Razor.AutoInsert; + +internal class AutoClosingTagOnAutoInsertProvider : IOnAutoInsertProvider { // From http://dev.w3.org/html5/spec/Overview.html#elements-0 private static readonly ImmutableHashSet s_voidElements = ImmutableHashSet.Create(StringComparer.OrdinalIgnoreCase, @@ -39,55 +38,58 @@ internal sealed class AutoClosingTagOnAutoInsertProvider(RazorLSPOptionsMonitor private static readonly ImmutableHashSet s_voidElementsCaseSensitive = s_voidElements.WithComparer(StringComparer.Ordinal); - private readonly RazorLSPOptionsMonitor _optionsMonitor = optionsMonitor; - public string TriggerCharacter => ">"; - public bool TryResolveInsertion(Position position, FormattingContext context, [NotNullWhen(true)] out TextEdit? edit, out InsertTextFormat format) + public bool TryResolveInsertion( + Position position, + RazorCodeDocument codeDocument, + bool enableAutoClosingTags, + [NotNullWhen(true)] out VSInternalDocumentOnAutoInsertResponseItem? autoInsertEdit) { - if (!_optionsMonitor.CurrentValue.AutoClosingTags) - { - format = default; - edit = default; - return false; - } + autoInsertEdit = null; - if (!context.SourceText.TryGetAbsoluteIndex(position, out var afterCloseAngleIndex)) + if (!(enableAutoClosingTags + && codeDocument.Source.Text is { } sourceText + && sourceText.TryGetAbsoluteIndex(position, out var afterCloseAngleIndex) + && TryResolveAutoClosingBehavior(codeDocument, afterCloseAngleIndex) is { } tagNameWithClosingBehavior)) { - format = default; - edit = default; return false; } - if (!TryResolveAutoClosingBehavior(context, afterCloseAngleIndex, out var tagName, out var autoClosingBehavior)) + if (tagNameWithClosingBehavior.AutoClosingBehavior == AutoClosingBehavior.EndTag) { - format = default; - edit = default; - return false; - } + var formatForEndTag = InsertTextFormat.Snippet; + var editForEndTag = VsLspFactory.CreateTextEdit(position, $"$0"); - if (autoClosingBehavior == AutoClosingBehavior.EndTag) - { - format = InsertTextFormat.Snippet; - edit = VsLspFactory.CreateTextEdit(position, $"$0"); + autoInsertEdit = new() + { + TextEdit = editForEndTag, + TextEditFormat = formatForEndTag + }; return true; } - Debug.Assert(autoClosingBehavior == AutoClosingBehavior.SelfClosing); + Debug.Assert(tagNameWithClosingBehavior.AutoClosingBehavior == AutoClosingBehavior.SelfClosing); - format = InsertTextFormat.Plaintext; + var format = InsertTextFormat.Plaintext; // Need to replace the `>` with ' />$0' or '/>$0' depending on if there's prefixed whitespace. - var insertionText = char.IsWhiteSpace(context.SourceText[afterCloseAngleIndex - 2]) ? "/" : " /"; - edit = VsLspFactory.CreateTextEdit(position.Line, position.Character - 1, insertionText); + var insertionText = char.IsWhiteSpace(sourceText[afterCloseAngleIndex - 2]) ? "/" : " /"; + var edit = VsLspFactory.CreateTextEdit(position.Line, position.Character - 1, insertionText); + + autoInsertEdit = new() + { + TextEdit = edit, + TextEditFormat = format + }; return true; } - private static bool TryResolveAutoClosingBehavior(FormattingContext context, int afterCloseAngleIndex, [NotNullWhen(true)] out string? name, out AutoClosingBehavior autoClosingBehavior) + private static TagNameWithClosingBehavior? TryResolveAutoClosingBehavior(RazorCodeDocument codeDocument, int afterCloseAngleIndex) { - var syntaxTree = context.CodeDocument.GetSyntaxTree(); + var syntaxTree = codeDocument.GetSyntaxTree(); var closeAngle = syntaxTree.Root.FindToken(afterCloseAngleIndex - 1); if (closeAngle.Parent is MarkupStartTagSyntax @@ -97,19 +99,17 @@ private static bool TryResolveAutoClosingBehavior(FormattingContext context, int } startTag) { var unescapedTagName = startTag.Name.Content; - autoClosingBehavior = InferAutoClosingBehavior(unescapedTagName, caseSensitive: false); + var autoClosingBehavior = InferAutoClosingBehavior(unescapedTagName, caseSensitive: false); if (autoClosingBehavior == AutoClosingBehavior.EndTag && !CouldAutoCloseParentOrSelf(unescapedTagName, htmlElement)) { // Auto-closing behavior is end-tag; however, we already have and end-tag therefore we don't need to do anything! - autoClosingBehavior = default; - name = null; - return false; + return default; } // Finally capture the entire tag name with the potential escape operator. - name = startTag.GetTagNameWithOptionalBang(); - return true; + var name = startTag.GetTagNameWithOptionalBang(); + return new TagNameWithClosingBehavior(name, autoClosingBehavior); } if (closeAngle.Parent is MarkupTagHelperStartTagSyntax @@ -118,9 +118,9 @@ private static bool TryResolveAutoClosingBehavior(FormattingContext context, int Parent: MarkupTagHelperElementSyntax { TagHelperInfo.BindingResult: var binding } tagHelperElement } startTagHelper) { - name = startTagHelper.Name.Content; + var name = startTagHelper.Name.Content; - if (!TryGetTagHelperAutoClosingBehavior(binding, out autoClosingBehavior)) + if (!TryGetTagHelperAutoClosingBehavior(binding, out var autoClosingBehavior)) { autoClosingBehavior = InferAutoClosingBehavior(name, caseSensitive: true); } @@ -128,17 +128,13 @@ private static bool TryResolveAutoClosingBehavior(FormattingContext context, int if (autoClosingBehavior == AutoClosingBehavior.EndTag && !CouldAutoCloseParentOrSelf(name, tagHelperElement)) { // Auto-closing behavior is end-tag; however, we already have and end-tag therefore we don't need to do anything! - autoClosingBehavior = default; - name = null; - return false; + return default; } - return true; + return new TagNameWithClosingBehavior(name, autoClosingBehavior); } - autoClosingBehavior = default; - name = null; - return false; + return default; } private static AutoClosingBehavior InferAutoClosingBehavior(string name, bool caseSensitive) @@ -194,7 +190,7 @@ private static bool TryGetTagHelperAutoClosingBehavior(TagHelperBinding bindingR return false; } - private static bool CouldAutoCloseParentOrSelf(string currentTagName, SyntaxNode node) + private static bool CouldAutoCloseParentOrSelf(string currentTagName, RazorSyntaxNode node) { do { @@ -256,4 +252,6 @@ private enum AutoClosingBehavior EndTag, SelfClosing, } + + private readonly record struct TagNameWithClosingBehavior(string TagName, AutoClosingBehavior AutoClosingBehavior); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoInsertService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoInsertService.cs new file mode 100644 index 00000000000..d6b6e3e3a47 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/AutoInsertService.cs @@ -0,0 +1,80 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Frozen; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.CodeAnalysis.Razor.AutoInsert; + +internal class AutoInsertService(IEnumerable onAutoInsertProviders) : IAutoInsertService +{ + private readonly ImmutableArray _onAutoInsertProviders = onAutoInsertProviders.ToImmutableArray(); + + public static FrozenSet HtmlAllowedAutoInsertTriggerCharacters { get; } + = new string[] { "=" }.ToFrozenSet(StringComparer.Ordinal); + public static FrozenSet CSharpAllowedAutoInsertTriggerCharacters { get; } + = new string[] { "'", "/", "\n" }.ToFrozenSet(StringComparer.Ordinal); + + private readonly ImmutableArray _triggerCharacters = CalculateTriggerCharacters(onAutoInsertProviders); + + private static ImmutableArray CalculateTriggerCharacters(IEnumerable onAutoInsertProviders) + { + using var builder = new PooledArrayBuilder(); + using var _ = StringHashSetPool.Ordinal.GetPooledObject(out var set); + foreach (var provider in onAutoInsertProviders) + { + var triggerCharacter = provider.TriggerCharacter; + if (set.Add(triggerCharacter)) + { + builder.Add(triggerCharacter); + } + } + + return builder.DrainToImmutable(); + } + + public ImmutableArray TriggerCharacters => _triggerCharacters; + + public bool TryResolveInsertion( + RazorCodeDocument codeDocument, + Position position, + string character, + bool autoCloseTags, + [NotNullWhen(true)] out VSInternalDocumentOnAutoInsertResponseItem? insertTextEdit) + { + using var applicableProviders = new PooledArrayBuilder(capacity: _onAutoInsertProviders.Length); + foreach (var provider in _onAutoInsertProviders) + { + if (provider.TriggerCharacter == character) + { + applicableProviders.Add(provider); + } + } + + if (applicableProviders.Count == 0) + { + // There's currently a bug in the LSP platform where other language clients OnAutoInsert trigger characters influence every language clients trigger characters. + // To combat this we need to preemptively return so we don't try having our providers handle characters that they can't. + insertTextEdit = null; + return false; + } + + foreach (var provider in applicableProviders) + { + if (provider.TryResolveInsertion(position, codeDocument, autoCloseTags, out insertTextEdit)) + { + return true; + } + } + + // No provider could handle the text edit. + insertTextEdit = null; + return false; + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/CloseTextTagOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/CloseTextTagOnAutoInsertProvider.cs new file mode 100644 index 00000000000..b2a791b6881 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/CloseTextTagOnAutoInsertProvider.cs @@ -0,0 +1,68 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.Language.Legacy; +using Microsoft.AspNetCore.Razor.Language.Syntax; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.CodeAnalysis.Razor.AutoInsert; + +internal class CloseTextTagOnAutoInsertProvider : IOnAutoInsertProvider +{ + public string TriggerCharacter => ">"; + + public bool TryResolveInsertion( + Position position, + RazorCodeDocument codeDocument, + bool enableAutoClosingTags, + [NotNullWhen(true)] out VSInternalDocumentOnAutoInsertResponseItem? autoInsertEdit) + { + if (!(enableAutoClosingTags && IsAtTextTag(codeDocument, position))) + { + autoInsertEdit = null; + return false; + } + + // This is a text tag. + var format = InsertTextFormat.Snippet; + var edit = VsLspFactory.CreateTextEdit(position, $"$0"); + + autoInsertEdit = new() + { + TextEdit = edit, + TextEditFormat = format + }; + + return true; + } + + private static bool IsAtTextTag(RazorCodeDocument codeDocument, Position position) + { + var syntaxTree = codeDocument.GetSyntaxTree(); + + if (!(codeDocument.Source.Text is { } sourceText + && sourceText.TryGetAbsoluteIndex(position, out var absoluteIndex))) + { + return false; + } + + var owner = syntaxTree.Root.FindToken(absoluteIndex - 1); + // Make sure the end tag doesn't already exist + if (owner?.Parent is MarkupStartTagSyntax + { + IsMarkupTransition: true, + Parent: MarkupElementSyntax { EndTag: null } + } startTag) + { + Debug.Assert(string.Equals(startTag.Name.Content, SyntaxConstants.TextTagName, StringComparison.Ordinal), "MarkupTransition that is not a tag."); + + return true; + } + + return false; + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IAutoInsertService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IAutoInsertService.cs new file mode 100644 index 00000000000..8bad0493d0f --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IAutoInsertService.cs @@ -0,0 +1,21 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.CodeAnalysis.Razor.AutoInsert; + +internal interface IAutoInsertService +{ + ImmutableArray TriggerCharacters { get; } + + bool TryResolveInsertion( + RazorCodeDocument codeDocument, + Position position, + string character, + bool autoCloseTags, + [NotNullWhen(true)] out VSInternalDocumentOnAutoInsertResponseItem? insertTextEdit); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IOnAutoInsertProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IOnAutoInsertProvider.cs new file mode 100644 index 00000000000..ba6458712a0 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IOnAutoInsertProvider.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.CodeAnalysis.Razor.AutoInsert; + +internal interface IOnAutoInsertProvider : IOnAutoInsertTriggerCharacterProvider +{ + public bool TryResolveInsertion( + Position position, + RazorCodeDocument codeDocument, + bool enableAutoClosingTags, + [NotNullWhen(true)] out VSInternalDocumentOnAutoInsertResponseItem? autoInsertEdit); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IOnAutoInsertTriggerCharacterProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IOnAutoInsertTriggerCharacterProvider.cs new file mode 100644 index 00000000000..cfc1ffbed5e --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AutoInsert/IOnAutoInsertTriggerCharacterProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Razor.AutoInsert; + +internal interface IOnAutoInsertTriggerCharacterProvider +{ + string TriggerCharacter { get; } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/CSharpFormattingPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/CSharpFormattingPass.cs index e061b305aaf..722b986ffee 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/CSharpFormattingPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/CSharpFormattingPass.cs @@ -17,7 +17,7 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; -internal sealed class CSharpFormattingPass( +internal class CSharpFormattingPass( IDocumentMappingService documentMappingService, ILoggerFactory loggerFactory) : CSharpFormattingPassBase(documentMappingService) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContentValidationPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContentValidationPass.cs index 7973e9d0df3..0b80da73d28 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContentValidationPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContentValidationPass.cs @@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; -internal sealed class FormattingContentValidationPass( +internal class FormattingContentValidationPass( IDocumentMappingService documentMappingService, ILoggerFactory loggerFactory) : FormattingPassBase(documentMappingService) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs index e5329eccbc7..bd0fd0db7b7 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs @@ -21,16 +21,27 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; internal sealed class FormattingContext : IDisposable { private readonly IAdhocWorkspaceFactory _workspaceFactory; - private Document? _csharpWorkspaceDocument; + private readonly IFormattingCodeDocumentProvider _codeDocumentProvider; + private Document? _csharpWorkspaceDocument; private AdhocWorkspace? _csharpWorkspace; private IReadOnlyList? _formattingSpans; private IReadOnlyDictionary? _indentations; - private FormattingContext(IAdhocWorkspaceFactory workspaceFactory, Uri uri, IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, FormattingOptions options, - bool isFormatOnType, bool automaticallyAddUsings, int hostDocumentIndex, char triggerCharacter) + private FormattingContext( + IFormattingCodeDocumentProvider codeDocumentProvider, + IAdhocWorkspaceFactory workspaceFactory, + Uri uri, + IDocumentSnapshot originalSnapshot, + RazorCodeDocument codeDocument, + FormattingOptions options, + bool isFormatOnType, + bool automaticallyAddUsings, + int hostDocumentIndex, + char triggerCharacter) { + _codeDocumentProvider = codeDocumentProvider; _workspaceFactory = workspaceFactory; Uri = uri; OriginalSnapshot = originalSnapshot; @@ -268,11 +279,12 @@ public async Task WithTextAsync(SourceText changedText) var changedSnapshot = OriginalSnapshot.WithText(changedText); - var codeDocument = await changedSnapshot.GetFormatterCodeDocumentAsync().ConfigureAwait(false); + var codeDocument = await _codeDocumentProvider.GetCodeDocumentAsync(changedSnapshot).ConfigureAwait(false); DEBUG_ValidateComponents(CodeDocument, codeDocument); var newContext = new FormattingContext( + _codeDocumentProvider, _workspaceFactory, Uri, OriginalSnapshot, @@ -309,12 +321,23 @@ public static FormattingContext CreateForOnTypeFormatting( IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, FormattingOptions options, + IFormattingCodeDocumentProvider codeDocumentProvider, IAdhocWorkspaceFactory workspaceFactory, bool automaticallyAddUsings, int hostDocumentIndex, char triggerCharacter) { - return CreateCore(uri, originalSnapshot, codeDocument, options, workspaceFactory, isFormatOnType: true, automaticallyAddUsings, hostDocumentIndex, triggerCharacter); + return CreateCore( + uri, + originalSnapshot, + codeDocument, + options, + codeDocumentProvider, + workspaceFactory, + isFormatOnType: true, + automaticallyAddUsings, + hostDocumentIndex, + triggerCharacter); } public static FormattingContext Create( @@ -322,9 +345,20 @@ public static FormattingContext Create( IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, FormattingOptions options, + IFormattingCodeDocumentProvider codeDocumentProvider, IAdhocWorkspaceFactory workspaceFactory) { - return CreateCore(uri, originalSnapshot, codeDocument, options, workspaceFactory, isFormatOnType: false, automaticallyAddUsings: false, hostDocumentIndex: 0, triggerCharacter: '\0'); + return CreateCore( + uri, + originalSnapshot, + codeDocument, + options, + codeDocumentProvider, + workspaceFactory, + isFormatOnType: false, + automaticallyAddUsings: false, + hostDocumentIndex: 0, + triggerCharacter: '\0'); } private static FormattingContext CreateCore( @@ -332,6 +366,7 @@ private static FormattingContext CreateCore( IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, FormattingOptions options, + IFormattingCodeDocumentProvider codeDocumentProvider, IAdhocWorkspaceFactory workspaceFactory, bool isFormatOnType, bool automaticallyAddUsings, @@ -367,6 +402,7 @@ private static FormattingContext CreateCore( Debug.Assert(isFormatOnType || (hostDocumentIndex == 0 && triggerCharacter == '\0' && automaticallyAddUsings == false)); var result = new FormattingContext( + codeDocumentProvider, workspaceFactory, uri, originalSnapshot, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingDiagnosticValidationPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingDiagnosticValidationPass.cs index 64bf765dd73..8515f5ff13b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingDiagnosticValidationPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingDiagnosticValidationPass.cs @@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; -internal sealed class FormattingDiagnosticValidationPass( +internal class FormattingDiagnosticValidationPass( IDocumentMappingService documentMappingService, ILoggerFactory loggerFactory) : FormattingPassBase(documentMappingService) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/IFormattingCodeDocumentProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/IFormattingCodeDocumentProvider.cs new file mode 100644 index 00000000000..0d1c25da983 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/IFormattingCodeDocumentProvider.cs @@ -0,0 +1,13 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; + +namespace Microsoft.CodeAnalysis.Razor.Formatting; + +internal interface IFormattingCodeDocumentProvider +{ + Task GetCodeDocumentAsync(IDocumentSnapshot snapshot); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index 79d03f61986..15ef27643c9 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -21,10 +21,12 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; internal class RazorFormattingService : IRazorFormattingService { private readonly List _formattingPasses; + private readonly IFormattingCodeDocumentProvider _codeDocumentProvider; private readonly IAdhocWorkspaceFactory _workspaceFactory; public RazorFormattingService( IEnumerable formattingPasses, + IFormattingCodeDocumentProvider codeDocumentProvider, IAdhocWorkspaceFactory workspaceFactory) { if (formattingPasses is null) @@ -33,6 +35,7 @@ public RazorFormattingService( } _formattingPasses = formattingPasses.OrderBy(f => f.Order).ToList(); + _codeDocumentProvider = codeDocumentProvider ?? throw new ArgumentNullException(nameof(codeDocumentProvider)); _workspaceFactory = workspaceFactory ?? throw new ArgumentNullException(nameof(workspaceFactory)); } @@ -42,7 +45,7 @@ public async Task FormatAsync( FormattingOptions options, CancellationToken cancellationToken) { - var codeDocument = await documentContext.Snapshot.GetFormatterCodeDocumentAsync().ConfigureAwait(false); + var codeDocument = await _codeDocumentProvider.GetCodeDocumentAsync(documentContext.Snapshot).ConfigureAwait(false); // Range formatting happens on every paste, and if there are Razor diagnostics in the file // that can make some very bad results. eg, given: @@ -70,7 +73,13 @@ public async Task FormatAsync( var uri = documentContext.Uri; var documentSnapshot = documentContext.Snapshot; var hostDocumentVersion = documentContext.Snapshot.Version; - using var context = FormattingContext.Create(uri, documentSnapshot, codeDocument, options, _workspaceFactory); + using var context = FormattingContext.Create( + uri, + documentSnapshot, + codeDocument, + options, + _codeDocumentProvider, + _workspaceFactory); var originalText = context.SourceText; var result = new FormattingResult([]); @@ -156,7 +165,16 @@ private async Task ApplyFormattedEditsAsync( var documentSnapshot = documentContext.Snapshot; var uri = documentContext.Uri; var codeDocument = await documentSnapshot.GetGeneratedOutputAsync().ConfigureAwait(false); - using var context = FormattingContext.CreateForOnTypeFormatting(uri, documentSnapshot, codeDocument, options, _workspaceFactory, automaticallyAddUsings: automaticallyAddUsings, hostDocumentIndex, triggerCharacter); + using var context = FormattingContext.CreateForOnTypeFormatting( + uri, + documentSnapshot, + codeDocument, + options, + _codeDocumentProvider, + _workspaceFactory, + automaticallyAddUsings: automaticallyAddUsings, + hostDocumentIndex, + triggerCharacter); var result = new FormattingResult(formattedEdits, kind); foreach (var pass in _formattingPasses) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs index 00d3e9fa182..7a145bf3ee1 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentSnapshot.cs @@ -36,12 +36,6 @@ public Task GetTextAsync() public Task GetTextVersionAsync() => State.GetTextVersionAsync(); - public virtual async Task GetGeneratedOutputAsync() - { - var (output, _) = await State.GetGeneratedOutputAndVersionAsync(ProjectInternal, this).ConfigureAwait(false); - return output; - } - public bool TryGetText([NotNullWhen(true)] out SourceText? result) => State.TryGetText(out result); @@ -69,8 +63,27 @@ public IDocumentSnapshot WithText(SourceText text) public async Task GetCSharpSyntaxTreeAsync(CancellationToken cancellationToken) { - var codeDocument = await GetGeneratedOutputAsync().ConfigureAwait(false); + var codeDocument = await GetGeneratedOutputAsync(forceDesignTimeGeneratedOutput: false).ConfigureAwait(false); var csharpText = codeDocument.GetCSharpSourceText(); return CSharpSyntaxTree.ParseText(csharpText, cancellationToken: cancellationToken); } + + public virtual async Task GetGeneratedOutputAsync(bool forceDesignTimeGeneratedOutput) + { + if (forceDesignTimeGeneratedOutput) + { + return await GetDesignTimeGeneratedOutputAsync().ConfigureAwait(false); + } + + var (output, _) = await State.GetGeneratedOutputAndVersionAsync(ProjectInternal, this).ConfigureAwait(false); + return output; + } + + private async Task GetDesignTimeGeneratedOutputAsync() + { + var tagHelpers = await Project.GetTagHelpersAsync(CancellationToken.None).ConfigureAwait(false); + var projectEngine = Project.GetProjectEngine(); + var imports = await DocumentState.GetImportsAsync(this, projectEngine).ConfigureAwait(false); + return await DocumentState.GenerateCodeDocumentAsync(this, projectEngine, imports, tagHelpers, forceRuntimeCodeGeneration: false).ConfigureAwait(false); + } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs index 3e226a3eda9..c3e7f78f698 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshot.cs @@ -21,7 +21,7 @@ internal interface IDocumentSnapshot Task GetTextAsync(); Task GetTextVersionAsync(); - Task GetGeneratedOutputAsync(); + Task GetGeneratedOutputAsync(bool forceDesignTimeGeneratedOutput); ///
/// Gets the Roslyn syntax tree for the generated C# for this Razor document diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshotExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshotExtensions.cs index ef8b26ca9e9..6b6ec6a9360 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshotExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshotExtensions.cs @@ -59,29 +59,9 @@ public static bool IsPathCandidateForComponent(this IDocumentSnapshot documentSn return fileName.AsSpan().Equals(path.Span, FilePathComparison.Instance); } - public static Task GetFormatterCodeDocumentAsync(this IDocumentSnapshot documentSnapshot) + public static Task GetGeneratedOutputAsync(this IDocumentSnapshot documentSnapshot) { - var forceRuntimeCodeGeneration = documentSnapshot.Project.Configuration.LanguageServerFlags?.ForceRuntimeCodeGeneration ?? false; - if (!forceRuntimeCodeGeneration) - { - return documentSnapshot.GetGeneratedOutputAsync(); - } - - // if forceRuntimeCodeGeneration is on, GetGeneratedOutputAsync will get runtime code. As of now - // the formatting service doesn't expect the form of code generated to be what the compiler does with - // runtime. For now force usage of design time and avoid the cache. There may be a slight perf hit - // but either the user is typing (which will invalidate the cache) or the user is manually attempting to - // format. We expect formatting to invalidate the cache if it changes things and consider this an - // acceptable overhead for now. - return GetDesignTimeDocumentAsync(documentSnapshot); + return documentSnapshot.GetGeneratedOutputAsync(forceDesignTimeGeneratedOutput: false); } - private static async Task GetDesignTimeDocumentAsync(IDocumentSnapshot documentSnapshot) - { - var project = documentSnapshot.Project; - var tagHelpers = await project.GetTagHelpersAsync(CancellationToken.None).ConfigureAwait(false); - var projectEngine = project.GetProjectEngine(); - var imports = await DocumentState.GetImportsAsync(documentSnapshot, projectEngine).ConfigureAwait(false); - return await DocumentState.GenerateCodeDocumentAsync(documentSnapshot, project.GetProjectEngine(), imports, tagHelpers, false).ConfigureAwait(false); - } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ImportDocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ImportDocumentSnapshot.cs index e77a615ed5c..213a2f2352c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ImportDocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ImportDocumentSnapshot.cs @@ -35,9 +35,6 @@ public ImportDocumentSnapshot(IProjectSnapshot project, RazorProjectItem item) public int Version => 1; - public Task GetGeneratedOutputAsync() - => throw new NotSupportedException(); - public async Task GetTextAsync() { using (var stream = _importItem.Read()) @@ -50,6 +47,9 @@ public async Task GetTextAsync() return _sourceText; } + public Task GetGeneratedOutputAsync(bool _) + => throw new NotSupportedException(); + public Task GetTextVersionAsync() { return Task.FromResult(_version); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/AutoInsert/RemoteAutoInsertTextEdit.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/AutoInsert/RemoteAutoInsertTextEdit.cs new file mode 100644 index 00000000000..faaf69dc274 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/AutoInsert/RemoteAutoInsertTextEdit.cs @@ -0,0 +1,36 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Runtime.Serialization; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using static Microsoft.VisualStudio.LanguageServer.Protocol.VsLspExtensions; +using static Roslyn.LanguageServer.Protocol.RoslynLspExtensions; +using RoslynInsertTextFormat = Roslyn.LanguageServer.Protocol.InsertTextFormat; + +namespace Microsoft.CodeAnalysis.Razor.Protocol.AutoInsert; + +[DataContract] +internal readonly record struct RemoteAutoInsertTextEdit( + [property: DataMember(Order = 0)] LinePositionSpan LinePositionSpan, + [property: DataMember(Order = 1)] string NewText, + [property: DataMember(Order = 2)] RoslynInsertTextFormat InsertTextFormat) +{ + public static RemoteAutoInsertTextEdit FromLspInsertTextEdit(VSInternalDocumentOnAutoInsertResponseItem edit) + => new ( + edit.TextEdit.Range.ToLinePositionSpan(), + edit.TextEdit.NewText, + (RoslynInsertTextFormat)edit.TextEditFormat); + + public static VSInternalDocumentOnAutoInsertResponseItem ToLspInsertTextEdit(RemoteAutoInsertTextEdit edit) + => new() + { + TextEdit = VsLspFactory.CreateTextEdit(edit.LinePositionSpan, edit.NewText), + TextEditFormat = (InsertTextFormat)edit.InsertTextFormat, + }; + + public override string ToString() + { + return $"({LinePositionSpan}), '{NewText}', {InsertTextFormat}"; + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteAutoInsertService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteAutoInsertService.cs new file mode 100644 index 00000000000..3872965c0f7 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteAutoInsertService.cs @@ -0,0 +1,24 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Text; + +using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; + +internal interface IRemoteAutoInsertService +{ + ValueTask GetAutoInsertTextEditAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + LinePosition position, + string character, + bool autoCloseTags, + bool formatOnType, + bool indentWithTabs, + int indentSize, + CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs index b99ef863b7e..558b737d4c4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs @@ -21,6 +21,7 @@ internal static class RazorServices (typeof(IRemoteUriPresentationService), null), (typeof(IRemoteFoldingRangeService), null), (typeof(IRemoteDocumentHighlightService), null), + (typeof(IRemoteAutoInsertService), null), ]; // Internal for testing diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/OOPAutoInsertService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/OOPAutoInsertService.cs new file mode 100644 index 00000000000..6e19d616fcf --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/OOPAutoInsertService.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Composition; +using Microsoft.CodeAnalysis.Razor.AutoInsert; + +namespace Microsoft.CodeAnalysis.Remote.Razor.AutoInsert; + +[Export(typeof(IAutoInsertService)), Shared] +[method: ImportingConstructor] +internal sealed class OOPAutoInsertService([ImportMany] IEnumerable providers) : AutoInsertService(providers) +{ +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteAutoInsertService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteAutoInsertService.cs new file mode 100644 index 00000000000..4c009c6b7ad --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteAutoInsertService.cs @@ -0,0 +1,212 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; +using Microsoft.CodeAnalysis.Razor.AutoInsert; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.Protocol.AutoInsert; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; +using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; +using RoslynFormattingOptions = Roslyn.LanguageServer.Protocol.FormattingOptions; +using RoslynInsertTextFormat = Roslyn.LanguageServer.Protocol.InsertTextFormat; +using VsLspFormattingOptions = Microsoft.VisualStudio.LanguageServer.Protocol.FormattingOptions; + +namespace Microsoft.CodeAnalysis.Remote.Razor; + +internal sealed class RemoteAutoInsertService(in ServiceArgs args) + : RazorDocumentServiceBase(in args), IRemoteAutoInsertService +{ + internal sealed class Factory : FactoryBase + { + protected override IRemoteAutoInsertService CreateService(in ServiceArgs args) + => new RemoteAutoInsertService(in args); + } + + private readonly IAutoInsertService _autoInsertService = args.ExportProvider.GetExportedValue(); + private readonly IFilePathService _filePathService = args.ExportProvider.GetExportedValue(); + private readonly IRazorFormattingService _razorFormattingService = args.ExportProvider.GetExportedValue(); + + protected override IDocumentPositionInfoStrategy DocumentPositionInfoStrategy => PreferHtmlInAttributeValuesDocumentPositionInfoStrategy.Instance; + + public ValueTask GetAutoInsertTextEditAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + LinePosition linePosition, + string character, + bool autoCloseTags, + bool formatOnType, + bool indentWithTabs, + int indentSize, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => TryResolveInsertionAsync( + context, + linePosition, + character, + autoCloseTags, + formatOnType, + indentWithTabs, + indentSize, + cancellationToken), + cancellationToken); + + private async ValueTask TryResolveInsertionAsync( + RemoteDocumentContext remoteDocumentContext, + LinePosition linePosition, + string character, + bool autoCloseTags, + bool formatOnType, + bool indentWithTabs, + int indentSize, + CancellationToken cancellationToken) + { + var sourceText = await remoteDocumentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); + if (!sourceText.TryGetAbsoluteIndex(linePosition, out var index)) + { + return Response.NoFurtherHandling; + } + + var codeDocument = await remoteDocumentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + + // Always try our own service first, regardless of language + // E.g. if ">" is typed for html tag, it's actually our auto-insert provider + // that adds closing tag instead of HTML even though we are in HTML + if (_autoInsertService.TryResolveInsertion( + codeDocument, + VsLspExtensions.ToPosition(linePosition), + character, + autoCloseTags, + out var insertTextEdit)) + { + return Response.Results(RemoteAutoInsertTextEdit.FromLspInsertTextEdit(insertTextEdit)); + } + + var positionInfo = GetPositionInfo(codeDocument, index); + var languageKind = positionInfo.LanguageKind; + + switch (languageKind) + { + case RazorLanguageKind.Razor: + // If we are in Razor and got no edit from our own service, there is nothing else to do + return Response.NoFurtherHandling; + case RazorLanguageKind.Html: + return AutoInsertService.HtmlAllowedAutoInsertTriggerCharacters.Contains(character) + ? Response.CallHtml + : Response.NoFurtherHandling; + case RazorLanguageKind.CSharp: + var mappedPosition = positionInfo.Position.ToLinePosition(); + return await TryResolveInsertionInCSharpAsync( + remoteDocumentContext, + mappedPosition, + character, + formatOnType, + indentWithTabs, + indentSize, + cancellationToken); + default: + Logger.LogError($"Unsupported language {languageKind} in {nameof(RemoteAutoInsertService)}"); + return Response.NoFurtherHandling; + } + } + + private async ValueTask TryResolveInsertionInCSharpAsync( + RemoteDocumentContext remoteDocumentContext, + LinePosition mappedPosition, + string character, + bool formatOnType, + bool indentWithTabs, + int indentSize, + CancellationToken cancellationToken) + { + // Special case for C# where we use AutoInsert for two purposes: + // 1. For XML documentation comments (filling out the template when typing "///") + // 2. For "on type formatting" style behavior, like adjusting indentation when pressing Enter inside empty braces + // + // If users have turned off on-type formatting, they don't want the behavior of number 2, but its impossible to separate + // that out from number 1. Typing "///" could just as easily adjust indentation on some unrelated code higher up in the + // file, which is exactly the behavior users complain about. + // + // Therefore we are just going to no-op if the user has turned off on type formatting. Maybe one day we can make this + // smarter, but at least the user can always turn the setting back on, type their "///", and turn it back off, without + // having to restart VS. Not the worst compromise (hopefully!) + if (!formatOnType) + { + return Response.NoFurtherHandling; + } + + if (!AutoInsertService.CSharpAllowedAutoInsertTriggerCharacters.Contains(character)) + { + return Response.NoFurtherHandling; + } + + var generatedDocument = await remoteDocumentContext.Snapshot.GetGeneratedDocumentAsync().ConfigureAwait(false); + var formattingOptions = new RoslynFormattingOptions() + { + InsertSpaces = !indentWithTabs, + TabSize = indentSize + }; + + var autoInsertResponseItem = await OnAutoInsert.GetOnAutoInsertResponseAsync( + generatedDocument, + mappedPosition, + character, + formattingOptions, + cancellationToken + ); + + if (autoInsertResponseItem is null) + { + return Response.NoFurtherHandling; + } + + var razorFormattingOptions = new VsLspFormattingOptions() + { + InsertSpaces = !indentWithTabs, + TabSize = indentSize + }; + + var vsLspTextEdit = VsLspFactory.CreateTextEdit( + autoInsertResponseItem.TextEdit.Range.ToLinePositionSpan(), + autoInsertResponseItem.TextEdit.NewText); + var mappedEdits = autoInsertResponseItem.TextEditFormat == RoslynInsertTextFormat.Snippet + ? await _razorFormattingService.FormatSnippetAsync( + remoteDocumentContext, + RazorLanguageKind.CSharp, + [vsLspTextEdit], + razorFormattingOptions, + cancellationToken) + .ConfigureAwait(false) + : await _razorFormattingService.FormatOnTypeAsync( + remoteDocumentContext, + RazorLanguageKind.CSharp, + [vsLspTextEdit], + razorFormattingOptions, + hostDocumentIndex: 0, + triggerCharacter: '\0', + cancellationToken) + .ConfigureAwait(false); + + if (mappedEdits is not [{ } edit]) + { + return Response.NoFurtherHandling; + } + + return Response.Results( + new RemoteAutoInsertTextEdit( + edit.Range.ToLinePositionSpan(), + edit.NewText, + autoInsertResponseItem.TextEditFormat)); + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteOnAutoInsertProviders.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteOnAutoInsertProviders.cs new file mode 100644 index 00000000000..e619a1aa100 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteOnAutoInsertProviders.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using Microsoft.CodeAnalysis.Razor.AutoInsert; + +namespace Microsoft.CodBeAnalysis.Remote.Razor.AutoInsert; + +[Shared] +[Export(typeof(IOnAutoInsertProvider))] +internal sealed class RemoteAutoClosingTagOnAutoInsertProvider + : AutoClosingTagOnAutoInsertProvider; + +[Shared] +[Export(typeof(IOnAutoInsertProvider))] +internal sealed class RemoteCloseTextTagOnAutoInsertProvider + : CloseTextTagOnAutoInsertProvider; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentMapping/RemoteDocumentMappingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentMapping/RemoteDocumentMappingService.cs index 50fbc2fec25..0d3a170efac 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentMapping/RemoteDocumentMappingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentMapping/RemoteDocumentMappingService.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteCSharpOnTypeFormattingPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteCSharpOnTypeFormattingPass.cs index 6d4e33d0af8..638aa40b213 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteCSharpOnTypeFormattingPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteCSharpOnTypeFormattingPass.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Diagnostics; +using System.Composition; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; @@ -13,6 +13,8 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; +[Export(typeof(IFormattingPass)), Shared] +[method: ImportingConstructor] internal sealed class RemoteCSharpOnTypeFormattingPass( IDocumentMappingService documentMappingService, ILoggerFactory loggerFactory) @@ -20,7 +22,8 @@ internal sealed class RemoteCSharpOnTypeFormattingPass( { protected override Task AddUsingStatementEditsIfNecessaryAsync(CodeAnalysis.Razor.Formatting.FormattingContext context, RazorCodeDocument codeDocument, SourceText csharpText, TextEdit[] textEdits, SourceText originalTextWithChanges, TextEdit[] finalEdits, CancellationToken cancellationToken) { - Debug.Fail("Implement this when code actions are migrated to cohosting"); + // Implement this when code actions are migrated to cohosting, + // probably will be able to move it back into base class and make that non-abstract. return Task.FromResult(finalEdits); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingCodeDocumentProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingCodeDocumentProvider.cs new file mode 100644 index 00000000000..92a0ccd1ae6 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingCodeDocumentProvider.cs @@ -0,0 +1,19 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; + +namespace Microsoft.CodeAnalysis.Remote.Razor.Formatting; + +[Export(typeof(IFormattingCodeDocumentProvider)), Shared] +internal sealed class RemoteFormattingCodeDocumentProvider : IFormattingCodeDocumentProvider +{ + public Task GetCodeDocumentAsync(IDocumentSnapshot snapshot) + { + return snapshot.GetGeneratedOutputAsync(); + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingPasses.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingPasses.cs new file mode 100644 index 00000000000..2ca3bda8a99 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingPasses.cs @@ -0,0 +1,30 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.Logging; + +namespace Microsoft.CodeAnalysis.Remote.Razor.Formatting; + +[Export(typeof(IFormattingPass)), Shared] +[method: ImportingConstructor] +internal sealed class RemoteCSharpFormattingPass( + IDocumentMappingService documentMappingService, + ILoggerFactory loggerFactory) + : CSharpFormattingPass(documentMappingService, loggerFactory); + +[Export(typeof(IFormattingPass)), Shared] +[method: ImportingConstructor] +internal sealed class RemoteFormattingContentValidationPass( + IDocumentMappingService documentMappingService, + ILoggerFactory loggerFactory) + : FormattingContentValidationPass(documentMappingService, loggerFactory); + +[Export(typeof(IFormattingPass)), Shared] +[method: ImportingConstructor] +internal sealed class RemoteFormattingDiagnosticValidationPass( + IDocumentMappingService documentMappingService, + ILoggerFactory loggerFactory) + : FormattingDiagnosticValidationPass(documentMappingService, loggerFactory); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingPass.cs index 500d610a99e..0347e5591c9 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingPass.cs @@ -1,15 +1,18 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System.Composition; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Formatting; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; +[Export(typeof(IFormattingPass)), Shared] +[method: ImportingConstructor] internal sealed class RemoteRazorFormattingPass( IDocumentMappingService documentMappingService) : RazorFormattingPassBase(documentMappingService) { // TODO: properly plumb this through - protected override bool CodeBlockBraceOnNextLine => true; + protected override bool CodeBlockBraceOnNextLine => false; } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs new file mode 100644 index 00000000000..bff121bd4c0 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Composition; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.Workspaces; + +namespace Microsoft.CodeAnalysis.Remote.Razor.Formatting; + +[Export(typeof(IRazorFormattingService)), Shared] +[method: ImportingConstructor] +internal class RemoteRazorFormattingService( + [ImportMany] IEnumerable formattingPasses, + IFormattingCodeDocumentProvider codeDocumentProvider, + IAdhocWorkspaceFactory adhocWorkspaceFactory) + : RazorFormattingService( + formattingPasses, + codeDocumentProvider, + adhocWorkspaceFactory) +{ +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs index e4e413bc5a6..bf65778cd50 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs @@ -46,7 +46,7 @@ internal class RemoteDocumentSnapshot(TextDocument textDocument, RemoteProjectSn public bool TryGetTextVersion(out VersionStamp result) => _textDocument.TryGetTextVersion(out result); - public async Task GetGeneratedOutputAsync() + public async Task GetGeneratedOutputAsync(bool _) { // TODO: We don't need to worry about locking if we get called from the didOpen/didChange LSP requests, as CLaSP // takes care of that for us, and blocks requests until those are complete. If that doesn't end up happening, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs index 232561f871f..9abf7da6394 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs @@ -2,20 +2,23 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System.Collections.Immutable; +using System.Composition; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Razor.Workspaces; namespace Microsoft.CodeAnalysis.Remote.Razor; -internal sealed class RemoteAdhocWorkspaceFactory(HostServices hostServices) : IAdhocWorkspaceFactory +[Export(typeof(IAdhocWorkspaceFactory)), Shared] +internal sealed class RemoteAdhocWorkspaceFactory() : IAdhocWorkspaceFactory { public AdhocWorkspace Create(params IWorkspaceService[] workspaceServices) { workspaceServices ??= []; + var hostServices = RemoteWorkspaceAccessor.GetWorkspace().Services.HostServices; var services = AdhocServices.Create( workspaceServices: workspaceServices.ToImmutableArray(), - languageServices: ImmutableArray.Empty, + languageServices: [], fallbackServices: hostServices); return new AdhocWorkspace(services); diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs new file mode 100644 index 00000000000..1b90bd110ac --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs @@ -0,0 +1,176 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Composition; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.AutoInsert; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Protocol.AutoInsert; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.VisualStudio.Razor.LanguageClient.Cohost; +using Microsoft.VisualStudio.Razor.Settings; +using RazorLSPConstants = Microsoft.VisualStudio.Razor.LanguageClient.RazorLSPConstants; +using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; + +namespace Microsoft.VisualStudio.LanguageServices.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(VSInternalMethods.OnAutoInsertName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostOnAutoInsertEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostOnAutoInsertEndpoint( + IRemoteServiceInvoker remoteServiceInvoker, + IClientSettingsManager clientSettingsManager, +#pragma warning disable RS0030 // Do not use banned APIs + [ImportMany] IEnumerable onAutoInsertTriggerCharacterProviders, +#pragma warning restore RS0030 // Do not use banned APIs + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker, + ILoggerFactory loggerFactory) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + private readonly IClientSettingsManager _clientSettingsManager = clientSettingsManager; + private readonly IEnumerable _onAutoInsertTriggerCharacterProviders = onAutoInsertTriggerCharacterProviders; + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); + + private readonly ImmutableArray _triggerCharacters = CalculateTriggerChars(onAutoInsertTriggerCharacterProviders); + + private static ImmutableArray CalculateTriggerChars(IEnumerable onAutoInsertTriggerCharacterProviders) + { + var providerTriggerCharacters = onAutoInsertTriggerCharacterProviders.Select((provider) => provider.TriggerCharacter).Distinct(); + + ImmutableArray _triggerCharacters = [ + .. providerTriggerCharacters, + .. AutoInsertService.HtmlAllowedAutoInsertTriggerCharacters, + .. AutoInsertService.CSharpAllowedAutoInsertTriggerCharacters ]; + + return _triggerCharacters; + } + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.SupportsVisualStudioExtensions) + { + return new Registration + { + Method = VSInternalMethods.OnAutoInsertName, + RegisterOptions = new VSInternalDocumentOnAutoInsertOptions() + .EnableOnAutoInsert(_triggerCharacters) + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(VSInternalDocumentOnAutoInsertParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override async Task HandleRequestAsync(VSInternalDocumentOnAutoInsertParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + { + var razorDocument = context.TextDocument.AssumeNotNull(); + + _logger.LogDebug($"Resolving auto-insertion for {razorDocument.FilePath}"); + + var clientSettings = _clientSettingsManager.GetClientSettings(); + var enableAutoClosingTags = clientSettings.AdvancedSettings.AutoClosingTags; + var formatOnType = clientSettings.AdvancedSettings.FormatOnType; + var indentWithTabs = clientSettings.ClientSpaceSettings.IndentWithTabs; + var indentSize = clientSettings.ClientSpaceSettings.IndentSize; + + _logger.LogDebug($"Calling OOP to resolve insertion at {request.Position} invoked by typing '{request.Character}'"); + var data = await _remoteServiceInvoker.TryInvokeAsync( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) + => service.GetAutoInsertTextEditAsync( + solutionInfo, + razorDocument.Id, + request.Position.ToLinePosition(), + request.Character, + enableAutoClosingTags, + formatOnType, + indentWithTabs, + indentSize, + cancellationToken), + cancellationToken).ConfigureAwait(false); + + if (data.Result is { } remoteInsertTextEdit) + { + _logger.LogDebug($"Got insert text edit from OOP {remoteInsertTextEdit}"); + return RemoteAutoInsertTextEdit.ToLspInsertTextEdit(remoteInsertTextEdit); + } + + if (data.StopHandling) + { + return null; + } + + // Got no data but no signal to stop handling + + return await TryResolveHtmlInsertionAsync( + razorDocument, + request, + clientSettings.AdvancedSettings.AutoInsertAttributeQuotes, + cancellationToken) + .ConfigureAwait(false); + } + + private async Task TryResolveHtmlInsertionAsync( + TextDocument razorDocument, + VSInternalDocumentOnAutoInsertParams request, + bool autoInsertAttributeQuotes, + CancellationToken cancellationToken) + { + if (!autoInsertAttributeQuotes && request.Character == "=") + { + // Use Razor setting for auto insert attribute quotes. HTML Server doesn't have a way to pass that + // information along so instead we just don't delegate the request. + _logger.LogTrace($"Not delegating to HTML completion because AutoInsertAttributeQuotes is disabled"); + return null; + } + + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + request.TextDocument = request.TextDocument.WithUri(htmlDocument.Uri); + + _logger.LogDebug($"Resolving auto-insertion edit for {htmlDocument.Uri}"); + + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + htmlDocument.Buffer, + VSInternalMethods.OnAutoInsertName, + RazorLSPConstants.HtmlLanguageServerName, + request, + cancellationToken).ConfigureAwait(false); + + if (result?.Response is null) + { + _logger.LogDebug($"Didn't get insert edit back from Html."); + return null; + } + + return result.Response; + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertTriggerCharacterProviders.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertTriggerCharacterProviders.cs new file mode 100644 index 00000000000..84a7207e1cd --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertTriggerCharacterProviders.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.ComponentModel.Composition; +using Microsoft.CodeAnalysis.Razor.AutoInsert; + +namespace Microsoft.VisualStudio.LanguageServices.Razor.LanguageClient.Cohost; + +// These are needed to we can get auto-insert trigger character collection +// during registration of CohostOnAutoInsertProvider without using a remote service + +[Export(typeof(IOnAutoInsertTriggerCharacterProvider))] +internal sealed class CohostAutoClosingTagOnAutoInsertTriggerCharacterProvider : AutoClosingTagOnAutoInsertProvider; + +[Export(typeof(IOnAutoInsertTriggerCharacterProvider))] +internal sealed class CohostCloseTextTagOnAutoInsertTriggerCharacterProvider : CloseTextTagOnAutoInsertProvider; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/AutoClosingTagOnAutoInsertProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/AutoClosingTagOnAutoInsertProviderTest.cs index 0e806675535..3eba6dff3fd 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/AutoClosingTagOnAutoInsertProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/AutoClosingTagOnAutoInsertProviderTest.cs @@ -3,8 +3,8 @@ using System; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis.Razor.AutoInsert; using Xunit; using Xunit.Abstractions; using static Microsoft.AspNetCore.Razor.Language.CommonMetadata; @@ -13,8 +13,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.AutoInsert; public class AutoClosingTagOnAutoInsertProviderTest(ITestOutputHelper testOutput) : RazorOnAutoInsertProviderTestBase(testOutput) { - private RazorLSPOptions Options { get; set; } = RazorLSPOptions.Default; - private static TagHelperDescriptor CatchAllTagHelper { get @@ -104,19 +102,18 @@ private static TagHelperDescriptor WithoutEndTagTagHelper public void OnTypeCloseAngle_ConflictingAutoClosingBehaviorsChoosesMostSpecific() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly - -$$ -", -expected: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly - -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { WithoutEndTagTagHelper, CatchAllTagHelper }); + $$ + """, + expected: """ + @addTagHelper *, TestAssembly + + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { WithoutEndTagTagHelper, CatchAllTagHelper }); } [Fact] @@ -124,18 +121,18 @@ public void OnTypeCloseAngle_ConflictingAutoClosingBehaviorsChoosesMostSpecific( public void OnTypeCloseAngle_TagHelperAlreadyHasEndTag() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly - -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -143,18 +140,18 @@ public void OnTypeCloseAngle_TagHelperAlreadyHasEndTag() public void OnTypeCloseAngle_VoidTagHelperHasEndTag_ShouldStillAutoClose() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly - -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { UnspecifiedInputTagHelper }); + + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { UnspecifiedInputTagHelper }); } [Fact] @@ -162,12 +159,12 @@ public void OnTypeCloseAngle_VoidTagHelperHasEndTag_ShouldStillAutoClose() public void OnTypeCloseAngle_TagAlreadyHasEndTag() { RunAutoInsertTest( -input: @" -
$$
-", -expected: @" -
-"); + input: """ +
$$
+ """, + expected: """ +
+ """); } [Fact] @@ -175,33 +172,33 @@ public void OnTypeCloseAngle_TagAlreadyHasEndTag() public void OnTypeCloseAngle_TagDoesNotAutoCloseOutOfScope() { RunAutoInsertTest( -input: @" -
- @if (true) - { -
$$
- } -", -expected: @" -
- @if (true) - { -
- } -"); + input: """ +
+ @if (true) + { +
$$
+ } + """, + expected: """ +
+ @if (true) + { +
+ } + """); } [Fact] [WorkItem("https://github.com/dotnet/aspnetcore/issues/36125")] - public void OnTypeCloseAngle_VoidTagHasEndTag_ShouldStillAutoClose() + public void OnTypeCloseAngle_VoidTagHasEndTag_ShouldStillClose() { RunAutoInsertTest( -input: @" -$$ -", -expected: @" - -"); + input: """ + $$ + """, + expected: """ + + """); } [Fact] @@ -209,18 +206,18 @@ public void OnTypeCloseAngle_VoidTagHasEndTag_ShouldStillAutoClose() public void OnTypeCloseAngle_VoidElementMirroringTagHelper() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly -$0 -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { UnspecifiedInputMirroringTagHelper }); + $0 + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { UnspecifiedInputMirroringTagHelper }); } [Fact] @@ -228,82 +225,82 @@ public void OnTypeCloseAngle_VoidElementMirroringTagHelper() public void OnTypeCloseAngle_VoidHtmlElementCapitalized_SelfCloses() { RunAutoInsertTest( -input: "$$", -expected: "", -fileKind: FileKinds.Legacy, -tagHelpers: Array.Empty()); + input: "$$", + expected: "", + fileKind: FileKinds.Legacy, + tagHelpers: Array.Empty()); } [Fact] public void OnTypeCloseAngle_NormalOrSelfClosingStructureOverridesVoidTagBehavior() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly -$0 -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfclosingInputTagHelper }); + $0 + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfclosingInputTagHelper }); } [Fact] public void OnTypeCloseAngle_UnspeccifiedStructureInheritsVoidTagBehavior() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly - -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { UnspecifiedInputTagHelper }); + + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { UnspecifiedInputTagHelper }); } [Fact] public void OnTypeCloseAngle_UnspeccifiedTagHelperTagStructure() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly -$0 -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { UnspecifiedTagHelper }); + $0 + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { UnspecifiedTagHelper }); } [Fact] public void OnTypeCloseAngle_NormalOrSelfClosingTagHelperTagStructure() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly -$0 -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + $0 + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -311,24 +308,24 @@ public void OnTypeCloseAngle_NormalOrSelfClosingTagHelperTagStructure() public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$$
-} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { +
$$
+ } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$0
-} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { +
$0
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -336,24 +333,24 @@ public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement() public void OnTypeCloseAngle_HtmlTagInHtml_NestedStatement_WithAttribute() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ - -} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { + + } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ - -} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { +
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -361,24 +358,24 @@ public void OnTypeCloseAngle_HtmlTagInHtml_NestedStatement_WithAttribute() public void OnTypeCloseAngle_HtmlTagInHtml_NestedStatement_WithAttribute_SpaceBetweenClosingAngleAndAttributeClosingQuote() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ - -} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { + + } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ - -} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { + + } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -386,24 +383,24 @@ public void OnTypeCloseAngle_HtmlTagInHtml_NestedStatement_WithAttribute_SpaceBe public void OnTypeCloseAngle_HtmlTagInHtml_NestedStatement_WithMinimalizedAttribute() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$$
-} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { +
$$
+ } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$0
-} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { +
$0
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -411,24 +408,24 @@ public void OnTypeCloseAngle_HtmlTagInHtml_NestedStatement_WithMinimalizedAttrib public void OnTypeCloseAngle_HtmlTagInHtml_NestedStatement_WithMinimalizedAttribute_SpaceBetweenClosingAngleAndAttributeClosingQuote() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$$
-} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { +
$$
+ } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$0
-} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { +
$0
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -436,24 +433,24 @@ public void OnTypeCloseAngle_HtmlTagInHtml_NestedStatement_WithMinimalizedAttrib public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement_WithAttribute() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$$
-} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { +
$$
+ } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$0
-} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { +
$0
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -461,24 +458,24 @@ public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement_WithAttribute() public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement_WithAttribute_SpaceBetweenClosingAngleAndAttributeClosingQuote() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$$
-} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { +
$$
+ } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$0
-} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { +
$0
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -486,24 +483,24 @@ public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement_WithAttribute_Space public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement_WithMinimalizedAttribute() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$$
-} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { +
$$
+ } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$0
-} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { +
$0
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -511,24 +508,24 @@ public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement_WithMinimalizedAttr public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement_WithMinimalizedAttribute_SpaceBetweenClosingAngleAndAttributeClosingQuote() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$$
-} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { +
$$
+ } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$0
-} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @if (true) + { +
$0
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] @@ -536,24 +533,24 @@ public void OnTypeCloseAngle_TagHelperInHtml_NestedStatement_WithMinimalizedAttr public void OnTypeCloseAngle_TagHelperInTagHelper_NestedStatement() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -$$ -} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { + $$ + } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ - -} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper, UnspecifiedInputTagHelper }); + @if (true) + { + + } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper, UnspecifiedInputTagHelper }); } [Fact] @@ -561,24 +558,24 @@ public void OnTypeCloseAngle_TagHelperInTagHelper_NestedStatement() public void OnTypeCloseAngle_TagHelperNextToVoidTagHelper_NestedStatement() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -$$ -} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { + $$ + } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -$0 -} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper, UnspecifiedInputTagHelper }); + @if (true) + { + $0 + } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper, UnspecifiedInputTagHelper }); } [Fact] @@ -586,64 +583,64 @@ public void OnTypeCloseAngle_TagHelperNextToVoidTagHelper_NestedStatement() public void OnTypeCloseAngle_TagHelperNextToTagHelper_NestedStatement() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -$$ -} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { + $$ + } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -$0 -} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper, NormalOrSelfclosingInputTagHelper }); + @if (true) + { + $0 + } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper, NormalOrSelfclosingInputTagHelper }); } [Fact] public void OnTypeCloseAngle_NormalOrSelfClosingTagHelperTagStructure_CodeBlock() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@{ - $$ -} -", -expected: @" -@addTagHelper *, TestAssembly + @{ + $$ + } + """, + expected: """ + @addTagHelper *, TestAssembly -@{ - $0 -} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + @{ + $0 + } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] public void OnTypeCloseAngle_WithSlash_WithoutEndTagTagHelperTagStructure() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly - -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { WithoutEndTagTagHelper }); + + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { WithoutEndTagTagHelper }); } [Fact] @@ -651,130 +648,130 @@ public void OnTypeCloseAngle_WithSlash_WithoutEndTagTagHelperTagStructure() public void OnTypeCloseAngle_NestedStatement() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
$$
-} -", -expected: @" -@addTagHelper *, TestAssembly + @if (true) + { +
$$
+ } + """, + expected: """ + @addTagHelper *, TestAssembly -@if (true) -{ -
-} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { WithoutEndTagTagHelper }); + @if (true) + { +
+ } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { WithoutEndTagTagHelper }); } [Fact] public void OnTypeCloseAngle_WithSpace_WithoutEndTagTagHelperTagStructure() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly - -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { WithoutEndTagTagHelper }); + + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { WithoutEndTagTagHelper }); } [Fact] public void OnTypeCloseAngle_WithoutEndTagTagHelperTagStructure() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly - -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { WithoutEndTagTagHelper }); + + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { WithoutEndTagTagHelper }); } [Fact] public void OnTypeCloseAngle_WithoutEndTagTagHelperTagStructure_CodeBlock() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -@{ - $$ -} -", -expected: @" -@addTagHelper *, TestAssembly + @{ + $$ + } + """, + expected: """ + @addTagHelper *, TestAssembly -@{ - -} -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { WithoutEndTagTagHelper }); + @{ + + } + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { WithoutEndTagTagHelper }); } [Fact] public void OnTypeCloseAngle_MultipleApplicableTagHelperTagStructures() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly -$0 -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { UnspecifiedTagHelper, NormalOrSelfClosingTagHelper, WithoutEndTagTagHelper }); + $0 + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { UnspecifiedTagHelper, NormalOrSelfClosingTagHelper, WithoutEndTagTagHelper }); } [Fact] public void OnTypeCloseAngle_EscapedTagTagHelperAutoCompletesWithEscape() { RunAutoInsertTest( -input: @" -@addTagHelper *, TestAssembly + input: """ + @addTagHelper *, TestAssembly -$$ -", -expected: @" -@addTagHelper *, TestAssembly + $$ + """, + expected: """ + @addTagHelper *, TestAssembly -$0 -", -fileKind: FileKinds.Legacy, -tagHelpers: new[] { NormalOrSelfClosingTagHelper }); + $0 + """, + fileKind: FileKinds.Legacy, + tagHelpers: new[] { NormalOrSelfClosingTagHelper }); } [Fact] public void OnTypeCloseAngle_AlwaysClosesStandardHTMLTag() { RunAutoInsertTest( -input: @" -
$$
-", -expected: @" -
$0
-"); + input: """ +
$$
+ """, + expected: """ +
$0
+ """); } [Fact] @@ -782,18 +779,18 @@ public void OnTypeCloseAngle_AlwaysClosesStandardHTMLTag() public void OnTypeCloseAngle_ClosesStandardHTMLTag_NestedStatement() { RunAutoInsertTest( -input: @" -@if (true) -{ -

$$

-} -", -expected: @" -@if (true) -{ -

$0

-} -"); + input: """ + @if (true) + { +

$$

+ } + """, + expected: """ + @if (true) + { +

$0

+ } + """); } [Fact] @@ -801,18 +798,18 @@ public void OnTypeCloseAngle_ClosesStandardHTMLTag_NestedStatement() public void OnTypeCloseAngle_TagNextToTag_NestedStatement() { RunAutoInsertTest( -input: @" -@if (true) -{ -

$$

-} -", -expected: @" -@if (true) -{ -

$0

-} -"); + input: """ + @if (true) + { +

$$

+ } + """, + expected: """ + @if (true) + { +

$0

+ } + """); } [Fact] @@ -820,58 +817,58 @@ public void OnTypeCloseAngle_TagNextToTag_NestedStatement() public void OnTypeCloseAngle_TagNextToVoidTag_NestedStatement() { RunAutoInsertTest( -input: @" -@if (true) -{ -

$$ -} -", -expected: @" -@if (true) -{ -

$0

-} -"); + input: """ + @if (true) + { +

$$ + } + """, + expected: """ + @if (true) + { +

$0

+ } + """); } [Fact] public void OnTypeCloseAngle_ClosesStandardHTMLTag() { RunAutoInsertTest( -input: @" -
$$ -", -expected: @" -
$0
-"); + input: """ +
$$ + """, + expected: """ +
$0
+ """); } [Fact] public void OnTypeCloseAngle_ClosesStandardHTMLTag_CodeBlock() { RunAutoInsertTest( -input: @" -@{ -
$$ -} -", -expected: @" -@{ -
$0
-} -"); + input: """ + @{ +
$$ + } + """, + expected: """ + @{ +
$0
+ } + """); } [Fact] public void OnTypeCloseAngle_ClosesVoidHTMLTag() { RunAutoInsertTest( -input: @" - $$ -", -expected: @" - -"); + input: """ + $$ + """, + expected: """ + + """); } [Fact] @@ -879,79 +876,73 @@ public void OnTypeCloseAngle_ClosesVoidHTMLTag() public void OnTypeCloseAngle_ClosesVoidHTMLTag_NestedStatement() { RunAutoInsertTest( -input: @" -@if (true) -{ - $$ -} -", -expected: @" -@if (true) -{ - -} -"); + input: """ + @if (true) + { + $$ + } + """, + expected: """ + @if (true) + { + + } + """); } [Fact] public void OnTypeCloseAngle_ClosesVoidHTMLTag_CodeBlock() { RunAutoInsertTest( -input: @" -@{ - $$ -} -", -expected: @" -@{ - -} -"); + input: """ + @{ + $$ + } + """, + expected: """ + @{ + + } + """); } [Fact] public void OnTypeCloseAngle_WithSlash_ClosesVoidHTMLTag() { RunAutoInsertTest( -input: @" - $$ -", -expected: @" - -"); + input: """ + $$ + """, + expected: """ + + """); } [Fact] public void OnTypeCloseAngle_WithSpace_ClosesVoidHTMLTag() { RunAutoInsertTest( -input: @" - $$ -", -expected: @" - -"); + input: """ + $$ + """, + expected: """ + + """); } [Fact] public void OnTypeCloseAngle_AutoInsertDisabled_Noops() { - Options = RazorLSPOptions.Default with { AutoClosingTags = false }; RunAutoInsertTest( -input: @" -
$$ -", -expected: @" -
-"); + input: """ +
$$ + """, + expected: """ +
+ """, + enableAutoClosingTags: false); } internal override IOnAutoInsertProvider CreateProvider() - { - var configService = StrictMock.Of(); - var optionsMonitor = new RazorLSPOptionsMonitor(configService, Options); - - var provider = new AutoClosingTagOnAutoInsertProvider(optionsMonitor); - return provider; - } + => new AutoClosingTagOnAutoInsertProvider(); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/CloseTextTagOnAutoInsertProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/CloseTextTagOnAutoInsertProviderTest.cs index 18fed07bd85..74b17456c4c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/CloseTextTagOnAutoInsertProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/CloseTextTagOnAutoInsertProviderTest.cs @@ -1,8 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis.Razor.AutoInsert; using Xunit; using Xunit.Abstractions; @@ -14,36 +13,30 @@ public class CloseTextTagOnAutoInsertProviderTest(ITestOutputHelper testOutput) public void OnTypeCloseAngle_ClosesTextTag() { RunAutoInsertTest( -input: @" -@{ - $$ -} -", -expected: @" -@{ - $0 -} -"); + input: """ + @{ + $$ + } + """, + expected: """ + @{ + $0 + } + """); } [Fact] public void OnTypeCloseAngle_OutsideRazorBlock_DoesNotCloseTextTag() { RunAutoInsertTest( -input: @" - $$ -", -expected: @" - -"); + input: """ + $$ + """, + expected: """ + + """); } - internal override IOnAutoInsertProvider CreateProvider() - { - var configService = StrictMock.Of(); - var optionsMonitor = new RazorLSPOptionsMonitor(configService, RazorLSPOptions.Default); - - var provider = new CloseTextTagOnAutoInsertProvider(optionsMonitor); - return provider; - } + internal override IOnAutoInsertProvider CreateProvider() => + new CloseTextTagOnAutoInsertProvider(); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs index 26b5acd8561..b5bb61530e2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.NetFx.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.AspNetCore.Razor.LanguageServer.Test; +using Microsoft.CodeAnalysis.Razor.AutoInsert; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; @@ -27,7 +28,15 @@ public async Task Handle_SingleProvider_InvokesProvider() var optionsMonitor = GetOptionsMonitor(); var insertProvider = new TestOnAutoInsertProvider(">", canResolve: true); var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + formattingService, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -69,7 +78,15 @@ public async Task Handle_MultipleProviderSameTrigger_UsesSuccessful() ResolvedTextEdit = VsLspFactory.CreateTextEdit(position: (0, 0), string.Empty) }; var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider1, insertProvider2], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider1, insertProvider2]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + formattingService, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -114,7 +131,15 @@ public async Task Handle_MultipleProviderSameTrigger_UsesFirstSuccessful() ResolvedTextEdit = VsLspFactory.CreateTextEdit(position: (0, 0), string.Empty) }; var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider1, insertProvider2], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider1, insertProvider2]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + formattingService, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -151,7 +176,15 @@ public async Task Handle_NoApplicableProvider_CallsProviderAndReturnsNull() var optionsMonitor = GetOptionsMonitor(); var insertProvider = new TestOnAutoInsertProvider(">", canResolve: false); var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + formattingService, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -186,7 +219,15 @@ public async Task Handle_OnTypeFormattingOff_Html_CallsLanguageServer() var optionsMonitor = GetOptionsMonitor(formatOnType: false); var insertProvider = new TestOnAutoInsertProvider("<", canResolve: false); var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + formattingService, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -219,7 +260,15 @@ public async Task Handle_AutoInsertAttributeQuotesOff_Html_DoesNotCallLanguageSe var optionsMonitor = GetOptionsMonitor(autoInsertAttributeQuotes: false); var insertProvider = new TestOnAutoInsertProvider("<", canResolve: false); var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + formattingService, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -357,7 +406,15 @@ private async Task VerifyCSharpOnAutoInsertAsync(string input, string expected, var optionsMonitor = GetOptionsMonitor(); var insertProvider = new TestOnAutoInsertProvider("!!!", canResolve: false); var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider], optionsMonitor, TestAdhocWorkspaceFactory.Instance, formattingService, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + formattingService, + LoggerFactory); var text = codeDocument.Source.Text; var @params = new VSInternalDocumentOnAutoInsertParams() diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs index d5c57f9abff..6811b702468 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/OnAutoInsertEndpointTest.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.Test; -using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.AutoInsert; using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; using Xunit.Abstractions; @@ -27,7 +27,16 @@ public async Task Handle_MultipleProviderUnmatchingTrigger_ReturnsNull() var optionsMonitor = GetOptionsMonitor(); var insertProvider1 = new TestOnAutoInsertProvider(">", canResolve: true); var insertProvider2 = new TestOnAutoInsertProvider("<", canResolve: true); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider1, insertProvider2], optionsMonitor, TestAdhocWorkspaceFactory.Instance, null!, LoggerFactory); + var autoInsertService = new AutoInsertService([insertProvider1, insertProvider2]); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + autoInsertService, + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + null!, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -61,7 +70,15 @@ public async Task Handle_DocumentNotFound_ReturnsNull() var optionsMonitor = GetOptionsMonitor(); var insertProvider = new TestOnAutoInsertProvider(">", canResolve: true); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider], optionsMonitor, TestAdhocWorkspaceFactory.Instance, null!, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + null!, + LoggerFactory); var uri = new Uri("file://path/test.razor"); var @params = new VSInternalDocumentOnAutoInsertParams() { @@ -97,7 +114,15 @@ public async Task Handle_UnsupportedCodeDocument_ReturnsNull() var documentContext = CreateDocumentContext(uri, codeDocument); var optionsMonitor = GetOptionsMonitor(); var insertProvider = new TestOnAutoInsertProvider(">", canResolve: true); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider], optionsMonitor, TestAdhocWorkspaceFactory.Instance, null!, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider]), + optionsMonitor, + TestAdhocWorkspaceFactory.Instance, + razorFormattingService: null!, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -131,7 +156,14 @@ public async Task Handle_OnTypeFormattingOff_CSharp_ReturnsNull() var documentContext = CreateDocumentContext(uri, codeDocument); var optionsMonitor = GetOptionsMonitor(formatOnType: false); var insertProvider = new TestOnAutoInsertProvider(">", canResolve: false); - var endpoint = new OnAutoInsertEndpoint(LanguageServerFeatureOptions, DocumentMappingService, languageServer, [insertProvider], optionsMonitor, TestAdhocWorkspaceFactory.Instance, null!, LoggerFactory); + var endpoint = new OnAutoInsertEndpoint( + LanguageServerFeatureOptions, + DocumentMappingService, + languageServer, + new AutoInsertService([insertProvider]), + optionsMonitor, TestAdhocWorkspaceFactory.Instance, + razorFormattingService: null!, + LoggerFactory); var @params = new VSInternalDocumentOnAutoInsertParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -161,12 +193,15 @@ private class TestOnAutoInsertProvider(string triggerCharacter, bool canResolve) public string TriggerCharacter { get; } = triggerCharacter; - // Disabling because [NotNullWhen] is available in two Assemblies and causes warnings - public bool TryResolveInsertion(Position position, FormattingContext context, [NotNullWhen(true)] out TextEdit? edit, out InsertTextFormat format) + public bool TryResolveInsertion( + Position position, + RazorCodeDocument codeDocument, + bool enableAutoClosingTags, + [NotNullWhen(true)] out VSInternalDocumentOnAutoInsertResponseItem? autoInsertEdit) { Called = true; - edit = ResolvedTextEdit!; - format = default; + autoInsertEdit = canResolve ? new() { TextEdit = ResolvedTextEdit!, TextEditFormat = InsertTextFormat.Plaintext } : null; + return canResolve; } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs index 2d77fa619a3..c5e809d705a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/AutoInsert/RazorOnAutoInsertProviderTestBase.cs @@ -6,14 +6,11 @@ using System; using System.Collections.Generic; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.LanguageServer.Test; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.CodeAnalysis.Razor.Formatting; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.AutoInsert; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Moq; using Xunit; using Xunit.Abstractions; @@ -28,7 +25,7 @@ protected RazorOnAutoInsertProviderTestBase(ITestOutputHelper testOutput) internal abstract IOnAutoInsertProvider CreateProvider(); - protected void RunAutoInsertTest(string input, string expected, int tabSize = 4, bool insertSpaces = true, string fileKind = default, IReadOnlyList tagHelpers = default) + protected void RunAutoInsertTest(string input, string expected, int tabSize = 4, bool insertSpaces = true, bool enableAutoClosingTags = true, string fileKind = default, IReadOnlyList tagHelpers = default) { // Arrange TestFileMarkupParser.GetPosition(input, out input, out var location); @@ -39,23 +36,14 @@ protected void RunAutoInsertTest(string input, string expected, int tabSize = 4, var path = "file:///path/to/document.razor"; var uri = new Uri(path); var codeDocument = CreateCodeDocument(source, uri.AbsolutePath, tagHelpers, fileKind: fileKind); - var options = new FormattingOptions() - { - TabSize = tabSize, - InsertSpaces = insertSpaces, - }; var provider = CreateProvider(); - using var context = FormattingContext.Create(uri, Mock.Of(MockBehavior.Strict), codeDocument, options, TestAdhocWorkspaceFactory.Instance); // Act - if (!provider.TryResolveInsertion(position, context, out var edit, out _)) - { - edit = null; - } + provider.TryResolveInsertion(position, codeDocument, enableAutoClosingTags: enableAutoClosingTags, out var edit); // Assert - var edited = edit is null ? source : ApplyEdit(source, edit); + var edited = edit is null ? source : ApplyEdit(source, edit.TextEdit); var actual = edited.ToString(); Assert.Equal(expected, actual); } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs index bd93514e88f..2f668586916 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/DefaultCSharpCodeActionProviderTest.cs @@ -333,7 +333,7 @@ private static RazorCodeActionContext CreateRazorCodeActionContext( codeDocument.SetCSharpDocument(csharpDocumentWithDiagnostic); var documentSnapshot = Mock.Of(document => - document.GetGeneratedOutputAsync() == Task.FromResult(codeDocument) && + document.GetGeneratedOutputAsync(It.IsAny()) == Task.FromResult(codeDocument) && document.GetTextAsync() == Task.FromResult(codeDocument.Source.Text) && document.Project.GetTagHelpersAsync(It.IsAny()) == new ValueTask>(tagHelpers), MockBehavior.Strict); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs index 610e0462269..86d1b8239e5 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CSharp/TypeAccessibilityCodeActionProviderTest.cs @@ -464,7 +464,7 @@ private static RazorCodeActionContext CreateRazorCodeActionContext( codeDocument.SetCSharpDocument(csharpDocumentWithDiagnostic); var documentSnapshot = Mock.Of(document => - document.GetGeneratedOutputAsync() == Task.FromResult(codeDocument) && + document.GetGeneratedOutputAsync(It.IsAny()) == Task.FromResult(codeDocument) && document.GetTextAsync() == Task.FromResult(codeDocument.Source.Text) && document.Project.GetTagHelpersAsync(It.IsAny()) == new ValueTask>(tagHelpers), MockBehavior.Strict); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs index 297848bba6c..8bcc81013b1 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Html/DefaultHtmlCodeActionProviderTest.cs @@ -152,7 +152,7 @@ private static RazorCodeActionContext CreateRazorCodeActionContext( var codeDocument = projectEngine.ProcessDesignTime(sourceDocument, FileKinds.Component, importSources: default, tagHelpers); var documentSnapshot = Mock.Of(document => - document.GetGeneratedOutputAsync() == Task.FromResult(codeDocument) && + document.GetGeneratedOutputAsync(It.IsAny()) == Task.FromResult(codeDocument) && document.GetTextAsync() == Task.FromResult(codeDocument.Source.Text) && document.Project.GetTagHelpersAsync(It.IsAny()) == new ValueTask>(tagHelpers), MockBehavior.Strict); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs index 56874c402da..2a0e033c4b5 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ComponentAccessibilityCodeActionProviderTest.cs @@ -464,7 +464,7 @@ private static RazorCodeActionContext CreateRazorCodeActionContext(VSCodeActionP codeDocument.SetCSharpDocument(csharpDocumentWithDiagnostic); var documentSnapshot = Mock.Of(document => - document.GetGeneratedOutputAsync() == Task.FromResult(codeDocument) && + document.GetGeneratedOutputAsync(It.IsAny()) == Task.FromResult(codeDocument) && document.GetTextAsync() == Task.FromResult(codeDocument.Source.Text) && document.Project.GetTagHelpersAsync(It.IsAny()) == new ValueTask>(tagHelpers), MockBehavior.Strict); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs index a0995f885a9..698d462b310 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToCodeBehindCodeActionProviderTest.cs @@ -396,7 +396,7 @@ private static RazorCodeActionContext CreateRazorCodeActionContext(VSCodeActionP codeDocument.SetSyntaxTree(syntaxTree); var documentSnapshot = Mock.Of(document => - document.GetGeneratedOutputAsync() == Task.FromResult(codeDocument) && + document.GetGeneratedOutputAsync(It.IsAny()) == Task.FromResult(codeDocument) && document.GetTextAsync() == Task.FromResult(codeDocument.Source.Text), MockBehavior.Strict); var sourceText = SourceText.From(text); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs index 52ee2ceb54a..3b814f35d33 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs @@ -216,7 +216,7 @@ public async Task Handle_NoTypeNameIdentifier_ReturnsNull() var builder = TagHelperDescriptorBuilder.Create("MyTagHelper", "MyAssembly"); var tagHelperDescriptor = builder.Build(); - var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync() == Task.FromResult(componentCodeDocument), MockBehavior.Strict); + var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync(It.IsAny()) == Task.FromResult(componentCodeDocument), MockBehavior.Strict); var uri = new Uri("file://path/test.razor"); var documentContextFactory = CreateDocumentContextFactory(uri, codeDocument); @@ -262,7 +262,7 @@ public async Task Handle_MultipleUris_ReturnsNull() var documentMappingService = Mock.Of( s => s.GetLanguageKind(codeDocument, It.IsAny(), It.IsAny()) == RazorLanguageKind.Html, MockBehavior.Strict); - var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync() == Task.FromResult(codeDocument), MockBehavior.Strict); + var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync(false) == Task.FromResult(codeDocument), MockBehavior.Strict); var uri = new Uri("file://path/test.razor"); var documentContextFactory = CreateDocumentContextFactory(uri, codeDocument); @@ -313,7 +313,7 @@ public async Task Handle_NotComponent_ReturnsNull() var documentMappingService = Mock.Of( s => s.GetLanguageKind(codeDocument, It.IsAny(), It.IsAny()) == RazorLanguageKind.Html, MockBehavior.Strict); - var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync() == Task.FromResult(codeDocument), MockBehavior.Strict); + var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync(false) == Task.FromResult(codeDocument), MockBehavior.Strict); var droppedUri = new Uri("file:///c:/path/MyTagHelper.cshtml"); var uri = new Uri("file://path/test.razor"); @@ -422,7 +422,7 @@ public async Task Handle_CSharp_ReturnsNull() s => s.GetLanguageKind(codeDocument, It.IsAny(), It.IsAny()) == RazorLanguageKind.CSharp && s.TryMapToGeneratedDocumentRange(csharpDocument, It.IsAny(), out projectedRange) == true, MockBehavior.Strict); - var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync() == Task.FromResult(codeDocument), MockBehavior.Strict); + var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync(false) == Task.FromResult(codeDocument), MockBehavior.Strict); var documentContextFactory = CreateDocumentContextFactory(uri, codeDocument); var response = (WorkspaceEdit?)null; @@ -466,7 +466,7 @@ public async Task Handle_DocumentNotFound_ReturnsNull() var documentMappingService = Mock.Of( s => s.GetLanguageKind(codeDocument, It.IsAny(), It.IsAny()) == RazorLanguageKind.Html, MockBehavior.Strict); - var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync() == Task.FromResult(codeDocument), MockBehavior.Strict); + var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync(false) == Task.FromResult(codeDocument), MockBehavior.Strict); var documentContextFactory = CreateDocumentContextFactory(uri, codeDocument); var response = (WorkspaceEdit?)null; @@ -511,7 +511,7 @@ public async Task Handle_UnsupportedCodeDocument_ReturnsNull() var documentMappingService = Mock.Of( s => s.GetLanguageKind(codeDocument, It.IsAny(), It.IsAny()) == RazorLanguageKind.Html, MockBehavior.Strict); - var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync() == Task.FromResult(codeDocument), MockBehavior.Strict); + var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync(false) == Task.FromResult(codeDocument), MockBehavior.Strict); var documentContextFactory = CreateDocumentContextFactory(uri, codeDocument); var response = new WorkspaceEdit(); @@ -555,7 +555,7 @@ public async Task Handle_NoUris_ReturnsNull() var documentMappingService = Mock.Of( s => s.GetLanguageKind(codeDocument, It.IsAny(), It.IsAny()) == RazorLanguageKind.Html, MockBehavior.Strict); - var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync() == Task.FromResult(codeDocument), MockBehavior.Strict); + var documentSnapshot = Mock.Of(s => s.GetGeneratedOutputAsync(false) == Task.FromResult(codeDocument), MockBehavior.Strict); var documentContextFactory = CreateDocumentContextFactory(uri, codeDocument); var response = (WorkspaceEdit?)null; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs index ba5973a36ef..f35c3dffeeb 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs @@ -132,7 +132,13 @@ private static FormattingContext CreateFormattingContext(SourceText source, int InsertSpaces = insertSpaces, }; - var context = FormattingContext.Create(uri, documentSnapshot, codeDocument, options, TestAdhocWorkspaceFactory.Instance); + var context = FormattingContext.Create( + uri, + documentSnapshot, + codeDocument, + options, + new LspFormattingCodeDocumentProvider(), + TestAdhocWorkspaceFactory.Instance); return context; } @@ -146,7 +152,7 @@ private static (RazorCodeDocument, IDocumentSnapshot) CreateCodeDocumentAndSnaps var documentSnapshot = new Mock(MockBehavior.Strict); documentSnapshot - .Setup(d => d.GetGeneratedOutputAsync()) + .Setup(d => d.GetGeneratedOutputAsync(It.IsAny())) .ReturnsAsync(codeDocument); documentSnapshot .Setup(d => d.TargetPath) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs index 60adc04a1fc..7ca4655ac5e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs @@ -129,7 +129,13 @@ private static FormattingContext CreateFormattingContext(SourceText source, int InsertSpaces = insertSpaces, }; - var context = FormattingContext.Create(uri, documentSnapshot, codeDocument, options, TestAdhocWorkspaceFactory.Instance); + var context = FormattingContext.Create( + uri, + documentSnapshot, + codeDocument, + options, + new LspFormattingCodeDocumentProvider(), + TestAdhocWorkspaceFactory.Instance); return context; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index 62221cac30b..dc8c6ddd2be 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -287,7 +287,7 @@ internal static IDocumentSnapshot CreateDocumentSnapshot(string path, ImmutableA { var documentSnapshot = new Mock(MockBehavior.Strict); documentSnapshot - .Setup(d => d.GetGeneratedOutputAsync()) + .Setup(d => d.GetGeneratedOutputAsync(It.IsAny())) .ReturnsAsync(codeDocument); documentSnapshot .Setup(d => d.FilePath) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs index 151cfc51df9..21b381771c8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs @@ -57,6 +57,9 @@ public static async Task CreateWithFullSupportAsync( new FormattingContentValidationPass(mappingService, loggerFactory), }; - return new RazorFormattingService(passes, TestAdhocWorkspaceFactory.Instance); + return new RazorFormattingService( + passes, + new LspFormattingCodeDocumentProvider(), + TestAdhocWorkspaceFactory.Instance); } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs index 411d6405171..4430868d72e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs @@ -923,7 +923,7 @@ public void Increment(){ var sourceText = SourceText.From(txt); var snapshot = Mock.Of(d => - d.GetGeneratedOutputAsync() == Task.FromResult(codeDocument) && + d.GetGeneratedOutputAsync(It.IsAny()) == Task.FromResult(codeDocument) && d.FilePath == path && d.FileKind == FileKinds.Component && d.GetTextAsync() == Task.FromResult(sourceText) && diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs index 748262ec53a..455da63ae60 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs @@ -937,7 +937,7 @@ private static DocumentContext CreateDocumentContext( .SetupGet(x => x.Project) .Returns(projectSnapshot.Object); documentSnapshotMock - .Setup(x => x.GetGeneratedOutputAsync()) + .Setup(x => x.GetGeneratedOutputAsync(It.IsAny())) .ReturnsAsync(document); documentSnapshotMock .Setup(x => x.GetTextAsync()) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs index 65c0670b26c..645bec36bae 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/ProjectSystem/TestDocumentSnapshot.cs @@ -79,7 +79,7 @@ public TestDocumentSnapshot(ProjectSnapshot projectSnapshot, DocumentState docum public HostDocument HostDocument => State.HostDocument; - public override Task GetGeneratedOutputAsync() + public override Task GetGeneratedOutputAsync(bool _) { if (_codeDocument is null) { diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs index 22c43a1a755..041b95c6eee 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.GoToDefinition; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; From ee83a6b9bbfbb722e6e3ac2eeb3a0f4a996a2977 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 30 Aug 2024 07:38:43 +1000 Subject: [PATCH 248/386] Fixes after merge --- .../Formatting/FormattingContext.cs | 4 +-- .../FormattingDiagnosticValidationPass.cs | 2 +- .../AutoInsert/RemoteAutoInsertService.cs | 21 +++++-------- .../Formatting/RemoteFormattingPasses.cs | 30 ------------------- .../RemoteRazorFormattingService.cs | 13 +++----- .../Formatting_NetFx/FormattingTestBase.cs | 17 +++-------- .../TestRazorFormattingService.cs | 4 ++- 7 files changed, 22 insertions(+), 69 deletions(-) delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingPasses.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs index 32233177efd..e0a16ef90d4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs @@ -313,12 +313,12 @@ public static FormattingContext CreateForOnTypeFormatting( char triggerCharacter) { return new FormattingContext( + codeDocumentProvider, + workspaceFactory, uri, originalSnapshot, codeDocument, options, - codeDocumentProvider, - workspaceFactory, automaticallyAddUsings, hostDocumentIndex, triggerCharacter); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/FormattingDiagnosticValidationPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/FormattingDiagnosticValidationPass.cs index a402d6b6c96..c223878de25 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/FormattingDiagnosticValidationPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/FormattingDiagnosticValidationPass.cs @@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; -internal class FormattingDiagnosticValidationPass(ILoggerFactory loggerFactory) : IFormattingPass +internal sealed class FormattingDiagnosticValidationPass(ILoggerFactory loggerFactory) : IFormattingPass { private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteAutoInsertService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteAutoInsertService.cs index 4c009c6b7ad..9793c86b68e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteAutoInsertService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/AutoInsert/RemoteAutoInsertService.cs @@ -19,7 +19,6 @@ using Response = Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; using RoslynFormattingOptions = Roslyn.LanguageServer.Protocol.FormattingOptions; using RoslynInsertTextFormat = Roslyn.LanguageServer.Protocol.InsertTextFormat; -using VsLspFormattingOptions = Microsoft.VisualStudio.LanguageServer.Protocol.FormattingOptions; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -171,7 +170,7 @@ private async ValueTask TryResolveInsertionInCSharpAsync( return Response.NoFurtherHandling; } - var razorFormattingOptions = new VsLspFormattingOptions() + var razorFormattingOptions = new RazorFormattingOptions() { InsertSpaces = !indentWithTabs, TabSize = indentSize @@ -180,33 +179,29 @@ private async ValueTask TryResolveInsertionInCSharpAsync( var vsLspTextEdit = VsLspFactory.CreateTextEdit( autoInsertResponseItem.TextEdit.Range.ToLinePositionSpan(), autoInsertResponseItem.TextEdit.NewText); - var mappedEdits = autoInsertResponseItem.TextEditFormat == RoslynInsertTextFormat.Snippet - ? await _razorFormattingService.FormatSnippetAsync( + var mappedEdit = autoInsertResponseItem.TextEditFormat == RoslynInsertTextFormat.Snippet + ? await _razorFormattingService.GetCSharpSnippetFormattingEditAsync( remoteDocumentContext, - RazorLanguageKind.CSharp, [vsLspTextEdit], razorFormattingOptions, cancellationToken) .ConfigureAwait(false) - : await _razorFormattingService.FormatOnTypeAsync( + : await _razorFormattingService.GetSingleCSharpEditAsync( remoteDocumentContext, - RazorLanguageKind.CSharp, - [vsLspTextEdit], + vsLspTextEdit, razorFormattingOptions, - hostDocumentIndex: 0, - triggerCharacter: '\0', cancellationToken) .ConfigureAwait(false); - if (mappedEdits is not [{ } edit]) + if (mappedEdit is null) { return Response.NoFurtherHandling; } return Response.Results( new RemoteAutoInsertTextEdit( - edit.Range.ToLinePositionSpan(), - edit.NewText, + mappedEdit.Range.ToLinePositionSpan(), + mappedEdit.NewText, autoInsertResponseItem.TextEditFormat)); } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingPasses.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingPasses.cs deleted file mode 100644 index 2ca3bda8a99..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingPasses.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System.Composition; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; -using Microsoft.CodeAnalysis.Razor.Formatting; -using Microsoft.CodeAnalysis.Razor.Logging; - -namespace Microsoft.CodeAnalysis.Remote.Razor.Formatting; - -[Export(typeof(IFormattingPass)), Shared] -[method: ImportingConstructor] -internal sealed class RemoteCSharpFormattingPass( - IDocumentMappingService documentMappingService, - ILoggerFactory loggerFactory) - : CSharpFormattingPass(documentMappingService, loggerFactory); - -[Export(typeof(IFormattingPass)), Shared] -[method: ImportingConstructor] -internal sealed class RemoteFormattingContentValidationPass( - IDocumentMappingService documentMappingService, - ILoggerFactory loggerFactory) - : FormattingContentValidationPass(documentMappingService, loggerFactory); - -[Export(typeof(IFormattingPass)), Shared] -[method: ImportingConstructor] -internal sealed class RemoteFormattingDiagnosticValidationPass( - IDocumentMappingService documentMappingService, - ILoggerFactory loggerFactory) - : FormattingDiagnosticValidationPass(documentMappingService, loggerFactory); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs index bff121bd4c0..7d9344fe3d0 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs @@ -1,22 +1,17 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Collections.Generic; using System.Composition; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Workspaces; namespace Microsoft.CodeAnalysis.Remote.Razor.Formatting; [Export(typeof(IRazorFormattingService)), Shared] [method: ImportingConstructor] -internal class RemoteRazorFormattingService( - [ImportMany] IEnumerable formattingPasses, - IFormattingCodeDocumentProvider codeDocumentProvider, - IAdhocWorkspaceFactory adhocWorkspaceFactory) - : RazorFormattingService( - formattingPasses, - codeDocumentProvider, - adhocWorkspaceFactory) +internal class RemoteRazorFormattingService(IFormattingCodeDocumentProvider codeDocumentProvider, IDocumentMappingService documentMappingService, IAdhocWorkspaceFactory adhocWorkspaceFactory, ILoggerFactory loggerFactory) + : RazorFormattingService(codeDocumentProvider, documentMappingService, adhocWorkspaceFactory, loggerFactory) { } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index 22d20e22845..8835b479edc 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -25,7 +25,6 @@ using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Microsoft.VisualStudio.Settings.Internal; using Moq; using Roslyn.Test.Utilities; using Xunit; @@ -83,14 +82,10 @@ private async Task RunFormattingTestAsync(string input, string expected, int tab var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, razorLSPOptions); var documentContext = new DocumentContext(uri, documentSnapshot, projectContext: null); - var projectManager = StrictMock.Of(); - var versionCache = new DocumentVersionCache(projectManager); - versionCache.TrackDocumentVersion(documentSnapshot, version: 1); - var client = new FormattingLanguageServerClient(LoggerFactory); client.AddCodeDocument(codeDocument); - var htmlFormatter = new HtmlFormatter(client, versionCache); + var htmlFormatter = new HtmlFormatter(client); var htmlEdits = await htmlFormatter.GetDocumentFormattingEditsAsync(documentSnapshot, uri, options, DisposalToken); // Act @@ -152,14 +147,10 @@ private protected async Task RunOnTypeFormattingTestAsync( } else { - var projectManager = StrictMock.Of(); - var versionCache = new DocumentVersionCache(projectManager); - versionCache.TrackDocumentVersion(documentSnapshot, version: 1); - var client = new FormattingLanguageServerClient(LoggerFactory); client.AddCodeDocument(codeDocument); - var htmlFormatter = new HtmlFormatter(client, versionCache); + var htmlFormatter = new HtmlFormatter(client); var htmlEdits = await htmlFormatter.GetDocumentFormattingEditsAsync(documentSnapshot, uri, options, DisposalToken); edits = await formattingService.GetHtmlOnTypeFormattingEditsAsync(documentContext, htmlEdits, razorOptions, hostDocumentIndex: positionAfterTrigger, triggerCharacter: triggerCharacter, DisposalToken); } @@ -292,7 +283,7 @@ @using Microsoft.AspNetCore.Components.Web ]); var projectEngine = RazorProjectEngine.Create( - new RazorConfiguration(RazorLanguageVersion.Latest, "TestConfiguration", ImmutableArray.Empty, new LanguageServerFlags(forceRuntimeCodeGeneration)), + new RazorConfiguration(RazorLanguageVersion.Latest, "TestConfiguration", Extensions: [], new LanguageServerFlags(forceRuntimeCodeGeneration)), projectFileSystem, builder => { @@ -301,7 +292,7 @@ @using Microsoft.AspNetCore.Components.Web RazorExtensions.Register(builder); }); - var codeDocument = projectEngine.ProcessDesignTime(sourceDocument, fileKind, ImmutableArray.Create(importsDocument), tagHelpers); + var codeDocument = projectEngine.ProcessDesignTime(sourceDocument, fileKind, [importsDocument], tagHelpers); if (!allowDiagnostics) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs index 01152568edc..fc10917be71 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs @@ -39,6 +39,8 @@ public static async Task CreateWithFullSupportAsync( await optionsMonitor.UpdateAsync(CancellationToken.None); } - return new RazorFormattingService(mappingService, TestAdhocWorkspaceFactory.Instance, loggerFactory); + var formattingCodeDocumentProvider = new LspFormattingCodeDocumentProvider(); + + return new RazorFormattingService(formattingCodeDocumentProvider, mappingService, TestAdhocWorkspaceFactory.Instance, loggerFactory); } } From 8dc0e5a518bec91e1f84b8132f5cb4d7c506bd03 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 30 Aug 2024 14:55:54 +1000 Subject: [PATCH 249/386] Bump WebTools and remove legacy CLaSP package --- Directory.Packages.props | 2 +- .../FormattingLanguageServerClient.cs | 4 +- .../Formatting_NetFx/WebTools.cs | 61 +++++++++++++------ ...spNetCore.Razor.LanguageServer.Test.csproj | 26 +------- 4 files changed, 49 insertions(+), 44 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8bfc1b8a0f2..19c6deb856d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,7 +5,7 @@ here should be _ prefixed to indicate that they are not meant to be used outside this file. --> - <_MicrosoftWebToolsPackageVersion>17.9.67-preview-0001 + <_MicrosoftWebToolsPackageVersion>17.11.11-preview-0001 <_MicrosoftVisualStudioShellPackagesVersion>17.11.39721 <_MicrosoftVisualStudioPackagesVersion>17.11.191 <_VisualStudioLanguageServerProtocolVersion>17.12.1-preview diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs index 5c77e198d46..66dc9647845 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs @@ -102,12 +102,12 @@ private async Task CallWebToolsApplyFormattedEd if (!contentTypeService.ContentTypes.Any(t => t.TypeName == HtmlContentTypeDefinition.HtmlContentType)) { - contentTypeService.AddContentType(HtmlContentTypeDefinition.HtmlContentType, new[] { StandardContentTypeNames.Text }); + contentTypeService.AddContentType(HtmlContentTypeDefinition.HtmlContentType, [StandardContentTypeNames.Text]); } var textBufferFactoryService = (ITextBufferFactoryService3)exportProvider.GetExportedValue(); var bufferManager = WebTools.BufferManager.New(contentTypeService, textBufferFactoryService, []); - var logger = new ClaspLoggingBridge(_loggerFactory); + var logger = _loggerFactory.GetOrCreateLogger("ApplyFormattedEditsHandler"); var applyFormatEditsHandler = WebTools.ApplyFormatEditsHandler.New(textBufferFactoryService, bufferManager, logger); // Make sure the buffer manager knows about the source document diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/WebTools.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/WebTools.cs index e29535214fa..ec0430afe16 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/WebTools.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/WebTools.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -extern alias LegacyClasp; - using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -10,7 +8,8 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.PooledObjects; -using Microsoft.CommonLanguageServerProtocol.Framework; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.VisualStudio.Settings.Internal; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Utilities; using Microsoft.WebTools.Languages.Shared.Editor.Composition; @@ -32,6 +31,7 @@ internal static class WebTools private const string ApplyFormatEditsParamTypeName = "Microsoft.WebTools.Languages.Shared.Editor.LanguageServer.ContainedLanguage.ApplyFormatEditsParam"; private const string ApplyFormatEditsResponseTypeName = "Microsoft.WebTools.Languages.Shared.Editor.LanguageServer.ContainedLanguage.ApplyFormatEditsResponse"; private const string TextChangeTypeName = "Microsoft.WebTools.Languages.Shared.Editor.EditorHelpers.TextChange"; + private const string LspLoggerTypeName = "Microsoft.WebTools.Languages.LanguageServer.Server.Shared.Clasp.LspLogger"; private static Assembly? s_serverAssembly; private static Assembly? s_editorAssembly; @@ -240,29 +240,56 @@ public async Task HandleRequestAsync( public static ApplyFormatEditsHandler New( ITextBufferFactoryService3 textBufferFactoryService, BufferManager bufferManager, - ILspLogger logger) + ILogger logger) { - var instance = CreateInstance(Type, textBufferFactoryService, bufferManager.Instance, new LegacyClaspILspLogger(logger)); + var instance = CreateInstance(Type, textBufferFactoryService, bufferManager.Instance, LspLogger.New(logger).Instance); return new(instance); } + } - /// - /// Wraps the razor logger (from the clasp source package) into the binary clasp logger that webtools uses. - /// - /// - private class LegacyClaspILspLogger(ILspLogger logger) : LegacyClasp.Microsoft.CommonLanguageServerProtocol.Framework.ILspLogger - { - public void LogEndContext(string message, params object[] @params) => logger.LogEndContext(message, @params); + public sealed class LspLogger(object instance) : ReflectedObject(instance) + { + private static Type? s_type; - public void LogError(string message, params object[] @params) => logger.LogError(message, @params); + public static Type Type + => s_type ?? InterlockedOperations.Initialize(ref s_type, + WebTools.GetType(ServerAssembly, LspLoggerTypeName)); - public void LogException(Exception exception, string? message = null, params object[] @params) => logger.LogException(exception, message, @params); + public static RequestContext New(ILogger logger) + { + var instance = CreateInstance(Type, new MicrosoftExtensionsLoggerWrapper(logger)); + return new(instance); + } - public void LogInformation(string message, params object[] @params) => logger.LogInformation(message, @params); + private class MicrosoftExtensionsLoggerWrapper(ILogger logger) : Microsoft.Extensions.Logging.ILogger + { + public IDisposable? BeginScope(TState state) where TState : notnull + { + return NoOpDisposable.Instance; + } - public void LogStartContext(string message, params object[] @params) => logger.LogStartContext(message, @params); + public bool IsEnabled(Microsoft.Extensions.Logging.LogLevel logLevel) + { + return true; + } - public void LogWarning(string message, params object[] @params) => logger.LogWarning(message, @params); + public void Log(Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, TState state, Exception? exception, Func formatter) + { + var message = formatter(state, exception); + var level = logLevel switch + { + Microsoft.Extensions.Logging.LogLevel.Trace => LogLevel.Trace, + Microsoft.Extensions.Logging.LogLevel.Debug => LogLevel.Debug, + Microsoft.Extensions.Logging.LogLevel.Information => LogLevel.Information, + Microsoft.Extensions.Logging.LogLevel.Warning => LogLevel.Warning, + Microsoft.Extensions.Logging.LogLevel.Error => LogLevel.Error, + Microsoft.Extensions.Logging.LogLevel.Critical => LogLevel.Critical, + Microsoft.Extensions.Logging.LogLevel.None => LogLevel.None, + _ => throw new NotImplementedException() + }; + + logger.Log(level, message); + } } } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj index ab200262e88..b50276628ee 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj @@ -6,18 +6,6 @@ $(DefineConstants);GENERATE_BASELINES $(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES - - - 4.7.0-1.23178.15 @@ -35,19 +23,9 @@ + - - - - - - - - true - LegacyClasp - - - + From 4d4e9ab735e6d16302e7e248ae7f4485a772dace Mon Sep 17 00:00:00 2001 From: David Barbet Date: Fri, 30 Aug 2024 15:19:30 -0700 Subject: [PATCH 250/386] Update PublishData after VS snap --- eng/config/PublishData.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/config/PublishData.json b/eng/config/PublishData.json index 0ed6c986efe..17180c95458 100644 --- a/eng/config/PublishData.json +++ b/eng/config/PublishData.json @@ -28,7 +28,7 @@ ], "vsBranch": "main", "vsMajorVersion": 17, - "insertionCreateDraftPR": true, + "insertionCreateDraftPR": false, "insertionTitlePrefix": "[d17.12 P3]" }, "release/dev17.6": { From 3ca44979ccf5fc3d4fad28466e8f589093bfb10c Mon Sep 17 00:00:00 2001 From: David Barbet Date: Fri, 30 Aug 2024 15:34:59 -0700 Subject: [PATCH 251/386] Update PublishData.json --- eng/config/PublishData.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/config/PublishData.json b/eng/config/PublishData.json index 17180c95458..60ddaded238 100644 --- a/eng/config/PublishData.json +++ b/eng/config/PublishData.json @@ -92,7 +92,7 @@ "Shipping", "NonShipping" ], - "vsBranch": "main", + "vsBranch": "rel/d17.12", "vsMajorVersion": 17, "insertionCreateDraftPR": false, "insertionTitlePrefix": "[d17.12 P2]" From 18c310725a019fa9843bf1e07770adac0f39bf0f Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 08:15:44 +1000 Subject: [PATCH 252/386] Skip flaky test --- .../RenameTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/RenameTests.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/RenameTests.cs index 37e533b0cca..697a10f79a8 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/RenameTests.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/RenameTests.cs @@ -60,7 +60,7 @@ public async Task Rename_ComponentAttribute_FromCSharpInRazor() await TestServices.Editor.VerifyTextContainsAsync("@ZooperDooper", ControlledHangMitigatingCancellationToken); } - [IdeFact] + [IdeFact(Skip = "https://github.com/dotnet/razor/issues/10820")] public async Task Rename_ComponentAttribute_FromCSharpInCSharp() { // Create the file From cb0ae1321eccd2fa29227199362f679dd0c043db Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 15:01:37 +1000 Subject: [PATCH 253/386] Move trigger characters and logic to the formatting service So it can be shared --- .../DocumentOnTypeFormattingEndpoint.cs | 48 ++----------------- .../Formatting/IRazorFormattingService.cs | 8 ++++ .../Formatting/RazorFormattingService.cs | 37 ++++++++++++++ .../DocumentOnTypeFormattingEndpointTest.cs | 37 +------------- .../FormattingLanguageServerTestBase.cs | 9 +++- .../RazorFormattingServiceTest.cs | 27 +++++++++++ 6 files changed, 87 insertions(+), 79 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs index e72d79f83ce..6568e9deb30 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs @@ -15,6 +15,7 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -36,20 +37,14 @@ internal class DocumentOnTypeFormattingEndpoint( private readonly IHtmlFormatter _htmlFormatter = htmlFormatter; private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); - private static readonly ImmutableArray s_allTriggerCharacters = ["}", ";", "\n", "{"]; - - private static readonly FrozenSet s_csharpTriggerCharacterSet = FrozenSet.ToFrozenSet(["}", ";"], StringComparer.Ordinal); - private static readonly FrozenSet s_htmlTriggerCharacterSet = FrozenSet.ToFrozenSet(["\n", "{", "}", ";"], StringComparer.Ordinal); - private static readonly FrozenSet s_allTriggerCharacterSet = s_allTriggerCharacters.ToFrozenSet(StringComparer.Ordinal); - public bool MutatesSolutionState => false; public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, VSInternalClientCapabilities clientCapabilities) { serverCapabilities.DocumentOnTypeFormattingProvider = new DocumentOnTypeFormattingOptions { - FirstTriggerCharacter = s_allTriggerCharacters[0], - MoreTriggerCharacter = s_allTriggerCharacters.AsSpan()[1..].ToArray(), + FirstTriggerCharacter = RazorFormattingService.AllTriggerCharacters[0], + MoreTriggerCharacter = RazorFormattingService.AllTriggerCharacters.AsSpan()[1..].ToArray(), }; } @@ -74,7 +69,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentOnTypeFormatting return null; } - if (!s_allTriggerCharacterSet.Contains(request.Character)) + if (!RazorFormattingService.AllTriggerCharacterSet.Contains(request.Character)) { _logger.LogWarning($"Unexpected trigger character '{request.Character}'."); return null; @@ -102,24 +97,13 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentOnTypeFormatting return null; } - var triggerCharacterKind = _documentMappingService.GetLanguageKind(codeDocument, hostDocumentIndex, rightAssociative: false); - if (triggerCharacterKind is not (RazorLanguageKind.CSharp or RazorLanguageKind.Html)) + if (_razorFormattingService.TryGetOnTypeFormattingTriggerKind(codeDocument, hostDocumentIndex, request.Character, out var triggerCharacterKind)) { - _logger.LogInformation($"Unsupported trigger character language {triggerCharacterKind:G}."); - return null; - } - - if (!IsApplicableTriggerCharacter(request.Character, triggerCharacterKind)) - { - // We were triggered but the trigger character doesn't make sense for the current cursor position. Bail. - _logger.LogInformation($"Unsupported trigger character location."); return null; } cancellationToken.ThrowIfCancellationRequested(); - Debug.Assert(request.Character.Length > 0); - var options = RazorFormattingOptions.From(request.Options, _optionsMonitor.CurrentValue.CodeBlockBraceOnNextLine); TextEdit[] formattedEdits; @@ -147,26 +131,4 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentOnTypeFormatting _logger.LogInformation($"Returning {formattedEdits.Length} final formatted results."); return formattedEdits; } - - private static bool IsApplicableTriggerCharacter(string triggerCharacter, RazorLanguageKind languageKind) - { - if (languageKind == RazorLanguageKind.CSharp) - { - return s_csharpTriggerCharacterSet.Contains(triggerCharacter); - } - else if (languageKind == RazorLanguageKind.Html) - { - return s_htmlTriggerCharacterSet.Contains(triggerCharacter); - } - - // Unknown trigger character. - return false; - } - - internal static class TestAccessor - { - public static ImmutableArray GetAllTriggerCharacters() => s_allTriggerCharacters; - public static FrozenSet GetCSharpTriggerCharacterSet() => s_csharpTriggerCharacterSet; - public static FrozenSet GetHtmlTriggerCharacterSet() => s_htmlTriggerCharacterSet; - } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/IRazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/IRazorFormattingService.cs index 1ad189e90fd..5974e7f18ad 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/IRazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/IRazorFormattingService.cs @@ -3,7 +3,9 @@ using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Formatting; @@ -49,4 +51,10 @@ Task GetCSharpOnTypeFormattingEditsAsync( TextEdit[] csharpEdits, RazorFormattingOptions options, CancellationToken cancellationToken); + + bool TryGetOnTypeFormattingTriggerKind( + RazorCodeDocument codeDocument, + int hostDocumentIndex, + string triggerCharacter, + out RazorLanguageKind triggerCharacterKind); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index d9f012ff881..ea201061f0b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; +using System.Collections.Frozen; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; @@ -11,6 +13,7 @@ using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -20,7 +23,14 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; internal class RazorFormattingService : IRazorFormattingService { + public static readonly ImmutableArray AllTriggerCharacters = ["}", ";", "\n", "{"]; + public static readonly FrozenSet AllTriggerCharacterSet = AllTriggerCharacters.ToFrozenSet(StringComparer.Ordinal); + + private static readonly FrozenSet s_csharpTriggerCharacterSet = FrozenSet.ToFrozenSet(["}", ";"], StringComparer.Ordinal); + private static readonly FrozenSet s_htmlTriggerCharacterSet = FrozenSet.ToFrozenSet(["\n", "{", "}", ";"], StringComparer.Ordinal); + private readonly IFormattingCodeDocumentProvider _codeDocumentProvider; + private readonly IDocumentMappingService _documentMappingService; private readonly IAdhocWorkspaceFactory _workspaceFactory; private readonly ImmutableArray _documentFormattingPasses; @@ -35,6 +45,7 @@ public RazorFormattingService( ILoggerFactory loggerFactory) { _codeDocumentProvider = codeDocumentProvider; + _documentMappingService = documentMappingService; _workspaceFactory = workspaceFactory; _htmlOnTypeFormattingPass = new HtmlOnTypeFormattingPass(loggerFactory); @@ -185,6 +196,26 @@ public Task GetHtmlOnTypeFormattingEditsAsync(DocumentContext docume return razorEdits.SingleOrDefault(); } + public bool TryGetOnTypeFormattingTriggerKind(RazorCodeDocument codeDocument, int hostDocumentIndex, string triggerCharacter, out RazorLanguageKind triggerCharacterKind) + { + triggerCharacterKind = _documentMappingService.GetLanguageKind(codeDocument, hostDocumentIndex, rightAssociative: false); + if (triggerCharacterKind is not (RazorLanguageKind.CSharp or RazorLanguageKind.Html)) + { + return false; + } + + if (triggerCharacterKind == RazorLanguageKind.CSharp) + { + return s_csharpTriggerCharacterSet.Contains(triggerCharacter); + } + else if (triggerCharacterKind == RazorLanguageKind.Html) + { + return s_htmlTriggerCharacterSet.Contains(triggerCharacter); + } + + return true; + } + private async Task ApplyFormattedEditsAsync( DocumentContext documentContext, TextEdit[] generatedDocumentEdits, @@ -279,4 +310,10 @@ private static void UnwrapCSharpSnippets(TextEdit[] razorEdits) edit.NewText = edit.NewText.Replace("/*$0*/", "$0"); } } + + internal static class TestAccessor + { + public static FrozenSet GetCSharpTriggerCharacterSet() => s_csharpTriggerCharacterSet; + public static FrozenSet GetHtmlTriggerCharacterSet() => s_htmlTriggerCharacterSet; + } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs index 776cb9a2957..5448d383abf 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs @@ -2,8 +2,6 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; @@ -19,37 +17,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; public class DocumentOnTypeFormattingEndpointTest(ITestOutputHelper testOutput) : FormattingLanguageServerTestBase(testOutput) { - [Fact] - public void AllTriggerCharacters_IncludesCSharpTriggerCharacters() - { - var allChars = DocumentOnTypeFormattingEndpoint.TestAccessor.GetAllTriggerCharacters(); - - foreach (var character in DocumentOnTypeFormattingEndpoint.TestAccessor.GetCSharpTriggerCharacterSet()) - { - Assert.Contains(character, allChars); - } - } - - [Fact] - public void AllTriggerCharacters_IncludesHtmlTriggerCharacters() - { - var allChars = DocumentOnTypeFormattingEndpoint.TestAccessor.GetAllTriggerCharacters(); - - foreach (var character in DocumentOnTypeFormattingEndpoint.TestAccessor.GetHtmlTriggerCharacterSet()) - { - Assert.Contains(character, allChars); - } - } - - [Fact] - public void AllTriggerCharacters_ContainsUniqueCharacters() - { - var allChars = DocumentOnTypeFormattingEndpoint.TestAccessor.GetAllTriggerCharacters(); - var distinctChars = allChars.Distinct().ToArray(); - - Assert.Equal(distinctChars, allChars); - } - [Fact] public async Task Handle_OnTypeFormatting_FormattingDisabled_ReturnsNull() { @@ -154,7 +121,7 @@ public async Task Handle_OnTypeFormatting_HtmlLanguageKind_ReturnsNull() var uri = new Uri("file://path/test.razor"); var documentContext = CreateDocumentContext(uri, codeDocument); - var formattingService = new DummyRazorFormattingService(); + var formattingService = new DummyRazorFormattingService(RazorLanguageKind.Html); var documentMappingService = new Mock(MockBehavior.Strict); documentMappingService.Setup(s => s.GetLanguageKind(codeDocument, 17, false)).Returns(RazorLanguageKind.Html); @@ -190,7 +157,7 @@ public async Task Handle_OnTypeFormatting_RazorLanguageKind_ReturnsNull() var uri = new Uri("file://path/test.razor"); var documentContext = CreateDocumentContext(uri, codeDocument); - var formattingService = new DummyRazorFormattingService(); + var formattingService = new DummyRazorFormattingService(RazorLanguageKind.Razor); var documentMappingService = new Mock(MockBehavior.Strict); documentMappingService.Setup(s => s.GetLanguageKind(codeDocument, 17, false)).Returns(RazorLanguageKind.Razor); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs index bf6ce5a569e..d14e475aa56 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit.Abstractions; using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; @@ -31,7 +32,7 @@ internal static RazorCodeDocument CreateCodeDocument(string content, ImmutableAr return codeDocument; } - internal class DummyRazorFormattingService : IRazorFormattingService + internal class DummyRazorFormattingService(RazorLanguageKind? languageKind = null) : IRazorFormattingService { public bool Called { get; private set; } @@ -65,5 +66,11 @@ public Task GetHtmlOnTypeFormattingEditsAsync(DocumentContext docume { throw new NotImplementedException(); } + + public bool TryGetOnTypeFormattingTriggerKind(RazorCodeDocument codeDocument, int hostDocumentIndex, string triggerCharacter, out RazorLanguageKind triggerCharacterKind) + { + triggerCharacterKind = languageKind ?? RazorLanguageKind.CSharp; + return languageKind is not null; + } } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs index 67a2f3e182d..b3d38ddd5bd 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs @@ -40,4 +40,31 @@ public class Foo{} Assert.Equal(multiEditChange.ToString(), singleEditChange.ToString()); } + + [Fact] + public void AllTriggerCharacters_IncludesCSharpTriggerCharacters() + { + foreach (var character in RazorFormattingService.TestAccessor.GetCSharpTriggerCharacterSet()) + { + Assert.Contains(character, RazorFormattingService.AllTriggerCharacters); + } + } + + [Fact] + public void AllTriggerCharacters_IncludesHtmlTriggerCharacters() + { + foreach (var character in RazorFormattingService.TestAccessor.GetHtmlTriggerCharacterSet()) + { + Assert.Contains(character, RazorFormattingService.AllTriggerCharacters); + } + } + + [Fact] + public void AllTriggerCharacters_ContainsUniqueCharacters() + { + var allChars = RazorFormattingService.AllTriggerCharacters; + var distinctChars = allChars.Distinct().ToArray(); + + Assert.Equal(distinctChars, allChars); + } } From 3da875b6fe51c63c4a3754f9a0352670f9aad35c Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 15:02:42 +1000 Subject: [PATCH 254/386] Create remote formatting service that delegates to the Razor formatting service --- eng/targets/Services.props | 1 + .../Formatting/RazorFormattingOptions.cs | 5 + .../Remote/IRemoteFormattingService.cs | 26 +++ .../Remote/RazorServices.cs | 1 + .../Formatting/RemoteFormattingService.cs | 175 ++++++++++++++++++ 5 files changed, 208 insertions(+) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingService.cs diff --git a/eng/targets/Services.props b/eng/targets/Services.props index b2476eab94a..03343f4a39a 100644 --- a/eng/targets/Services.props +++ b/eng/targets/Services.props @@ -29,5 +29,6 @@ + diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs index a0397ec80f5..a1ab2f6a3e3 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs @@ -1,17 +1,22 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System.Runtime.Serialization; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Formatting; +[DataContract] internal readonly record struct RazorFormattingOptions { public static readonly RazorFormattingOptions Default = new(); + [DataMember(Order = 0)] public bool InsertSpaces { get; init; } = true; + [DataMember(Order = 1)] public int TabSize { get; init; } = 4; + [DataMember(Order = 2)] public bool CodeBlockBraceOnNextLine { get; init; } = false; public RazorFormattingOptions() diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs new file mode 100644 index 00000000000..8a1b7aa3798 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.CodeAnalysis.Razor.Remote; + +internal interface IRemoteFormattingService +{ + ValueTask> GetDocumentFormattingEditsAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId documentId, ImmutableArray htmlChanges, RazorFormattingOptions options, CancellationToken cancellationToken); + ValueTask> GetRangeFormattingEditsAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId documentId, ImmutableArray htmlChanges, LinePositionSpan linePositionSpan, RazorFormattingOptions options, CancellationToken cancellationToken); + ValueTask> GetOnTypeFormattingEditsAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId documentId, ImmutableArray htmlChanges, LinePosition linePosition, string triggerCharacter, RazorFormattingOptions options, CancellationToken cancellationToken); + ValueTask GetOnTypeFormattingTriggerKindAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId documentId, LinePosition linePosition, string triggerCharacter, CancellationToken cancellationToken); + + internal enum TriggerKind + { + Invalid, + ValidHtml, + ValidCSharp, + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs index 558b737d4c4..1974d72c494 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs @@ -22,6 +22,7 @@ internal static class RazorServices (typeof(IRemoteFoldingRangeService), null), (typeof(IRemoteDocumentHighlightService), null), (typeof(IRemoteAutoInsertService), null), + (typeof(IRemoteFormattingService), null), ]; // Internal for testing diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingService.cs new file mode 100644 index 00000000000..e0dc5d35acb --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingService.cs @@ -0,0 +1,175 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Response = Microsoft.CodeAnalysis.Razor.Remote.IRemoteFormattingService.TriggerKind; + +namespace Microsoft.CodeAnalysis.Remote.Razor; + +internal sealed class RemoteFormattingService(in ServiceArgs args) : RazorDocumentServiceBase(in args), IRemoteFormattingService +{ + internal sealed class Factory : FactoryBase + { + protected override IRemoteFormattingService CreateService(in ServiceArgs args) + => new RemoteFormattingService(in args); + } + + private readonly IRazorFormattingService _formattingService = args.ExportProvider.GetExportedValue(); + + public ValueTask> GetDocumentFormattingEditsAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + ImmutableArray htmlChanges, + RazorFormattingOptions options, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => GetDocumentFormattingEditsAsync(context, htmlChanges, options, cancellationToken), + cancellationToken); + + private async ValueTask> GetDocumentFormattingEditsAsync( + RemoteDocumentContext context, + ImmutableArray htmlChanges, + RazorFormattingOptions options, + CancellationToken cancellationToken) + { + var sourceText = await context.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); + var htmlEdits = htmlChanges.Select(sourceText.GetTextEdit).ToArray(); + + var edits = await _formattingService.GetDocumentFormattingEditsAsync(context, htmlEdits, range: null, options, cancellationToken).ConfigureAwait(false); + + if (edits is null) + { + return ImmutableArray.Empty; + } + + return edits.SelectAsArray(sourceText.GetTextChange); + } + + public ValueTask> GetRangeFormattingEditsAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + ImmutableArray htmlChanges, + LinePositionSpan linePositionSpan, + RazorFormattingOptions options, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => GetRangeFormattingEditsAsync(context, htmlChanges, linePositionSpan, options, cancellationToken), + cancellationToken); + + private async ValueTask> GetRangeFormattingEditsAsync( + RemoteDocumentContext context, + ImmutableArray htmlChanges, + LinePositionSpan linePositionSpan, + RazorFormattingOptions options, + CancellationToken cancellationToken) + { + var sourceText = await context.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); + var htmlEdits = htmlChanges.Select(sourceText.GetTextEdit).ToArray(); + + var edits = await _formattingService.GetDocumentFormattingEditsAsync(context, htmlEdits, range: linePositionSpan.ToRange(), options, cancellationToken).ConfigureAwait(false); + + if (edits is null) + { + return ImmutableArray.Empty; + } + + return edits.SelectAsArray(sourceText.GetTextChange); + } + + public ValueTask> GetOnTypeFormattingEditsAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + ImmutableArray htmlChanges, + LinePosition linePosition, + string character, + RazorFormattingOptions options, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => GetOnTypeFormattingEditsAsync(context, htmlChanges, linePosition, character, options, cancellationToken), + cancellationToken); + + private async ValueTask> GetOnTypeFormattingEditsAsync(RemoteDocumentContext context, ImmutableArray htmlChanges, LinePosition linePosition, string triggerCharacter, RazorFormattingOptions options, CancellationToken cancellationToken) + { + var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + var sourceText = await context.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); + if (!sourceText.TryGetAbsoluteIndex(linePosition, out var hostDocumentIndex)) + { + return []; + } + + if (!_formattingService.TryGetOnTypeFormattingTriggerKind(codeDocument, hostDocumentIndex, triggerCharacter, out var triggerCharacterKind)) + { + return []; + } + + TextEdit[] result; + if (triggerCharacterKind is RazorLanguageKind.Html) + { + var htmlEdits = htmlChanges.Select(sourceText.GetTextEdit).ToArray(); + result = await _formattingService.GetHtmlOnTypeFormattingEditsAsync(context, htmlEdits, options, hostDocumentIndex, triggerCharacter[0], cancellationToken).ConfigureAwait(false); + } + else if (triggerCharacterKind is RazorLanguageKind.CSharp) + { + result = await _formattingService.GetCSharpOnTypeFormattingEditsAsync(context, options, hostDocumentIndex, triggerCharacter[0], cancellationToken).ConfigureAwait(false); + } + else + { + Assumed.Unreachable(); + return []; + } + + return result.SelectAsArray(sourceText.GetTextChange); + } + + public ValueTask GetOnTypeFormattingTriggerKindAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + LinePosition linePosition, + string triggerCharacter, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => IsValidOnTypeFormattingTriggerAsync(context, linePosition, triggerCharacter, cancellationToken), + cancellationToken); + + private async ValueTask IsValidOnTypeFormattingTriggerAsync(RemoteDocumentContext context, LinePosition linePosition, string triggerCharacter, CancellationToken cancellationToken) + { + var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + var sourceText = await context.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); + if (!sourceText.TryGetAbsoluteIndex(linePosition, out var hostDocumentIndex)) + { + return Response.Invalid; + } + + if (!_formattingService.TryGetOnTypeFormattingTriggerKind(codeDocument, hostDocumentIndex, triggerCharacter, out var triggerCharacterKind)) + { + return Response.Invalid; + } + + if (triggerCharacterKind is RazorLanguageKind.Html) + { + return Response.ValidHtml; + } + + return Response.ValidCSharp; + } +} From 2a266248b3638a991f2009a857797142d1db810d Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 15:03:10 +1000 Subject: [PATCH 255/386] Fix a bug from a previous PR --- .../Formatting/LspFormattingCodeDocumentProvider.cs | 4 ++-- .../Formatting/RazorFormattingService.cs | 2 +- .../Formatting/RemoteFormattingCodeDocumentProvider.cs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/LspFormattingCodeDocumentProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/LspFormattingCodeDocumentProvider.cs index eaf9bfa091b..e47da7f437d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/LspFormattingCodeDocumentProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/LspFormattingCodeDocumentProvider.cs @@ -12,7 +12,7 @@ internal sealed class LspFormattingCodeDocumentProvider : IFormattingCodeDocumen { public Task GetCodeDocumentAsync(IDocumentSnapshot snapshot) { - var useDesignTimeGeneratedOutput = snapshot.Project.Configuration.LanguageServerFlags?.ForceRuntimeCodeGeneration ?? false; - return snapshot.GetGeneratedOutputAsync(useDesignTimeGeneratedOutput); + // Formatting always uses design time + return snapshot.GetGeneratedOutputAsync(forceDesignTimeGeneratedOutput: true); } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index ea201061f0b..99d63fe9d32 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -233,7 +233,7 @@ private async Task ApplyFormattedEditsAsync( var documentSnapshot = documentContext.Snapshot; var uri = documentContext.Uri; - var codeDocument = await documentSnapshot.GetGeneratedOutputAsync().ConfigureAwait(false); + var codeDocument = await _codeDocumentProvider.GetCodeDocumentAsync(documentSnapshot).ConfigureAwait(false); using var context = FormattingContext.CreateForOnTypeFormatting( uri, documentSnapshot, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingCodeDocumentProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingCodeDocumentProvider.cs index 92a0ccd1ae6..64c90c21cb5 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingCodeDocumentProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingCodeDocumentProvider.cs @@ -14,6 +14,7 @@ internal sealed class RemoteFormattingCodeDocumentProvider : IFormattingCodeDocu { public Task GetCodeDocumentAsync(IDocumentSnapshot snapshot) { - return snapshot.GetGeneratedOutputAsync(); + // Formatting always uses design time + return snapshot.GetGeneratedOutputAsync(forceDesignTimeGeneratedOutput: true); } } From 90c7b476a58f755ccd886f53b3b59e5d5f2c2587 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 15:04:49 +1000 Subject: [PATCH 256/386] Move WebTools calling code to a shared layer --- .../FormattingLanguageServerClient.cs | 109 +++-------------- ...spNetCore.Razor.LanguageServer.Test.csproj | 13 -- .../Formatting_NetFx/HtmlFormatting.cs | 111 ++++++++++++++++++ .../Formatting_NetFx/WebTools.cs | 3 +- ...spNetCore.Razor.Test.Common.Tooling.csproj | 13 ++ 5 files changed, 142 insertions(+), 107 deletions(-) create mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormatting.cs rename src/Razor/test/{Microsoft.AspNetCore.Razor.LanguageServer.Test => Microsoft.AspNetCore.Razor.Test.Common.Tooling}/Formatting_NetFx/WebTools.cs (99%) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs index 66dc9647845..f647e7d31d6 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs @@ -3,25 +3,17 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.AspNetCore.Razor.PooledObjects; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.AspNetCore.Razor.Utilities; -using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Razor; +using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Formatting; -using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Microsoft.VisualStudio.Text; -using Microsoft.VisualStudio.Utilities; -using Microsoft.WebTools.Languages.Shared.ContentTypes; using Newtonsoft.Json.Linq; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; @@ -40,52 +32,28 @@ public void AddCodeDocument(RazorCodeDocument codeDocument) _documents.Add("/" + path, codeDocument); } - private Task FormatAsync(DocumentOnTypeFormattingParams @params) + private async Task FormatAsync(DocumentOnTypeFormattingParams @params) { var generatedHtml = GetGeneratedHtml(@params.TextDocument.Uri); - var generatedHtmlSource = SourceText.From(generatedHtml, Encoding.UTF8); - var absoluteIndex = generatedHtmlSource.GetRequiredAbsoluteIndex(@params.Position); - - var request = $$""" - { - "Options": - { - "UseSpaces": {{(@params.Options.InsertSpaces ? "true" : "false")}}, - "TabSize": {{@params.Options.TabSize}}, - "IndentSize": {{@params.Options.TabSize}} - }, - "Uri": "{{@params.TextDocument.Uri}}", - "GeneratedChanges": [], - "OperationType": "FormatOnType", - "SpanToFormat": - { - "Start": {{absoluteIndex}}, - "End": {{absoluteIndex}} - } - } - """; - - return CallWebToolsApplyFormattedEditsHandlerAsync(request, @params.TextDocument.Uri, generatedHtml); + + var edits = await HtmlFormatting.GetOnTypeFormattingEditsAsync(_loggerFactory, @params.TextDocument.Uri, generatedHtml, @params.Position, @params.Options.InsertSpaces, @params.Options.TabSize); + + return new() + { + Edits = edits + }; } - private Task FormatAsync(DocumentFormattingParams @params) + private async Task FormatAsync(DocumentFormattingParams @params) { var generatedHtml = GetGeneratedHtml(@params.TextDocument.Uri); - var request = $$""" - { - "Options": - { - "UseSpaces": {{(@params.Options.InsertSpaces ? "true" : "false")}}, - "TabSize": {{@params.Options.TabSize}}, - "IndentSize": {{@params.Options.TabSize}} - }, - "Uri": "{{@params.TextDocument.Uri}}", - "GeneratedChanges": [], - } - """; - - return CallWebToolsApplyFormattedEditsHandlerAsync(request, @params.TextDocument.Uri, generatedHtml); + var edits = await HtmlFormatting.GetDocumentFormattingEditsAsync(_loggerFactory, @params.TextDocument.Uri, generatedHtml, @params.Options.InsertSpaces, @params.Options.TabSize); + + return new() + { + Edits = edits + }; } private string GetGeneratedHtml(Uri uri) @@ -95,51 +63,6 @@ private string GetGeneratedHtml(Uri uri) return generatedHtml.Replace("\r", "").Replace("\n", "\r\n"); } - private async Task CallWebToolsApplyFormattedEditsHandlerAsync(string serializedValue, Uri documentUri, string generatedHtml) - { - var exportProvider = TestComposition.Editor.ExportProviderFactory.CreateExportProvider(); - var contentTypeService = exportProvider.GetExportedValue(); - - if (!contentTypeService.ContentTypes.Any(t => t.TypeName == HtmlContentTypeDefinition.HtmlContentType)) - { - contentTypeService.AddContentType(HtmlContentTypeDefinition.HtmlContentType, [StandardContentTypeNames.Text]); - } - - var textBufferFactoryService = (ITextBufferFactoryService3)exportProvider.GetExportedValue(); - var bufferManager = WebTools.BufferManager.New(contentTypeService, textBufferFactoryService, []); - var logger = _loggerFactory.GetOrCreateLogger("ApplyFormattedEditsHandler"); - var applyFormatEditsHandler = WebTools.ApplyFormatEditsHandler.New(textBufferFactoryService, bufferManager, logger); - - // Make sure the buffer manager knows about the source document - var textSnapshot = bufferManager.CreateBuffer( - documentUri: documentUri, - contentTypeName: HtmlContentTypeDefinition.HtmlContentType, - initialContent: generatedHtml, - snapshotVersionFromLSP: 0); - - var requestContext = WebTools.RequestContext.New(textSnapshot); - - var request = WebTools.ApplyFormatEditsParam.DeserializeFrom(serializedValue); - var response = await applyFormatEditsHandler.HandleRequestAsync(request, requestContext, CancellationToken.None); - - var sourceText = SourceText.From(generatedHtml); - - using var edits = new PooledArrayBuilder(); - - foreach (var textChange in response.TextChanges) - { - var span = new TextSpan(textChange.Position, textChange.Length); - var edit = VsLspFactory.CreateTextEdit(sourceText.GetRange(span), textChange.NewText); - - edits.Add(edit); - } - - return new() - { - Edits = edits.ToArray() - }; - } - public async Task SendRequestAsync(string method, TParams @params, CancellationToken cancellationToken) { if (@params is DocumentFormattingParams formattingParams && diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj index b50276628ee..685173189f4 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj @@ -13,19 +13,6 @@ - - - - - - - - - - - - - diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormatting.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormatting.cs new file mode 100644 index 00000000000..1879dfadf1d --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormatting.cs @@ -0,0 +1,111 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.AspNetCore.Razor.Test.Common.Mef; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.VisualStudio.Text; +using Microsoft.VisualStudio.Utilities; +using Microsoft.WebTools.Languages.Shared.ContentTypes; + +namespace Microsoft.CodeAnalysis.Razor.Formatting; + +internal static class HtmlFormatting +{ + public static Task GetDocumentFormattingEditsAsync(ILoggerFactory loggerFactory, Uri uri, string generatedHtml, bool insertSpaces, int tabSize) + { + var request = $$""" + { + "Options": + { + "UseSpaces": {{(insertSpaces ? "true" : "false")}}, + "TabSize": {{tabSize}}, + "IndentSize": {{tabSize}} + }, + "Uri": "{{uri}}", + "GeneratedChanges": [], + } + """; + + return CallWebToolsApplyFormattedEditsHandlerAsync(loggerFactory, request, uri, generatedHtml); + } + + public static Task GetOnTypeFormattingEditsAsync(ILoggerFactory loggerFactory, Uri uri, string generatedHtml, Position position, bool insertSpaces, int tabSize) + { + var generatedHtmlSource = SourceText.From(generatedHtml, Encoding.UTF8); + var absoluteIndex = generatedHtmlSource.GetRequiredAbsoluteIndex(position); + + var request = $$""" + { + "Options": + { + "UseSpaces": {{(insertSpaces ? "true" : "false")}}, + "TabSize": {{tabSize}}, + "IndentSize": {{tabSize}} + }, + "Uri": "{{uri}}", + "GeneratedChanges": [], + "OperationType": "FormatOnType", + "SpanToFormat": + { + "Start": {{absoluteIndex}}, + "End": {{absoluteIndex}} + } + } + """; + + return CallWebToolsApplyFormattedEditsHandlerAsync(loggerFactory, request, uri, generatedHtml); + } + + private static async Task CallWebToolsApplyFormattedEditsHandlerAsync(ILoggerFactory loggerFactory, string serializedValue, Uri documentUri, string generatedHtml) + { + var exportProvider = TestComposition.Editor.ExportProviderFactory.CreateExportProvider(); + var contentTypeService = exportProvider.GetExportedValue(); + + lock (contentTypeService) + { + if (!contentTypeService.ContentTypes.Any(t => t.TypeName == HtmlContentTypeDefinition.HtmlContentType)) + { + contentTypeService.AddContentType(HtmlContentTypeDefinition.HtmlContentType, [StandardContentTypeNames.Text]); + } + } + + var textBufferFactoryService = (ITextBufferFactoryService3)exportProvider.GetExportedValue(); + var bufferManager = WebTools.BufferManager.New(contentTypeService, textBufferFactoryService, []); + var logger = loggerFactory.GetOrCreateLogger("ApplyFormattedEditsHandler"); + var applyFormatEditsHandler = WebTools.ApplyFormatEditsHandler.New(textBufferFactoryService, bufferManager, logger); + + // Make sure the buffer manager knows about the source document + var textSnapshot = bufferManager.CreateBuffer( + documentUri: documentUri, + contentTypeName: HtmlContentTypeDefinition.HtmlContentType, + initialContent: generatedHtml, + snapshotVersionFromLSP: 0); + + var requestContext = WebTools.RequestContext.New(textSnapshot); + + var request = WebTools.ApplyFormatEditsParam.DeserializeFrom(serializedValue); + var response = await applyFormatEditsHandler.HandleRequestAsync(request, requestContext, CancellationToken.None); + + var sourceText = SourceText.From(generatedHtml); + + using var edits = new PooledArrayBuilder(); + + foreach (var textChange in response.TextChanges) + { + var span = new TextSpan(textChange.Position, textChange.Length); + var edit = VsLspFactory.CreateTextEdit(sourceText.GetRange(span), textChange.NewText); + + edits.Add(edit); + } + + return edits.ToArray(); + } +} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/WebTools.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/WebTools.cs similarity index 99% rename from src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/WebTools.cs rename to src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/WebTools.cs index ec0430afe16..1077a3b09ec 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/WebTools.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/WebTools.cs @@ -7,6 +7,7 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.VisualStudio.Settings.Internal; @@ -16,7 +17,7 @@ using Microsoft.WebTools.Languages.Shared.Editor.Text; using Newtonsoft.Json; -namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; +namespace Microsoft.CodeAnalysis.Razor.Formatting; /// /// Provides reflection-based access to the Web Tools LSP infrastructure needed for tests. diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj index 6caeb6b2982..89019499fa8 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj @@ -35,6 +35,19 @@ + + + + + + + + + + + + + From 2cbbdf56908fe13105a023ac97604084e1bf1128 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 15:05:10 +1000 Subject: [PATCH 257/386] Create cohosting endpoints --- .../CohostDocumentFormattingEndpoint.cs | 140 ++++++++++++++ .../Cohost/CohostOnTypeFormattingEndpoint.cs | 176 ++++++++++++++++++ .../Cohost/CohostRangeFormattingEndpoint.cs | 147 +++++++++++++++ 3 files changed, 463 insertions(+) create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentFormattingEndpoint.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostRangeFormattingEndpoint.cs diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentFormattingEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentFormattingEndpoint.cs new file mode 100644 index 00000000000..8589644a08a --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentFormattingEndpoint.cs @@ -0,0 +1,140 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Composition; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.VisualStudio.Razor.Settings; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(Methods.TextDocumentFormattingName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostDocumentFormattingEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostDocumentFormattingEndpoint( + IRemoteServiceInvoker remoteServiceInvoker, + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker, + IClientSettingsManager clientSettingsManager, + ILoggerFactory loggerFactory) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly IClientSettingsManager _clientSettingsManager = clientSettingsManager; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.TextDocument?.Formatting?.DynamicRegistration is true) + { + return new Registration() + { + Method = Methods.TextDocumentFormattingName, + RegisterOptions = new DocumentFormattingRegistrationOptions() + { + DocumentSelector = filter + } + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(DocumentFormattingParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(DocumentFormattingParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(request, context.TextDocument.AssumeNotNull(), cancellationToken); + + private async Task HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + _logger.LogDebug($"Getting Html formatting changes for {razorDocument.FilePath}"); + var htmlResult = await GetHtmlFormattingEditsAsync(request, razorDocument, cancellationToken).ConfigureAwait(false); + + if (htmlResult is not { } htmlEdits) + { + // We prefer to return null, so the client will try again + _logger.LogDebug($"Didn't get any edits back from Html"); + return null; + } + + var sourceText = await razorDocument.GetTextAsync(cancellationToken).ConfigureAwait(false); + var htmlChanges = htmlEdits.SelectAsArray(sourceText.GetTextChange); + + var options = RazorFormattingOptions.From(request.Options, _clientSettingsManager.GetClientSettings().AdvancedSettings.CodeBlockBraceOnNextLine); + + _logger.LogDebug($"Calling OOP with the {htmlChanges.Length} html edits, so it can fill in the rest"); + var remoteResult = await _remoteServiceInvoker.TryInvokeAsync>( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => service.GetDocumentFormattingEditsAsync(solutionInfo, razorDocument.Id, htmlChanges, options, cancellationToken), + cancellationToken).ConfigureAwait(false); + + if (remoteResult is [_, ..] allChanges) + { + _logger.LogDebug($"Got a total of {allChanges.Length} ranges back from OOP"); + + return allChanges.Select(sourceText.GetTextEdit).ToArray(); + } + + return null; + } + + private async Task GetHtmlFormattingEditsAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + request.TextDocument = request.TextDocument.WithUri(htmlDocument.Uri); + + _logger.LogDebug($"Requesting document formatting edits for {htmlDocument.Uri}"); + + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + htmlDocument.Buffer, + Methods.TextDocumentFormattingName, + RazorLSPConstants.HtmlLanguageServerName, + request, + cancellationToken).ConfigureAwait(false); + + if (result?.Response is null) + { + _logger.LogDebug($"Didn't get any ranges back from Html. Returning null so we can abandon the whole thing"); + return null; + } + + return result.Response; + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostDocumentFormattingEndpoint instance) + { + public Task HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(request, razorDocument, cancellationToken); + } +} + diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs new file mode 100644 index 00000000000..e5cd437628f --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs @@ -0,0 +1,176 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Composition; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.VisualStudio.Razor.Settings; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(Methods.TextDocumentOnTypeFormattingName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostOnTypeFormattingEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostOnTypeFormattingEndpoint( + IRemoteServiceInvoker remoteServiceInvoker, + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker, + IClientSettingsManager clientSettingsManager, + ILoggerFactory loggerFactory) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly IClientSettingsManager _clientSettingsManager = clientSettingsManager; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.TextDocument?.Formatting?.DynamicRegistration is true) + { + return new Registration() + { + Method = Methods.TextDocumentOnTypeFormattingName, + RegisterOptions = new DocumentOnTypeFormattingRegistrationOptions() + { + DocumentSelector = filter, + FirstTriggerCharacter = RazorFormattingService.AllTriggerCharacters[0], + MoreTriggerCharacter = RazorFormattingService.AllTriggerCharacters.AsSpan()[1..].ToArray(), + } + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(DocumentOnTypeFormattingParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(DocumentOnTypeFormattingParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(request, context.TextDocument.AssumeNotNull(), cancellationToken); + + private async Task HandleRequestAsync(DocumentOnTypeFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var clientSettings = _clientSettingsManager.GetClientSettings(); + if (!clientSettings.AdvancedSettings.FormatOnType) + { + _logger.LogInformation($"Formatting on type disabled."); + return null; + } + + if (!RazorFormattingService.AllTriggerCharacterSet.Contains(request.Character)) + { + _logger.LogWarning($"Unexpected trigger character '{request.Character}'."); + return null; + } + + // We have to go to OOP to find out if we want Html formatting for this request. This is a little unfortunate + // but just asking Html for formatting, just in case, would be bad for a couple of reasons. Firstly, the Html + // trigger characters are a superset of the C# triggers, so we can't use that as a sign. Secondly, whilst we + // might be making one Html request, it could be then calling CSS or TypeScript servers, so our single request + // to OOP could potentially save a few requests downstream. Lastly, our request to OOP is MessagePack which is + // generally faster than Json anyway. + var triggerKind = await _remoteServiceInvoker.TryInvokeAsync( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => service.GetOnTypeFormattingTriggerKindAsync(solutionInfo, razorDocument.Id, request.Position.ToLinePosition(), request.Character, cancellationToken), + cancellationToken).ConfigureAwait(false); + + if (triggerKind == IRemoteFormattingService.TriggerKind.Invalid) + { + return null; + } + + var sourceText = await razorDocument.GetTextAsync(cancellationToken).ConfigureAwait(false); + + ImmutableArray htmlChanges = []; + if (triggerKind == IRemoteFormattingService.TriggerKind.ValidHtml) + { + _logger.LogDebug($"Getting Html formatting changes for {razorDocument.FilePath}"); + var htmlResult = await GetHtmlFormattingEditsAsync(request, razorDocument, cancellationToken).ConfigureAwait(false); + + if (htmlResult is not { } htmlEdits) + { + // We prefer to return null, so the client will try again + _logger.LogDebug($"Didn't get any edits back from Html"); + return null; + } + + htmlChanges = htmlEdits.SelectAsArray(sourceText.GetTextChange); + } + + var options = RazorFormattingOptions.From(request.Options, clientSettings.AdvancedSettings.CodeBlockBraceOnNextLine); + + _logger.LogDebug($"Calling OOP with the {htmlChanges.Length} html edits, so it can fill in the rest"); + var remoteResult = await _remoteServiceInvoker.TryInvokeAsync>( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => service.GetOnTypeFormattingEditsAsync(solutionInfo, razorDocument.Id, htmlChanges, request.Position.ToLinePosition(), request.Character, options, cancellationToken), + cancellationToken).ConfigureAwait(false); + + if (remoteResult is [_, ..] allChanges) + { + _logger.LogDebug($"Got a total of {allChanges.Length} ranges back from OOP"); + + return allChanges.Select(sourceText.GetTextEdit).ToArray(); + } + + return null; + } + + private async Task GetHtmlFormattingEditsAsync(DocumentOnTypeFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + request.TextDocument = request.TextDocument.WithUri(htmlDocument.Uri); + + _logger.LogDebug($"Requesting document formatting edits for {htmlDocument.Uri}"); + + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + htmlDocument.Buffer, + Methods.TextDocumentOnTypeFormattingName, + RazorLSPConstants.HtmlLanguageServerName, + request, + cancellationToken).ConfigureAwait(false); + + if (result?.Response is null) + { + _logger.LogDebug($"Didn't get any ranges back from Html. Returning null so we can abandon the whole thing"); + return null; + } + + return result.Response; + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostOnTypeFormattingEndpoint instance) + { + public Task HandleRequestAsync(DocumentOnTypeFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(request, razorDocument, cancellationToken); + } +} + diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostRangeFormattingEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostRangeFormattingEndpoint.cs new file mode 100644 index 00000000000..9be30b7eabe --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostRangeFormattingEndpoint.cs @@ -0,0 +1,147 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Composition; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.VisualStudio.Razor.Settings; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(Methods.TextDocumentRangeFormattingName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostRangeFormattingEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostRangeFormattingEndpoint( + IRemoteServiceInvoker remoteServiceInvoker, + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker, + IClientSettingsManager clientSettingsManager, + ILoggerFactory loggerFactory) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly IClientSettingsManager _clientSettingsManager = clientSettingsManager; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.TextDocument?.Formatting?.DynamicRegistration is true) + { + return new Registration() + { + Method = Methods.TextDocumentRangeFormattingName, + RegisterOptions = new DocumentRangeFormattingRegistrationOptions() + { + DocumentSelector = filter + } + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(DocumentRangeFormattingParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(DocumentRangeFormattingParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(request, context.TextDocument.AssumeNotNull(), cancellationToken); + + private async Task HandleRequestAsync(DocumentRangeFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + _logger.LogDebug($"Getting Html formatting changes for {razorDocument.FilePath}"); + var htmlResult = await GetHtmlFormattingEditsAsync(request, razorDocument, cancellationToken).ConfigureAwait(false); + + if (htmlResult is not { } htmlEdits) + { + // We prefer to return null, so the client will try again + _logger.LogDebug($"Didn't get any edits back from Html"); + return null; + } + + var sourceText = await razorDocument.GetTextAsync(cancellationToken).ConfigureAwait(false); + var htmlChanges = htmlEdits.SelectAsArray(sourceText.GetTextChange); + + var options = RazorFormattingOptions.From(request.Options, _clientSettingsManager.GetClientSettings().AdvancedSettings.CodeBlockBraceOnNextLine); + + _logger.LogDebug($"Calling OOP with the {htmlChanges.Length} html edits, so it can fill in the rest"); + var remoteResult = await _remoteServiceInvoker.TryInvokeAsync>( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => service.GetRangeFormattingEditsAsync(solutionInfo, razorDocument.Id, htmlChanges, request.Range.ToLinePositionSpan(), options, cancellationToken), + cancellationToken).ConfigureAwait(false); + + if (remoteResult is [_, ..] allChanges) + { + _logger.LogDebug($"Got a total of {allChanges.Length} ranges back from OOP"); + + return allChanges.Select(sourceText.GetTextEdit).ToArray(); + } + + return null; + } + + private async Task GetHtmlFormattingEditsAsync(DocumentRangeFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + // We don't actually request range formatting results from Html, because our formatting engine can't deal with + // relative formatting results. Instead we request full document formatting, and filter the edits inside the + // formatting service to only the ones we care about. + var formattingRequest = new DocumentFormattingParams + { + TextDocument = request.TextDocument.WithUri(htmlDocument.Uri), + Options = request.Options + }; + + _logger.LogDebug($"Requesting document formatting edits for {htmlDocument.Uri}"); + + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + htmlDocument.Buffer, + Methods.TextDocumentFormattingName, + RazorLSPConstants.HtmlLanguageServerName, + formattingRequest, + cancellationToken).ConfigureAwait(false); + + if (result?.Response is null) + { + _logger.LogDebug($"Didn't get any ranges back from Html. Returning null so we can abandon the whole thing"); + return null; + } + + return result.Response; + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostRangeFormattingEndpoint instance) + { + public Task HandleRequestAsync(DocumentRangeFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(request, razorDocument, cancellationToken); + } +} + From 6c3b12be1e103dc4388605558dd3b6ea56b94677 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 15:05:36 +1000 Subject: [PATCH 258/386] Turn off the old endpoints --- .../Extensions/IServiceCollectionExtensions.cs | 14 +++++++++----- .../RazorLanguageServer.cs | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs index 5b5a1911208..b717027d9e7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs @@ -56,15 +56,19 @@ public static void AddLifeCycleServices(this IServiceCollection services, RazorL services.AddSingleton(clientConnection); } - public static void AddFormattingServices(this IServiceCollection services) + public static void AddFormattingServices(this IServiceCollection services, LanguageServerFeatureOptions featureOptions) { // Formatting - services.AddSingleton(); services.AddSingleton(); - services.AddHandlerWithCapabilities(); - services.AddHandlerWithCapabilities(); - services.AddHandlerWithCapabilities(); + if (!featureOptions.UseRazorCohostServer) + { + services.AddSingleton(); + + services.AddHandlerWithCapabilities(); + services.AddHandlerWithCapabilities(); + services.AddHandlerWithCapabilities(); + } } public static void AddCompletionServices(this IServiceCollection services) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index d3162a0e5b1..763edb83c35 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -135,7 +135,7 @@ protected override ILspServices ConstructLspServices() services.AddSemanticTokensServices(featureOptions); services.AddDocumentManagementServices(featureOptions); services.AddCompletionServices(); - services.AddFormattingServices(); + services.AddFormattingServices(featureOptions); services.AddCodeActionsServices(); services.AddOptionsServices(_lspOptions); services.AddHoverServices(); From a336b7fe2b1d92904392b7a9d1842662dcb22f24 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 15:06:09 +1000 Subject: [PATCH 259/386] Create basic tests These don't test the full capabilities of the formatting engine, just that it runs in cohosting --- .../CohostDocumentFormattingEndpointTest.cs | 144 ++++++++++++++++ .../CohostOnTypeFormattingEndpointTest.cs | 158 ++++++++++++++++++ .../CohostRangeFormattingEndpointTest.cs | 139 +++++++++++++++ 3 files changed, 441 insertions(+) create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs new file mode 100644 index 00000000000..3c8f9b268b0 --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs @@ -0,0 +1,144 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.AspNetCore.Razor.Test.Common.Mef; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.VisualStudio.Razor.Settings; +using Microsoft.VisualStudio.Threading; +using Roslyn.Test.Utilities; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +[UseExportProvider] +public class CohostDocumentFormattingEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +{ + // All of the formatting tests in the language server exercise the formatting engine and cover various edge cases + // and provide regression prevention. The tests here are not exhaustive, but they validate the the cohost endpoints + // call into the formatting engine at least, and handles C#, Html and Razor formatting changes correctly. + + [Fact] + public Task Formatting() + => VerifyDocumentFormattingAsync( + input: """ + @preservewhitespace true + +
+ + @{ +

+ @{ + var t = 1; + if (true) + { + + } + } +

+
+ @{ +
+
+ This is heavily nested +
+
+ } +
+ } + + @code { + private void M(string thisIsMyString) + { + var x = 5; + + var y = "Hello"; + + M("Hello"); + } + } + + """, + expected: """ + @preservewhitespace true + +
+ + @{ +

+ @{ + var t = 1; + if (true) + { + + } + } +

+
+ @{ +
+
+ This is heavily nested +
+
+ } +
+ } + + @code { + private void M(string thisIsMyString) + { + var x = 5; + + var y = "Hello"; + + M("Hello"); + } + } + + """); + + private async Task VerifyDocumentFormattingAsync(string input, string expected) + { + var document = CreateProjectAndRazorDocument(input); + var inputText = await document.GetTextAsync(DisposalToken); + + var htmlDocumentPublisher = new HtmlDocumentPublisher(RemoteServiceInvoker, StrictMock.Of(), StrictMock.Of(), LoggerFactory); + var generatedHtml = await htmlDocumentPublisher.GetHtmlSourceFromOOPAsync(document, DisposalToken); + Assert.NotNull(generatedHtml); + + var uri = new Uri(document.CreateUri(), $"{document.FilePath}{FeatureOptions.HtmlVirtualDocumentSuffix}"); + var htmlEdits = await HtmlFormatting.GetDocumentFormattingEditsAsync(LoggerFactory, uri, generatedHtml, insertSpaces: true, tabSize: 4); + + var requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentFormattingName, htmlEdits)]); + + var clientSettingsManager = new ClientSettingsManager(changeTriggers: []); + + var endpoint = new CohostDocumentFormattingEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker, clientSettingsManager, LoggerFactory); + + var request = new DocumentFormattingParams() + { + TextDocument = new TextDocumentIdentifier() { Uri = document.CreateUri() }, + Options = new FormattingOptions() + { + TabSize = 4, + InsertSpaces = true + } + }; + + var edits = await endpoint.GetTestAccessor().HandleRequestAsync(request, document, DisposalToken); + + var changes = edits.Select(inputText.GetTextChange); + var finalText = inputText.WithChanges(changes); + + AssertEx.EqualOrDiff(expected, finalText.ToString()); + } +} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs new file mode 100644 index 00000000000..b39ca778abe --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs @@ -0,0 +1,158 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.AspNetCore.Razor.Test.Common.Mef; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.VisualStudio.Razor.Settings; +using Microsoft.VisualStudio.TestPlatform.ObjectModel; +using Microsoft.VisualStudio.Threading; +using Roslyn.Test.Utilities; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +[UseExportProvider] +public class CohostOnTypeFormattingEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +{ + [Fact] + public async Task InvalidTrigger() + { + await VerifyOnTypeFormattingAsync( + input: """ + @{ + if(true){}$$ + } + """, + expected: """ + @{ + if(true){} + } + """, + triggerCharacter: 'h'); + } + + [Fact] + public async Task CSharp_InvalidTrigger() + { + await VerifyOnTypeFormattingAsync( + input: """ + @{ + if(true){}$$ + } + """, + expected: """ + @{ + if(true){} + } + """, + triggerCharacter: '\n'); + } + + [Fact] + public async Task CSharp() + { + await VerifyOnTypeFormattingAsync( + input: """ + @{ + if(true){}$$ + } + """, + expected: """ + @{ + if (true) { } + } + """, + triggerCharacter: '}'); + } + + [Fact] + public async Task FormatsSimpleHtmlTag_OnType() + { + await VerifyOnTypeFormattingAsync( + input: """ + + + Hello + + + + """, + expected: """ + + + Hello + + + + """, + triggerCharacter: ';', + html: true); + } + + private async Task VerifyOnTypeFormattingAsync(TestCode input, string expected, char triggerCharacter, bool html = false) + { + var document = CreateProjectAndRazorDocument(input.Text); + var inputText = await document.GetTextAsync(DisposalToken); + var position = inputText.GetPosition(input.Position); + + LSPRequestInvoker requestInvoker; + if (html) + { + var htmlDocumentPublisher = new HtmlDocumentPublisher(RemoteServiceInvoker, StrictMock.Of(), StrictMock.Of(), LoggerFactory); + var generatedHtml = await htmlDocumentPublisher.GetHtmlSourceFromOOPAsync(document, DisposalToken); + Assert.NotNull(generatedHtml); + + var uri = new Uri(document.CreateUri(), $"{document.FilePath}{FeatureOptions.HtmlVirtualDocumentSuffix}"); + var htmlEdits = await HtmlFormatting.GetOnTypeFormattingEditsAsync(LoggerFactory, uri, generatedHtml, position, insertSpaces: true, tabSize: 4); + + requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentOnTypeFormattingName, htmlEdits)]); + } + else + { + // We use a mock here so that it will throw if called + requestInvoker = StrictMock.Of(); + } + + var clientSettingsManager = new ClientSettingsManager(changeTriggers: []); + + var endpoint = new CohostOnTypeFormattingEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker, clientSettingsManager, LoggerFactory); + + var request = new DocumentOnTypeFormattingParams() + { + TextDocument = new TextDocumentIdentifier() { Uri = document.CreateUri() }, + Options = new FormattingOptions() + { + TabSize = 4, + InsertSpaces = true + }, + Character = triggerCharacter.ToString(), + Position = position + }; + + var edits = await endpoint.GetTestAccessor().HandleRequestAsync(request, document, DisposalToken); + + if (edits is null) + { + Assert.Equal(expected, input.Text); + return; + } + + var changes = edits.Select(inputText.GetTextChange); + var finalText = inputText.WithChanges(changes); + + AssertEx.EqualOrDiff(expected, finalText.ToString()); + } +} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs new file mode 100644 index 00000000000..32d03e28002 --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs @@ -0,0 +1,139 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.AspNetCore.Razor.Test.Common.Mef; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Formatting; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Microsoft.VisualStudio.Razor.Settings; +using Microsoft.VisualStudio.Threading; +using Roslyn.Test.Utilities; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +[UseExportProvider] +public class CohostRangeFormattingEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +{ + [Fact] + public Task RangeFormatting() + => VerifyRangeFormattingAsync( + input: """ + @preservewhitespace true + +
+ + @{ +

+ @{ + var t = 1; + if (true) + { + + } + } +

+ [|
+ @{ +
+
+ This is heavily nested +
+
+ } +
|] + } + + @code { + private void M(string thisIsMyString) + { + var x = 5; + + var y = "Hello"; + + M("Hello"); + } + } + """, + expected: """ + @preservewhitespace true + +
+ + @{ +

+ @{ + var t = 1; + if (true) + { + + } + } +

+
+ @{ +
+
+ This is heavily nested +
+
+ } +
+ } + + @code { + private void M(string thisIsMyString) + { + var x = 5; + + var y = "Hello"; + + M("Hello"); + } + } + """); + + private async Task VerifyRangeFormattingAsync(TestCode input, string expected) + { + var document = CreateProjectAndRazorDocument(input.Text); + var inputText = await document.GetTextAsync(DisposalToken); + + var htmlDocumentPublisher = new HtmlDocumentPublisher(RemoteServiceInvoker, StrictMock.Of(), StrictMock.Of(), LoggerFactory); + var generatedHtml = await htmlDocumentPublisher.GetHtmlSourceFromOOPAsync(document, DisposalToken); + Assert.NotNull(generatedHtml); + + var uri = new Uri(document.CreateUri(), $"{document.FilePath}{FeatureOptions.HtmlVirtualDocumentSuffix}"); + var htmlEdits = await HtmlFormatting.GetDocumentFormattingEditsAsync(LoggerFactory, uri, generatedHtml, insertSpaces: true, tabSize: 4); + + var requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentFormattingName, htmlEdits)]); + + var clientSettingsManager = new ClientSettingsManager(changeTriggers: []); + + var endpoint = new CohostRangeFormattingEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker, clientSettingsManager, LoggerFactory); + + var request = new DocumentRangeFormattingParams() + { + TextDocument = new TextDocumentIdentifier() { Uri = document.CreateUri() }, + Options = new FormattingOptions() + { + TabSize = 4, + InsertSpaces = true + }, + Range = inputText.GetRange(input.Span) + }; + + var edits = await endpoint.GetTestAccessor().HandleRequestAsync(request, document, DisposalToken); + + var changes = edits.Select(inputText.GetTextChange); + var finalText = inputText.WithChanges(changes); + + AssertEx.EqualOrDiff(expected, finalText.ToString()); + } +} From 55c51a3a9d0218c9983d01a68ad9a20fdaf5075f Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 2 Sep 2024 15:34:32 +1000 Subject: [PATCH 260/386] Apply suggestions from code review --- .../Formatting/RazorFormattingService.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index 99d63fe9d32..c5f28c682c7 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -199,21 +199,16 @@ public Task GetHtmlOnTypeFormattingEditsAsync(DocumentContext docume public bool TryGetOnTypeFormattingTriggerKind(RazorCodeDocument codeDocument, int hostDocumentIndex, string triggerCharacter, out RazorLanguageKind triggerCharacterKind) { triggerCharacterKind = _documentMappingService.GetLanguageKind(codeDocument, hostDocumentIndex, rightAssociative: false); - if (triggerCharacterKind is not (RazorLanguageKind.CSharp or RazorLanguageKind.Html)) - { - return false; - } - - if (triggerCharacterKind == RazorLanguageKind.CSharp) + if (triggerCharacterKind is RazorLanguageKind.CSharp) { return s_csharpTriggerCharacterSet.Contains(triggerCharacter); } - else if (triggerCharacterKind == RazorLanguageKind.Html) + else if (triggerCharacterKind is RazorLanguageKind.Html) { return s_htmlTriggerCharacterSet.Contains(triggerCharacter); } - return true; + return false; } private async Task ApplyFormattedEditsAsync( From 4a9669226e1d37fd2da827790dda66d2863b9211 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 2 Sep 2024 12:51:26 +0000 Subject: [PATCH 261/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240828.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 10.0.0-alpha.1.24421.1 -> To Version 10.0.0-alpha.1.24428.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6eecf640008..0e40c75311d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - bdd698774daa248301c236f09b97015610ca2842 + 6bcf90f99d13da86c5e9753a6f34b6484673d0a0 diff --git a/eng/Versions.props b/eng/Versions.props index 29508bb3e05..3e183febe6d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 10.0.0-alpha.1.24421.1 + 10.0.0-alpha.1.24428.1 9.0.0-beta.24352.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From 56128c3c26608077bb196ba6790ca44797c1fc2b Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 29 Aug 2024 17:42:10 +1000 Subject: [PATCH 262/386] Refactor out spell check endpoints to services, and clean up a little --- .../IServiceCollectionExtensions.cs | 3 + .../SpellCheck/DocumentSpellCheckEndpoint.cs | 187 ++---------------- .../SpellCheck/LspCSharpSpellCheckService.cs | 74 +++++++ .../SpellCheck/ICSharpSpellCheckService.cs | 14 ++ .../SpellCheck/ISpellCheckService.cs | 13 ++ .../SpellCheck/SpellCheckRange.cs | 6 + .../SpellCheck/SpellCheckService.cs | 137 +++++++++++++ .../DocumentSpellCheckEndpointTest.cs | 5 +- 8 files changed, 263 insertions(+), 176 deletions(-) create mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ISpellCheckService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckRange.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs index 5b5a1911208..bd27fef9adc 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs @@ -27,6 +27,7 @@ using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.SemanticTokens; +using Microsoft.CodeAnalysis.Razor.SpellCheck; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CommonLanguageServerProtocol.Framework; using Microsoft.Extensions.DependencyInjection; @@ -159,6 +160,8 @@ public static void AddTextDocumentServices(this IServiceCollection services, Lan services.AddHandlerWithCapabilities(); } + services.AddSingleton(); + services.AddSingleton(); services.AddHandlerWithCapabilities(); services.AddHandler(); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs index 625c7a6086b..5de64a1a7c9 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs @@ -2,38 +2,19 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; -using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; -using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.AspNetCore.Razor.PooledObjects; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; -using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.CodeAnalysis.Razor.Protocol; -using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.CodeAnalysis.Razor.SpellCheck; using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.AspNetCore.Razor.LanguageServer.SpellCheck; [RazorLanguageServerEndpoint(VSInternalMethods.TextDocumentSpellCheckableRangesName)] -internal sealed class DocumentSpellCheckEndpoint : IRazorRequestHandler, ICapabilitiesProvider +internal sealed class DocumentSpellCheckEndpoint( + ISpellCheckService spellCheckService) : IRazorRequestHandler, ICapabilitiesProvider { - private readonly IDocumentMappingService _documentMappingService; - private readonly LanguageServerFeatureOptions _languageServerFeatureOptions; - private readonly IClientConnection _clientConnection; - - public DocumentSpellCheckEndpoint( - IDocumentMappingService documentMappingService, - LanguageServerFeatureOptions languageServerFeatureOptions, - IClientConnection clientConnection) - { - _documentMappingService = documentMappingService ?? throw new ArgumentNullException(nameof(documentMappingService)); - _languageServerFeatureOptions = languageServerFeatureOptions ?? throw new ArgumentNullException(nameof(languageServerFeatureOptions)); - _clientConnection = clientConnection ?? throw new ArgumentNullException(nameof(clientConnection)); - } + private readonly ISpellCheckService _spellCheckService = spellCheckService; public bool MutatesSolutionState => false; @@ -43,14 +24,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V } public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentSpellCheckableParams request) - { - if (request.TextDocument is null) - { - throw new ArgumentNullException(nameof(request.TextDocument)); - } - - return request.TextDocument; - } + => request.TextDocument; public async Task HandleRequestAsync(VSInternalDocumentSpellCheckableParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) { @@ -60,150 +34,13 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentSpellC return null; } - using var _ = ListPool.GetPooledObject(out var ranges); - - await AddRazorSpellCheckRangesAsync(ranges, documentContext, cancellationToken).ConfigureAwait(false); - - if (_languageServerFeatureOptions.SingleServerSupport) - { - await AddCSharpSpellCheckRangesAsync(ranges, documentContext, cancellationToken).ConfigureAwait(false); - } - - return new[] - { - new VSInternalSpellCheckableRangeReport - { - Ranges = ConvertSpellCheckRangesToIntTriples(ranges), - ResultId = Guid.NewGuid().ToString() - } - }; - } - - private static async Task AddRazorSpellCheckRangesAsync(List ranges, DocumentContext documentContext, CancellationToken cancellationToken) - { - var tree = await documentContext.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); - - // We don't want to report spelling errors in script or style tags, so we avoid descending into them at all, which - // means we don't need complicated logic, and it performs a bit better. We assume any C# in them will still be reported - // by Roslyn. - // In an ideal world we wouldn't need this logic at all, as we would defer to the Html LSP server to provide spell checking - // but it doesn't currently support it. When that support is added, we can remove all of this but the RazorCommentBlockSyntax - // handling. - foreach (var node in tree.Root.DescendantNodes(n => n is not MarkupElementSyntax { StartTag.Name.Content: "script" or "style" })) - { - if (node is RazorCommentBlockSyntax commentBlockSyntax) - { - ranges.Add(new((int)VSInternalSpellCheckableRangeKind.Comment, commentBlockSyntax.Comment.SpanStart, commentBlockSyntax.Comment.Span.Length)); - } - else if (node is MarkupTextLiteralSyntax textLiteralSyntax) - { - // Attribute names are text literals, but we don't want to spell check them because either C# will, - // whether they're component attributes based on property names, or they come from tag helper attribute - // parameters as strings, or they're Html attributes which are not necessarily expected to be real words. - if (node.Parent is MarkupTagHelperAttributeSyntax or - MarkupAttributeBlockSyntax or - MarkupMinimizedAttributeBlockSyntax or - MarkupTagHelperDirectiveAttributeSyntax or - MarkupMinimizedTagHelperAttributeSyntax or - MarkupMinimizedTagHelperDirectiveAttributeSyntax or - MarkupMiscAttributeContentSyntax) - { - continue; - } - - // Text literals appear everywhere in Razor to hold newlines and indentation, so its worth saving the tokens - if (textLiteralSyntax.ContainsOnlyWhitespace()) - { - continue; - } - - if (textLiteralSyntax.Span.Length == 0) - { - continue; - } - - ranges.Add(new((int)VSInternalSpellCheckableRangeKind.String, textLiteralSyntax.SpanStart, textLiteralSyntax.Span.Length)); - } - } - } - - private async Task AddCSharpSpellCheckRangesAsync(List ranges, DocumentContext documentContext, CancellationToken cancellationToken) - { - var delegatedParams = new DelegatedSpellCheckParams(documentContext.GetTextDocumentIdentifierAndVersion()); - var delegatedResponse = await _clientConnection.SendRequestAsync( - CustomMessageNames.RazorSpellCheckEndpoint, - delegatedParams, - cancellationToken).ConfigureAwait(false); + var data = await _spellCheckService.GetSpellCheckRangeTriplesAsync(documentContext, cancellationToken).ConfigureAwait(false); - if (delegatedResponse is null) - { - return; - } - - var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var csharpDocument = codeDocument.GetCSharpDocument(); - - foreach (var report in delegatedResponse) - { - if (report.Ranges is not { } csharpRanges) - { - continue; - } - - // Since we get C# tokens that have relative starts, we need to convert them back to absolute indexes - // so we can sort them with the Razor tokens later - var absoluteCSharpStartIndex = 0; - for (var i = 0; i < csharpRanges.Length; i += 3) - { - var kind = csharpRanges[i]; - var start = csharpRanges[i + 1]; - var length = csharpRanges[i + 2]; - - absoluteCSharpStartIndex += start; - - // We need to map the start index to produce results, and we validate that we can map the end index so we don't have - // squiggles that go from C# into Razor/Html. - if (_documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteCSharpStartIndex, out var _1, out var hostDocumentIndex) && - _documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteCSharpStartIndex + length, out var _2, out var _3)) - { - ranges.Add(new(kind, hostDocumentIndex, length)); - } - - absoluteCSharpStartIndex += length; - } - } - } - - private static int[] ConvertSpellCheckRangesToIntTriples(List ranges) - { - // Important to sort first, or the client will just ignore anything we say - ranges.Sort(CompareSpellCheckRanges); - - using var _ = ListPool.GetPooledObject(out var data); - data.SetCapacityIfLarger(ranges.Count * 3); - - var lastAbsoluteEndIndex = 0; - foreach (var range in ranges) - { - if (range.Length == 0) - { - continue; - } - - data.Add(range.Kind); - data.Add(range.AbsoluteStartIndex - lastAbsoluteEndIndex); - data.Add(range.Length); - - lastAbsoluteEndIndex = range.AbsoluteStartIndex + range.Length; - } - - return data.ToArray(); - } - - private record struct SpellCheckRange(int Kind, int AbsoluteStartIndex, int Length); - - private static int CompareSpellCheckRanges(SpellCheckRange x, SpellCheckRange y) - { - return x.AbsoluteStartIndex.CompareTo(y.AbsoluteStartIndex); + return [new VSInternalSpellCheckableRangeReport + { + Ranges =data, + ResultId = Guid.NewGuid().ToString() + } + ]; } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckService.cs new file mode 100644 index 00000000000..764c9c1f31e --- /dev/null +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckService.cs @@ -0,0 +1,74 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.SpellCheck; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.AspNetCore.Razor.LanguageServer.SpellCheck; + +internal sealed class LspCSharpSpellCheckService( + LanguageServerFeatureOptions languageServerFeatureOptions, + IClientConnection clientConnection) : ICSharpSpellCheckService +{ + private readonly LanguageServerFeatureOptions _languageServerFeatureOptions = languageServerFeatureOptions; + private readonly IClientConnection _clientConnection = clientConnection; + + public async Task> GetCSharpSpellCheckRangesAsync(DocumentContext documentContext, CancellationToken cancellationToken) + { + if (!_languageServerFeatureOptions.SingleServerSupport) + { + return []; + } + + var delegatedParams = new DelegatedSpellCheckParams(documentContext.GetTextDocumentIdentifierAndVersion()); + var delegatedResponse = await _clientConnection.SendRequestAsync( + CustomMessageNames.RazorSpellCheckEndpoint, + delegatedParams, + cancellationToken).ConfigureAwait(false); + + if (delegatedResponse is null) + { + return []; + } + + using var ranges = new PooledArrayBuilder(); + foreach (var report in delegatedResponse) + { + if (report.Ranges is not { } csharpRanges) + { + continue; + } + + // Since we get C# tokens that have relative starts, we need to convert them back to absolute indexes + // so we can sort them with the Razor tokens later + var absoluteCSharpStartIndex = 0; + for (var i = 0; i < csharpRanges.Length; i += 3) + { + var kind = csharpRanges[i]; + var start = csharpRanges[i + 1]; + var length = csharpRanges[i + 2]; + + absoluteCSharpStartIndex += start; + + ranges.Add(new(kind, absoluteCSharpStartIndex, length)); + + absoluteCSharpStartIndex += length; + } + } + + return ranges.ToImmutable(); + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckService.cs new file mode 100644 index 00000000000..de7341567b6 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckService.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; + +namespace Microsoft.CodeAnalysis.Razor.SpellCheck; + +internal interface ICSharpSpellCheckService +{ + Task> GetCSharpSpellCheckRangesAsync(DocumentContext documentContext, CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ISpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ISpellCheckService.cs new file mode 100644 index 00000000000..dc45deee3b4 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ISpellCheckService.cs @@ -0,0 +1,13 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; + +namespace Microsoft.CodeAnalysis.Razor.SpellCheck; + +internal interface ISpellCheckService +{ + Task GetSpellCheckRangeTriplesAsync(DocumentContext documentContext, CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckRange.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckRange.cs new file mode 100644 index 00000000000..472d213f336 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckRange.cs @@ -0,0 +1,6 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +namespace Microsoft.CodeAnalysis.Razor.SpellCheck; + +internal readonly record struct SpellCheckRange(int Kind, int AbsoluteStartIndex, int Length); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs new file mode 100644 index 00000000000..78f0441e383 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs @@ -0,0 +1,137 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.Language.Syntax; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.CodeAnalysis.Razor.SpellCheck; + +internal class SpellCheckService( + ICSharpSpellCheckService csharpSpellCheckService, + IDocumentMappingService documentMappingService) : ISpellCheckService +{ + private readonly ICSharpSpellCheckService _csharpSpellCheckService = csharpSpellCheckService; + private readonly IDocumentMappingService _documentMappingService = documentMappingService; + + public async Task GetSpellCheckRangeTriplesAsync(DocumentContext documentContext, CancellationToken cancellationToken) + { + using var ranges = new PooledArrayBuilder(); + + var syntaxTree = await documentContext.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); + + AddRazorSpellCheckRanges(ref ranges.AsRef(), syntaxTree); + + var csharpRanges = await _csharpSpellCheckService.GetCSharpSpellCheckRangesAsync(documentContext, cancellationToken).ConfigureAwait(false); + + if (csharpRanges.Length > 0) + { + var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + AddCSharpSpellCheckRanges(ref ranges.AsRef(), csharpRanges, codeDocument); + } + + return ConvertSpellCheckRangesToIntTriples(ranges.ToImmutable()); + } + + private static void AddRazorSpellCheckRanges(ref PooledArrayBuilder ranges, RazorSyntaxTree syntaxTree) + { + // We don't want to report spelling errors in script or style tags, so we avoid descending into them at all, which + // means we don't need complicated logic, and it performs a bit better. We assume any C# in them will still be reported + // by Roslyn. + // In an ideal world we wouldn't need this logic at all, as we would defer to the Html LSP server to provide spell checking + // but it doesn't currently support it. When that support is added, we can remove all of this but the RazorCommentBlockSyntax + // handling. + foreach (var node in syntaxTree.Root.DescendantNodes(static n => n is not MarkupElementSyntax { StartTag.Name.Content: "script" or "style" })) + { + if (node is RazorCommentBlockSyntax commentBlockSyntax) + { + ranges.Add(new((int)VSInternalSpellCheckableRangeKind.Comment, commentBlockSyntax.Comment.SpanStart, commentBlockSyntax.Comment.Span.Length)); + } + else if (node is MarkupTextLiteralSyntax textLiteralSyntax) + { + // Attribute names are text literals, but we don't want to spell check them because either C# will, + // whether they're component attributes based on property names, or they come from tag helper attribute + // parameters as strings, or they're Html attributes which are not necessarily expected to be real words. + if (node.Parent is MarkupTagHelperAttributeSyntax or + MarkupAttributeBlockSyntax or + MarkupMinimizedAttributeBlockSyntax or + MarkupTagHelperDirectiveAttributeSyntax or + MarkupMinimizedTagHelperAttributeSyntax or + MarkupMinimizedTagHelperDirectiveAttributeSyntax or + MarkupMiscAttributeContentSyntax) + { + continue; + } + + // Text literals appear everywhere in Razor to hold newlines and indentation, so its worth saving the tokens + if (textLiteralSyntax.ContainsOnlyWhitespace()) + { + continue; + } + + if (textLiteralSyntax.Span.Length == 0) + { + continue; + } + + ranges.Add(new((int)VSInternalSpellCheckableRangeKind.String, textLiteralSyntax.SpanStart, textLiteralSyntax.Span.Length)); + } + } + } + + private void AddCSharpSpellCheckRanges(ref PooledArrayBuilder ranges, ImmutableArray csharpRanges, RazorCodeDocument codeDocument) + { + var csharpDocument = codeDocument.GetCSharpDocument(); + + foreach (var report in csharpRanges) + { + var absoluteCSharpStartIndex = report.AbsoluteStartIndex; + var length = report.Length; + + // We need to map the start index to produce results, and we validate that we can map the end index so we don't have + // squiggles that go from C# into Razor/Html. + if (_documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteCSharpStartIndex, out var _1, out var hostDocumentIndex) && + _documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteCSharpStartIndex + length, out var _2, out var _3)) + { + ranges.Add(new(report.Kind, hostDocumentIndex, length)); + } + } + } + + private static int[] ConvertSpellCheckRangesToIntTriples(ImmutableArray ranges) + { + // Important to sort first as we're calculating relative indexes + ranges = ranges.OrderAsArray(CompareSpellCheckRanges); + + using var data = new PooledArrayBuilder(ranges.Length * 3); + + var lastAbsoluteEndIndex = 0; + foreach (var range in ranges) + { + if (range.Length == 0) + { + continue; + } + + data.Add(range.Kind); + data.Add(range.AbsoluteStartIndex - lastAbsoluteEndIndex); + data.Add(range.Length); + + lastAbsoluteEndIndex = range.AbsoluteStartIndex + range.Length; + } + + return data.ToArray(); + } + + private static int CompareSpellCheckRanges(SpellCheckRange x, SpellCheckRange y) + { + return x.AbsoluteStartIndex.CompareTo(y.AbsoluteStartIndex); + } +} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs index 72f9c894e4f..5e547834463 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; +using Microsoft.CodeAnalysis.Razor.SpellCheck; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -174,7 +175,9 @@ private async Task ValidateSpellCheckRangesAsync(string originalInput, string? f var documentContext = CreateDocumentContext(uri, codeDocument); var requestContext = new RazorRequestContext(documentContext, null!, "lsp/method", uri: null); - var endpoint = new DocumentSpellCheckEndpoint(DocumentMappingService, LanguageServerFeatureOptions, languageServer); + var csharpSpellCheckService = new LspCSharpSpellCheckService(LanguageServerFeatureOptions, languageServer); + var spellCheckService = new SpellCheckService(csharpSpellCheckService, DocumentMappingService); + var endpoint = new DocumentSpellCheckEndpoint(spellCheckService); var request = new VSInternalDocumentSpellCheckableParams { From 4a44a99239697e3a5b9d5efcbf5a65ef029433da Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 3 Sep 2024 08:47:03 +1000 Subject: [PATCH 263/386] Create cohost spell check endpoints and services --- eng/targets/Services.props | 1 + .../IServiceCollectionExtensions.cs | 9 ++- .../SpellCheck/DocumentSpellCheckEndpoint.cs | 14 ++-- .../Remote/IRemoteSpellCheckService.cs | 16 ++++ .../Remote/RazorServices.cs | 1 + .../SpellCheck/OOPSpellCheckService.cs | 17 ++++ .../RemoteCSharpSpellCheckService.cs | 30 +++++++ .../SpellCheck/RemoteSpellCheckService.cs | 34 ++++++++ .../CohostDocumentSpellCheckEndpoint.cs | 80 +++++++++++++++++++ .../CohostWorkspaceSpellCheckEndpoint.cs | 34 ++++++++ 10 files changed, 226 insertions(+), 10 deletions(-) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSpellCheckService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/OOPSpellCheckService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteSpellCheckService.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSpellCheckEndpoint.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostWorkspaceSpellCheckEndpoint.cs diff --git a/eng/targets/Services.props b/eng/targets/Services.props index b2476eab94a..e2db181385e 100644 --- a/eng/targets/Services.props +++ b/eng/targets/Services.props @@ -29,5 +29,6 @@ +
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs index bd27fef9adc..e4a7dc87af7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs @@ -158,12 +158,13 @@ public static void AddTextDocumentServices(this IServiceCollection services, Lan { services.AddHandlerWithCapabilities(); services.AddHandlerWithCapabilities(); + + services.AddSingleton(); + services.AddSingleton(); + services.AddHandlerWithCapabilities(); + services.AddHandler(); } - services.AddSingleton(); - services.AddSingleton(); - services.AddHandlerWithCapabilities(); - services.AddHandler(); services.AddHandlerWithCapabilities(); services.AddHandler(); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs index 5de64a1a7c9..aa2173d784d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs @@ -36,11 +36,13 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentSpellC var data = await _spellCheckService.GetSpellCheckRangeTriplesAsync(documentContext, cancellationToken).ConfigureAwait(false); - return [new VSInternalSpellCheckableRangeReport - { - Ranges =data, - ResultId = Guid.NewGuid().ToString() - } - ]; + return + [ + new VSInternalSpellCheckableRangeReport + { + Ranges =data, + ResultId = Guid.NewGuid().ToString() + } + ]; } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSpellCheckService.cs new file mode 100644 index 00000000000..f7233564653 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSpellCheckService.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; + +namespace Microsoft.CodeAnalysis.Razor.Remote; + +internal interface IRemoteSpellCheckService +{ + ValueTask GetSpellCheckRangeTriplesAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId razorDocumentId, + CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs index 558b737d4c4..a4e46afb63b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs @@ -22,6 +22,7 @@ internal static class RazorServices (typeof(IRemoteFoldingRangeService), null), (typeof(IRemoteDocumentHighlightService), null), (typeof(IRemoteAutoInsertService), null), + (typeof(IRemoteSpellCheckService), null), ]; // Internal for testing diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/OOPSpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/OOPSpellCheckService.cs new file mode 100644 index 00000000000..f34e86b686d --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/OOPSpellCheckService.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.SpellCheck; + +namespace Microsoft.CodeAnalysis.Remote.Razor.SpellCheck; + +[Export(typeof(ISpellCheckService)), Shared] +[method: ImportingConstructor] +internal sealed class OOPSpellCheckService( + ICSharpSpellCheckService csharpSpellCheckService, + IDocumentMappingService documentMappingService) + : SpellCheckService(csharpSpellCheckService, documentMappingService) +{ +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckService.cs new file mode 100644 index 00000000000..d2779d745ab --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckService.cs @@ -0,0 +1,30 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using System.Composition; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.SpellCheck; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; + +namespace Microsoft.CodeAnalysis.Remote.Razor.SpellCheck; + +[Export(typeof(ICSharpSpellCheckService)), Shared] +[method: ImportingConstructor] +internal class RemoteCSharpSpellCheckService() : ICSharpSpellCheckService +{ + public async Task> GetCSharpSpellCheckRangesAsync(DocumentContext documentContext, CancellationToken cancellationToken) + { + // We have a razor document, lets find the generated C# document + Debug.Assert(documentContext is RemoteDocumentContext, "This method only works on document snapshots created in the OOP process"); + var snapshot = (RemoteDocumentSnapshot)documentContext.Snapshot; + var generatedDocument = await snapshot.GetGeneratedDocumentAsync().ConfigureAwait(false); + + var csharpRanges = await ExternalAccess.Razor.Cohost.Handlers.SpellCheck.GetSpellCheckSpansAsync(generatedDocument, cancellationToken).ConfigureAwait(false); + + return csharpRanges.SelectAsArray(r => new SpellCheckRange((int)r.Kind, r.StartIndex, r.Length)); + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteSpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteSpellCheckService.cs new file mode 100644 index 00000000000..161fbf7b5e3 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteSpellCheckService.cs @@ -0,0 +1,34 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Razor.SpellCheck; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; + +namespace Microsoft.CodeAnalysis.Remote.Razor; + +internal sealed partial class RemoteSpellCheckService(in ServiceArgs args) : RazorDocumentServiceBase(in args), IRemoteSpellCheckService +{ + internal sealed class Factory : FactoryBase + { + protected override IRemoteSpellCheckService CreateService(in ServiceArgs args) + => new RemoteSpellCheckService(in args); + } + + private readonly ISpellCheckService _spellCheckService = args.ExportProvider.GetExportedValue(); + + public ValueTask GetSpellCheckRangeTriplesAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId razorDocumentId, CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + razorDocumentId, + context => GetSpellCheckRangeTriplesAsync(context, cancellationToken), + cancellationToken); + + private async ValueTask GetSpellCheckRangeTriplesAsync(RemoteDocumentContext context, CancellationToken cancellationToken) + { + return await _spellCheckService.GetSpellCheckRangeTriplesAsync(context, cancellationToken).ConfigureAwait(false); + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSpellCheckEndpoint.cs new file mode 100644 index 00000000000..9aa87a0cd69 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSpellCheckEndpoint.cs @@ -0,0 +1,80 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(VSInternalMethods.TextDocumentSpellCheckableRangesName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostDocumentSpellCheckEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostDocumentSpellCheckEndpoint( + IRemoteServiceInvoker remoteServiceInvoker) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.SupportsVisualStudioExtensions) + { + return new Registration + { + Method = VSInternalMethods.TextDocumentSpellCheckableRangesName, + RegisterOptions = new TextDocumentRegistrationOptions() + { + DocumentSelector = filter + } + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(VSInternalDocumentSpellCheckableParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(VSInternalDocumentSpellCheckableParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(context.TextDocument.AssumeNotNull(), cancellationToken); + + private async Task HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken) + { + var data = await _remoteServiceInvoker.TryInvokeAsync( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => service.GetSpellCheckRangeTriplesAsync(solutionInfo, razorDocument.Id, cancellationToken), + cancellationToken).ConfigureAwait(false); + + return + [ + new VSInternalSpellCheckableRangeReport + { + Ranges = data, + ResultId = Guid.NewGuid().ToString() + } + ]; + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostDocumentSpellCheckEndpoint instance) + { + public Task HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(razorDocument, cancellationToken); + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostWorkspaceSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostWorkspaceSpellCheckEndpoint.cs new file mode 100644 index 00000000000..cad02498732 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostWorkspaceSpellCheckEndpoint.cs @@ -0,0 +1,34 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Threading; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.VisualStudio.LanguageServer.Protocol; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(VSInternalMethods.WorkspaceSpellCheckableRangesName)] +[ExportCohostStatelessLspService(typeof(CohostWorkspaceSpellCheckEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostWorkspaceSpellCheckEndpoint( + IRemoteServiceInvoker remoteServiceInvoker) + : AbstractRazorCohostRequestHandler +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => false; + + // Razor files generally don't do anything at the workspace level + + protected override Task HandleRequestAsync(VSInternalWorkspaceSpellCheckableParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => SpecializedTasks.EmptyArray(); +} From 391f3227044b4de829c4fb900d06a6e79c2e5836 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 3 Sep 2024 09:31:12 +1000 Subject: [PATCH 264/386] Test --- .../TestCode.cs | 3 + .../CohostDocumentSpellCheckEndpointTest.cs | 100 ++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSpellCheckEndpointTest.cs diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs index d19cbc5281e..6930bda0d33 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs @@ -10,6 +10,7 @@ namespace Microsoft.AspNetCore.Razor.Test.Common; internal readonly struct TestCode { + public string OriginalInput { get; } public string Text { get; } public ImmutableArray Positions { get; } @@ -17,6 +18,8 @@ internal readonly struct TestCode public TestCode(string input, bool treatPositionIndicatorsAsCode = false) { + OriginalInput = input; + if (treatPositionIndicatorsAsCode) { TestFileMarkupParser.GetSpans(input, treatPositionIndicatorsAsCode, out var text, out var nameToSpanMap); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSpellCheckEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSpellCheckEndpointTest.cs new file mode 100644 index 00000000000..6711a4bdc2b --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSpellCheckEndpointTest.cs @@ -0,0 +1,100 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis.Text; +using Roslyn.Test.Utilities; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +public class CohostDocumentSpellCheckEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +{ + [Fact] + public async Task Handle() + { + var input = """ + @page [|"this is csharp"|] + +
[| + + Eat more chickin. + + |]
+ + + + + + @{ var [|x|] = [|"csharp"|]; + + @*[| Eat more chickin. |]*@ + +
+ + @code + { + void [|M|]() + { + [|// Eat more chickin|] + } + } + """; + + await VerifySemanticTokensAsync(input); + } + + private async Task VerifySemanticTokensAsync(TestCode input) + { + var document = CreateProjectAndRazorDocument(input.Text); + var sourceText = await document.GetTextAsync(DisposalToken); + + var endpoint = new CohostDocumentSpellCheckEndpoint(RemoteServiceInvoker); + + var span = new LinePositionSpan(new(0, 0), new(sourceText.Lines.Count, 0)); + + var result = await endpoint.GetTestAccessor().HandleRequestAsync(document, DisposalToken); + + var ranges = result.First().Ranges.AssumeNotNull(); + + // To make for easier test failure analysis, we convert the ranges back to the test input, so we can show a diff + // rather than "Expected 23, got 53" and leave the developer to deal with what that means. + // As a bonus, this also ensures the ranges array has the right number of elements (ie, multiple of 3) + var absoluteRanges = new List<(int Start, int End)>(); + var absoluteStart = 0; + for (var i = 0; i < ranges.Length; i += 3) + { + var kind = ranges[i]; + var start = ranges[i + 1]; + var length = ranges[i + 2]; + + absoluteStart += start; + absoluteRanges.Add((absoluteStart, absoluteStart + length)); + absoluteStart += length; + } + + // Make sure the response is sorted correctly, or the IDE will complain + Assert.True(absoluteRanges.SequenceEqual(absoluteRanges.OrderBy(r => r.Start)), "Results are not in order!"); + + absoluteRanges.Reverse(); + + var actual = input.Text; + foreach (var (start, end) in absoluteRanges) + { + actual = actual.Insert(end, "|]").Insert(start, "[|"); + } + + AssertEx.EqualOrDiff(input.OriginalInput, actual); + } +} From a7cd940cd7800ce5e791ac9033d9a495f9944cf3 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 3 Sep 2024 16:21:10 +1000 Subject: [PATCH 265/386] Cohost go to implementation --- eng/targets/Services.props | 1 + .../RazorLanguageServer.cs | 4 +- .../IRemoteGoToImplementationService.cs | 19 ++ .../Remote/RazorServices.cs | 1 + .../RemoteGoToDefinitionService.cs | 15 +- .../RemoteGoToImplementationService.cs | 111 ++++++++++++ .../RazorDocumentServiceBase.cs | 33 +++- .../CohostGoToImplementationEndpoint.cs | 153 ++++++++++++++++ .../CohostGoToImplementationEndpointTest.cs | 166 ++++++++++++++++++ 9 files changed, 484 insertions(+), 19 deletions(-) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToImplementationService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToImplementation/RemoteGoToImplementationService.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToImplementationEndpoint.cs create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs diff --git a/eng/targets/Services.props b/eng/targets/Services.props index b2476eab94a..07c6ab44565 100644 --- a/eng/targets/Services.props +++ b/eng/targets/Services.props @@ -29,5 +29,6 @@ + diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index d3162a0e5b1..f1034646716 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -184,10 +184,10 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption // Transient because it should only be used once and I'm hoping it doesn't stick around. services.AddTransient(sp => sp.GetRequiredService()); - services.AddHandlerWithCapabilities(); - if (!featureOptions.UseRazorCohostServer) { + services.AddHandlerWithCapabilities(); + services.AddSingleton(); services.AddHandlerWithCapabilities(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToImplementationService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToImplementationService.cs new file mode 100644 index 00000000000..41311404578 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteGoToImplementationService.cs @@ -0,0 +1,19 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; +using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; + +namespace Microsoft.CodeAnalysis.Razor.Remote; + +internal interface IRemoteGoToImplementationService : IRemoteJsonService +{ + ValueTask> GetImplementationAsync( + JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, + JsonSerializableDocumentId razorDocumentId, + RoslynPosition position, + CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs index 558b737d4c4..1a86184e8a2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs @@ -32,6 +32,7 @@ internal static class RazorServices (typeof(IRemoteInlayHintService), null), (typeof(IRemoteDocumentSymbolService), null), (typeof(IRemoteRenameService), null), + (typeof(IRemoteGoToImplementationService), null), ]; private const string ComponentName = "Razor"; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs index 58d6abd3e0a..6169c994349 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToDefinition/RemoteGoToDefinitionService.cs @@ -58,20 +58,7 @@ protected override IRemoteGoToDefinitionService CreateService(in ServiceArgs arg return NoFurtherHandling; } - var positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex); - - if (positionInfo.LanguageKind == RazorLanguageKind.Html) - { - // Sometimes Html can actually be mapped to C#, like for example component attributes, which map to - // C# properties, even though they appear entirely in a Html context. Since remapping is pretty cheap - // it's easier to just try mapping, and see what happens, rather than checking for specific syntax nodes. - if (DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), positionInfo.HostDocumentIndex, out VsPosition? csharpPosition, out _)) - { - // We're just gonna pretend this mapped perfectly normally onto C#. Moving this logic to the actual position info - // calculating code is possible, but could have untold effects, so opt-in is better (for now?) - positionInfo = positionInfo with { LanguageKind = RazorLanguageKind.CSharp, Position = csharpPosition }; - } - } + var positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex, preferCSharpOverHtml: true); if (positionInfo.LanguageKind is RazorLanguageKind.Html or RazorLanguageKind.Razor) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToImplementation/RemoteGoToImplementationService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToImplementation/RemoteGoToImplementationService.cs new file mode 100644 index 00000000000..7121cd6dbf0 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/GoToImplementation/RemoteGoToImplementationService.cs @@ -0,0 +1,111 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Protocol; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Remote.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.LanguageServer.Protocol; +using static Microsoft.CodeAnalysis.Razor.Remote.RemoteResponse; +using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; +using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; +using RoslynPosition = Roslyn.LanguageServer.Protocol.Position; +using VsPosition = Microsoft.VisualStudio.LanguageServer.Protocol.Position; + +namespace Microsoft.CodeAnalysis.Remote.Razor; + +internal sealed class RemoteGoToImplementationService(in ServiceArgs args) : RazorDocumentServiceBase(in args), IRemoteGoToImplementationService +{ + internal sealed class Factory : FactoryBase + { + protected override IRemoteGoToImplementationService CreateService(in ServiceArgs args) + => new RemoteGoToImplementationService(in args); + } + + protected override IDocumentPositionInfoStrategy DocumentPositionInfoStrategy => PreferAttributeNameDocumentPositionInfoStrategy.Instance; + + public ValueTask> GetImplementationAsync( + JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, + JsonSerializableDocumentId documentId, + RoslynPosition position, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => GetImplementationAsync(context, position, cancellationToken), + cancellationToken); + + private async ValueTask> GetImplementationAsync( + RemoteDocumentContext context, + RoslynPosition position, + CancellationToken cancellationToken) + { + var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + + if (!codeDocument.Source.Text.TryGetAbsoluteIndex(position, out var hostDocumentIndex)) + { + return NoFurtherHandling; + } + + var positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex, preferCSharpOverHtml: true); + + if (positionInfo.LanguageKind is RazorLanguageKind.Razor) + { + return NoFurtherHandling; + } + + if (positionInfo.LanguageKind is RazorLanguageKind.Html) + { + return CallHtml; + } + + if (!DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), positionInfo.HostDocumentIndex, out var mappedPosition, out _)) + { + // If we can't map to the generated C# file, we're done. + return NoFurtherHandling; + } + + // Finally, call into C#. + var generatedDocument = await context.Snapshot.GetGeneratedDocumentAsync().ConfigureAwait(false); + + var locations = await ExternalHandlers.GoToImplementation + .FindImplementationsAsync( + generatedDocument, + mappedPosition, + supportsVisualStudioExtensions: true, + cancellationToken) + .ConfigureAwait(false); + + if (locations is null and not []) + { + // C# didn't return anything, so we're done. + return NoFurtherHandling; + } + + // Map the C# locations back to the Razor file. + using var mappedLocations = new PooledArrayBuilder(locations.Length); + + foreach (var location in locations) + { + var (uri, range) = location; + + var (mappedDocumentUri, mappedRange) = await DocumentMappingService + .MapToHostDocumentUriAndRangeAsync(context.Snapshot, uri, range.ToLinePositionSpan(), cancellationToken) + .ConfigureAwait(false); + + var mappedLocation = RoslynLspFactory.CreateLocation(mappedDocumentUri, mappedRange); + + mappedLocations.Add(mappedLocation); + } + + return Results(mappedLocations.ToArray()); + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs index 9327d9931e7..557fc66d271 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RazorDocumentServiceBase.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -24,11 +25,34 @@ internal abstract class RazorDocumentServiceBase(in ServiceArgs args) : RazorBro protected virtual IDocumentPositionInfoStrategy DocumentPositionInfoStrategy { get; } = DefaultDocumentPositionInfoStrategy.Instance; protected DocumentPositionInfo GetPositionInfo(RazorCodeDocument codeDocument, int hostDocumentIndex) + => GetPositionInfo(codeDocument, hostDocumentIndex, preferCSharpOverHtml: false); + + protected DocumentPositionInfo GetPositionInfo(RazorCodeDocument codeDocument, int hostDocumentIndex, bool preferCSharpOverHtml) { - return DocumentPositionInfoStrategy.GetPositionInfo(DocumentMappingService, codeDocument, hostDocumentIndex); + var positionInfo = DocumentPositionInfoStrategy.GetPositionInfo(DocumentMappingService, codeDocument, hostDocumentIndex); + + if (preferCSharpOverHtml && positionInfo.LanguageKind == RazorLanguageKind.Html) + { + // Sometimes Html can actually be mapped to C#, like for example component attributes, which map to + // C# properties, even though they appear entirely in a Html context. Since remapping is pretty cheap + // it's easier to just try mapping, and see what happens, rather than checking for specific syntax nodes. + if (DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), positionInfo.HostDocumentIndex, out VsPosition? csharpPosition, out _)) + { + // We're just gonna pretend this mapped perfectly normally onto C#. Moving this logic to the actual position info + // calculating code is possible, but could have untold effects, so opt-in is better (for now?) + + // TODO: Not using a with operator here because it doesn't work in OOP for some reason. + positionInfo = new DocumentPositionInfo(RazorLanguageKind.CSharp, csharpPosition, positionInfo.HostDocumentIndex); + } + } + + return positionInfo; } protected bool TryGetDocumentPositionInfo(RazorCodeDocument codeDocument, RoslynPosition position, out DocumentPositionInfo positionInfo) + => TryGetDocumentPositionInfo(codeDocument, position, preferCSharpOverHtml: false, out positionInfo); + + protected bool TryGetDocumentPositionInfo(RazorCodeDocument codeDocument, RoslynPosition position, bool preferCSharpOverHtml, out DocumentPositionInfo positionInfo) { if (!codeDocument.Source.Text.TryGetAbsoluteIndex(position, out var hostDocumentIndex)) { @@ -36,11 +60,14 @@ protected bool TryGetDocumentPositionInfo(RazorCodeDocument codeDocument, Roslyn return false; } - positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex); + positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex, preferCSharpOverHtml); return true; } protected bool TryGetDocumentPositionInfo(RazorCodeDocument codeDocument, VsPosition position, out DocumentPositionInfo positionInfo) + => TryGetDocumentPositionInfo(codeDocument, position, preferCSharpOverHtml: false, out positionInfo); + + protected bool TryGetDocumentPositionInfo(RazorCodeDocument codeDocument, VsPosition position, bool preferCSharpOverHtml, out DocumentPositionInfo positionInfo) { if (!codeDocument.Source.Text.TryGetAbsoluteIndex(position, out var hostDocumentIndex)) { @@ -48,7 +75,7 @@ protected bool TryGetDocumentPositionInfo(RazorCodeDocument codeDocument, VsPosi return false; } - positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex); + positionInfo = GetPositionInfo(codeDocument, hostDocumentIndex, preferCSharpOverHtml); return true; } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToImplementationEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToImplementationEndpoint.cs new file mode 100644 index 00000000000..be8e197bbbd --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToImplementationEndpoint.cs @@ -0,0 +1,153 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using RoslynLspFactory = Roslyn.LanguageServer.Protocol.RoslynLspFactory; +using RoslynLspLocation = Roslyn.LanguageServer.Protocol.Location; +using VsLspLocation = Microsoft.VisualStudio.LanguageServer.Protocol.Location; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(Methods.TextDocumentImplementationName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostGoToImplementationEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal sealed class CohostGoToImplementationEndpoint( + IRemoteServiceInvoker remoteServiceInvoker, + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker, + IFilePathService filePathService) + : AbstractRazorCohostDocumentRequestHandler?>, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly IFilePathService _filePathService = filePathService; + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + if (clientCapabilities.TextDocument?.Implementation?.DynamicRegistration == true) + { + return new Registration + { + Method = Methods.TextDocumentImplementationName, + RegisterOptions = new ImplementationOptions() + }; + } + + return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(TextDocumentPositionParams request) + => request.TextDocument.ToRazorTextDocumentIdentifier(); + + protected override Task?> HandleRequestAsync(TextDocumentPositionParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync( + request, + context.TextDocument.AssumeNotNull(), + cancellationToken); + + private async Task?> HandleRequestAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var position = RoslynLspFactory.CreatePosition(request.Position.ToLinePosition()); + + var response = await _remoteServiceInvoker + .TryInvokeAsync>( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => + service.GetImplementationAsync(solutionInfo, razorDocument.Id, position, cancellationToken), + cancellationToken) + .ConfigureAwait(false); + + if (response.Result is RoslynLspLocation[] locations) + { + return locations; + } + + if (response.StopHandling) + { + return null; + } + + return await GetHtmlImplementationsAsync(request, razorDocument, cancellationToken).ConfigureAwait(false); + } + + private async Task?> GetHtmlImplementationsAsync(TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return null; + } + + request.TextDocument = request.TextDocument.WithUri(htmlDocument.Uri); + + var result = await _requestInvoker + .ReinvokeRequestOnServerAsync?>( + htmlDocument.Buffer, + Methods.TextDocumentImplementationName, + RazorLSPConstants.HtmlLanguageServerName, + request, + cancellationToken) + .ConfigureAwait(false); + + if (result is not { Response: { } response }) + { + return null; + } + + if (response.TryGetFirst(out var locations)) + { + foreach (var location in locations) + { + RemapVirtualHtmlUri(location); + } + + return locations; + } + else if (response.TryGetSecond(out var referenceItems)) + { + foreach (var referenceItem in referenceItems) + { + RemapVirtualHtmlUri(referenceItem.Location); + } + + return referenceItems; + } + + return null; + } + + private void RemapVirtualHtmlUri(VsLspLocation location) + { + if (_filePathService.IsVirtualHtmlFile(location.Uri)) + { + location.Uri = _filePathService.GetRazorDocumentUri(location.Uri); + } + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostGoToImplementationEndpoint instance) + { + public Task?> HandleRequestAsync( + TextDocumentPositionParams request, TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(request, razorDocument, cancellationToken); + } +} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs new file mode 100644 index 00000000000..170ca71d6a6 --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs @@ -0,0 +1,166 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Remote.Razor; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Xunit; +using Xunit.Abstractions; +using LspLocation = Microsoft.VisualStudio.LanguageServer.Protocol.Location; +using RoslynLspExtensions = Roslyn.LanguageServer.Protocol.RoslynLspExtensions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +public class CohostGoToImplementationEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +{ + [Fact] + public async Task CSharp_Method() + { + var input = """ +
+ + @{ + var x = Ge$$tX(); + } + + @code + { + void [|GetX|]() + { + } + } + """; + + await VerifyCSharpGoToImplementationAsync(input); + } + + [Fact] + public async Task CSharp_Field() + { + var input = """ +
+ + @{ + var x = GetX(); + } + + @code + { + private string [|_name|]; + + string GetX() + { + return _na$$me; + } + } + """; + + await VerifyCSharpGoToImplementationAsync(input); + } + + [Fact] + public async Task CSharp_Multiple() + { + var input = """ +
+ + @code + { + class [|Base|] { } + class [|Derived1|] : Base { } + class [|Derived2|] : Base { } + + void M(Ba$$se b) + { + } + } + """; + + await VerifyCSharpGoToImplementationAsync(input); + } + + [Fact] + public async Task Html() + { + // This really just validates Uri remapping, the actual response is largely arbitrary + + TestCode input = """ +
+ + + """; + + var document = CreateProjectAndRazorDocument(input.Text); + var inputText = await document.GetTextAsync(DisposalToken); + + var htmlResponse = new SumType?(new LspLocation[] + { + new LspLocation + { + Uri = new Uri(document.CreateUri(), document.Name + FeatureOptions.HtmlVirtualDocumentSuffix), + Range = inputText.GetRange(input.Span), + }, + }); + + var requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentImplementationName, htmlResponse)]); + + await VerifyGoToImplementationResultAsync(input, document, requestInvoker); + } + + private async Task VerifyCSharpGoToImplementationAsync(TestCode input) + { + var document = CreateProjectAndRazorDocument(input.Text); + + var requestInvoker = new TestLSPRequestInvoker(); + + await VerifyGoToImplementationResultAsync(input, document, requestInvoker); + } + + private async Task VerifyGoToImplementationResultAsync(TestCode input, TextDocument document, TestLSPRequestInvoker requestInvoker) + { + var inputText = await document.GetTextAsync(DisposalToken); + + var filePathService = new RemoteFilePathService(FeatureOptions); + var endpoint = new CohostGoToImplementationEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker, filePathService); + + var position = inputText.GetPosition(input.Position); + var textDocumentPositionParams = new TextDocumentPositionParams + { + Position = position, + TextDocument = new TextDocumentIdentifier { Uri = document.CreateUri() }, + }; + + var result = await endpoint.GetTestAccessor().HandleRequestAsync(textDocumentPositionParams, document, DisposalToken); + + if (result.Value.TryGetFirst(out var roslynLocations)) + { + var expected = input.Spans.Select(s => inputText.GetRange(s).ToLinePositionSpan()).OrderBy(r => r.Start.Line).ToArray(); + var actual = roslynLocations.Select(l => RoslynLspExtensions.ToLinePositionSpan(l.Range)).OrderBy(r => r.Start.Line).ToArray(); + Assert.Equal(expected, actual); + + Assert.All(roslynLocations, l => l.Uri.Equals(document.CreateUri())); + } + else if (result.Value.TryGetSecond(out var vsLocations)) + { + var expected = input.Spans.Select(s => inputText.GetRange(s).ToLinePositionSpan()).OrderBy(r => r.Start.Line).ToArray(); + var actual = vsLocations.Select(l => l.Range.ToLinePositionSpan()).OrderBy(r => r.Start.Line).ToArray(); + Assert.Equal(expected, actual); + + Assert.All(vsLocations, l => l.Uri.Equals(document.CreateUri())); + } + else + { + Assert.Fail($"Unsupported result type: {result.Value.GetType()}"); + } + } +} From 1e82de71fe84cb32730c50976201825f385badc1 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 3 Sep 2024 16:54:11 +1000 Subject: [PATCH 266/386] Add failing test, and add verification to existing tests --- .../CohostGoToDefinitionEndpointTest.cs | 60 +++++++++++++++++-- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs index 1c61c7d714f..b0ac0d7e9d3 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -14,6 +15,7 @@ using RoslynDocumentLink = Roslyn.LanguageServer.Protocol.DocumentLink; using RoslynLocation = Roslyn.LanguageServer.Protocol.Location; using RoslynLspExtensions = Roslyn.LanguageServer.Protocol.RoslynLspExtensions; +using TextDocument = Microsoft.CodeAnalysis.TextDocument; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; @@ -157,7 +159,7 @@ public partial class SurveyPrompt : ComponentBase """; var result = await GetGoToDefinitionResultAsync(input, FileKinds.Component, - (FileName("SurveyPrompt.razor"), surveyPrompt.Text), + (FileName("SurveyPrompt.razor"), surveyPrompt.Text), (FileName("SurveyPrompt.razor.g.cs"), surveyPromptGeneratedCode.Text)); Assert.NotNull(result.Value.Second); @@ -283,7 +285,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #endregion var result = await GetGoToDefinitionResultAsync(input, FileKinds.Component, - (FileName("SurveyPrompt.razor"), surveyPrompt.Text), + (FileName("SurveyPrompt.razor"), surveyPrompt.Text), (FileName("SurveyPrompt.razor.g.cs"), surveyPromptGeneratedCode.Text)); Assert.NotNull(result.Value.Second); @@ -295,24 +297,70 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. Assert.Equal(range, location.Range); } + [Fact] + public async Task Html() + { + // This really just validates Uri remapping, the actual response is largely arbitrary + + TestCode input = """ +
+ + + """; + + var document = CreateProjectAndRazorDocument(input.Text); + var inputText = await document.GetTextAsync(DisposalToken); + + var htmlResponse = new SumType?(new Location[] + { + new Location + { + Uri = new Uri(document.CreateUri(), document.Name + FeatureOptions.HtmlVirtualDocumentSuffix), + Range = inputText.GetRange(input.Span), + }, + }); + + await VerifyGoToDefinitionAsync(input, htmlResponse: htmlResponse); + } + private static string FileName(string projectRelativeFileName) => Path.Combine(TestProjectData.SomeProjectPath, projectRelativeFileName); - private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = null, params (string fileName, string contents)[]? additionalFiles) + private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = null, SumType? htmlResponse = null) { - var result = await GetGoToDefinitionResultAsync(input, fileKind, additionalFiles); + var document = CreateProjectAndRazorDocument(input.Text, fileKind); + var result = await GetGoToDefinitionResultAsync(document, input, htmlResponse); Assumes.NotNull(result); + + Assert.NotNull(result.Value.Second); + var locations = result.Value.Second; + var location = Assert.Single(locations); + + var text = SourceText.From(input.Text); + var range = RoslynLspExtensions.GetRange(text, input.Span); + Assert.Equal(range, location.Range); + + Assert.Equal(document.CreateUri(), location.Uri); } - private async Task?> GetGoToDefinitionResultAsync( + private Task?> GetGoToDefinitionResultAsync( TestCode input, string? fileKind = null, params (string fileName, string contents)[]? additionalFiles) { var document = CreateProjectAndRazorDocument(input.Text, fileKind, additionalFiles); + return GetGoToDefinitionResultAsync(document, input, htmlResponse: null); + } + private async Task?> GetGoToDefinitionResultAsync( + TextDocument document, TestCode input, SumType? htmlResponse) + { var inputText = await document.GetTextAsync(DisposalToken); var position = inputText.GetPosition(input.Position); - var requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentDefinitionName, null)]); + var requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentDefinitionName, htmlResponse)]); var endpoint = new CohostGoToDefinitionEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker); From f867a039260f841791ebeb96a5e729a1ae0be608 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 3 Sep 2024 16:57:46 +1000 Subject: [PATCH 267/386] Remap Html uris if we get them --- .../Cohost/CohostGoToDefinitionEndpoint.cs | 22 +++++++++++++++---- .../CohostGoToDefinitionEndpointTest.cs | 4 +++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs index fbab17f6a38..a13efe7ba4a 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostGoToDefinitionEndpoint.cs @@ -10,6 +10,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.LanguageServer.Protocol; using static Roslyn.LanguageServer.Protocol.RoslynLspExtensions; @@ -30,12 +31,14 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; internal sealed class CohostGoToDefinitionEndpoint( IRemoteServiceInvoker remoteServiceInvoker, IHtmlDocumentSynchronizer htmlDocumentSynchronizer, - LSPRequestInvoker requestInvoker) + LSPRequestInvoker requestInvoker, + IFilePathService filePathService) : AbstractRazorCohostDocumentRequestHandler?>, IDynamicRegistrationProvider { private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly IFilePathService _filePathService = filePathService; protected override bool MutatesSolutionState => false; @@ -115,11 +118,11 @@ internal sealed class CohostGoToDefinitionEndpoint( if (response.TryGetFirst(out var singleLocation)) { - return RoslynLspFactory.CreateLocation(singleLocation.Uri, singleLocation.Range.ToLinePositionSpan()); + return RoslynLspFactory.CreateLocation(RemapVirtualHtmlUri(singleLocation.Uri), singleLocation.Range.ToLinePositionSpan()); } else if (response.TryGetSecond(out var multipleLocations)) { - return Array.ConvertAll(multipleLocations, static l => RoslynLspFactory.CreateLocation(l.Uri, l.Range.ToLinePositionSpan())); + return Array.ConvertAll(multipleLocations, l => RoslynLspFactory.CreateLocation(RemapVirtualHtmlUri(l.Uri), l.Range.ToLinePositionSpan())); } else if (response.TryGetThird(out var documentLinks)) { @@ -129,7 +132,7 @@ internal sealed class CohostGoToDefinitionEndpoint( { if (documentLink.Target is Uri target) { - builder.Add(RoslynLspFactory.CreateDocumentLink(target, documentLink.Range.ToLinePositionSpan())); + builder.Add(RoslynLspFactory.CreateDocumentLink(RemapVirtualHtmlUri(target), documentLink.Range.ToLinePositionSpan())); } } @@ -139,6 +142,17 @@ internal sealed class CohostGoToDefinitionEndpoint( return null; } + private Uri RemapVirtualHtmlUri(Uri uri) + { + if (_filePathService.IsVirtualHtmlFile(uri)) + { + return _filePathService.GetRazorDocumentUri(uri); + } + + return uri; + } + + internal TestAccessor GetTestAccessor() => new(this); internal readonly struct TestAccessor(CohostGoToDefinitionEndpoint instance) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs index b0ac0d7e9d3..7e0cc0a8b1e 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Remote.Razor; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; @@ -362,7 +363,8 @@ private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = var requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentDefinitionName, htmlResponse)]); - var endpoint = new CohostGoToDefinitionEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker); + var filePathService = new VisualStudioFilePathService(FeatureOptions); + var endpoint = new CohostGoToDefinitionEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker, filePathService); var textDocumentPositionParams = new TextDocumentPositionParams { From 277c780a686d629913b9bd5c985d0c58b661fcde Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 3 Sep 2024 10:53:32 -0700 Subject: [PATCH 268/386] Clarify [EventHandler] tag helper discovery logic and avoid exception --- ...EventHandlerTagHelperDescriptorProvider.cs | 66 +++-- ...tHandlerTagHelperDescriptorProviderTest.cs | 267 ++++++++++++++++-- 2 files changed, 290 insertions(+), 43 deletions(-) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/EventHandlerTagHelperDescriptorProvider.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/EventHandlerTagHelperDescriptorProvider.cs index f89840fde8b..ff052c408d2 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/EventHandlerTagHelperDescriptorProvider.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/EventHandlerTagHelperDescriptorProvider.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Collections.Immutable; using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Components; @@ -54,14 +55,14 @@ protected override void Collect(ISymbol symbol, ICollection { if (SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, _eventHandlerAttribute)) { - if (!AttributeArgs.TryGet(attribute, out var values)) + if (!AttributeArgs.TryGet(attribute, out var args)) { - // If this occurs, the EventHandlerAttribute type has been broken. - Assumed.Unreachable(); + // If this occurs, the [EventHandler] was defined incorrectly, so we can't create a tag helper. + continue; } var (typeName, namespaceName) = displayNames.GetNames(); - results.Add(CreateTagHelper(typeName, namespaceName, type.Name, values)); + results.Add(CreateTagHelper(typeName, namespaceName, type.Name, args)); } } } @@ -70,8 +71,8 @@ protected override void Collect(ISymbol symbol, ICollection private readonly record struct AttributeArgs( string Attribute, INamedTypeSymbol EventArgsType, - bool EnableStopPropagation, - bool EnablePreventDefault) + bool EnableStopPropagation = false, + bool EnablePreventDefault = false) { public static bool TryGet(AttributeData attribute, out AttributeArgs args) { @@ -80,34 +81,49 @@ public static bool TryGet(AttributeData attribute, out AttributeArgs args) // - EventHandlerAttribute(string attributeName, Type eventArgsType); // - EventHandlerAttribute(string attributeName, Type eventArgsType, bool enableStopPropagation, bool enablePreventDefault); - args = default; - var arguments = attribute.ConstructorArguments; - if (arguments.Length is not (2 or 4)) - { - return false; - } + return TryGetFromTwoArguments(arguments, out args) || + TryGetFromFourArguments(arguments, out args); - if (arguments[0] is not { Value: string attributeName } || - arguments[1] is not { Value: INamedTypeSymbol eventArgsType }) + static bool TryGetFromTwoArguments(ImmutableArray arguments, out AttributeArgs args) { + // Ctor 1: EventHandlerAttribute(string attributeName, Type eventArgsType); + + if (arguments is [ + { Value: string attributeName }, + { Value: INamedTypeSymbol eventArgsType }]) + { + args = new(attributeName, eventArgsType); + return true; + } + + args = default; return false; } - // TODO: The enablePreventDefault and enableStopPropagation arguments are incorrectly swapped! - // However, they have been that way since the 4-argument constructor variant was introduced - // in https://github.com/dotnet/razor/commit/7635bba6ef2d3e6798d0846ceb96da6d5908e1b0. - // Fixing this is tracked be https://github.com/dotnet/razor/issues/10497 - - if (arguments is not [.., { Value: bool enablePreventDefault }, { Value: bool enableStopPropagation }]) + static bool TryGetFromFourArguments(ImmutableArray arguments, out AttributeArgs args) { - enableStopPropagation = false; - enablePreventDefault = false; - } + // Ctor 2: EventHandlerAttribute(string attributeName, Type eventArgsType, bool enableStopPropagation, bool enablePreventDefault); + + // TODO: The enablePreventDefault and enableStopPropagation arguments are incorrectly swapped! + // However, they have been that way since the 4-argument constructor variant was introduced + // in https://github.com/dotnet/razor/commit/7635bba6ef2d3e6798d0846ceb96da6d5908e1b0. + // Fixing this is tracked be https://github.com/dotnet/razor/issues/10497 + + if (arguments is [ + { Value: string attributeName }, + { Value: INamedTypeSymbol eventArgsType }, + { Value: bool enablePreventDefault }, + { Value: bool enableStopPropagation }]) + { + args = new(attributeName, eventArgsType, enableStopPropagation, enablePreventDefault); + return true; + } - args = new(attributeName, eventArgsType, enableStopPropagation, enablePreventDefault); - return true; + args = default; + return false; + } } } diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor/test/EventHandlerTagHelperDescriptorProviderTest.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor/test/EventHandlerTagHelperDescriptorProviderTest.cs index 101927ad544..397035db55b 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor/test/EventHandlerTagHelperDescriptorProviderTest.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor/test/EventHandlerTagHelperDescriptorProviderTest.cs @@ -1,8 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#nullable disable - using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Razor.Language; @@ -14,22 +12,22 @@ namespace Microsoft.CodeAnalysis.Razor; public class EventHandlerTagHelperDescriptorProviderTest : TagHelperDescriptorProviderTestBase { [Fact] - public void Execute_EventHandler_CreatesDescriptor() + public void Execute_EventHandler_TwoArgumentsCreatesDescriptor() { // Arrange - var compilation = BaseCompilation.AddSyntaxTrees(Parse(@" -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; + var compilation = BaseCompilation.AddSyntaxTrees(Parse(""" + using System; + using Microsoft.AspNetCore.Components; + using Microsoft.AspNetCore.Components.Web; -namespace Test -{ - [EventHandler(""onclick"", typeof(Action))] - public class EventHandlers - { - } -} -")); + namespace Test + { + [EventHandler("onclick", typeof(Action))] + public class EventHandlers + { + } + } + """)); Assert.Empty(compilation.GetDiagnostics()); @@ -102,9 +100,9 @@ public class EventHandlers Assert.Collection( attribute.Metadata.OrderBy(kvp => kvp.Key), - kvp => Assert.Equal(kvp, new KeyValuePair(ComponentMetadata.Common.DirectiveAttribute, bool.TrueString)), - kvp => Assert.Equal(kvp, new KeyValuePair("Common.PropertyName", "onclick")), - kvp => Assert.Equal(kvp, new KeyValuePair(ComponentMetadata.Component.WeaklyTypedKey, bool.TrueString))); + kvp => Assert.Equal(kvp, new KeyValuePair(ComponentMetadata.Common.DirectiveAttribute, bool.TrueString)), + kvp => Assert.Equal(kvp, new KeyValuePair("Common.PropertyName", "onclick")), + kvp => Assert.Equal(kvp, new KeyValuePair(ComponentMetadata.Component.WeaklyTypedKey, bool.TrueString))); Assert.Equal( "Sets the '@onclick' attribute to the provided string or delegate value. " + @@ -122,6 +120,239 @@ public class EventHandlers Assert.False(attribute.IsEnum); } + [Fact] + public void Execute_EventHandler_FourArgumentsCreatesDescriptorWithDiagnostic() + { + // Arrange + var compilation = BaseCompilation.AddSyntaxTrees(Parse(""" + using System; + using Microsoft.AspNetCore.Components; + using Microsoft.AspNetCore.Components.Web; + + namespace Test + { + [EventHandler("onclick", typeof(Action), true, true)] + public class EventHandlers + { + } + } + """)); + + Assert.Empty(compilation.GetDiagnostics()); + + var context = new TagHelperDescriptorProviderContext(compilation); + var provider = new EventHandlerTagHelperDescriptorProvider(); + + // Act + provider.Execute(context); + + // Assert + var matches = GetEventHandlerTagHelpers(context); + var item = Assert.Single(matches); + + // These are features Event Handler Tag Helpers don't use. Verifying them once here and + // then ignoring them. + Assert.Empty(item.AllowedChildTags); + Assert.Null(item.TagOutputHint); + + // These are features that are invariants of all Event Handler Helpers. Verifying them once + // here and then ignoring them. + Assert.Empty(item.Diagnostics); + Assert.False(item.HasErrors); + Assert.Equal(ComponentMetadata.EventHandler.TagHelperKind, item.Kind); + Assert.Equal(bool.TrueString, item.Metadata[TagHelperMetadata.Common.ClassifyAttributesOnly]); + Assert.Equal(ComponentMetadata.EventHandler.RuntimeName, item.Metadata[TagHelperMetadata.Runtime.Name]); + Assert.False(item.IsDefaultKind()); + Assert.False(item.KindUsesDefaultTagHelperRuntime()); + Assert.False(item.IsComponentOrChildContentTagHelper); + Assert.True(item.CaseSensitive); + + Assert.Equal( + "Sets the '@onclick' attribute to the provided string or delegate value. " + + "A delegate value should be of type 'System.Action'.", + item.Documentation); + + // These are all trivially derived from the assembly/namespace/type name + Assert.Equal("Microsoft.AspNetCore.Components", item.AssemblyName); + Assert.Equal("onclick", item.Name); + Assert.Equal("Test.EventHandlers", item.DisplayName); + Assert.Equal("Test.EventHandlers", item.GetTypeName()); + + Assert.Equal(3, item.TagMatchingRules.Length); + + var catchAllRule = item.TagMatchingRules[0]; + Assert.Empty(catchAllRule.Diagnostics); + Assert.False(catchAllRule.HasErrors); + Assert.Null(catchAllRule.ParentTag); + Assert.Equal("*", catchAllRule.TagName); + Assert.Equal(TagStructure.Unspecified, catchAllRule.TagStructure); + + var catchAllRequiredAttribute = Assert.Single(catchAllRule.Attributes); + Assert.Empty(catchAllRequiredAttribute.Diagnostics); + Assert.Equal("@onclick", catchAllRequiredAttribute.DisplayName); + Assert.Equal("@onclick", catchAllRequiredAttribute.Name); + Assert.Equal(RequiredAttributeDescriptor.NameComparisonMode.FullMatch, catchAllRequiredAttribute.NameComparison); + Assert.Null(catchAllRequiredAttribute.Value); + Assert.Equal(RequiredAttributeDescriptor.ValueComparisonMode.None, catchAllRequiredAttribute.ValueComparison); + + var preventDefaultRule = item.TagMatchingRules[1]; + Assert.Empty(preventDefaultRule.Diagnostics); + Assert.False(preventDefaultRule.HasErrors); + Assert.Null(preventDefaultRule.ParentTag); + Assert.Equal("*", preventDefaultRule.TagName); + Assert.Equal(TagStructure.Unspecified, preventDefaultRule.TagStructure); + + var preventDefaultRequiredAttribute = Assert.Single(preventDefaultRule.Attributes); + Assert.Empty(preventDefaultRequiredAttribute.Diagnostics); + Assert.Equal("@onclick:preventDefault", preventDefaultRequiredAttribute.DisplayName); + Assert.Equal("@onclick:preventDefault", preventDefaultRequiredAttribute.Name); + Assert.Equal(RequiredAttributeDescriptor.NameComparisonMode.FullMatch, preventDefaultRequiredAttribute.NameComparison); + Assert.Null(preventDefaultRequiredAttribute.Value); + Assert.Equal(RequiredAttributeDescriptor.ValueComparisonMode.None, preventDefaultRequiredAttribute.ValueComparison); + + var stopPropagationRule = item.TagMatchingRules[2]; + Assert.Empty(stopPropagationRule.Diagnostics); + Assert.False(stopPropagationRule.HasErrors); + Assert.Null(stopPropagationRule.ParentTag); + Assert.Equal("*", stopPropagationRule.TagName); + Assert.Equal(TagStructure.Unspecified, stopPropagationRule.TagStructure); + + var stopPropagationRequiredAttribute = Assert.Single(stopPropagationRule.Attributes); + Assert.Empty(stopPropagationRequiredAttribute.Diagnostics); + Assert.Equal("@onclick:stopPropagation", stopPropagationRequiredAttribute.DisplayName); + Assert.Equal("@onclick:stopPropagation", stopPropagationRequiredAttribute.Name); + Assert.Equal(RequiredAttributeDescriptor.NameComparisonMode.FullMatch, stopPropagationRequiredAttribute.NameComparison); + Assert.Null(stopPropagationRequiredAttribute.Value); + Assert.Equal(RequiredAttributeDescriptor.ValueComparisonMode.None, stopPropagationRequiredAttribute.ValueComparison); + + var attribute = Assert.Single(item.BoundAttributes); + + // Invariants + Assert.Empty(attribute.Diagnostics); + Assert.False(attribute.HasErrors); + Assert.Equal(ComponentMetadata.EventHandler.TagHelperKind, attribute.Kind); + Assert.False(attribute.IsDefaultKind()); + Assert.False(attribute.HasIndexer); + Assert.Null(attribute.IndexerNamePrefix); + Assert.Null(attribute.IndexerTypeName); + Assert.False(attribute.IsIndexerBooleanProperty); + Assert.False(attribute.IsIndexerStringProperty); + + Assert.Collection( + attribute.Metadata.OrderBy(kvp => kvp.Key), + kvp => Assert.Equal(kvp, new KeyValuePair(ComponentMetadata.Common.DirectiveAttribute, bool.TrueString)), + kvp => Assert.Equal(kvp, new KeyValuePair("Common.PropertyName", "onclick")), + kvp => Assert.Equal(kvp, new KeyValuePair(ComponentMetadata.Component.WeaklyTypedKey, bool.TrueString))); + + Assert.Equal( + "Sets the '@onclick' attribute to the provided string or delegate value. " + + "A delegate value should be of type 'System.Action'.", + attribute.Documentation); + + Assert.Equal("@onclick", attribute.Name); + Assert.Equal("onclick", attribute.GetPropertyName()); + Assert.Equal("Microsoft.AspNetCore.Components.EventCallback> Test.EventHandlers.onclick", attribute.DisplayName); + + // Defined from the property type + Assert.Equal("Microsoft.AspNetCore.Components.EventCallback>", attribute.TypeName); + Assert.False(attribute.IsStringProperty); + Assert.False(attribute.IsBooleanProperty); + Assert.False(attribute.IsEnum); + } + + [Fact] + public void Execute_EventHandler_NoArgumentsDoesNotCreateDescriptor() + { + // Arrange + var compilation = BaseCompilation.AddSyntaxTrees(Parse(""" + using System; + using Microsoft.AspNetCore.Components; + using Microsoft.AspNetCore.Components.Web; + + namespace Test + { + [EventHandler] + public class EventHandlers + { + } + } + """)); + + Assert.NotEmpty(compilation.GetDiagnostics()); + + var context = new TagHelperDescriptorProviderContext(compilation); + var provider = new EventHandlerTagHelperDescriptorProvider(); + + // Act + provider.Execute(context); + + // Assert + var matches = GetEventHandlerTagHelpers(context); + Assert.Empty(matches); + } + + [Fact] + public void Execute_EventHandler_OneArgumentDoesNotCreateDescriptor() + { + // Arrange + var compilation = BaseCompilation.AddSyntaxTrees(Parse(""" + using System; + using Microsoft.AspNetCore.Components; + using Microsoft.AspNetCore.Components.Web; + + namespace Test + { + [EventHandler("onclick")] + public class EventHandlers + { + } + } + """)); + + Assert.NotEmpty(compilation.GetDiagnostics()); + + var context = new TagHelperDescriptorProviderContext(compilation); + var provider = new EventHandlerTagHelperDescriptorProvider(); + + // Act + provider.Execute(context); + + // Assert + var matches = GetEventHandlerTagHelpers(context); + Assert.Empty(matches); + } + + [Fact] + public void Execute_EventHandler_ThreeArgumentsDoesNotCreateDiagnostic() + { + // Arrange + var compilation = BaseCompilation.AddSyntaxTrees(Parse(""" + using System; + using Microsoft.AspNetCore.Components; + using Microsoft.AspNetCore.Components.Web; + + namespace Test + { + [EventHandler("onclick", typeof(Action), true)] + public class EventHandlers + { + } + } + """)); + + Assert.NotEmpty(compilation.GetDiagnostics()); + + var context = new TagHelperDescriptorProviderContext(compilation); + var provider = new EventHandlerTagHelperDescriptorProvider(); + + // Act + provider.Execute(context); + + // Assert + var matches = GetEventHandlerTagHelpers(context); + Assert.Empty(matches); + } + private static TagHelperDescriptor[] GetEventHandlerTagHelpers(TagHelperDescriptorProviderContext context) { return ExcludeBuiltInComponents(context).Where(t => t.IsEventHandlerTagHelper()).ToArray(); From abc48b312c93e396dbf1f42be79dc8cbd4d445a6 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 3 Sep 2024 13:30:01 -0700 Subject: [PATCH 269/386] Test that the DrainToImmutableOrdered* methods actually drain --- ...NetCore.Razor.Utilities.Shared.Test.csproj | 1 + .../PooledObjects/Extensions.cs | 15 +++++++ .../PooledArrayBuilderOrderingTests.cs | 44 +++++++++++++++---- .../PooledObjects/TestArrayBuilderPool`1.cs | 30 +++++++++++++ .../PooledObjects/PooledArrayBuilder`1.cs | 20 +++++++-- 5 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/Extensions.cs create mode 100644 src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/TestArrayBuilderPool`1.cs diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/Microsoft.AspNetCore.Razor.Utilities.Shared.Test.csproj b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/Microsoft.AspNetCore.Razor.Utilities.Shared.Test.csproj index 470d326cc87..b10885404af 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/Microsoft.AspNetCore.Razor.Utilities.Shared.Test.csproj +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/Microsoft.AspNetCore.Razor.Utilities.Shared.Test.csproj @@ -4,6 +4,7 @@ $(DefaultNetCoreTargetFrameworks) $(TargetFrameworks);$(DefaultNetFxTargetFramework) True + false diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/Extensions.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/Extensions.cs new file mode 100644 index 00000000000..53de1ae5329 --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/Extensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Razor.PooledObjects; + +namespace Microsoft.AspNetCore.Razor.Utilities.Shared.Test.PooledObjects; + +internal static class Extensions +{ + public static void Validate(this ref readonly PooledArrayBuilder builder, Action.TestAccessor> validator) + { + validator(builder.GetTestAccessor()); + } +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/PooledArrayBuilderOrderingTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/PooledArrayBuilderOrderingTests.cs index c1d4a196eb1..515ee999523 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/PooledArrayBuilderOrderingTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/PooledArrayBuilderOrderingTests.cs @@ -102,87 +102,115 @@ public void ToImmutableOrderedByDescending_OddBeforeEven(ImmutableArray data, ImmutableArray expected) { - using var builder = new PooledArrayBuilder(capacity: data.Length); + var builderPool = TestArrayBuilderPool.Create(); + using var builder = new PooledArrayBuilder(capacity: data.Length, builderPool); builder.AddRange(data); var sorted = builder.DrainToImmutableOrdered(); AssertEqual(expected, sorted); + AssertIsDrained(in builder); } [Theory] [MemberData(nameof(OrderTestData_OddBeforeEven))] public void DrainToImmutableOrdered_OddBeforeEven(ImmutableArray data, ImmutableArray expected) { - using var builder = new PooledArrayBuilder(capacity: data.Length); + var builderPool = TestArrayBuilderPool.Create(); + using var builder = new PooledArrayBuilder(capacity: data.Length, builderPool); builder.AddRange(data); var sorted = builder.DrainToImmutableOrdered(OddBeforeEven); AssertEqual(expected, sorted); + AssertIsDrained(in builder); } [Theory] [MemberData(nameof(OrderDescendingTestData))] public void DrainToImmutableOrderedDescending(ImmutableArray data, ImmutableArray expected) { - using var builder = new PooledArrayBuilder(capacity: data.Length); + var builderPool = TestArrayBuilderPool.Create(); + using var builder = new PooledArrayBuilder(capacity: data.Length, builderPool); builder.AddRange(data); var sorted = builder.DrainToImmutableOrderedDescending(); AssertEqual(expected, sorted); + AssertIsDrained(in builder); } [Theory] [MemberData(nameof(OrderDescendingTestData_OddBeforeEven))] public void DrainToImmutableOrderedDescending_OddBeforeEven(ImmutableArray data, ImmutableArray expected) { - using var builder = new PooledArrayBuilder(capacity: data.Length); + var builderPool = TestArrayBuilderPool.Create(); + using var builder = new PooledArrayBuilder(capacity: data.Length, builderPool); builder.AddRange(data); var sorted = builder.DrainToImmutableOrderedDescending(OddBeforeEven); AssertEqual(expected, sorted); + AssertIsDrained(in builder); } [Theory] [MemberData(nameof(OrderByTestData))] public void DrainToImmutableOrderedBy(ImmutableArray> data, ImmutableArray> expected) { - using var builder = new PooledArrayBuilder>(capacity: data.Length); + var builderPool = TestArrayBuilderPool>.Create(); + using var builder = new PooledArrayBuilder>(capacity: data.Length, builderPool); builder.AddRange(data); var sorted = builder.DrainToImmutableOrderedBy(static x => x.Value); AssertEqual(expected, sorted); + AssertIsDrained(in builder); } [Theory] [MemberData(nameof(OrderByTestData_OddBeforeEven))] public void DrainToImmutableOrderedBy_OddBeforeEven(ImmutableArray> data, ImmutableArray> expected) { - using var builder = new PooledArrayBuilder>(capacity: data.Length); + var builderPool = TestArrayBuilderPool>.Create(); + using var builder = new PooledArrayBuilder>(capacity: data.Length, builderPool); builder.AddRange(data); var sorted = builder.DrainToImmutableOrderedBy(static x => x.Value, OddBeforeEven); AssertEqual(expected, sorted); + AssertIsDrained(in builder); } [Theory] [MemberData(nameof(OrderByDescendingTestData))] public void DrainToImmutableOrderedByDescending(ImmutableArray> data, ImmutableArray> expected) { - using var builder = new PooledArrayBuilder>(capacity: data.Length); + var builderPool = TestArrayBuilderPool>.Create(); + using var builder = new PooledArrayBuilder>(capacity: data.Length, builderPool); builder.AddRange(data); var sorted = builder.DrainToImmutableOrderedByDescending(static x => x.Value); AssertEqual(expected, sorted); + AssertIsDrained(in builder); } [Theory] [MemberData(nameof(OrderByDescendingTestData_OddBeforeEven))] public void DrainToImmutableOrderedByDescending_OddBeforeEven(ImmutableArray> data, ImmutableArray> expected) { - using var builder = new PooledArrayBuilder>(capacity: data.Length); + var builderPool = TestArrayBuilderPool>.Create(); + using var builder = new PooledArrayBuilder>(capacity: data.Length, builderPool); builder.AddRange(data); var sorted = builder.DrainToImmutableOrderedByDescending(static x => x.Value, OddBeforeEven); AssertEqual(expected, sorted); + AssertIsDrained(in builder); + } + + private static void AssertIsDrained(ref readonly PooledArrayBuilder builder) + { + builder.Validate(static t => + { + Assert.NotNull(t.InnerArrayBuilder); + Assert.Empty(t.InnerArrayBuilder); + + // After draining, the capacity of the inner array builder should be 0. + Assert.Equal(0, t.InnerArrayBuilder.Capacity); + }); } } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/TestArrayBuilderPool`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/TestArrayBuilderPool`1.cs new file mode 100644 index 00000000000..8380389a86d --- /dev/null +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/TestArrayBuilderPool`1.cs @@ -0,0 +1,30 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.Extensions.ObjectPool; + +namespace Microsoft.AspNetCore.Razor.Utilities.Shared.Test.PooledObjects; + +internal static class TestArrayBuilderPool +{ + public static ObjectPool.Builder> Create( + IPooledObjectPolicy.Builder>? policy = null, int size = 1) + => DefaultPool.Create(policy ?? NoReturnPolicy.Instance, size); + + public sealed class NoReturnPolicy : IPooledObjectPolicy.Builder> + { + public static readonly NoReturnPolicy Instance = new(); + + private NoReturnPolicy() + { + } + + public ImmutableArray.Builder Create() + => ImmutableArray.CreateBuilder(); + + public bool Return(ImmutableArray.Builder obj) + => false; + } +} diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder`1.cs index 6d4f984552a..c684d50fac6 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder`1.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder`1.cs @@ -9,6 +9,7 @@ using System.Runtime.CompilerServices; using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Utilities; +using Microsoft.Extensions.ObjectPool; namespace Microsoft.AspNetCore.Razor.PooledObjects; @@ -33,6 +34,8 @@ internal partial struct PooledArrayBuilder : IDisposable ///
private const int InlineCapacity = 4; + private ObjectPool.Builder>? _builderPool; + /// /// A builder to be used as storage after the first time that the number /// of items exceeds . Once the builder is used, @@ -56,9 +59,10 @@ internal partial struct PooledArrayBuilder : IDisposable /// private int _inlineCount; - public PooledArrayBuilder(int? capacity = null) + public PooledArrayBuilder(int? capacity = null, ObjectPool.Builder>? builderPool = null) { _capacity = capacity is > InlineCapacity ? capacity : null; + _builderPool = builderPool; _element0 = default!; _element1 = default!; _element2 = default!; @@ -81,7 +85,7 @@ public void Dispose() // stack after the last use of a reference to them. if (_builder is { } builder) { - ArrayBuilderPool.Default.Return(builder); + _builderPool?.Return(builder); _builder = null; } } @@ -1314,7 +1318,8 @@ private void MoveInlineItemsToBuilder() { Debug.Assert(_builder is null); - var builder = ArrayBuilderPool.Default.Get(); + _builderPool ??= ArrayBuilderPool.Default; + var builder = _builderPool.Get(); if (_capacity is int capacity) { @@ -1525,4 +1530,13 @@ public ImmutableArray DrainToImmutableOrderedByDescending(Func return result; } + + internal readonly TestAccessor GetTestAccessor() => new(in this); + + internal readonly struct TestAccessor(ref readonly PooledArrayBuilder builder) + { + public ImmutableArray.Builder? InnerArrayBuilder { get; } = builder._builder; + public int? Capacity { get; } = builder._capacity; + public int InlineItemCount { get; } = builder._inlineCount; + } } From 5c0677ad275e64300b897de0f6e8856ebe13f07b Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 3 Sep 2024 14:46:52 -0700 Subject: [PATCH 270/386] Ensure PooledArrayBuilder resets capacity of builder after drain It is perfectly legal for a PooledArrayBuilder to be drained via one of the DrainToImmutable* methods and then continue adding items to the builder. However, if the inner ImmutableArray.Builder's capacity was set to 0 during the drain, its capacity will not be reset to any specified value when adding new items. This change fixes that. --- .../PooledObjects/PooledArrayBuilderTests.cs | 55 +++++++++++++++++ .../PooledObjects/PooledArrayBuilder`1.cs | 61 +++++++++++++++---- 2 files changed, 104 insertions(+), 12 deletions(-) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/PooledArrayBuilderTests.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/PooledArrayBuilderTests.cs index 03129b86b02..c029b9d7aca 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/PooledArrayBuilderTests.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.Test/PooledObjects/PooledArrayBuilderTests.cs @@ -86,6 +86,61 @@ public void RemoveAtIndex(int count, int removeIndex) } } + [Fact] + public void UseDrainAndReuse() + { + var builderPool = TestArrayBuilderPool.Create(); + using var builder = new PooledArrayBuilder(capacity: 10, builderPool); + + for (var i = 0; i < 10; i++) + { + builder.Add(i); + } + + // Verify that the builder contains 10 items within its inner array builder. + builder.Validate(static t => + { + Assert.Equal(0, t.InlineItemCount); + Assert.Equal(10, t.Capacity); + Assert.NotNull(t.InnerArrayBuilder); + + Assert.Equal(10, t.InnerArrayBuilder.Count); + Assert.Equal(10, t.InnerArrayBuilder.Capacity); + }); + + var result = builder.DrainToImmutable(); + + // After draining, the builder should contain 0 items in its inner array builder + // and the capacity should have been set to 0. + builder.Validate(static t => + { + Assert.Equal(0, t.InlineItemCount); + Assert.Equal(10, t.Capacity); + Assert.NotNull(t.InnerArrayBuilder); + + Assert.Empty(t.InnerArrayBuilder); + Assert.Equal(0, t.InnerArrayBuilder.Capacity); + }); + + // Add another 10 items to the builder. At the end, the inner array builder + // should hold 10 items with a capacity of 10. + for (var i = 0; i < 10; i++) + { + builder.Add(i); + } + + // Verify that the builder contains 10 items within its inner array builder. + builder.Validate(static t => + { + Assert.Equal(0, t.InlineItemCount); + Assert.Equal(10, t.Capacity); + Assert.NotNull(t.InnerArrayBuilder); + + Assert.Equal(10, t.InnerArrayBuilder.Count); + Assert.Equal(10, t.InnerArrayBuilder.Capacity); + }); + } + private static Func IsEven => x => x % 2 == 0; private static Func IsOdd => x => x % 2 != 0; diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder`1.cs b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder`1.cs index c684d50fac6..11f9ae42214 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder`1.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder`1.cs @@ -83,13 +83,50 @@ public void Dispose() // Return _builder to the pool if necessary. Note that we don't need to clear the inline elements here // because this type is intended to be allocated on the stack and the GC can reclaim objects from the // stack after the last use of a reference to them. - if (_builder is { } builder) + if (_builder is { } innerBuilder) { - _builderPool?.Return(builder); + _builderPool?.Return(innerBuilder); _builder = null; } } + /// + /// Retrieves the inner . + /// + /// + /// Returns if is available; otherwise + /// + /// + /// This should only be used by methods that will not add to the inner . + /// + private readonly bool TryGetBuilder([NotNullWhen(true)] out ImmutableArray.Builder? builder) + { + builder = _builder; + return builder is not null; + } + + /// + /// Retrieves the inner and resets its capacity if necessary. + /// + /// + /// Returns if is available; otherwise + /// + /// + /// This should only be used by methods that will add to the inner . + /// + private readonly bool TryGetBuilderAndEnsureCapacity([NotNullWhen(true)] out ImmutableArray.Builder? builder) + { + if (TryGetBuilder(out builder)) + { + if (builder.Capacity == 0 && _capacity is int capacity) + { + builder.Capacity = capacity; + } + } + + return builder is not null; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void ClearInlineElement(int index) { @@ -112,7 +149,7 @@ public T this[int index] [MethodImpl(MethodImplOptions.AggressiveInlining)] readonly get { - if (_builder is { } builder) + if (TryGetBuilder(out var builder)) { return builder[index]; } @@ -128,7 +165,7 @@ readonly get [MethodImpl(MethodImplOptions.AggressiveInlining)] set { - if (_builder is { } builder) + if (TryGetBuilder(out var builder)) { builder[index] = value; return; @@ -198,7 +235,7 @@ public readonly int Count public void Add(T item) { - if (_builder is { } builder) + if (TryGetBuilderAndEnsureCapacity(out var builder)) { builder.Add(item); } @@ -233,7 +270,7 @@ public void AddRange(ReadOnlySpan items) return; } - if (_builder is { } builder) + if (TryGetBuilderAndEnsureCapacity(out var builder)) { builder.AddRange(items); } @@ -254,7 +291,7 @@ public void AddRange(ReadOnlySpan items) public void AddRange(IEnumerable items) { - if (_builder is { } builder) + if (TryGetBuilderAndEnsureCapacity(out var builder)) { builder.AddRange(items); return; @@ -296,7 +333,7 @@ public void AddRange(IEnumerable items) public void Clear() { - if (_builder is { } builder) + if (TryGetBuilder(out var builder)) { // Keep using a real builder to avoid churn in the object pool. builder.Clear(); @@ -314,7 +351,7 @@ public readonly Enumerator GetEnumerator() public void RemoveAt(int index) { - if (_builder is { } builder) + if (TryGetBuilderAndEnsureCapacity(out var builder)) { builder.RemoveAt(index); return; @@ -384,7 +421,7 @@ public void RemoveAt(Index index) /// An immutable array. public ImmutableArray DrainToImmutable() { - if (_builder is { } builder) + if (TryGetBuilder(out var builder)) { return builder.DrainToImmutable(); } @@ -400,7 +437,7 @@ public ImmutableArray DrainToImmutable() public readonly ImmutableArray ToImmutable() { - if (_builder is { } builder) + if (TryGetBuilder(out var builder)) { return builder.ToImmutable(); } @@ -424,7 +461,7 @@ private readonly ImmutableArray InlineItemsToImmutableArray() public readonly T[] ToArray() { - if (_builder is { } builder) + if (TryGetBuilder(out var builder)) { return builder.ToArray(); } From 467ff246de4cc165cb9d841ee273c77aaf7b516f Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 4 Sep 2024 11:04:31 +1000 Subject: [PATCH 271/386] PR feedback --- .../CohostGoToDefinitionEndpointTest.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs index 7e0cc0a8b1e..b97fe4ef07a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs @@ -160,7 +160,7 @@ public partial class SurveyPrompt : ComponentBase """; var result = await GetGoToDefinitionResultAsync(input, FileKinds.Component, - (FileName("SurveyPrompt.razor"), surveyPrompt.Text), + (FileName("SurveyPrompt.razor"), surveyPrompt.Text), (FileName("SurveyPrompt.razor.g.cs"), surveyPromptGeneratedCode.Text)); Assert.NotNull(result.Value.Second); @@ -286,7 +286,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #endregion var result = await GetGoToDefinitionResultAsync(input, FileKinds.Component, - (FileName("SurveyPrompt.razor"), surveyPrompt.Text), + (FileName("SurveyPrompt.razor"), surveyPrompt.Text), (FileName("SurveyPrompt.razor.g.cs"), surveyPromptGeneratedCode.Text)); Assert.NotNull(result.Value.Second); @@ -304,14 +304,14 @@ public async Task Html() // This really just validates Uri remapping, the actual response is largely arbitrary TestCode input = """ -
+
- - """; + + """; var document = CreateProjectAndRazorDocument(input.Text); var inputText = await document.GetTextAsync(DisposalToken); @@ -355,6 +355,7 @@ private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = var document = CreateProjectAndRazorDocument(input.Text, fileKind, additionalFiles); return GetGoToDefinitionResultAsync(document, input, htmlResponse: null); } + private async Task?> GetGoToDefinitionResultAsync( TextDocument document, TestCode input, SumType? htmlResponse) { From d9e380b533723825b65b74ac5ca3157b1f5e251a Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 4 Sep 2024 11:17:50 +1000 Subject: [PATCH 272/386] Rename service --- .../Extensions/IServiceCollectionExtensions.cs | 2 +- ...ellCheckService.cs => LspCSharpSpellCheckRangeProvider.cs} | 4 ++-- ...SpellCheckService.cs => ICSharpSpellCheckRangeProvider.cs} | 2 +- .../SpellCheck/SpellCheckService.cs | 4 ++-- .../SpellCheck/OOPSpellCheckService.cs | 2 +- ...CheckService.cs => RemoteCSharpSpellCheckRangeProvider.cs} | 4 ++-- .../SpellCheck/DocumentSpellCheckEndpointTest.cs | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) rename src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/{LspCSharpSpellCheckService.cs => LspCSharpSpellCheckRangeProvider.cs} (95%) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/{ICSharpSpellCheckService.cs => ICSharpSpellCheckRangeProvider.cs} (90%) rename src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/{RemoteCSharpSpellCheckService.cs => RemoteCSharpSpellCheckRangeProvider.cs} (90%) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs index e4a7dc87af7..91ecc7a562f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs @@ -160,7 +160,7 @@ public static void AddTextDocumentServices(this IServiceCollection services, Lan services.AddHandlerWithCapabilities(); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); services.AddHandlerWithCapabilities(); services.AddHandler(); } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckService.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckRangeProvider.cs similarity index 95% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckService.cs rename to src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckRangeProvider.cs index 764c9c1f31e..97cf038f3c7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckService.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/LspCSharpSpellCheckRangeProvider.cs @@ -19,9 +19,9 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.SpellCheck; -internal sealed class LspCSharpSpellCheckService( +internal sealed class LspCSharpSpellCheckRangeProvider( LanguageServerFeatureOptions languageServerFeatureOptions, - IClientConnection clientConnection) : ICSharpSpellCheckService + IClientConnection clientConnection) : ICSharpSpellCheckRangeProvider { private readonly LanguageServerFeatureOptions _languageServerFeatureOptions = languageServerFeatureOptions; private readonly IClientConnection _clientConnection = clientConnection; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckRangeProvider.cs similarity index 90% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckService.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckRangeProvider.cs index de7341567b6..b25dc9f42dd 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/ICSharpSpellCheckRangeProvider.cs @@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Razor.SpellCheck; -internal interface ICSharpSpellCheckService +internal interface ICSharpSpellCheckRangeProvider { Task> GetCSharpSpellCheckRangesAsync(DocumentContext documentContext, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs index 78f0441e383..5690e39cff0 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs @@ -15,10 +15,10 @@ namespace Microsoft.CodeAnalysis.Razor.SpellCheck; internal class SpellCheckService( - ICSharpSpellCheckService csharpSpellCheckService, + ICSharpSpellCheckRangeProvider csharpSpellCheckService, IDocumentMappingService documentMappingService) : ISpellCheckService { - private readonly ICSharpSpellCheckService _csharpSpellCheckService = csharpSpellCheckService; + private readonly ICSharpSpellCheckRangeProvider _csharpSpellCheckService = csharpSpellCheckService; private readonly IDocumentMappingService _documentMappingService = documentMappingService; public async Task GetSpellCheckRangeTriplesAsync(DocumentContext documentContext, CancellationToken cancellationToken) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/OOPSpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/OOPSpellCheckService.cs index f34e86b686d..1eecb538056 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/OOPSpellCheckService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/OOPSpellCheckService.cs @@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Remote.Razor.SpellCheck; [Export(typeof(ISpellCheckService)), Shared] [method: ImportingConstructor] internal sealed class OOPSpellCheckService( - ICSharpSpellCheckService csharpSpellCheckService, + ICSharpSpellCheckRangeProvider csharpSpellCheckService, IDocumentMappingService documentMappingService) : SpellCheckService(csharpSpellCheckService, documentMappingService) { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckRangeProvider.cs similarity index 90% rename from src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckService.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckRangeProvider.cs index d2779d745ab..970a1d51388 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/SpellCheck/RemoteCSharpSpellCheckRangeProvider.cs @@ -12,9 +12,9 @@ namespace Microsoft.CodeAnalysis.Remote.Razor.SpellCheck; -[Export(typeof(ICSharpSpellCheckService)), Shared] +[Export(typeof(ICSharpSpellCheckRangeProvider)), Shared] [method: ImportingConstructor] -internal class RemoteCSharpSpellCheckService() : ICSharpSpellCheckService +internal class RemoteCSharpSpellCheckRangeProvider() : ICSharpSpellCheckRangeProvider { public async Task> GetCSharpSpellCheckRangesAsync(DocumentContext documentContext, CancellationToken cancellationToken) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs index 5e547834463..a81ed10c7f1 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SpellCheck/DocumentSpellCheckEndpointTest.cs @@ -175,7 +175,7 @@ private async Task ValidateSpellCheckRangesAsync(string originalInput, string? f var documentContext = CreateDocumentContext(uri, codeDocument); var requestContext = new RazorRequestContext(documentContext, null!, "lsp/method", uri: null); - var csharpSpellCheckService = new LspCSharpSpellCheckService(LanguageServerFeatureOptions, languageServer); + var csharpSpellCheckService = new LspCSharpSpellCheckRangeProvider(LanguageServerFeatureOptions, languageServer); var spellCheckService = new SpellCheckService(csharpSpellCheckService, DocumentMappingService); var endpoint = new DocumentSpellCheckEndpoint(spellCheckService); From 84c2983392827a137e6b55be48f03a7a0dceb6b8 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 4 Sep 2024 11:21:13 +1000 Subject: [PATCH 273/386] Whitespace --- .../CohostGoToImplementationEndpointTest.cs | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs index 170ca71d6a6..4ee5dab2c8d 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs @@ -23,19 +23,19 @@ public class CohostGoToImplementationEndpointTest(ITestOutputHelper testOutputHe public async Task CSharp_Method() { var input = """ -
+
- @{ - var x = Ge$$tX(); - } + @{ + var x = Ge$$tX(); + } - @code + @code + { + void [|GetX|]() { - void [|GetX|]() - { - } } - """; + } + """; await VerifyCSharpGoToImplementationAsync(input); } @@ -44,22 +44,22 @@ public async Task CSharp_Method() public async Task CSharp_Field() { var input = """ -
+
- @{ - var x = GetX(); - } + @{ + var x = GetX(); + } - @code - { - private string [|_name|]; + @code + { + private string [|_name|]; - string GetX() - { - return _na$$me; - } + string GetX() + { + return _na$$me; } - """; + } + """; await VerifyCSharpGoToImplementationAsync(input); } @@ -68,19 +68,19 @@ string GetX() public async Task CSharp_Multiple() { var input = """ -
+
- @code - { - class [|Base|] { } - class [|Derived1|] : Base { } - class [|Derived2|] : Base { } + @code + { + class [|Base|] { } + class [|Derived1|] : Base { } + class [|Derived2|] : Base { } - void M(Ba$$se b) - { - } + void M(Ba$$se b) + { } - """; + } + """; await VerifyCSharpGoToImplementationAsync(input); } @@ -91,14 +91,14 @@ public async Task Html() // This really just validates Uri remapping, the actual response is largely arbitrary TestCode input = """ -
- - - """; +
+ + + """; var document = CreateProjectAndRazorDocument(input.Text); var inputText = await document.GetTextAsync(DisposalToken); From 074043b5163041beaaf1adf8a9acd75c0bf0a856 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 4 Sep 2024 13:35:33 +1000 Subject: [PATCH 274/386] Remove IsImportDocument Was only used in one place, and that place could never have any result except false due to a FileKind check above --- .../IDocumentSnapshotExtensions.cs | 6 --- .../ProjectSystem/IProjectSnapshot.cs | 1 - .../ProjectSystem/ProjectSnapshot.cs | 10 ----- .../ProjectSystem/RemoteProjectSnapshot.cs | 6 --- .../EphemeralProjectSnapshot.cs | 10 ----- .../DefaultProjectSnapshotTest.cs | 37 ------------------- .../CohostUriPresentationEndpointTest.cs | 20 ++++++++++ 7 files changed, 20 insertions(+), 70 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshotExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshotExtensions.cs index 6b6ec6a9360..62a90f11432 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshotExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IDocumentSnapshotExtensions.cs @@ -27,12 +27,6 @@ internal static class IDocumentSnapshotExtensions var project = documentSnapshot.Project; - // If the document is an import document, then it can't be a component - if (project.IsImportDocument(documentSnapshot)) - { - return null; - } - // If we got this far, we can check for tag helpers var tagHelpers = await project.GetTagHelpersAsync(cancellationToken).ConfigureAwait(false); foreach (var tagHelper in tagHelpers) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshot.cs index 56459d179bc..070e8a325e8 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshot.cs @@ -39,7 +39,6 @@ internal interface IProjectSnapshot RazorProjectEngine GetProjectEngine(); IDocumentSnapshot? GetDocument(string filePath); bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSnapshot? document); - bool IsImportDocument(IDocumentSnapshot document); /// /// If the provided document is an import document, gets the other documents in the project diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs index ff80c8c93a7..066808d200a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs @@ -79,16 +79,6 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSna return document is not null; } - public bool IsImportDocument(IDocumentSnapshot document) - { - if (document is null) - { - throw new ArgumentNullException(nameof(document)); - } - - return document.TargetPath is { } targetPath && State.ImportsToRelatedDocuments.ContainsKey(targetPath); - } - public ImmutableArray GetRelatedDocuments(IDocumentSnapshot document) { if (document is null) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs index cfd8e70171a..8e59270f35b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs @@ -176,12 +176,6 @@ public ImmutableArray GetRelatedDocuments(IDocumentSnapshot d return builder.DrainToImmutable(); } - public bool IsImportDocument(IDocumentSnapshot document) - { - return document.TargetPath is { } targetPath && - _importsToRelatedDocumentsLazy.Value.ContainsKey(targetPath); - } - private RazorConfiguration CreateRazorConfiguration() { // See RazorSourceGenerator.RazorProviders.cs diff --git a/src/Razor/src/Microsoft.VisualStudio.LegacyEditor.Razor/EphemeralProjectSnapshot.cs b/src/Razor/src/Microsoft.VisualStudio.LegacyEditor.Razor/EphemeralProjectSnapshot.cs index e0d3b2670a7..16b41408362 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LegacyEditor.Razor/EphemeralProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LegacyEditor.Razor/EphemeralProjectSnapshot.cs @@ -72,16 +72,6 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSna return false; } - public bool IsImportDocument(IDocumentSnapshot document) - { - if (document is null) - { - throw new ArgumentNullException(nameof(document)); - } - - return false; - } - public ImmutableArray GetRelatedDocuments(IDocumentSnapshot document) { if (document is null) diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/DefaultProjectSnapshotTest.cs b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/DefaultProjectSnapshotTest.cs index 4c8734c90c7..b661352b3e0 100644 --- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/DefaultProjectSnapshotTest.cs +++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/ProjectSystem/DefaultProjectSnapshotTest.cs @@ -61,43 +61,6 @@ public void ProjectSnapshot_CachesDocumentSnapshots() d => Assert.Same(d.Value, snapshot.GetDocument(d.Key))); } - [Fact] - public void IsImportDocument_NonImportDocument_ReturnsFalse() - { - // Arrange - var state = ProjectState.Create(ProjectEngineFactoryProvider, _hostProject, _projectWorkspaceState) - .WithAddedHostDocument(_documents[0], DocumentState.EmptyLoader); - var snapshot = new ProjectSnapshot(state); - - var document = snapshot.GetDocument(_documents[0].FilePath); - Assert.NotNull(document); - - // Act - var result = snapshot.IsImportDocument(document); - - // Assert - Assert.False(result); - } - - [Fact] - public void IsImportDocument_ImportDocument_ReturnsTrue() - { - // Arrange - var state = ProjectState.Create(ProjectEngineFactoryProvider, _hostProject, _projectWorkspaceState) - .WithAddedHostDocument(_documents[0], DocumentState.EmptyLoader) - .WithAddedHostDocument(TestProjectData.SomeProjectImportFile, DocumentState.EmptyLoader); - var snapshot = new ProjectSnapshot(state); - - var document = snapshot.GetDocument(TestProjectData.SomeProjectImportFile.FilePath); - Assert.NotNull(document); - - // Act - var result = snapshot.IsImportDocument(document); - - // Assert - Assert.True(result); - } - [Fact] public void GetRelatedDocuments_NonImportDocument_ReturnsEmpty() { diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs index 981e8f7a8b9..d1f965f0b76 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs @@ -97,6 +97,26 @@ public class Component : Microsoft.AspNetCore.Components.ComponentBase expected: ""); } + [Fact] + public async Task ImportsFile() + { + await VerifyUriPresentationAsync( + input: """ + This is a Razor document. + +
+ [||] +
+ + The end. + """, + additionalFiles: [ + (File("_Imports.razor"), "") + ], + uris: [FileUri("_Imports.razor")], + expected: null); + } + [Fact] public async Task Html_IntoCSharp_NoTag() { From 7107165cd47ce9ccd41a7bc006a231fb76b9d99e Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 4 Sep 2024 13:58:57 +1000 Subject: [PATCH 275/386] Remove GetRelatedDocuments from IProjectSnapshot This is only called from the LSP server, and shouldn't be called from cohosting, so now it can't be! --- .../ProjectSystem/IProjectSnapshot.cs | 9 ----- .../ProjectSystem/ProjectChangeEventArgs.cs | 10 +++--- .../ProjectSystem/ProjectSnapshot.cs | 5 +++ .../ProjectSnapshotManager.Entry.cs | 4 +-- .../ProjectSystem/ProjectSnapshotManager.cs | 6 ++-- .../ProjectSystem/RemoteProjectSnapshot.cs | 36 ------------------- .../EphemeralProjectSnapshot.cs | 10 ------ .../VisualStudioDocumentTrackerTest.cs | 11 +++--- 8 files changed, 22 insertions(+), 69 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshot.cs index 070e8a325e8..5201a448104 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshot.cs @@ -39,13 +39,4 @@ internal interface IProjectSnapshot RazorProjectEngine GetProjectEngine(); IDocumentSnapshot? GetDocument(string filePath); bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSnapshot? document); - - /// - /// If the provided document is an import document, gets the other documents in the project - /// that include directives specified by the provided document. Otherwise returns an empty - /// list. - /// - /// The document. - /// A list of related documents. - ImmutableArray GetRelatedDocuments(IDocumentSnapshot document); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectChangeEventArgs.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectChangeEventArgs.cs index 9d2843994e0..be4ce51e13b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectChangeEventArgs.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectChangeEventArgs.cs @@ -8,12 +8,12 @@ namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; internal class ProjectChangeEventArgs : EventArgs { - public ProjectChangeEventArgs(IProjectSnapshot older, IProjectSnapshot newer, ProjectChangeKind kind) + public ProjectChangeEventArgs(ProjectSnapshot older, ProjectSnapshot newer, ProjectChangeKind kind) : this(older, newer, null, kind, false) { } - public ProjectChangeEventArgs(IProjectSnapshot? older, IProjectSnapshot? newer, string? documentFilePath, ProjectChangeKind kind, bool solutionIsClosing) + public ProjectChangeEventArgs(ProjectSnapshot? older, ProjectSnapshot? newer, string? documentFilePath, ProjectChangeKind kind, bool solutionIsClosing) { if (older is null && newer is null) { @@ -29,9 +29,9 @@ public ProjectChangeEventArgs(IProjectSnapshot? older, IProjectSnapshot? newer, ProjectKey = (older ?? newer)!.Key; } - public IProjectSnapshot? Older { get; } + public ProjectSnapshot? Older { get; } - public IProjectSnapshot? Newer { get; } + public ProjectSnapshot? Newer { get; } public ProjectKey ProjectKey { get; } @@ -43,6 +43,6 @@ public ProjectChangeEventArgs(IProjectSnapshot? older, IProjectSnapshot? newer, public bool SolutionIsClosing { get; } - public static ProjectChangeEventArgs CreateTestInstance(IProjectSnapshot older, IProjectSnapshot newer, string documentFilePath, ProjectChangeKind kind, bool solutionIsClosing = false) => + public static ProjectChangeEventArgs CreateTestInstance(ProjectSnapshot older, ProjectSnapshot newer, string documentFilePath, ProjectChangeKind kind, bool solutionIsClosing = false) => new(older, newer, documentFilePath, kind, solutionIsClosing); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs index 066808d200a..1278e741d68 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshot.cs @@ -79,6 +79,11 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSna return document is not null; } + /// + /// If the provided document is an import document, gets the other documents in the project + /// that include directives specified by the provided document. Otherwise returns an empty + /// list. + /// public ImmutableArray GetRelatedDocuments(IDocumentSnapshot document) { if (document is null) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.Entry.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.Entry.cs index 48341f3dd5d..c02de7a1bad 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.Entry.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.Entry.cs @@ -7,9 +7,9 @@ internal partial class ProjectSnapshotManager { private sealed record Entry(ProjectState State) { - private IProjectSnapshot? _snapshotUnsafe; + private ProjectSnapshot? _snapshotUnsafe; - public IProjectSnapshot GetSnapshot() + public ProjectSnapshot GetSnapshot() { return _snapshotUnsafe ??= new ProjectSnapshot(State); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.cs index 40f7d967401..96c5e4b8d65 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.cs @@ -383,7 +383,7 @@ private void SolutionClosed() } } - private void NotifyListeners(IProjectSnapshot? older, IProjectSnapshot? newer, string? documentFilePath, ProjectChangeKind kind) + private void NotifyListeners(ProjectSnapshot? older, ProjectSnapshot? newer, string? documentFilePath, ProjectChangeKind kind) { if (!_initialized) { @@ -421,8 +421,8 @@ private bool TryUpdate( ProjectKey projectKey, string? documentFilePath, IUpdateProjectAction action, - [NotNullWhen(true)] out IProjectSnapshot? oldSnapshot, - [NotNullWhen(true)] out IProjectSnapshot? newSnapshot) + [NotNullWhen(true)] out ProjectSnapshot? oldSnapshot, + [NotNullWhen(true)] out ProjectSnapshot? newSnapshot) { using var upgradeableLock = _readerWriterLock.DisposableUpgradeableRead(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs index 8e59270f35b..6d5d2ec6040 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs @@ -11,7 +11,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.ProjectEngineHost; using Microsoft.AspNetCore.Razor.ProjectSystem; using Microsoft.AspNetCore.Razor.Telemetry; @@ -32,7 +31,6 @@ internal class RemoteProjectSnapshot : IProjectSnapshot private readonly ITelemetryReporter _telemetryReporter; private readonly Lazy _lazyConfiguration; private readonly Lazy _lazyProjectEngine; - private readonly Lazy>> _importsToRelatedDocumentsLazy; private ImmutableArray _tagHelpers; @@ -56,18 +54,6 @@ public RemoteProjectSnapshot(Project project, DocumentSnapshotFactory documentSn builder.SetSupportLocalizedComponentNames(); }); }); - - _importsToRelatedDocumentsLazy = new Lazy>>(() => - { - var importsToRelatedDocuments = ImmutableDictionary.Create>(FilePathNormalizingComparer.Instance); - foreach (var documentFilePath in DocumentFilePaths) - { - var importTargetPaths = ProjectState.GetImportDocumentTargetPaths(documentFilePath, FileKinds.GetFileKindFromFilePath(documentFilePath), _lazyProjectEngine.Value); - importsToRelatedDocuments = ProjectState.AddToImportsToRelatedDocuments(importsToRelatedDocuments, documentFilePath, importTargetPaths); - } - - return importsToRelatedDocuments; - }); } public RazorConfiguration Configuration => throw new InvalidOperationException("Should not be called for cohosted projects."); @@ -154,28 +140,6 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSna /// internal RazorProjectEngine GetProjectEngine_CohostOnly() => _lazyProjectEngine.Value; - public ImmutableArray GetRelatedDocuments(IDocumentSnapshot document) - { - var targetPath = document.TargetPath.AssumeNotNull(); - - if (!_importsToRelatedDocumentsLazy.Value.TryGetValue(targetPath, out var relatedDocuments)) - { - return []; - } - - using var builder = new PooledArrayBuilder(relatedDocuments.Length); - - foreach (var relatedDocumentFilePath in relatedDocuments) - { - if (TryGetDocument(relatedDocumentFilePath, out var relatedDocument)) - { - builder.Add(relatedDocument); - } - } - - return builder.DrainToImmutable(); - } - private RazorConfiguration CreateRazorConfiguration() { // See RazorSourceGenerator.RazorProviders.cs diff --git a/src/Razor/src/Microsoft.VisualStudio.LegacyEditor.Razor/EphemeralProjectSnapshot.cs b/src/Razor/src/Microsoft.VisualStudio.LegacyEditor.Razor/EphemeralProjectSnapshot.cs index 16b41408362..ebc897de409 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LegacyEditor.Razor/EphemeralProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LegacyEditor.Razor/EphemeralProjectSnapshot.cs @@ -72,16 +72,6 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSna return false; } - public ImmutableArray GetRelatedDocuments(IDocumentSnapshot document) - { - if (document is null) - { - throw new ArgumentNullException(nameof(document)); - } - - return ImmutableArray.Empty; - } - public RazorProjectEngine GetProjectEngine() { return _projectEngine.Value; diff --git a/src/Razor/test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/VisualStudioDocumentTrackerTest.cs b/src/Razor/test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/VisualStudioDocumentTrackerTest.cs index ea936cb99b2..1ce0405fbdb 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/VisualStudioDocumentTrackerTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/VisualStudioDocumentTrackerTest.cs @@ -161,7 +161,8 @@ await _projectManager.UpdateAsync(updater => updater.ProjectAdded(_hostProject); }); - var e = new ProjectChangeEventArgs(null!, _projectManager.GetLoadedProject(_hostProject.Key), ProjectChangeKind.ProjectAdded); + var projectSnapshot = (ProjectSnapshot)_projectManager.GetLoadedProject(_hostProject.Key); + var e = new ProjectChangeEventArgs(null!, projectSnapshot, ProjectChangeKind.ProjectAdded); var called = false; _documentTracker.ContextChanged += (sender, args) => @@ -187,7 +188,8 @@ await _projectManager.UpdateAsync(updater => updater.ProjectAdded(_hostProject); }); - var e = new ProjectChangeEventArgs(null!, _projectManager.GetLoadedProject(_hostProject.Key), ProjectChangeKind.ProjectChanged); + var projectSnapshot = (ProjectSnapshot)_projectManager.GetLoadedProject(_hostProject.Key); + var e = new ProjectChangeEventArgs(null!, projectSnapshot, ProjectChangeKind.ProjectChanged); var called = false; _documentTracker.ContextChanged += (sender, args) => @@ -213,7 +215,7 @@ await _projectManager.UpdateAsync(updater => updater.ProjectAdded(_hostProject); }); - var project = _projectManager.GetLoadedProject(_hostProject.Key); + var project = (ProjectSnapshot)_projectManager.GetLoadedProject(_hostProject.Key); await _projectManager.UpdateAsync(updater => { @@ -247,7 +249,8 @@ await _projectManager.UpdateAsync(updater => updater.ProjectAdded(_otherHostProject); }); - var e = new ProjectChangeEventArgs(null!, _projectManager.GetLoadedProject(_otherHostProject.Key), ProjectChangeKind.ProjectChanged); + var projectSnapshot = (ProjectSnapshot)_projectManager.GetLoadedProject(_otherHostProject.Key); + var e = new ProjectChangeEventArgs(null!, projectSnapshot, ProjectChangeKind.ProjectChanged); var called = false; _documentTracker.ContextChanged += (sender, args) => called = true; From 4ec65fb914d964d3207edf5a3b8b5dab998d9d60 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 23:00:10 -0700 Subject: [PATCH 276/386] [main] Update dependencies from dotnet/arcade (#10816) * Update dependencies from https://github.com/dotnet/arcade build 20240829.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24426.3 -> To Version 9.0.0-beta.24429.3 * Update dependencies from https://github.com/dotnet/arcade build 20240829.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24429.3 -> To Version 9.0.0-beta.24429.5 * Failed to perform coherency update for one or more dependencies. --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 613a3732666..25e8a53eb8f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - e3bdd9a0f2a65fe037ba1adb2261eea48a840fa4 + d21db44e84b9038ea7b2add139adee2303d46800 - + https://github.com/dotnet/arcade - e3bdd9a0f2a65fe037ba1adb2261eea48a840fa4 + d21db44e84b9038ea7b2add139adee2303d46800 diff --git a/eng/Versions.props b/eng/Versions.props index c4680833301..af72d6b3939 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24426.3 + 9.0.0-beta.24429.5 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.12.0-2.24419.3 diff --git a/global.json b/global.json index 2e613368edb..88f4f0ce315 100644 --- a/global.json +++ b/global.json @@ -22,7 +22,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24426.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24429.5", "Microsoft.Build.NoTargets": "3.7.0" } } From 41acbdeb665c11bf26fea16b017ebf54e6a74e22 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 23:00:56 -0700 Subject: [PATCH 277/386] Update dependencies from https://github.com/dotnet/arcade build 20240826.2 (#10808) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24421.4 -> To Version 8.0.0-beta.24426.2 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a674ac10379..100731f89a8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - 4460b755f3c7c89e9660d9580ff79afc4218dd85 + 80264e60280e2815e7d65871081ccac04a32445c - + https://github.com/dotnet/arcade - 4460b755f3c7c89e9660d9580ff79afc4218dd85 + 80264e60280e2815e7d65871081ccac04a32445c diff --git a/eng/Versions.props b/eng/Versions.props index 76c5f9ea272..9296f591371 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 8.0.0-beta.24421.4 + 8.0.0-beta.24426.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.11.0-3.24303.3 diff --git a/global.json b/global.json index bbd507f30dc..0b7a32c0065 100644 --- a/global.json +++ b/global.json @@ -21,7 +21,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24421.4", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24426.2", "Microsoft.Build.NoTargets": "3.7.0" } } From 187962c1773a6056402dd1d92099abaea5c7fdac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 09:00:43 +0200 Subject: [PATCH 278/386] [release/dev17.10] Update dependencies from dotnet/arcade (#10529) * Update dependencies from https://github.com/dotnet/arcade build 20240624.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24324.1 * Update dependencies from https://github.com/dotnet/arcade build 20240624.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24324.7 * Update dependencies from https://github.com/dotnet/arcade build 20240624.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24324.7 * Update dependencies from https://github.com/dotnet/arcade build 20240624.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24324.7 * Update dependencies from https://github.com/dotnet/arcade build 20240624.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24324.7 * Update dependencies from https://github.com/dotnet/arcade build 20240626.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24326.4 * Update dependencies from https://github.com/dotnet/arcade build 20240626.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24326.4 * Update dependencies from https://github.com/dotnet/arcade build 20240628.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24328.2 * Update dependencies from https://github.com/dotnet/arcade build 20240628.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24328.2 * Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 * Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 * Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 * Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 * Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 * Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 * Update dependencies from https://github.com/dotnet/arcade build 20240702.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24352.1 * Update dependencies from https://github.com/dotnet/arcade build 20240709.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24359.3 * Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 * Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 * Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 * Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 * Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 * Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 * Update dependencies from https://github.com/dotnet/arcade build 20240710.5 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24360.5 * Update dependencies from https://github.com/dotnet/arcade build 20240716.7 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24366.7 * Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 * Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 * Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 * Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 * Update dependencies from https://github.com/dotnet/arcade build 20240717.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24367.1 * Update dependencies from https://github.com/dotnet/arcade build 20240722.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24372.3 * Update dependencies from https://github.com/dotnet/arcade build 20240722.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24372.3 * Update dependencies from https://github.com/dotnet/arcade build 20240722.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24372.3 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240726.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24321.3 -> To Version 8.0.0-beta.24376.1 * Update dependencies from https://github.com/dotnet/arcade build 20240812.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24376.1 -> To Version 8.0.0-beta.24412.1 * Update dependencies from https://github.com/dotnet/arcade build 20240813.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24412.1 -> To Version 8.0.0-beta.24413.2 * Update dependencies from https://github.com/dotnet/arcade build 20240821.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24413.2 -> To Version 8.0.0-beta.24421.4 * Update dependencies from https://github.com/dotnet/arcade build 20240826.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 8.0.0-beta.24421.4 -> To Version 8.0.0-beta.24426.2 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 +++--- eng/Versions.props | 2 +- eng/common/post-build/publish-using-darc.ps1 | 15 +++++----- eng/common/sdl/NuGet.config | 4 +-- eng/common/sdl/execute-all-sdl-tools.ps1 | 4 +-- eng/common/sdl/init-sdl.ps1 | 8 ------ eng/common/sdl/sdl.ps1 | 4 ++- .../job/publish-build-assets.yml | 23 +++++++++------ .../post-build/post-build.yml | 10 ++++--- .../templates-official/steps/execute-sdl.yml | 2 -- .../steps/get-federated-access-token.yml | 14 +++++++++- .../templates/job/publish-build-assets.yml | 23 +++++++++------ .../templates/post-build/post-build.yml | 10 ++++--- .../post-build/setup-maestro-vars.yml | 28 +++++++++---------- eng/common/templates/steps/execute-sdl.yml | 7 +++-- .../steps/get-federated-access-token.yml | 14 +++++++++- .../templates/steps/telemetry-start.yml | 2 +- global.json | 6 ++-- 18 files changed, 106 insertions(+), 78 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2acd2fa2f13..580471ed8d7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 80264e60280e2815e7d65871081ccac04a32445c - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 80264e60280e2815e7d65871081ccac04a32445c diff --git a/eng/Versions.props b/eng/Versions.props index 0133b0532fc..5a870c4ddec 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24113.1 - 8.0.0-beta.24321.3 + 8.0.0-beta.24426.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.10.0-3.24169.7 diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 5a3a32ea8d7..238945cb5ab 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -2,7 +2,6 @@ param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, [Parameter(Mandatory=$true)][string] $AzdoToken, - [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, @@ -31,13 +30,13 @@ try { } & $darc add-build-to-channel ` - --id $buildId ` - --publishing-infra-version $PublishingInfraVersion ` - --default-channels ` - --source-branch main ` - --azdev-pat $AzdoToken ` - --bar-uri $MaestroApiEndPoint ` - --password $MaestroToken ` + --id $buildId ` + --publishing-infra-version $PublishingInfraVersion ` + --default-channels ` + --source-branch main ` + --azdev-pat "$AzdoToken" ` + --bar-uri "$MaestroApiEndPoint" ` + --ci ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/eng/common/sdl/NuGet.config b/eng/common/sdl/NuGet.config index 3849bdb3cf5..5bfbb02ef04 100644 --- a/eng/common/sdl/NuGet.config +++ b/eng/common/sdl/NuGet.config @@ -5,11 +5,11 @@ - + - + diff --git a/eng/common/sdl/execute-all-sdl-tools.ps1 b/eng/common/sdl/execute-all-sdl-tools.ps1 index 4715d75e974..81ded5b7f47 100644 --- a/eng/common/sdl/execute-all-sdl-tools.ps1 +++ b/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -6,7 +6,6 @@ Param( [string] $BranchName=$env:BUILD_SOURCEBRANCH, # Optional: name of branch or version of gdn settings; defaults to master [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, # Required: the directory where source files are located [string] $ArtifactsDirectory = (Join-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY ('artifacts')), # Required: the directory where build artifacts are located - [string] $AzureDevOpsAccessToken, # Required: access token for dnceng; should be provided via KeyVault # Optional: list of SDL tools to run on source code. See 'configure-sdl-tool.ps1' for tools list # format. @@ -75,7 +74,7 @@ try { } Exec-BlockVerbosely { - & $(Join-Path $PSScriptRoot 'init-sdl.ps1') -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel + & $(Join-Path $PSScriptRoot 'init-sdl.ps1') -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -GuardianLoggerLevel $GuardianLoggerLevel } $gdnFolder = Join-Path $workingDirectory '.gdn' @@ -104,7 +103,6 @@ try { -TargetDirectory $targetDirectory ` -GdnFolder $gdnFolder ` -ToolsList $tools ` - -AzureDevOpsAccessToken $AzureDevOpsAccessToken ` -GuardianLoggerLevel $GuardianLoggerLevel ` -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams ` -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams ` diff --git a/eng/common/sdl/init-sdl.ps1 b/eng/common/sdl/init-sdl.ps1 index 3ac1d92b370..588ff8e22fb 100644 --- a/eng/common/sdl/init-sdl.ps1 +++ b/eng/common/sdl/init-sdl.ps1 @@ -3,7 +3,6 @@ Param( [string] $Repository, [string] $BranchName='master', [string] $WorkingDirectory, - [string] $AzureDevOpsAccessToken, [string] $GuardianLoggerLevel='Standard' ) @@ -21,14 +20,7 @@ $ci = $true # Don't display the console progress UI - it's a huge perf hit $ProgressPreference = 'SilentlyContinue' -# Construct basic auth from AzDO access token; construct URI to the repository's gdn folder stored in that repository; construct location of zip file -$encodedPat = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$AzureDevOpsAccessToken")) -$escapedRepository = [Uri]::EscapeDataString("/$Repository/$BranchName/.gdn") -$uri = "https://dev.azure.com/dnceng/internal/_apis/git/repositories/sdl-tool-cfg/Items?path=$escapedRepository&versionDescriptor[versionOptions]=0&`$format=zip&api-version=5.0" -$zipFile = "$WorkingDirectory/gdn.zip" - Add-Type -AssemblyName System.IO.Compression.FileSystem -$gdnFolder = (Join-Path $WorkingDirectory '.gdn') try { # if the folder does not exist, we'll do a guardian init and push it to the remote repository diff --git a/eng/common/sdl/sdl.ps1 b/eng/common/sdl/sdl.ps1 index 648c5068d7d..7fe603fe995 100644 --- a/eng/common/sdl/sdl.ps1 +++ b/eng/common/sdl/sdl.ps1 @@ -4,6 +4,8 @@ function Install-Gdn { [Parameter(Mandatory=$true)] [string]$Path, + [string]$Source = "https://pkgs.dev.azure.com/dnceng/_packaging/Guardian1ESPTUpstreamOrgFeed/nuget/v3/index.json", + # If omitted, install the latest version of Guardian, otherwise install that specific version. [string]$Version ) @@ -19,7 +21,7 @@ function Install-Gdn { $ci = $true . $PSScriptRoot\..\tools.ps1 - $argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache") + $argumentList = @("install", "Microsoft.Guardian.Cli.win-x64", "-Source $Source", "-OutputDirectory $Path", "-NonInteractive", "-NoCache") if ($Version) { $argumentList += "-Version $Version" diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index 589ac80a18b..0117328800c 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -76,13 +76,16 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 + arguments: > + -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -137,14 +140,16 @@ jobs: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates-official/post-build/post-build.yml b/eng/common/templates-official/post-build/post-build.yml index da1f40958b4..b81b8770b34 100644 --- a/eng/common/templates-official/post-build/post-build.yml +++ b/eng/common/templates-official/post-build/post-build.yml @@ -272,14 +272,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates-official/steps/execute-sdl.yml b/eng/common/templates-official/steps/execute-sdl.yml index 07426fde05d..301d5c591eb 100644 --- a/eng/common/templates-official/steps/execute-sdl.yml +++ b/eng/common/templates-official/steps/execute-sdl.yml @@ -9,8 +9,6 @@ parameters: steps: - task: NuGetAuthenticate@1 - inputs: - nuGetServiceConnections: GuardianConnect - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' diff --git a/eng/common/templates-official/steps/get-federated-access-token.yml b/eng/common/templates-official/steps/get-federated-access-token.yml index e3786cef6df..55e33bd38f7 100644 --- a/eng/common/templates-official/steps/get-federated-access-token.yml +++ b/eng/common/templates-official/steps/get-federated-access-token.yml @@ -3,6 +3,12 @@ parameters: type: string - name: outputVariableName type: string +- name: stepName + type: string + default: 'getFederatedAccessToken' +- name: condition + type: string + default: '' # Resource to get a token for. Common values include: # - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps # - 'https://storage.azure.com/' for storage @@ -10,10 +16,16 @@ parameters: - name: resource type: string default: '499b84ac-1321-427f-aa17-267ca6975798' +- name: isStepOutputVariable + type: boolean + default: false steps: - task: AzureCLI@2 displayName: 'Getting federated access token for feeds' + name: ${{ parameters.stepName }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} inputs: azureSubscription: ${{ parameters.federatedServiceConnection }} scriptType: 'pscore' @@ -25,4 +37,4 @@ steps: exit 1 } Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" \ No newline at end of file diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 8ec0151def2..cc2b346ba8b 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -74,13 +74,16 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 + arguments: > + -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro.dot.net /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -133,14 +136,16 @@ jobs: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index aba44a25a33..c3b6a3012fe 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -268,14 +268,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index 0c87f149a4a..64b9abc6850 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -11,13 +11,14 @@ steps: artifactName: ReleaseConfigs checkDownloadedFiles: true - - task: PowerShell@2 + - task: AzureCLI@2 name: setReleaseVars displayName: Set Release Configs Vars inputs: - targetType: inline - pwsh: true - script: | + azureSubscription: "Darc: Maestro Production" + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | try { if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt @@ -31,15 +32,16 @@ steps: $AzureDevOpsBuildId = $Env:Build_BuildId } else { - $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}" + . $(Build.SourcesDirectory)\eng\common\tools.ps1 + $darc = Get-Darc + $buildInfo = & $darc get-build ` + --id ${{ parameters.BARBuildId }} ` + --extended ` + --output-format json ` + --ci ` + | convertFrom-Json - $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $apiHeaders.Add('Accept', 'application/json') - $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") - - $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - - $BarId = $Env:BARBuildId + $BarId = ${{ parameters.BARBuildId }} $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" $Channels = "[$Channels]" @@ -65,6 +67,4 @@ steps: exit 1 } env: - MAESTRO_API_TOKEN: $(MaestroApiAccessToken) - BARBuildId: ${{ parameters.BARBuildId }} PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/eng/common/templates/steps/execute-sdl.yml b/eng/common/templates/steps/execute-sdl.yml index 07426fde05d..fe0ebf8c904 100644 --- a/eng/common/templates/steps/execute-sdl.yml +++ b/eng/common/templates/steps/execute-sdl.yml @@ -9,8 +9,6 @@ parameters: steps: - task: NuGetAuthenticate@1 - inputs: - nuGetServiceConnections: GuardianConnect - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' @@ -36,16 +34,19 @@ steps: displayName: Execute SDL (Overridden) continueOnError: ${{ parameters.sdlContinueOnError }} condition: ${{ parameters.condition }} + env: + GUARDIAN_DEFAULT_PACKAGE_SOURCE_SECRET: $(System.AccessToken) - ${{ if eq(parameters.overrideParameters, '') }}: - powershell: ${{ parameters.executeAllSdlToolsScript }} -GuardianCliLocation $(GuardianCliLocation) -NugetPackageDirectory $(Build.SourcesDirectory)\.packages - -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) ${{ parameters.additionalParameters }} displayName: Execute SDL continueOnError: ${{ parameters.sdlContinueOnError }} condition: ${{ parameters.condition }} + env: + GUARDIAN_DEFAULT_PACKAGE_SOURCE_SECRET: $(System.AccessToken) - ${{ if ne(parameters.publishGuardianDirectoryToPipeline, 'false') }}: # We want to publish the Guardian results and configuration for easy diagnosis. However, the diff --git a/eng/common/templates/steps/get-federated-access-token.yml b/eng/common/templates/steps/get-federated-access-token.yml index c8c49cc0e8f..55e33bd38f7 100644 --- a/eng/common/templates/steps/get-federated-access-token.yml +++ b/eng/common/templates/steps/get-federated-access-token.yml @@ -3,6 +3,12 @@ parameters: type: string - name: outputVariableName type: string +- name: stepName + type: string + default: 'getFederatedAccessToken' +- name: condition + type: string + default: '' # Resource to get a token for. Common values include: # - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps # - 'https://storage.azure.com/' for storage @@ -10,10 +16,16 @@ parameters: - name: resource type: string default: '499b84ac-1321-427f-aa17-267ca6975798' +- name: isStepOutputVariable + type: boolean + default: false steps: - task: AzureCLI@2 displayName: 'Getting federated access token for feeds' + name: ${{ parameters.stepName }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} inputs: azureSubscription: ${{ parameters.federatedServiceConnection }} scriptType: 'pscore' @@ -25,4 +37,4 @@ steps: exit 1 } Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" \ No newline at end of file + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" \ No newline at end of file diff --git a/eng/common/templates/steps/telemetry-start.yml b/eng/common/templates/steps/telemetry-start.yml index 32c01ef0b55..6abbcb33a67 100644 --- a/eng/common/templates/steps/telemetry-start.yml +++ b/eng/common/templates/steps/telemetry-start.yml @@ -8,7 +8,7 @@ parameters: steps: - ${{ if and(eq(parameters.runAsPublic, 'false'), not(eq(variables['System.TeamProject'], 'public'))) }}: - - task: AzureKeyVault@1 + - task: AzureKeyVault@2 inputs: azureSubscription: 'HelixProd_KeyVault' KeyVaultName: HelixProdKV diff --git a/global.json b/global.json index 659d5486c4e..9e2155c9f28 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "8.0.101", + "dotnet": "8.0.108", "runtimes": { "dotnet": [ "2.1.30", @@ -16,12 +16,12 @@ } }, "sdk": { - "version": "8.0.101", + "version": "8.0.108", "allowPrerelease": false, "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24321.3", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24426.2", "Microsoft.Build.NoTargets": "2.0.1" } } From de7eddc0e99bbae2c131e3eb6a861a6a194337d9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:33:30 -0700 Subject: [PATCH 279/386] Update dependencies from https://github.com/dotnet/arcade build 20240903.1 (#10835) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24429.5 -> To Version 9.0.0-beta.24453.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 25e8a53eb8f..271bb3308f5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - d21db44e84b9038ea7b2add139adee2303d46800 + dd332f2d4e21daa8b79f84251ab156af9a0b11b2 - + https://github.com/dotnet/arcade - d21db44e84b9038ea7b2add139adee2303d46800 + dd332f2d4e21daa8b79f84251ab156af9a0b11b2 diff --git a/eng/Versions.props b/eng/Versions.props index af72d6b3939..de22d65613b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24429.5 + 9.0.0-beta.24453.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.12.0-2.24419.3 diff --git a/global.json b/global.json index 88f4f0ce315..7f50b048965 100644 --- a/global.json +++ b/global.json @@ -22,7 +22,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24429.5", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24453.1", "Microsoft.Build.NoTargets": "3.7.0" } } From 148d71a9a319ea929c938ae3ba691a460cf63b5c Mon Sep 17 00:00:00 2001 From: Jordi Ramos Date: Wed, 4 Sep 2024 14:43:47 -0700 Subject: [PATCH 280/386] Fix LF line-ending auto format bug (#10802) * Implemented a line normalization function that prevents the language server from sending /r to LF line ending docs * check if indentation location has been processed * added LF line ending document to all previous razor formatting test cases * skipping some LF line ending formatting tests. Created an issue to track the progress --- .../Extensions/SourceTextExtensions.cs | 29 +++++++++++++ .../Passes/CSharpFormattingPassBase.cs | 5 ++- .../Formatting/RazorFormattingService.cs | 21 +++++++++- .../CodeDirectiveFormattingTest.cs | 6 ++- .../Formatting_NetFx/FormattingTestBase.cs | 42 +++++++++++++++++-- .../Formatting_NetFx/HtmlFormattingTest.cs | 18 +++++--- 6 files changed, 107 insertions(+), 14 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/SourceTextExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/SourceTextExtensions.cs index 77b8b9b1b8e..954acc93ae1 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/SourceTextExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/SourceTextExtensions.cs @@ -296,4 +296,33 @@ public static TextEdit[] MinimizeTextEdits(this SourceText text, TextEdit[] edit var cleanEdits = cleanChanges.Select(text.GetTextEdit).ToArray(); return cleanEdits; } + + /// + /// Determines if the given has more LF line endings ('\n') than CRLF line endings ('\r\n'). + /// + /// The to examine. + /// + /// true if the is deemed to use LF line endings; otherwise, false. + /// + public static bool HasLFLineEndings(this SourceText text) + { + var crlfCount = 0; + var lfCount = 0; + + foreach (var line in text.Lines) + { + var lineBreakSpan = TextSpan.FromBounds(line.End, line.EndIncludingLineBreak); + var lineBreak = line.Text?.ToString(lineBreakSpan) ?? string.Empty; + if (lineBreak == "\r\n") + { + crlfCount++; + } + else if (lineBreak == "\n") + { + lfCount++; + } + } + + return lfCount > crlfCount; + } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.cs index 4387ce3d7e6..e785aa49500 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.cs @@ -133,7 +133,10 @@ protected async Task> AdjustIndentationAsync(FormattingContext } var scopeOwner = syntaxTreeRoot.FindInnermostNode(originalLocation); - sourceMappingIndentations[originalLocation] = new IndentationData(indentation); + if (!sourceMappingIndentations.ContainsKey(originalLocation)) + { + sourceMappingIndentations[originalLocation] = new IndentationData(indentation); + } // For @section blocks we have special handling to add a fake source mapping/significant location at the end of the // section, to return the indentation back to before the start of the section block. diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index d9f012ff881..176d050550b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -108,7 +108,8 @@ public async Task GetDocumentFormattingEditsAsync( ? result : result.Where(e => range.LineOverlapsWith(e.Range)).ToArray(); - return originalText.MinimizeTextEdits(filteredEdits); + var normalizedEdits = NormalizeLineEndings(originalText, filteredEdits); + return originalText.MinimizeTextEdits(normalizedEdits); } public Task GetCSharpOnTypeFormattingEditsAsync(DocumentContext documentContext, RazorFormattingOptions options, int hostDocumentIndex, char triggerCharacter, CancellationToken cancellationToken) @@ -279,4 +280,22 @@ private static void UnwrapCSharpSnippets(TextEdit[] razorEdits) edit.NewText = edit.NewText.Replace("/*$0*/", "$0"); } } + + /// + /// This method counts the occurrences of CRLF and LF line endings in the original text. + /// If LF line endings are more prevalent, it removes any CR characters from the text edits + /// to ensure consistency with the LF style. + /// + private TextEdit[] NormalizeLineEndings(SourceText originalText, TextEdit[] edits) + { + if (originalText.HasLFLineEndings()) + { + foreach (var edit in edits) + { + edit.NewText = edit.NewText.Replace("\r", ""); + } + } + + return edits; + } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveFormattingTest.cs index 80589eb18ff..24ca9cf007a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveFormattingTest.cs @@ -1699,7 +1699,8 @@ await RunFormattingTestAsync( private IEnumerable _items = new[] { 1, 2, 3, 4, 5 }; } """, - tagHelpers: GetComponentWithCascadingTypeParameter()); + tagHelpers: GetComponentWithCascadingTypeParameter(), + skipFlipLineEndingTest: true); } [Fact] @@ -1789,7 +1790,8 @@ await RunFormattingTestAsync( private IEnumerable _items2 = new long[] { 1, 2, 3, 4, 5 }; } """, - tagHelpers: GetComponentWithTwoCascadingTypeParameter()); + tagHelpers: GetComponentWithTwoCascadingTypeParameter(), + skipFlipLineEndingTest: true); // tracked by https://github.com/dotnet/razor/issues/10836 } [Fact] diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index 8835b479edc..a43adfed09a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -49,14 +49,26 @@ private protected async Task RunFormattingTestAsync( ImmutableArray tagHelpers = default, bool allowDiagnostics = false, RazorLSPOptions? razorLSPOptions = null, - bool inGlobalNamespace = false) + bool inGlobalNamespace = false, + bool skipFlipLineEndingTest = false) { // Run with and without forceRuntimeCodeGeneration - await RunFormattingTestAsync(input, expected, tabSize, insertSpaces, fileKind, tagHelpers, allowDiagnostics, razorLSPOptions, inGlobalNamespace, forceRuntimeCodeGeneration: true); - await RunFormattingTestAsync(input, expected, tabSize, insertSpaces, fileKind, tagHelpers, allowDiagnostics, razorLSPOptions, inGlobalNamespace, forceRuntimeCodeGeneration: false); + await RunFormattingTestInternalAsync(input, expected, tabSize, insertSpaces, fileKind, tagHelpers, allowDiagnostics, razorLSPOptions, inGlobalNamespace, forceRuntimeCodeGeneration: true); + await RunFormattingTestInternalAsync(input, expected, tabSize, insertSpaces, fileKind, tagHelpers, allowDiagnostics, razorLSPOptions, inGlobalNamespace, forceRuntimeCodeGeneration: false); + + // some tests are failing, skip for now, tracked by https://github.com/dotnet/razor/issues/10836 + if (!skipFlipLineEndingTest) + { + // flip the line endings of the stings (LF to CRLF and vice versa) and run again + input = FlipLineEndings(input); + expected = FlipLineEndings(expected); + + await RunFormattingTestInternalAsync(input, expected, tabSize, insertSpaces, fileKind, tagHelpers, allowDiagnostics, razorLSPOptions, inGlobalNamespace, forceRuntimeCodeGeneration: true); + await RunFormattingTestInternalAsync(input, expected, tabSize, insertSpaces, fileKind, tagHelpers, allowDiagnostics, razorLSPOptions, inGlobalNamespace, forceRuntimeCodeGeneration: false); + } } - private async Task RunFormattingTestAsync(string input, string expected, int tabSize, bool insertSpaces, string? fileKind, ImmutableArray tagHelpers, bool allowDiagnostics, RazorLSPOptions? razorLSPOptions, bool inGlobalNamespace, bool forceRuntimeCodeGeneration) + private async Task RunFormattingTestInternalAsync(string input, string expected, int tabSize, bool insertSpaces, string? fileKind, ImmutableArray tagHelpers, bool allowDiagnostics, RazorLSPOptions? razorLSPOptions, bool inGlobalNamespace, bool forceRuntimeCodeGeneration) { // Arrange fileKind ??= FileKinds.Component; @@ -351,4 +363,26 @@ internal static IDocumentSnapshot CreateDocumentSnapshot(string path, ImmutableA }); return documentSnapshot.Object; } + + private static string FlipLineEndings(string input) + { + if (string.IsNullOrEmpty(input)) + { + return input; + } + + var hasCRLF = input.Contains("\r\n"); + var hasLF = !hasCRLF && input.Contains("\n"); + + if (hasCRLF) + { + return input.Replace("\r\n", "\n"); + } + else if (hasLF) + { + return input.Replace("\n", "\r\n"); + } + + return input; + } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs index 6ef32d08326..300f2fc42c1 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs @@ -487,7 +487,8 @@ await RunFormattingTestAsync( } """, - tagHelpers: tagHelpers); + tagHelpers: tagHelpers, + skipFlipLineEndingTest: true); // tracked by https://github.com/dotnet/razor/issues/10836 } [Fact] @@ -595,7 +596,8 @@ await RunFormattingTestAsync( @{

} - """); + """, + skipFlipLineEndingTest: true); // tracked by https://github.com/dotnet/razor/issues/10836 } [Fact] @@ -1316,7 +1318,8 @@ await RunFormattingTestAsync( public bool VarBool { get; set; } } """, - fileKind: FileKinds.Component); + fileKind: FileKinds.Component, + skipFlipLineEndingTest: true); // tracked by https://github.com/dotnet/razor/issues/10836 } [Fact] @@ -1428,7 +1431,8 @@ await RunFormattingTestAsync( public bool VarBool { get; set; } } """, - fileKind: FileKinds.Component); + fileKind: FileKinds.Component, + skipFlipLineEndingTest: true); // tracked by https://github.com/dotnet/razor/issues/10836 } [Fact] @@ -1486,7 +1490,8 @@ await RunFormattingTestAsync( public bool VarBool { get; set; } } """, - fileKind: FileKinds.Component); + fileKind: FileKinds.Component, + skipFlipLineEndingTest: true); // tracked by https://github.com/dotnet/razor/issues/10836 } [Fact] @@ -1794,7 +1799,8 @@ await RunFormattingTestAsync( } """, - tagHelpers: CreateTagHelpers()); + tagHelpers: CreateTagHelpers(), + skipFlipLineEndingTest: true); // tracked by https://github.com/dotnet/razor/issues/10836 ImmutableArray CreateTagHelpers() { From 42cc39e4a95bc135b06f83b9fd3e08367247ec96 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 5 Sep 2024 08:34:32 +1000 Subject: [PATCH 281/386] PR Feedback --- .../ProjectSystem/IProjectSnapshotExtensions.cs | 11 +++++++++++ .../ProjectSystem/ProjectChangeEventArgs.cs | 10 +++++----- .../ProjectSystem/ProjectSnapshotManager.Entry.cs | 4 ++-- .../ProjectSystem/ProjectSnapshotManager.cs | 6 +++--- .../VisualStudioDocumentTrackerTest.cs | 11 ++++------- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshotExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshotExtensions.cs index 3d48ba9d848..4735509191e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshotExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/IProjectSnapshotExtensions.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; using System.Collections.Immutable; using System.Diagnostics; using System.Threading; @@ -50,4 +51,14 @@ public static ImmutableArray GetTagHelpersSynchronously(thi return tagHelperTask.Result; #pragma warning restore VSTHRD002 // Avoid problematic synchronous waits } + + public static ImmutableArray GetRelatedDocuments(this IProjectSnapshot projectSnapshot, IDocumentSnapshot document) + { + if (projectSnapshot is not ProjectSnapshot project) + { + throw new InvalidOperationException("This method can only be called with a ProjectSnapshot."); + } + + return project.GetRelatedDocuments(document); + } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectChangeEventArgs.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectChangeEventArgs.cs index be4ce51e13b..9d2843994e0 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectChangeEventArgs.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectChangeEventArgs.cs @@ -8,12 +8,12 @@ namespace Microsoft.CodeAnalysis.Razor.ProjectSystem; internal class ProjectChangeEventArgs : EventArgs { - public ProjectChangeEventArgs(ProjectSnapshot older, ProjectSnapshot newer, ProjectChangeKind kind) + public ProjectChangeEventArgs(IProjectSnapshot older, IProjectSnapshot newer, ProjectChangeKind kind) : this(older, newer, null, kind, false) { } - public ProjectChangeEventArgs(ProjectSnapshot? older, ProjectSnapshot? newer, string? documentFilePath, ProjectChangeKind kind, bool solutionIsClosing) + public ProjectChangeEventArgs(IProjectSnapshot? older, IProjectSnapshot? newer, string? documentFilePath, ProjectChangeKind kind, bool solutionIsClosing) { if (older is null && newer is null) { @@ -29,9 +29,9 @@ public ProjectChangeEventArgs(ProjectSnapshot? older, ProjectSnapshot? newer, st ProjectKey = (older ?? newer)!.Key; } - public ProjectSnapshot? Older { get; } + public IProjectSnapshot? Older { get; } - public ProjectSnapshot? Newer { get; } + public IProjectSnapshot? Newer { get; } public ProjectKey ProjectKey { get; } @@ -43,6 +43,6 @@ public ProjectChangeEventArgs(ProjectSnapshot? older, ProjectSnapshot? newer, st public bool SolutionIsClosing { get; } - public static ProjectChangeEventArgs CreateTestInstance(ProjectSnapshot older, ProjectSnapshot newer, string documentFilePath, ProjectChangeKind kind, bool solutionIsClosing = false) => + public static ProjectChangeEventArgs CreateTestInstance(IProjectSnapshot older, IProjectSnapshot newer, string documentFilePath, ProjectChangeKind kind, bool solutionIsClosing = false) => new(older, newer, documentFilePath, kind, solutionIsClosing); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.Entry.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.Entry.cs index c02de7a1bad..48341f3dd5d 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.Entry.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.Entry.cs @@ -7,9 +7,9 @@ internal partial class ProjectSnapshotManager { private sealed record Entry(ProjectState State) { - private ProjectSnapshot? _snapshotUnsafe; + private IProjectSnapshot? _snapshotUnsafe; - public ProjectSnapshot GetSnapshot() + public IProjectSnapshot GetSnapshot() { return _snapshotUnsafe ??= new ProjectSnapshot(State); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.cs index 96c5e4b8d65..40f7d967401 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/ProjectSnapshotManager.cs @@ -383,7 +383,7 @@ private void SolutionClosed() } } - private void NotifyListeners(ProjectSnapshot? older, ProjectSnapshot? newer, string? documentFilePath, ProjectChangeKind kind) + private void NotifyListeners(IProjectSnapshot? older, IProjectSnapshot? newer, string? documentFilePath, ProjectChangeKind kind) { if (!_initialized) { @@ -421,8 +421,8 @@ private bool TryUpdate( ProjectKey projectKey, string? documentFilePath, IUpdateProjectAction action, - [NotNullWhen(true)] out ProjectSnapshot? oldSnapshot, - [NotNullWhen(true)] out ProjectSnapshot? newSnapshot) + [NotNullWhen(true)] out IProjectSnapshot? oldSnapshot, + [NotNullWhen(true)] out IProjectSnapshot? newSnapshot) { using var upgradeableLock = _readerWriterLock.DisposableUpgradeableRead(); diff --git a/src/Razor/test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/VisualStudioDocumentTrackerTest.cs b/src/Razor/test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/VisualStudioDocumentTrackerTest.cs index 1ce0405fbdb..ea936cb99b2 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/VisualStudioDocumentTrackerTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/VisualStudioDocumentTrackerTest.cs @@ -161,8 +161,7 @@ await _projectManager.UpdateAsync(updater => updater.ProjectAdded(_hostProject); }); - var projectSnapshot = (ProjectSnapshot)_projectManager.GetLoadedProject(_hostProject.Key); - var e = new ProjectChangeEventArgs(null!, projectSnapshot, ProjectChangeKind.ProjectAdded); + var e = new ProjectChangeEventArgs(null!, _projectManager.GetLoadedProject(_hostProject.Key), ProjectChangeKind.ProjectAdded); var called = false; _documentTracker.ContextChanged += (sender, args) => @@ -188,8 +187,7 @@ await _projectManager.UpdateAsync(updater => updater.ProjectAdded(_hostProject); }); - var projectSnapshot = (ProjectSnapshot)_projectManager.GetLoadedProject(_hostProject.Key); - var e = new ProjectChangeEventArgs(null!, projectSnapshot, ProjectChangeKind.ProjectChanged); + var e = new ProjectChangeEventArgs(null!, _projectManager.GetLoadedProject(_hostProject.Key), ProjectChangeKind.ProjectChanged); var called = false; _documentTracker.ContextChanged += (sender, args) => @@ -215,7 +213,7 @@ await _projectManager.UpdateAsync(updater => updater.ProjectAdded(_hostProject); }); - var project = (ProjectSnapshot)_projectManager.GetLoadedProject(_hostProject.Key); + var project = _projectManager.GetLoadedProject(_hostProject.Key); await _projectManager.UpdateAsync(updater => { @@ -249,8 +247,7 @@ await _projectManager.UpdateAsync(updater => updater.ProjectAdded(_otherHostProject); }); - var projectSnapshot = (ProjectSnapshot)_projectManager.GetLoadedProject(_otherHostProject.Key); - var e = new ProjectChangeEventArgs(null!, projectSnapshot, ProjectChangeKind.ProjectChanged); + var e = new ProjectChangeEventArgs(null!, _projectManager.GetLoadedProject(_otherHostProject.Key), ProjectChangeKind.ProjectChanged); var called = false; _documentTracker.ContextChanged += (sender, args) => called = true; From 7d8be8e16767e182beb31388d70c73eab1006abf Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 5 Sep 2024 12:12:55 +1000 Subject: [PATCH 282/386] Most PR feedback --- .../RazorCSharpFormattingBenchmark.cs | 2 +- .../CSharp/DefaultCSharpCodeActionResolver.cs | 2 +- .../Formatting/RazorFormattingOptions.cs | 2 -- .../Formatting/RazorFormattingService.cs | 15 ++++---- .../Remote/IRemoteFormattingService.cs | 34 +++++++++++++++--- .../Formatting/RemoteFormattingService.cs | 35 ++++++++++--------- .../RemoteRazorFormattingService.cs | 2 +- .../CohostDocumentFormattingEndpoint.cs | 12 +++---- .../Cohost/CohostOnTypeFormattingEndpoint.cs | 8 ++--- .../Cohost/CohostRangeFormattingEndpoint.cs | 8 ++--- .../FormattingLanguageServerTestBase.cs | 2 +- 11 files changed, 73 insertions(+), 49 deletions(-) diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs index 12056563e09..88d6e3b633f 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorCSharpFormattingBenchmark.cs @@ -112,7 +112,7 @@ public async Task RazorCSharpFormattingAsync() { var documentContext = new DocumentContext(DocumentUri, DocumentSnapshot, projectContext: null); - var edits = await RazorFormattingService.GetDocumentFormattingEditsAsync(documentContext, htmlEdits: [], range: null, RazorFormattingOptions.Default, CancellationToken.None); + var edits = await RazorFormattingService.GetDocumentFormattingEditsAsync(documentContext, htmlEdits: [], range: null, new RazorFormattingOptions(), CancellationToken.None); #if DEBUG // For debugging purposes only. diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs index 5e0636c6818..7457c02597f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CodeActions/CSharp/DefaultCSharpCodeActionResolver.cs @@ -68,7 +68,7 @@ public async override Task ResolveAsync( var formattedEdit = await _razorFormattingService.GetCSharpCodeActionEditAsync( documentContext, csharpTextEdits, - RazorFormattingOptions.Default, + new RazorFormattingOptions(), cancellationToken).ConfigureAwait(false); cancellationToken.ThrowIfCancellationRequested(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs index a1ab2f6a3e3..fdacc443ec3 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs @@ -10,8 +10,6 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; [DataContract] internal readonly record struct RazorFormattingOptions { - public static readonly RazorFormattingOptions Default = new(); - [DataMember(Order = 0)] public bool InsertSpaces { get; init; } = true; [DataMember(Order = 1)] diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index c5f28c682c7..87bf5d68bfd 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -199,16 +199,13 @@ public Task GetHtmlOnTypeFormattingEditsAsync(DocumentContext docume public bool TryGetOnTypeFormattingTriggerKind(RazorCodeDocument codeDocument, int hostDocumentIndex, string triggerCharacter, out RazorLanguageKind triggerCharacterKind) { triggerCharacterKind = _documentMappingService.GetLanguageKind(codeDocument, hostDocumentIndex, rightAssociative: false); - if (triggerCharacterKind is RazorLanguageKind.CSharp) - { - return s_csharpTriggerCharacterSet.Contains(triggerCharacter); - } - else if (triggerCharacterKind is RazorLanguageKind.Html) - { - return s_htmlTriggerCharacterSet.Contains(triggerCharacter); - } - return false; + return triggerCharacterKind switch + { + RazorLanguageKind.CSharp => s_csharpTriggerCharacterSet.Contains(triggerCharacter), + RazorLanguageKind.Html => s_htmlTriggerCharacterSet.Contains(triggerCharacter), + _ => false, + }; } private async Task ApplyFormattedEditsAsync( diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs index 8a1b7aa3798..3ec3ae4cb9c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs @@ -12,10 +12,36 @@ namespace Microsoft.CodeAnalysis.Razor.Remote; internal interface IRemoteFormattingService { - ValueTask> GetDocumentFormattingEditsAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId documentId, ImmutableArray htmlChanges, RazorFormattingOptions options, CancellationToken cancellationToken); - ValueTask> GetRangeFormattingEditsAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId documentId, ImmutableArray htmlChanges, LinePositionSpan linePositionSpan, RazorFormattingOptions options, CancellationToken cancellationToken); - ValueTask> GetOnTypeFormattingEditsAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId documentId, ImmutableArray htmlChanges, LinePosition linePosition, string triggerCharacter, RazorFormattingOptions options, CancellationToken cancellationToken); - ValueTask GetOnTypeFormattingTriggerKindAsync(RazorPinnedSolutionInfoWrapper solutionInfo, DocumentId documentId, LinePosition linePosition, string triggerCharacter, CancellationToken cancellationToken); + ValueTask> GetDocumentFormattingEditsAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + ImmutableArray htmlChanges, + RazorFormattingOptions options, + CancellationToken cancellationToken); + + ValueTask> GetRangeFormattingEditsAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + ImmutableArray htmlChanges, + LinePositionSpan linePositionSpan, + RazorFormattingOptions options, + CancellationToken cancellationToken); + + ValueTask> GetOnTypeFormattingEditsAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + ImmutableArray htmlChanges, + LinePosition linePosition, + string triggerCharacter, + RazorFormattingOptions options, + CancellationToken cancellationToken); + + ValueTask GetOnTypeFormattingTriggerKindAsync( + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + LinePosition linePosition, + string triggerCharacter, + CancellationToken cancellationToken); internal enum TriggerKind { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingService.cs index e0dc5d35acb..e3e334604cf 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteFormattingService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.Immutable; +using System.Diagnostics; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -53,24 +54,24 @@ private async ValueTask> GetDocumentFormattingEditsAs if (edits is null) { - return ImmutableArray.Empty; + return []; } return edits.SelectAsArray(sourceText.GetTextChange); } public ValueTask> GetRangeFormattingEditsAsync( - RazorPinnedSolutionInfoWrapper solutionInfo, - DocumentId documentId, - ImmutableArray htmlChanges, - LinePositionSpan linePositionSpan, - RazorFormattingOptions options, - CancellationToken cancellationToken) - => RunServiceAsync( - solutionInfo, - documentId, - context => GetRangeFormattingEditsAsync(context, htmlChanges, linePositionSpan, options, cancellationToken), - cancellationToken); + RazorPinnedSolutionInfoWrapper solutionInfo, + DocumentId documentId, + ImmutableArray htmlChanges, + LinePositionSpan linePositionSpan, + RazorFormattingOptions options, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => GetRangeFormattingEditsAsync(context, htmlChanges, linePositionSpan, options, cancellationToken), + cancellationToken); private async ValueTask> GetRangeFormattingEditsAsync( RemoteDocumentContext context, @@ -86,7 +87,7 @@ private async ValueTask> GetRangeFormattingEditsAsync if (edits is null) { - return ImmutableArray.Empty; + return []; } return edits.SelectAsArray(sourceText.GetTextChange); @@ -132,8 +133,7 @@ private async ValueTask> GetOnTypeFormattingEditsAsyn } else { - Assumed.Unreachable(); - return []; + return Assumed.Unreachable>(); } return result.SelectAsArray(sourceText.GetTextChange); @@ -154,7 +154,7 @@ public ValueTask GetOnTypeFormattingTriggerKindAsync( private async ValueTask IsValidOnTypeFormattingTriggerAsync(RemoteDocumentContext context, LinePosition linePosition, string triggerCharacter, CancellationToken cancellationToken) { var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var sourceText = await context.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); + var sourceText = codeDocument.Source.Text; if (!sourceText.TryGetAbsoluteIndex(linePosition, out var hostDocumentIndex)) { return Response.Invalid; @@ -170,6 +170,9 @@ private async ValueTask IsValidOnTypeFormattingTriggerAsync(RemoteDocu return Response.ValidHtml; } + // TryGetOnTypeFormattingTriggerKind only returns true for C# or Html + Debug.Assert(triggerCharacterKind is RazorLanguageKind.CSharp); + return Response.ValidCSharp; } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs index 7d9344fe3d0..6974dabd019 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs @@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Remote.Razor.Formatting; [Export(typeof(IRazorFormattingService)), Shared] [method: ImportingConstructor] -internal class RemoteRazorFormattingService(IFormattingCodeDocumentProvider codeDocumentProvider, IDocumentMappingService documentMappingService, IAdhocWorkspaceFactory adhocWorkspaceFactory, ILoggerFactory loggerFactory) +internal sealed class RemoteRazorFormattingService(IFormattingCodeDocumentProvider codeDocumentProvider, IDocumentMappingService documentMappingService, IAdhocWorkspaceFactory adhocWorkspaceFactory, ILoggerFactory loggerFactory) : RazorFormattingService(codeDocumentProvider, documentMappingService, adhocWorkspaceFactory, loggerFactory) { } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentFormattingEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentFormattingEndpoint.cs index 8589644a08a..9fa42babe9a 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentFormattingEndpoint.cs @@ -27,7 +27,7 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; [ExportCohostStatelessLspService(typeof(CohostDocumentFormattingEndpoint))] [method: ImportingConstructor] #pragma warning restore RS0030 // Do not use banned APIs -internal class CohostDocumentFormattingEndpoint( +internal sealed class CohostDocumentFormattingEndpoint( IRemoteServiceInvoker remoteServiceInvoker, IHtmlDocumentSynchronizer htmlDocumentSynchronizer, LSPRequestInvoker requestInvoker, @@ -71,7 +71,7 @@ internal class CohostDocumentFormattingEndpoint( private async Task HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) { _logger.LogDebug($"Getting Html formatting changes for {razorDocument.FilePath}"); - var htmlResult = await GetHtmlFormattingEditsAsync(request, razorDocument, cancellationToken).ConfigureAwait(false); + var htmlResult = await TryGetHtmlFormattingEditsAsync(request, razorDocument, cancellationToken).ConfigureAwait(false); if (htmlResult is not { } htmlEdits) { @@ -91,17 +91,17 @@ internal class CohostDocumentFormattingEndpoint( (service, solutionInfo, cancellationToken) => service.GetDocumentFormattingEditsAsync(solutionInfo, razorDocument.Id, htmlChanges, options, cancellationToken), cancellationToken).ConfigureAwait(false); - if (remoteResult is [_, ..] allChanges) + if (remoteResult.Length > 0) { - _logger.LogDebug($"Got a total of {allChanges.Length} ranges back from OOP"); + _logger.LogDebug($"Got a total of {remoteResult.Length} ranges back from OOP"); - return allChanges.Select(sourceText.GetTextEdit).ToArray(); + return remoteResult.Select(sourceText.GetTextEdit).ToArray(); } return null; } - private async Task GetHtmlFormattingEditsAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) + private async Task TryGetHtmlFormattingEditsAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken) { var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); if (htmlDocument is null) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs index e5cd437628f..11a2a6f2071 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs @@ -27,7 +27,7 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; [ExportCohostStatelessLspService(typeof(CohostOnTypeFormattingEndpoint))] [method: ImportingConstructor] #pragma warning restore RS0030 // Do not use banned APIs -internal class CohostOnTypeFormattingEndpoint( +internal sealed class CohostOnTypeFormattingEndpoint( IRemoteServiceInvoker remoteServiceInvoker, IHtmlDocumentSynchronizer htmlDocumentSynchronizer, LSPRequestInvoker requestInvoker, @@ -127,11 +127,11 @@ internal class CohostOnTypeFormattingEndpoint( (service, solutionInfo, cancellationToken) => service.GetOnTypeFormattingEditsAsync(solutionInfo, razorDocument.Id, htmlChanges, request.Position.ToLinePosition(), request.Character, options, cancellationToken), cancellationToken).ConfigureAwait(false); - if (remoteResult is [_, ..] allChanges) + if (remoteResult.Length > 0) { - _logger.LogDebug($"Got a total of {allChanges.Length} ranges back from OOP"); + _logger.LogDebug($"Got a total of {remoteResult.Length} ranges back from OOP"); - return allChanges.Select(sourceText.GetTextEdit).ToArray(); + return remoteResult.Select(sourceText.GetTextEdit).ToArray(); } return null; diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostRangeFormattingEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostRangeFormattingEndpoint.cs index 9be30b7eabe..cc27035b560 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostRangeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostRangeFormattingEndpoint.cs @@ -27,7 +27,7 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; [ExportCohostStatelessLspService(typeof(CohostRangeFormattingEndpoint))] [method: ImportingConstructor] #pragma warning restore RS0030 // Do not use banned APIs -internal class CohostRangeFormattingEndpoint( +internal sealed class CohostRangeFormattingEndpoint( IRemoteServiceInvoker remoteServiceInvoker, IHtmlDocumentSynchronizer htmlDocumentSynchronizer, LSPRequestInvoker requestInvoker, @@ -91,11 +91,11 @@ internal class CohostRangeFormattingEndpoint( (service, solutionInfo, cancellationToken) => service.GetRangeFormattingEditsAsync(solutionInfo, razorDocument.Id, htmlChanges, request.Range.ToLinePositionSpan(), options, cancellationToken), cancellationToken).ConfigureAwait(false); - if (remoteResult is [_, ..] allChanges) + if (remoteResult.Length > 0) { - _logger.LogDebug($"Got a total of {allChanges.Length} ranges back from OOP"); + _logger.LogDebug($"Got a total of {remoteResult.Length} ranges back from OOP"); - return allChanges.Select(sourceText.GetTextEdit).ToArray(); + return remoteResult.Select(sourceText.GetTextEdit).ToArray(); } return null; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs index d14e475aa56..85dfee530aa 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerTestBase.cs @@ -69,7 +69,7 @@ public Task GetHtmlOnTypeFormattingEditsAsync(DocumentContext docume public bool TryGetOnTypeFormattingTriggerKind(RazorCodeDocument codeDocument, int hostDocumentIndex, string triggerCharacter, out RazorLanguageKind triggerCharacterKind) { - triggerCharacterKind = languageKind ?? RazorLanguageKind.CSharp; + triggerCharacterKind = languageKind.GetValueOrDefault(); return languageKind is not null; } } From d87ad016dd11c313341b504f50144cb7261c4b8d Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 5 Sep 2024 13:09:33 +1000 Subject: [PATCH 283/386] Move initialization logic --- .../Formatting/DocumentOnTypeFormattingEndpoint.cs | 6 +----- .../Hosting/LspInitializationHelpers.cs | 9 +++++++++ .../Formatting/RazorFormattingService.cs | 5 +++-- .../Cohost/CohostOnTypeFormattingEndpoint.cs | 5 ++--- .../Formatting_NetFx/RazorFormattingServiceTest.cs | 13 ++----------- 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs index 6568e9deb30..af7b91a5c2c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs @@ -41,11 +41,7 @@ internal class DocumentOnTypeFormattingEndpoint( public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, VSInternalClientCapabilities clientCapabilities) { - serverCapabilities.DocumentOnTypeFormattingProvider = new DocumentOnTypeFormattingOptions - { - FirstTriggerCharacter = RazorFormattingService.AllTriggerCharacters[0], - MoreTriggerCharacter = RazorFormattingService.AllTriggerCharacters.AsSpan()[1..].ToArray(), - }; + serverCapabilities.DocumentOnTypeFormattingProvider = new DocumentOnTypeFormattingOptions().EnableOnTypeFormattingTriggerCharacters(); } public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentOnTypeFormattingParams request) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/LspInitializationHelpers.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/LspInitializationHelpers.cs index ac141c81680..f6016f918cf 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/LspInitializationHelpers.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/LspInitializationHelpers.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; +using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.SemanticTokens; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -84,4 +85,12 @@ public static VSInternalDocumentOnAutoInsertOptions EnableOnAutoInsert( return options; } + + public static DocumentOnTypeFormattingOptions EnableOnTypeFormattingTriggerCharacters(this DocumentOnTypeFormattingOptions options) + { + options.FirstTriggerCharacter = RazorFormattingService.FirstTriggerCharacter; + options.MoreTriggerCharacter = RazorFormattingService.MoreTriggerCharacters.ToArray(); + + return options; + } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index 6186505c51f..b4c593f67d7 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -23,8 +23,9 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; internal class RazorFormattingService : IRazorFormattingService { - public static readonly ImmutableArray AllTriggerCharacters = ["}", ";", "\n", "{"]; - public static readonly FrozenSet AllTriggerCharacterSet = AllTriggerCharacters.ToFrozenSet(StringComparer.Ordinal); + public static readonly string FirstTriggerCharacter = "}"; + public static readonly ImmutableArray MoreTriggerCharacters = [";", "\n", "{"]; + public static readonly FrozenSet AllTriggerCharacterSet = FrozenSet.ToFrozenSet([FirstTriggerCharacter, .. MoreTriggerCharacters], StringComparer.Ordinal); private static readonly FrozenSet s_csharpTriggerCharacterSet = FrozenSet.ToFrozenSet(["}", ";"], StringComparer.Ordinal); private static readonly FrozenSet s_htmlTriggerCharacterSet = FrozenSet.ToFrozenSet(["\n", "{", "}", ";"], StringComparer.Ordinal); diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs index 11a2a6f2071..a08a12a2a63 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnTypeFormattingEndpoint.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; +using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; using Microsoft.CodeAnalysis.Razor.Formatting; @@ -55,9 +56,7 @@ internal sealed class CohostOnTypeFormattingEndpoint( RegisterOptions = new DocumentOnTypeFormattingRegistrationOptions() { DocumentSelector = filter, - FirstTriggerCharacter = RazorFormattingService.AllTriggerCharacters[0], - MoreTriggerCharacter = RazorFormattingService.AllTriggerCharacters.AsSpan()[1..].ToArray(), - } + }.EnableOnTypeFormattingTriggerCharacters() }; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs index b3d38ddd5bd..6c56614d771 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingServiceTest.cs @@ -46,7 +46,7 @@ public void AllTriggerCharacters_IncludesCSharpTriggerCharacters() { foreach (var character in RazorFormattingService.TestAccessor.GetCSharpTriggerCharacterSet()) { - Assert.Contains(character, RazorFormattingService.AllTriggerCharacters); + Assert.Contains(character, RazorFormattingService.AllTriggerCharacterSet); } } @@ -55,16 +55,7 @@ public void AllTriggerCharacters_IncludesHtmlTriggerCharacters() { foreach (var character in RazorFormattingService.TestAccessor.GetHtmlTriggerCharacterSet()) { - Assert.Contains(character, RazorFormattingService.AllTriggerCharacters); + Assert.Contains(character, RazorFormattingService.AllTriggerCharacterSet); } } - - [Fact] - public void AllTriggerCharacters_ContainsUniqueCharacters() - { - var allChars = RazorFormattingService.AllTriggerCharacters; - var distinctChars = allChars.Distinct().ToArray(); - - Assert.Equal(distinctChars, allChars); - } } From b7cd05e45378f91951ef430b6d4660bd368f847b Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 5 Sep 2024 13:15:10 +1000 Subject: [PATCH 284/386] Remove unused parameter --- .../DocumentOnTypeFormattingEndpoint.cs | 2 -- .../Formatting/RazorFormattingService.cs | 2 +- .../DocumentOnTypeFormattingEndpointTest.cs | 23 +++++-------------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs index af7b91a5c2c..2c2a853b61b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs @@ -26,13 +26,11 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; internal class DocumentOnTypeFormattingEndpoint( IRazorFormattingService razorFormattingService, IHtmlFormatter htmlFormatter, - IDocumentMappingService documentMappingService, RazorLSPOptionsMonitor optionsMonitor, ILoggerFactory loggerFactory) : IRazorRequestHandler, ICapabilitiesProvider { private readonly IRazorFormattingService _razorFormattingService = razorFormattingService; - private readonly IDocumentMappingService _documentMappingService = documentMappingService; private readonly RazorLSPOptionsMonitor _optionsMonitor = optionsMonitor; private readonly IHtmlFormatter _htmlFormatter = htmlFormatter; private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index b4c593f67d7..396f6cf7ee8 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -310,7 +310,7 @@ private static void UnwrapCSharpSnippets(TextEdit[] razorEdits) /// If LF line endings are more prevalent, it removes any CR characters from the text edits /// to ensure consistency with the LF style. ///
- private TextEdit[] NormalizeLineEndings(SourceText originalText, TextEdit[] edits) + private static TextEdit[] NormalizeLineEndings(SourceText originalText, TextEdit[] edits) { if (originalText.HasLFLineEndings()) { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs index 5448d383abf..7d313bfffa3 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/DocumentOnTypeFormattingEndpointTest.cs @@ -4,12 +4,9 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Moq; using Xunit; using Xunit.Abstractions; @@ -23,12 +20,11 @@ public async Task Handle_OnTypeFormatting_FormattingDisabled_ReturnsNull() // Arrange var uri = new Uri("file://path/test.razor"); var formattingService = new DummyRazorFormattingService(); - var documentMappingService = new LspDocumentMappingService(FilePathService, new TestDocumentContextFactory(), LoggerFactory); var optionsMonitor = GetOptionsMonitor(enableFormatting: false); var htmlFormatter = new TestHtmlFormatter(); var endpoint = new DocumentOnTypeFormattingEndpoint( - formattingService, htmlFormatter, documentMappingService, optionsMonitor, LoggerFactory); + formattingService, htmlFormatter, optionsMonitor, LoggerFactory); var @params = new DocumentOnTypeFormattingParams { TextDocument = new TextDocumentIdentifier { Uri = uri, } }; var requestContext = CreateRazorRequestContext(documentContext: null); @@ -52,12 +48,11 @@ public async Task Handle_OnTypeFormatting_DocumentNotFound_ReturnsNull() var documentContext = CreateDocumentContext(new Uri("file://path/testDifferentFile.razor"), codeDocument); var formattingService = new DummyRazorFormattingService(); - var documentMappingService = new LspDocumentMappingService(FilePathService, new TestDocumentContextFactory(), LoggerFactory); var optionsMonitor = GetOptionsMonitor(enableFormatting: true); var htmlFormatter = new TestHtmlFormatter(); var endpoint = new DocumentOnTypeFormattingEndpoint( - formattingService, htmlFormatter, documentMappingService, optionsMonitor, LoggerFactory); + formattingService, htmlFormatter, optionsMonitor, LoggerFactory); var @params = new DocumentOnTypeFormattingParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -87,12 +82,11 @@ public async Task Handle_OnTypeFormatting_RemapFailed_ReturnsNull() var documentContext = CreateDocumentContext(uri, codeDocument); var formattingService = new DummyRazorFormattingService(); - var documentMappingService = new LspDocumentMappingService(FilePathService, new TestDocumentContextFactory(), LoggerFactory); var optionsMonitor = GetOptionsMonitor(enableFormatting: true); var htmlFormatter = new TestHtmlFormatter(); var endpoint = new DocumentOnTypeFormattingEndpoint( - formattingService, htmlFormatter, documentMappingService, optionsMonitor, LoggerFactory); + formattingService, htmlFormatter, optionsMonitor, LoggerFactory); var @params = new DocumentOnTypeFormattingParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -123,12 +117,10 @@ public async Task Handle_OnTypeFormatting_HtmlLanguageKind_ReturnsNull() var documentContext = CreateDocumentContext(uri, codeDocument); var formattingService = new DummyRazorFormattingService(RazorLanguageKind.Html); - var documentMappingService = new Mock(MockBehavior.Strict); - documentMappingService.Setup(s => s.GetLanguageKind(codeDocument, 17, false)).Returns(RazorLanguageKind.Html); var optionsMonitor = GetOptionsMonitor(enableFormatting: true); var htmlFormatter = new TestHtmlFormatter(); var endpoint = new DocumentOnTypeFormattingEndpoint( - formattingService, htmlFormatter, documentMappingService.Object, optionsMonitor, LoggerFactory); + formattingService, htmlFormatter, optionsMonitor, LoggerFactory); var @params = new DocumentOnTypeFormattingParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -159,12 +151,10 @@ public async Task Handle_OnTypeFormatting_RazorLanguageKind_ReturnsNull() var documentContext = CreateDocumentContext(uri, codeDocument); var formattingService = new DummyRazorFormattingService(RazorLanguageKind.Razor); - var documentMappingService = new Mock(MockBehavior.Strict); - documentMappingService.Setup(s => s.GetLanguageKind(codeDocument, 17, false)).Returns(RazorLanguageKind.Razor); var optionsMonitor = GetOptionsMonitor(enableFormatting: true); var htmlFormatter = new TestHtmlFormatter(); var endpoint = new DocumentOnTypeFormattingEndpoint( - formattingService, htmlFormatter, documentMappingService.Object, optionsMonitor, LoggerFactory); + formattingService, htmlFormatter, optionsMonitor, LoggerFactory); var @params = new DocumentOnTypeFormattingParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, @@ -194,12 +184,11 @@ public async Task Handle_OnTypeFormatting_UnexpectedTriggerCharacter_ReturnsNull var documentContextFactory = CreateDocumentContextFactory(uri, codeDocument); var formattingService = new DummyRazorFormattingService(); - var documentMappingService = new LspDocumentMappingService(FilePathService, documentContextFactory, LoggerFactory); var optionsMonitor = GetOptionsMonitor(enableFormatting: true); var htmlFormatter = new TestHtmlFormatter(); var endpoint = new DocumentOnTypeFormattingEndpoint( - formattingService, htmlFormatter, documentMappingService, optionsMonitor, LoggerFactory); + formattingService, htmlFormatter, optionsMonitor, LoggerFactory); var @params = new DocumentOnTypeFormattingParams() { TextDocument = new TextDocumentIdentifier { Uri = uri, }, From e0b2935d30349080403d22379a13df2a512df713 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 5 Sep 2024 14:01:52 +1000 Subject: [PATCH 285/386] PR Feedback --- .../SpellCheck/DocumentSpellCheckEndpoint.cs | 2 +- .../Extensions/RazorSyntaxNodeExtensions.cs | 12 ++++++ .../SpellCheck/SpellCheckService.cs | 40 +++++++------------ .../RemoteCSharpSpellCheckRangeProvider.cs | 4 +- .../CohostDocumentSpellCheckEndpoint.cs | 2 +- .../CohostWorkspaceSpellCheckEndpoint.cs | 2 +- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs index aa2173d784d..3cd304c989a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/SpellCheck/DocumentSpellCheckEndpoint.cs @@ -40,7 +40,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentSpellC [ new VSInternalSpellCheckableRangeReport { - Ranges =data, + Ranges = data, ResultId = Guid.NewGuid().ToString() } ]; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RazorSyntaxNodeExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RazorSyntaxNodeExtensions.cs index e3232c19d44..a0d33a9155d 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RazorSyntaxNodeExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RazorSyntaxNodeExtensions.cs @@ -308,4 +308,16 @@ static bool IsCSharpCodeBlockSyntax(SyntaxNode node) return node is CSharpCodeBlockSyntax; } } + + public static bool IsAnyAttributeSyntax(this SyntaxNode node) + { + return node is + MarkupAttributeBlockSyntax or + MarkupMinimizedAttributeBlockSyntax or + MarkupTagHelperAttributeSyntax or + MarkupMinimizedTagHelperAttributeSyntax or + MarkupTagHelperDirectiveAttributeSyntax or + MarkupMinimizedTagHelperDirectiveAttributeSyntax or + MarkupMiscAttributeContentSyntax; + } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs index 5690e39cff0..0ab6c5ac690 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SpellCheck/SpellCheckService.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Collections.Generic; using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; @@ -23,21 +22,24 @@ internal class SpellCheckService( public async Task GetSpellCheckRangeTriplesAsync(DocumentContext documentContext, CancellationToken cancellationToken) { - using var ranges = new PooledArrayBuilder(); + using var builder = new PooledArrayBuilder(); var syntaxTree = await documentContext.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); - AddRazorSpellCheckRanges(ref ranges.AsRef(), syntaxTree); + AddRazorSpellCheckRanges(ref builder.AsRef(), syntaxTree); var csharpRanges = await _csharpSpellCheckService.GetCSharpSpellCheckRangesAsync(documentContext, cancellationToken).ConfigureAwait(false); if (csharpRanges.Length > 0) { var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - AddCSharpSpellCheckRanges(ref ranges.AsRef(), csharpRanges, codeDocument); + AddCSharpSpellCheckRanges(ref builder.AsRef(), csharpRanges, codeDocument); } - return ConvertSpellCheckRangesToIntTriples(ranges.ToImmutable()); + // Important to sort first as we're calculating relative indexes + var ranges = builder.ToImmutableOrderedBy(static r => r.AbsoluteStartIndex); + + return ConvertSpellCheckRangesToIntTriples(ranges); } private static void AddRazorSpellCheckRanges(ref PooledArrayBuilder ranges, RazorSyntaxTree syntaxTree) @@ -59,13 +61,7 @@ private static void AddRazorSpellCheckRanges(ref PooledArrayBuilder r { var csharpDocument = codeDocument.GetCSharpDocument(); - foreach (var report in csharpRanges) + foreach (var range in csharpRanges) { - var absoluteCSharpStartIndex = report.AbsoluteStartIndex; - var length = report.Length; + var absoluteCSharpStartIndex = range.AbsoluteStartIndex; + var length = range.Length; // We need to map the start index to produce results, and we validate that we can map the end index so we don't have // squiggles that go from C# into Razor/Html. - if (_documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteCSharpStartIndex, out var _1, out var hostDocumentIndex) && - _documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteCSharpStartIndex + length, out var _2, out var _3)) + if (_documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteCSharpStartIndex, out _, out var hostDocumentIndex) && + _documentMappingService.TryMapToHostDocumentPosition(csharpDocument, absoluteCSharpStartIndex + length, out _, out _)) { - ranges.Add(new(report.Kind, hostDocumentIndex, length)); + ranges.Add(range with { AbsoluteStartIndex = hostDocumentIndex }); } } } private static int[] ConvertSpellCheckRangesToIntTriples(ImmutableArray ranges) { - // Important to sort first as we're calculating relative indexes - ranges = ranges.OrderAsArray(CompareSpellCheckRanges); - using var data = new PooledArrayBuilder(ranges.Length * 3); var lastAbsoluteEndIndex = 0; @@ -129,9 +122,4 @@ private static int[] ConvertSpellCheckRangesToIntTriples(ImmutableArray> GetCSharpSpellCheckRangesAsync(DocumentContext documentContext, CancellationToken cancellationToken) { @@ -25,6 +25,6 @@ public async Task> GetCSharpSpellCheckRangesAsyn var csharpRanges = await ExternalAccess.Razor.Cohost.Handlers.SpellCheck.GetSpellCheckSpansAsync(generatedDocument, cancellationToken).ConfigureAwait(false); - return csharpRanges.SelectAsArray(r => new SpellCheckRange((int)r.Kind, r.StartIndex, r.Length)); + return csharpRanges.SelectAsArray(static r => new SpellCheckRange((int)r.Kind, r.StartIndex, r.Length)); } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSpellCheckEndpoint.cs index 9aa87a0cd69..e12e969f886 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSpellCheckEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentSpellCheckEndpoint.cs @@ -20,7 +20,7 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; [ExportCohostStatelessLspService(typeof(CohostDocumentSpellCheckEndpoint))] [method: ImportingConstructor] #pragma warning restore RS0030 // Do not use banned APIs -internal class CohostDocumentSpellCheckEndpoint( +internal sealed class CohostDocumentSpellCheckEndpoint( IRemoteServiceInvoker remoteServiceInvoker) : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider { diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostWorkspaceSpellCheckEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostWorkspaceSpellCheckEndpoint.cs index cad02498732..79876202a35 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostWorkspaceSpellCheckEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostWorkspaceSpellCheckEndpoint.cs @@ -17,7 +17,7 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; [ExportCohostStatelessLspService(typeof(CohostWorkspaceSpellCheckEndpoint))] [method: ImportingConstructor] #pragma warning restore RS0030 // Do not use banned APIs -internal class CohostWorkspaceSpellCheckEndpoint( +internal sealed class CohostWorkspaceSpellCheckEndpoint( IRemoteServiceInvoker remoteServiceInvoker) : AbstractRazorCohostRequestHandler { From dde7fe8c2f3c2be154c631d281256cd153a0089e Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Thu, 5 Sep 2024 09:28:48 +0200 Subject: [PATCH 286/386] Ensure type arguments are `global::` qualified (#10834) * Add a test * Use fully globally qualified type name * Update baselines * Fix delegates and child content * Update baselines * Fix other child content scenarios * Update baselines * Encapsulate shared code --- .../ComponentCodeGenerationTestBase.cs | 55 +++++++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 6 +- .../TestComponent.codegen.cs | 4 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 8 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 6 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 6 +- .../TestComponent.codegen.cs | 4 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 6 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 6 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 6 +- .../TestComponent.codegen.cs | 4 +- .../TestComponent.mappings.txt | 10 +-- .../GenericTypeCheck/TestComponent.codegen.cs | 77 +++++++++++++++++++ .../GenericTypeCheck/TestComponent.ir.txt | 23 ++++++ .../TestComponent.mappings.txt | 35 +++++++++ .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 4 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 4 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 4 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 4 +- .../TestComponent.mappings.txt | 8 +- .../GenericTypeCheck/TestComponent.codegen.cs | 60 +++++++++++++++ .../GenericTypeCheck/TestComponent.ir.txt | 14 ++++ .../TestComponent.mappings.txt | 35 +++++++++ .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../TestComponent.codegen.cs | 2 +- .../TestComponent.mappings.txt | 2 +- .../ComponentDesignTimeNodeWriter.cs | 14 +--- .../Components/ComponentNodeWriter.cs | 30 ++++++++ .../Components/ComponentRuntimeNodeWriter.cs | 14 +--- 150 files changed, 546 insertions(+), 263 deletions(-) create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.mappings.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.mappings.txt diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs index 57040aebbad..02461edf28f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs @@ -2336,9 +2336,9 @@ public class MyComponent : ComponentBase : [// x:\dir\subdir\Test\TestComponent.cshtml(1,27): error CS1503: Argument 1: cannot convert from 'string' to 'int' // ParentValue Diagnostic(ErrorCode.ERR_BadArgType, "ParentValue").WithArguments("1", "string", "int").WithLocation(1, 27), - // (38,158): error CS0029: Cannot implicitly convert type 'int' to 'string' - // __builder.AddComponentParameter(2, "ValueChanged", (global::System.Action)(__value => ParentValue = __value)); - Diagnostic(ErrorCode.ERR_NoImplicitConv, "__value").WithArguments("int", "string").WithLocation(38, 158)]); + // (38,166): error CS0029: Cannot implicitly convert type 'int' to 'string' + // __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + Diagnostic(ErrorCode.ERR_NoImplicitConv, "__value").WithArguments("int", "string").WithLocation(38, 166)]); } [IntegrationTestFact] @@ -2616,18 +2616,18 @@ public class MyComponent : ComponentBase CompileToAssembly(generated, DesignTime - ? [// (31,179): error CS0029: Cannot implicitly convert type 'int' to 'string' - // __builder.AddComponentParameter(3, "ValueExpression", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); - Diagnostic(ErrorCode.ERR_NoImplicitConv, "ParentValue").WithArguments("int", "string").WithLocation(38, 179), - // (31,179): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type - // __builder.AddComponentParameter(3, "ValueExpression", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); - Diagnostic(ErrorCode.ERR_CantConvAnonMethReturns, "ParentValue").WithArguments("lambda expression").WithLocation(38, 179)] - : [// (39,258): error CS0029: Cannot implicitly convert type 'int' to 'string' - // __builder.AddComponentParameter(3, "ValueExpression", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); - Diagnostic(ErrorCode.ERR_NoImplicitConv, "ParentValue").WithArguments("int", "string").WithLocation(39, 258), - // (39,258): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type - // __builder.AddComponentParameter(3, "ValueExpression", global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); - Diagnostic(ErrorCode.ERR_CantConvAnonMethReturns, "ParentValue").WithArguments("lambda expression").WithLocation(39, 258) + ? [// (38,195): error CS0029: Cannot implicitly convert type 'int' to 'string' + // __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue); + Diagnostic(ErrorCode.ERR_NoImplicitConv, "ParentValue").WithArguments("int", "string").WithLocation(38, 195), + // (38,195): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type + // __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue); + Diagnostic(ErrorCode.ERR_CantConvAnonMethReturns, "ParentValue").WithArguments("lambda expression").WithLocation(38, 195)] + : [// (39,274): error CS0029: Cannot implicitly convert type 'int' to 'string' + // __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); + Diagnostic(ErrorCode.ERR_NoImplicitConv, "ParentValue").WithArguments("int", "string").WithLocation(39, 274), + // (39,274): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type + // __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); + Diagnostic(ErrorCode.ERR_CantConvAnonMethReturns, "ParentValue").WithArguments("lambda expression").WithLocation(39, 274) ]); } @@ -8743,6 +8743,31 @@ public class MyComponent : ComponentBase CompileToAssembly(generated); } + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/10827")] + public void GenericTypeCheck() + { + var generated = CompileToCSharp(""" + + + @code { + private class System + { + private class String + { + } + } + + [Parameter] + public List Data { get; set; } + } + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + #endregion #region Key diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.codegen.cs index 754429913ac..053890cdcba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. ); __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue))); - __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue); + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } )); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.mappings.txt index a19135f3259..cffece03fbb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (1135:29,26 [11] ) Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2197:45,19 [5] ) +Generated Location: (2213:45,19 [5] ) |Value| Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2610:63,7 [50] ) +Generated Location: (2626:63,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs index 934efc188bf..b2cdc3c52ee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => ParentValue = __value); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt index ca1dfc22c64..87644665784 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt @@ -5,19 +5,19 @@ Generated Location: (1135:29,26 [11] ) Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1668:44,19 [5] ) +Generated Location: (1676:44,19 [5] ) |Value| Source Location: (45:0,45 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1915:53,45 [5] ) +Generated Location: (1923:53,45 [5] ) |Value| Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2328:71,7 [50] ) +Generated Location: (2336:71,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.codegen.cs index a41ddb4b1f7..9f671206f3c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.codegen.cs @@ -33,9 +33,9 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => ParentValue = __value); - __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue); + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } )); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.mappings.txt index 4ebc3834dd7..e53ee23626f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (1135:29,26 [11] ) Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1860:45,19 [5] ) +Generated Location: (1884:45,19 [5] ) |Value| Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2273:63,7 [50] ) +Generated Location: (2297:63,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs index 973606f9d7c..cd9931c87d8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => ParentValue = __value); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt index cb7d4a25221..54450e18f96 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (1135:29,26 [11] ) Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1668:44,19 [5] ) +Generated Location: (1676:44,19 [5] ) |Value| Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2081:62,7 [50] ) +Generated Location: (2089:62,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.codegen.cs index da7e74a7844..f69fcc14f54 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => ParentValue = __value); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.mappings.txt index bebd4144eb5..d05b1672b9a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (1131:29,22 [11] ) Source Location: (15:0,15 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1656:44,15 [5] ) +Generated Location: (1664:44,15 [5] ) |Value| Source Location: (46:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2065:62,7 [50] ) +Generated Location: (2073:62,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.codegen.cs index 02317b1f280..be16367fc2a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => ParentValue = __value); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.mappings.txt index c0b3b29ac6b..ce4b96c4231 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (1127:29,18 [11] ) Source Location: (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1645:44,11 [5] ) +Generated Location: (1653:44,11 [5] ) |Value| Source Location: (42:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2051:62,7 [50] ) +Generated Location: (2059:62,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs index e57b3f7c0f9..d91f706f6ce 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => ParentValue = __value); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt index d69e5ca5733..6bf8284da13 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (1135:29,26 [11] ) Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1663:44,19 [5] ) +Generated Location: (1671:44,19 [5] ) |Value| Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2071:62,7 [50] ) +Generated Location: (2079:62,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.codegen.cs index 2d38b170952..a9c7f9e1c06 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => ParentValue = __value); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.mappings.txt index 39e1027589c..0682636b194 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.mappings.txt @@ -5,7 +5,7 @@ Generated Location: (1135:29,26 [11] ) Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1668:44,19 [5] ) +Generated Location: (1676:44,19 [5] ) |Value| Source Location: (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) @@ -14,7 +14,7 @@ Source Location: (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) public string nameof(string s) => string.Empty; | -Generated Location: (2081:62,7 [105] ) +Generated Location: (2089:62,7 [105] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.codegen.cs index a108553352f..703599cdda4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => ParentValue = __value); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.mappings.txt index a5d7ebef12a..41162759968 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (1135:29,26 [11] ) Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1668:44,19 [5] ) +Generated Location: (1676:44,19 [5] ) |Value| Source Location: (50:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml) | public string ParentValue { get; set; } = "42"; | -Generated Location: (2081:62,7 [55] ) +Generated Location: (2089:62,7 [55] ) | public string ParentValue { get; set; } = "42"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs index 325781c2132..9aa28166c36 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt index e1437b4eef4..8b70c24ba05 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt @@ -5,17 +5,17 @@ Generated Location: (1139:29,30 [11] ) Source Location: (62:0,62 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Update| -Generated Location: (1559:39,62 [6] ) +Generated Location: (1567:39,62 [6] ) |Update| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1983:52,19 [5] ) +Generated Location: (1991:52,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2234:61,49 [5] ) +Generated Location: (2242:61,49 [5] ) |Value| Source Location: (81:1,7 [82] x:\dir\subdir\Test\TestComponent.cshtml) @@ -24,7 +24,7 @@ Source Location: (81:1,7 [82] x:\dir\subdir\Test\TestComponent.cshtml) public void Update() { } | -Generated Location: (2647:79,7 [82] ) +Generated Location: (2655:79,7 [82] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs index 23292cba39f..e4c3b60d71f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt index 000cad67f5f..117445020ac 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt @@ -5,24 +5,24 @@ Generated Location: (1139:29,30 [11] ) Source Location: (62:0,62 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1559:39,62 [9] ) +Generated Location: (1567:39,62 [9] ) |() => { }| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1986:52,19 [5] ) +Generated Location: (1994:52,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2237:61,49 [5] ) +Generated Location: (2245:61,49 [5] ) |Value| Source Location: (84:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2650:79,7 [50] ) +Generated Location: (2658:79,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs index 2ce18051e07..f3ebee2d522 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" (value => { ParentValue = value; return Task.CompletedTask; }) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt index 93db8db95c1..7f370b64088 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt @@ -5,24 +5,24 @@ Generated Location: (1139:29,30 [11] ) Source Location: (60:0,60 [62] x:\dir\subdir\Test\TestComponent.cshtml) |(value => { ParentValue = value; return Task.CompletedTask; })| -Generated Location: (1408:38,60 [62] ) +Generated Location: (1416:38,60 [62] ) |(value => { ParentValue = value; return Task.CompletedTask; })| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1884:51,19 [5] ) +Generated Location: (1892:51,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2135:60,49 [5] ) +Generated Location: (2143:60,49 [5] ) |Value| Source Location: (135:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2548:78,7 [50] ) +Generated Location: (2556:78,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs index 745ce872aa2..8c3c5acf9d3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Func( + __o = new global::System.Func( async __value => { ParentValue = __value; await global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt index 73ef41823cd..70e32af6fed 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt @@ -5,17 +5,17 @@ Generated Location: (1139:29,30 [11] ) Source Location: (62:0,62 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Update| -Generated Location: (1599:39,62 [6] ) +Generated Location: (1615:39,62 [6] ) |Update| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2023:52,19 [5] ) +Generated Location: (2039:52,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2274:61,49 [5] ) +Generated Location: (2290:61,49 [5] ) |Value| Source Location: (81:1,7 [101] x:\dir\subdir\Test\TestComponent.cshtml) @@ -24,7 +24,7 @@ Source Location: (81:1,7 [101] x:\dir\subdir\Test\TestComponent.cshtml) public Task Update() => Task.CompletedTask; | -Generated Location: (2687:79,7 [101] ) +Generated Location: (2703:79,7 [101] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs index eec3fa00333..82155238483 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Func( + __o = new global::System.Func( async __value => { ParentValue = __value; await global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt index 269fe92e48a..e841920c43a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt @@ -5,24 +5,24 @@ Generated Location: (1139:29,30 [11] ) Source Location: (62:0,62 [36] x:\dir\subdir\Test\TestComponent.cshtml) |() => { return Task.CompletedTask; }| -Generated Location: (1599:39,62 [36] ) +Generated Location: (1615:39,62 [36] ) |() => { return Task.CompletedTask; }| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2053:52,19 [5] ) +Generated Location: (2069:52,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2304:61,49 [5] ) +Generated Location: (2320:61,49 [5] ) |Value| Source Location: (111:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2717:79,7 [50] ) +Generated Location: (2733:79,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs index 41fdf220508..5e2ebb8011d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" UpdateValue diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt index 1aeef332ea2..66925885b32 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt @@ -5,17 +5,17 @@ Generated Location: (1139:29,30 [11] ) Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) |UpdateValue| -Generated Location: (1408:38,60 [11] ) +Generated Location: (1416:38,60 [11] ) |UpdateValue| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1833:51,19 [5] ) +Generated Location: (1841:51,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2084:60,49 [5] ) +Generated Location: (2092:60,49 [5] ) |Value| Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) @@ -24,7 +24,7 @@ Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) public void UpdateValue(int value) => ParentValue = value; | -Generated Location: (2497:78,7 [116] ) +Generated Location: (2505:78,7 [116] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs index a8402349c92..074a23d6e79 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" value => ParentValue = value diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt index cc2db5348e5..d6ab56b5e6c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt @@ -5,24 +5,24 @@ Generated Location: (1139:29,30 [11] ) Source Location: (60:0,60 [28] x:\dir\subdir\Test\TestComponent.cshtml) |value => ParentValue = value| -Generated Location: (1408:38,60 [28] ) +Generated Location: (1416:38,60 [28] ) |value => ParentValue = value| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1850:51,19 [5] ) +Generated Location: (1858:51,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2101:60,49 [5] ) +Generated Location: (2109:60,49 [5] ) |Value| Source Location: (101:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2514:78,7 [50] ) +Generated Location: (2522:78,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs index 41fdf220508..5e2ebb8011d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" UpdateValue diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt index 1aeef332ea2..66925885b32 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt @@ -5,17 +5,17 @@ Generated Location: (1139:29,30 [11] ) Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) |UpdateValue| -Generated Location: (1408:38,60 [11] ) +Generated Location: (1416:38,60 [11] ) |UpdateValue| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1833:51,19 [5] ) +Generated Location: (1841:51,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2084:60,49 [5] ) +Generated Location: (2092:60,49 [5] ) |Value| Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) @@ -24,7 +24,7 @@ Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) public void UpdateValue(int value) => ParentValue = value; | -Generated Location: (2497:78,7 [116] ) +Generated Location: (2505:78,7 [116] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs index cfca3703663..aba901656da 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Func( + __o = new global::System.Func( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" UpdateValue diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt index b9472a3c420..df63516ed07 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt @@ -5,17 +5,17 @@ Generated Location: (1139:29,30 [11] ) Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) |UpdateValue| -Generated Location: (1435:38,60 [11] ) +Generated Location: (1451:38,60 [11] ) |UpdateValue| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1860:51,19 [5] ) +Generated Location: (1876:51,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2111:60,49 [5] ) +Generated Location: (2127:60,49 [5] ) |Value| Source Location: (84:1,7 [144] x:\dir\subdir\Test\TestComponent.cshtml) @@ -24,7 +24,7 @@ Source Location: (84:1,7 [144] x:\dir\subdir\Test\TestComponent.cshtml) public Task UpdateValue(int value) { ParentValue = value; return Task.CompletedTask; } | -Generated Location: (2524:78,7 [144] ) +Generated Location: (2540:78,7 [144] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs index 14e1416d3ee..332b6c0f6be 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Func( + __o = new global::System.Func( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" value => { ParentValue = value; return Task.CompletedTask; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt index f0d13ffcf59..5d61abde4f2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt @@ -5,24 +5,24 @@ Generated Location: (1139:29,30 [11] ) Source Location: (60:0,60 [60] x:\dir\subdir\Test\TestComponent.cshtml) |value => { ParentValue = value; return Task.CompletedTask; }| -Generated Location: (1435:38,60 [60] ) +Generated Location: (1451:38,60 [60] ) |value => { ParentValue = value; return Task.CompletedTask; }| Source Location: (19:0,19 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1909:51,19 [5] ) +Generated Location: (1925:51,19 [5] ) |Value| Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (2160:60,49 [5] ) +Generated Location: (2176:60,49 [5] ) |Value| Source Location: (133:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2573:78,7 [50] ) +Generated Location: (2589:78,7 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.codegen.cs index 61804569c7e..18c64f52827 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.codegen.cs @@ -33,7 +33,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); - __o = new global::System.Action( + __o = new global::System.Action( __value => person.Name = __value); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.mappings.txt index 429713ee70a..0701c79b991 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (1134:29,24 [11] ) Source Location: (17:0,17 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Value| -Generated Location: (1664:44,17 [5] ) +Generated Location: (1672:44,17 [5] ) |Value| Source Location: (56:3,1 [37] x:\dir\subdir\Test\TestComponent.cshtml) | Person person = new Person(); | -Generated Location: (2069:62,1 [37] ) +Generated Location: (2077:62,1 [37] ) | Person person = new Person(); | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.codegen.cs index 6ca7cc208ec..c75812baa9c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.codegen.cs @@ -47,7 +47,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - __o = new global::Microsoft.AspNetCore.Components.RenderFragment( + __o = new global::Microsoft.AspNetCore.Components.RenderFragment( #nullable restore #line 2 "x:\dir\subdir\Test\TestComponent.cshtml" header diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.mappings.txt index 35479cd8831..9d8376bf370 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.mappings.txt @@ -15,11 +15,11 @@ Generated Location: (1492:44,87 [2] ) Source Location: (113:1,21 [6] x:\dir\subdir\Test\TestComponent.cshtml) |header| -Generated Location: (1731:52,21 [6] ) +Generated Location: (1739:52,21 [6] ) |header| Source Location: (105:1,13 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Header| -Generated Location: (2145:65,13 [6] ) +Generated Location: (2153:65,13 [6] ) |Header| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.codegen.cs index 2c2ba993c48..32ddc0cb54d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.codegen.cs @@ -47,7 +47,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - __o = new global::Microsoft.AspNetCore.Components.RenderFragment( + __o = new global::Microsoft.AspNetCore.Components.RenderFragment( #nullable restore #line 2 "x:\dir\subdir\Test\TestComponent.cshtml" header diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.mappings.txt index 4aefa9dfb14..9b29d3d5c74 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.mappings.txt @@ -15,11 +15,11 @@ Generated Location: (1492:44,87 [2] ) Source Location: (113:1,21 [6] x:\dir\subdir\Test\TestComponent.cshtml) |header| -Generated Location: (1731:52,21 [6] ) +Generated Location: (1739:52,21 [6] ) |header| Source Location: (105:1,13 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Header| -Generated Location: (2302:68,13 [6] ) +Generated Location: (2310:68,13 [6] ) |Header| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs index 0306bc68f6b..e070a3569c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs @@ -24,7 +24,7 @@ private void __RazorDirectiveTokenHelpers__() { #pragma warning disable 1998 protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { - __o = new global::System.Action( + __o = new global::System.Action( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" Increment diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt index 55d40b8adf0..f37d2698599 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt @@ -1,11 +1,11 @@ Source Location: (23:0,23 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Increment| -Generated Location: (1072:29,23 [9] ) +Generated Location: (1080:29,23 [9] ) |Increment| Source Location: (13:0,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1489:42,13 [7] ) +Generated Location: (1497:42,13 [7] ) |OnClick| Source Location: (46:2,7 [98] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +15,7 @@ Source Location: (46:2,7 [98] x:\dir\subdir\Test\TestComponent.cshtml) counter++; } | -Generated Location: (1904:60,7 [98] ) +Generated Location: (1912:60,7 [98] ) | private int counter; private void Increment(EventArgs e) { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.codegen.cs index 4d2d180e5dd..84c02a181fb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.codegen.cs @@ -24,7 +24,7 @@ private void __RazorDirectiveTokenHelpers__() { #pragma warning disable 1998 protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { - __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" __o = context; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.mappings.txt index 20d19f9d441..c8b71a120d6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.mappings.txt @@ -1,5 +1,5 @@ Source Location: (28:0,28 [7] x:\dir\subdir\Test\TestComponent.cshtml) |context| -Generated Location: (1172:29,28 [7] ) +Generated Location: (1180:29,28 [7] ) |context| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.codegen.cs index 862bf02ba3c..078564652c8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.codegen.cs @@ -25,7 +25,7 @@ private void __RazorDirectiveTokenHelpers__() { protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { __o = ""; - __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" __o = context.ToLowerInvariant(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.mappings.txt index 80c0b6cf09f..a20c4a1227e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.mappings.txt @@ -1,10 +1,10 @@ Source Location: (54:0,54 [26] x:\dir\subdir\Test\TestComponent.cshtml) |context.ToLowerInvariant()| -Generated Location: (1221:30,54 [26] ) +Generated Location: (1229:30,54 [26] ) |context.ToLowerInvariant()| Source Location: (13:0,13 [6] x:\dir\subdir\Test\TestComponent.cshtml) |MyAttr| -Generated Location: (1509:41,13 [6] ) +Generated Location: (1517:41,13 [6] ) |MyAttr| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.codegen.cs index dba90ed5046..4a9f66ac457 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.codegen.cs @@ -25,7 +25,7 @@ private void __RazorDirectiveTokenHelpers__() { protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { __o = ""; - __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { #nullable restore #line 3 "x:\dir\subdir\Test\TestComponent.cshtml" __o = item.ToLowerInvariant(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.mappings.txt index 23b94d39bdd..507f9be45a0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.mappings.txt @@ -1,10 +1,10 @@ Source Location: (93:2,32 [23] x:\dir\subdir\Test\TestComponent.cshtml) |item.ToLowerInvariant()| -Generated Location: (1196:30,32 [23] ) +Generated Location: (1204:30,32 [23] ) |item.ToLowerInvariant()| Source Location: (13:0,13 [6] x:\dir\subdir\Test\TestComponent.cshtml) |MyAttr| -Generated Location: (1481:41,13 [6] ) +Generated Location: (1489:41,13 [6] ) |MyAttr| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.codegen.cs index dba90ed5046..4a9f66ac457 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.codegen.cs @@ -25,7 +25,7 @@ private void __RazorDirectiveTokenHelpers__() { protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { __o = ""; - __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { #nullable restore #line 3 "x:\dir\subdir\Test\TestComponent.cshtml" __o = item.ToLowerInvariant(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.mappings.txt index 23b94d39bdd..507f9be45a0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.mappings.txt @@ -1,10 +1,10 @@ Source Location: (93:2,32 [23] x:\dir\subdir\Test\TestComponent.cshtml) |item.ToLowerInvariant()| -Generated Location: (1196:30,32 [23] ) +Generated Location: (1204:30,32 [23] ) |item.ToLowerInvariant()| Source Location: (13:0,13 [6] x:\dir\subdir\Test\TestComponent.cshtml) |MyAttr| -Generated Location: (1481:41,13 [6] ) +Generated Location: (1489:41,13 [6] ) |MyAttr| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs index 77d4de4e322..1aecfc18a60 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs @@ -24,7 +24,7 @@ private void __RazorDirectiveTokenHelpers__() { #pragma warning disable 1998 protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { - __o = new global::System.Action( + __o = new global::System.Action( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" e => { Increment(); } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt index 69d76657c42..5897aed0e5e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt @@ -1,11 +1,11 @@ Source Location: (24:0,24 [21] x:\dir\subdir\Test\TestComponent.cshtml) |e => { Increment(); }| -Generated Location: (1073:29,24 [21] ) +Generated Location: (1081:29,24 [21] ) |e => { Increment(); }| Source Location: (13:0,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1502:42,13 [7] ) +Generated Location: (1510:42,13 [7] ) |OnClick| Source Location: (60:2,7 [87] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +15,7 @@ Source Location: (60:2,7 [87] x:\dir\subdir\Test\TestComponent.cshtml) counter++; } | -Generated Location: (1917:60,7 [87] ) +Generated Location: (1925:60,7 [87] ) | private int counter; private void Increment() { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs index f4de066d325..c00a412ae32 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs @@ -39,7 +39,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - __builder.AddAttribute(-1, "Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { + __builder.AddAttribute(-1, "Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { #nullable restore #line 7 "x:\dir\subdir\Test\TestComponent.cshtml" __o = context; @@ -66,7 +66,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - __builder.AddAttribute(-1, "Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { + __builder.AddAttribute(-1, "Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { #nullable restore #line 13 "x:\dir\subdir\Test\TestComponent.cshtml" __o = context; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt index 5f67098fac7..1e8ef43ff5f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt @@ -5,11 +5,11 @@ Generated Location: (361:12,0 [17] ) Source Location: (119:6,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |context| -Generated Location: (1578:44,13 [7] ) +Generated Location: (1586:44,13 [7] ) |context| Source Location: (276:12,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |context| -Generated Location: (2403:71,13 [7] ) +Generated Location: (2419:71,13 [7] ) |context| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.codegen.cs index 7b01bafbaaf..a81862f7e64 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.codegen.cs @@ -24,7 +24,7 @@ private void __RazorDirectiveTokenHelpers__() { #pragma warning disable 1998 protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { - __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<(System.Int32 Horizontal, System.Int32 Vertical)>( + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<(global::System.Int32 Horizontal, global::System.Int32 Vertical)>( #nullable restore #line 5 "x:\dir\subdir\Test\TestComponent.cshtml" (32, 16) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.mappings.txt index 21f5c103e9a..ee7c896015e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.mappings.txt @@ -1,18 +1,18 @@ Source Location: (113:4,23 [8] x:\dir\subdir\Test\TestComponent.cshtml) |(32, 16)| -Generated Location: (1160:29,23 [8] ) +Generated Location: (1176:29,23 [8] ) |(32, 16)| Source Location: (105:4,15 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Gutter| -Generated Location: (1580:42,15 [6] ) +Generated Location: (1596:42,15 [6] ) |Gutter| Source Location: (7:0,7 [78] x:\dir\subdir\Test\TestComponent.cshtml) | [Parameter] public (int Horizontal, int Vertical) Gutter { get; set; } | -Generated Location: (1996:60,7 [78] ) +Generated Location: (2012:60,7 [78] ) | [Parameter] public (int Horizontal, int Vertical) Gutter { get; set; } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.codegen.cs index fde39def4b8..dfa9acb1c26 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.codegen.cs @@ -44,7 +44,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. ); __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => message = __value, message))); - __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message); + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } )); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.mappings.txt index d91e91607f7..043705cd50f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.mappings.txt @@ -10,19 +10,19 @@ Generated Location: (1451:38,48 [7] ) Source Location: (13:0,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |Message| -Generated Location: (2496:54,13 [7] ) +Generated Location: (2512:54,13 [7] ) |Message| Source Location: (38:0,38 [7] x:\dir\subdir\Test\TestComponent.cshtml) |Message| -Generated Location: (2738:63,38 [7] ) +Generated Location: (2754:63,38 [7] ) |Message| Source Location: (73:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) | string message = "hi"; | -Generated Location: (3158:81,12 [30] ) +Generated Location: (3174:81,12 [30] ) | string message = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.codegen.cs index b5e8ba75d76..83ce025ea6b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.codegen.cs @@ -44,7 +44,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. ); __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => message = __value, message))); - __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message); + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } )); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.mappings.txt index 50654ea80a7..3d027651884 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.mappings.txt @@ -10,19 +10,19 @@ Generated Location: (1626:38,59 [7] ) Source Location: (13:0,13 [14] x:\dir\subdir\Test\TestComponent.cshtml) |MessageChanged| -Generated Location: (2671:54,13 [14] ) +Generated Location: (2687:54,13 [14] ) |MessageChanged| Source Location: (49:0,49 [7] x:\dir\subdir\Test\TestComponent.cshtml) |Message| -Generated Location: (2931:63,49 [7] ) +Generated Location: (2947:63,49 [7] ) |Message| Source Location: (84:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) | string message = "hi"; | -Generated Location: (3351:81,12 [30] ) +Generated Location: (3367:81,12 [30] ) | string message = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.codegen.cs index 31b29f813e0..0970d172be9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.codegen.cs @@ -24,7 +24,7 @@ private void __RazorDirectiveTokenHelpers__() { #pragma warning disable 1998 protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { - __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>( + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>( #nullable restore #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" (s) => {} @@ -44,7 +44,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. ); __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => message = __value, message))); - __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message); + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message); __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { } )); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.mappings.txt index ebf495502cf..14dc7e7f95d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.mappings.txt @@ -1,28 +1,28 @@ Source Location: (59:0,59 [9] x:\dir\subdir\Test\TestComponent.cshtml) |(s) => {}| -Generated Location: (1220:29,59 [9] ) +Generated Location: (1236:29,59 [9] ) |(s) => {}| Source Location: (29:0,29 [7] x:\dir\subdir\Test\TestComponent.cshtml) |message| -Generated Location: (1521:38,29 [7] ) +Generated Location: (1537:38,29 [7] ) |message| Source Location: (38:0,38 [17] x:\dir\subdir\Test\TestComponent.cshtml) |MessageExpression| -Generated Location: (2591:54,38 [17] ) +Generated Location: (2623:54,38 [17] ) |MessageExpression| Source Location: (19:0,19 [7] x:\dir\subdir\Test\TestComponent.cshtml) |Message| -Generated Location: (2824:63,19 [7] ) +Generated Location: (2856:63,19 [7] ) |Message| Source Location: (87:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) | string message = "hi"; | -Generated Location: (3244:81,12 [30] ) +Generated Location: (3276:81,12 [30] ) | string message = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.codegen.cs new file mode 100644 index 00000000000..87cac7cbb5d --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.codegen.cs @@ -0,0 +1,77 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __o = global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>( +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" + null + +#line default +#line hidden +#nullable disable + ); + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { + } + )); + #pragma warning disable BL0005 + ((global::Test.TestComponent)default). +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" + Data + +#line default +#line hidden +#nullable disable + = default; + #pragma warning restore BL0005 +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.TestComponent); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" + + private class System + { + private class String + { + } + } + + [Parameter] + public List Data { get; set; } + +#line default +#line hidden +#nullable disable + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt new file mode 100644 index 00000000000..a2e3283c0d3 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt @@ -0,0 +1,23 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + Component - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentAttribute - (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Data - Data - AttributeStructure.DoubleQuotes + LazyIntermediateToken - (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - null + HtmlContent - (29:0,29 [4] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (29:0,29 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n + CSharpCode - (40:2,7 [172] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (40:2,7 [172] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private class System\n {\n private class String\n {\n }\n }\n\n [Parameter]\n public List Data { get; set; }\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.mappings.txt new file mode 100644 index 00000000000..43f60bdfe93 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericTypeCheck/TestComponent.mappings.txt @@ -0,0 +1,35 @@ +Source Location: (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) +|null| +Generated Location: (1172:29,21 [4] ) +|null| + +Source Location: (15:0,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) +|Data| +Generated Location: (1588:42,15 [4] ) +|Data| + +Source Location: (40:2,7 [172] x:\dir\subdir\Test\TestComponent.cshtml) +| + private class System + { + private class String + { + } + } + + [Parameter] + public List Data { get; set; } +| +Generated Location: (2002:60,7 [172] ) +| + private class System + { + private class String + { + } + } + + [Parameter] + public List Data { get; set; } +| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.codegen.cs index 204c0b85da8..ff5688f4246 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.codegen.cs @@ -54,7 +54,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - __o = new global::Microsoft.AspNetCore.Components.RenderFragment( + __o = new global::Microsoft.AspNetCore.Components.RenderFragment( #nullable restore #line 2 "x:\dir\subdir\Test\TestComponent.cshtml" template diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.mappings.txt index 7fc1225c648..394dea96db0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.mappings.txt @@ -20,11 +20,11 @@ Generated Location: (1740:51,107 [2] ) Source Location: (136:1,24 [8] x:\dir\subdir\Test\TestComponent.cshtml) |template| -Generated Location: (1981:59,24 [8] ) +Generated Location: (1989:59,24 [8] ) |template| Source Location: (125:1,13 [8] x:\dir\subdir\Test\TestComponent.cshtml) |Template| -Generated Location: (2397:72,13 [8] ) +Generated Location: (2405:72,13 [8] ) |Template| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.codegen.cs index 3cc96f544ba..c1b4786f9bb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.codegen.cs @@ -47,7 +47,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - __o = new global::Microsoft.AspNetCore.Components.RenderFragment( + __o = new global::Microsoft.AspNetCore.Components.RenderFragment( #nullable restore #line 2 "x:\dir\subdir\Test\TestComponent.cshtml" template diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.mappings.txt index 8b670765ac0..ddf3533e923 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.mappings.txt @@ -15,11 +15,11 @@ Generated Location: (1465:44,73 [2] ) Source Location: (108:1,30 [8] x:\dir\subdir\Test\TestComponent.cshtml) |template| -Generated Location: (1711:52,30 [8] ) +Generated Location: (1719:52,30 [8] ) |template| Source Location: (91:1,13 [14] x:\dir\subdir\Test\TestComponent.cshtml) |PersonTemplate| -Generated Location: (2127:65,13 [14] ) +Generated Location: (2135:65,13 [14] ) |PersonTemplate| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.codegen.cs index abd3ceb0635..b46ee79b0fe 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.codegen.cs @@ -36,7 +36,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #nullable disable )); __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => ParentValue = __value, ParentValue)))); - __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); + __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.mappings.txt index 6a68a34f37a..f02bfe1b54a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2174:44,0 [50] ) +Generated Location: (2190:44,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs index 6c85c6edbb8..d901af09592 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.OnChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.OnChanged), (global::System.Action)(__value => ParentValue = __value)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt index 7f3dc1ced28..43bc0751867 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1560:43,0 [50] ) +Generated Location: (1568:43,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.codegen.cs index 3167bd4ea2d..2e70a69ed5b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.codegen.cs @@ -35,8 +35,8 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); - __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.ValueExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => ParentValue)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.mappings.txt index 01f8dac4026..e8d4440ec8e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1835:44,0 [50] ) +Generated Location: (1859:44,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs index e36578b746f..3f10ecd4ea1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt index d192ffede1f..3a94fce9997 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1563:43,0 [50] ) +Generated Location: (1571:43,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.codegen.cs index df3153b6eaf..bdf2d365142 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.dynamic.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.AddComponentParameter(2, nameof(global::Test.dynamic.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.mappings.txt index dbef272501e..0d5fcc2cce4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (46:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1551:43,0 [50] ) +Generated Location: (1559:43,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.codegen.cs index 983865f9dd9..94bebec1e54 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.@int.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.AddComponentParameter(2, nameof(global::Test.@int.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.mappings.txt index 776acdd1ae4..ff86df204f7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (42:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1542:43,0 [50] ) +Generated Location: (1550:43,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs index d8baebfd6df..aa9e2409461 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.AddComponentParameter(2, nameof(global::MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt index 1e7397b4f77..b2dabfd1ac9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1548:43,0 [50] ) +Generated Location: (1556:43,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.codegen.cs index 2748c8c3cfe..de4d84d6495 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.mappings.txt index 022089c5023..7daa1a95a55 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.mappings.txt @@ -14,7 +14,7 @@ Source Location: (50:1,7 [105] x:\dir\subdir\Test\TestComponent.cshtml) public string nameof(string s) => string.Empty; | -Generated Location: (1563:43,0 [105] ) +Generated Location: (1571:43,0 [105] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.codegen.cs index cade82dcb2c..ceb8519409b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)(__value => ParentValue = __value)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.mappings.txt index 01a2b30ddea..6391db2862a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (50:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml) | public string ParentValue { get; set; } = "42"; | -Generated Location: (1563:43,0 [55] ) +Generated Location: (1571:43,0 [55] ) | public string ParentValue { get; set; } = "42"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs index e7f7c74e2fe..1f8135dd3dc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( #nullable restore #line (1,63)-(1,69) "x:\dir\subdir\Test\TestComponent.cshtml" Update diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt index 52094507c13..810b5101f39 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt @@ -10,7 +10,7 @@ Generated Location: (1144:31,0 [11] ) Source Location: (62:0,62 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Update| -Generated Location: (1575:40,0 [6] ) +Generated Location: (1583:40,0 [6] ) |Update| Source Location: (81:1,7 [82] x:\dir\subdir\Test\TestComponent.cshtml) @@ -19,7 +19,7 @@ Source Location: (81:1,7 [82] x:\dir\subdir\Test\TestComponent.cshtml) public void Update() { } | -Generated Location: (1824:51,0 [82] ) +Generated Location: (1832:51,0 [82] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs index 5f96b9aa07a..f386b9d2740 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( __value => { ParentValue = __value; global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeSynchronousDelegate( #nullable restore #line (1,63)-(1,72) "x:\dir\subdir\Test\TestComponent.cshtml" () => { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt index 7f2679c6167..8240e570289 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt @@ -10,14 +10,14 @@ Generated Location: (1144:31,0 [11] ) Source Location: (62:0,62 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1575:40,0 [9] ) +Generated Location: (1583:40,0 [9] ) |() => { }| Source Location: (84:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1827:51,0 [50] ) +Generated Location: (1835:51,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs index a673f7ff341..1bf6800bda0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( #nullable restore #line (1,61)-(1,123) "x:\dir\subdir\Test\TestComponent.cshtml" (value => { ParentValue = value; return Task.CompletedTask; }) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt index f8a444575ca..586a029c535 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt @@ -10,14 +10,14 @@ Generated Location: (1144:31,0 [11] ) Source Location: (60:0,60 [62] x:\dir\subdir\Test\TestComponent.cshtml) |(value => { ParentValue = value; return Task.CompletedTask; })| -Generated Location: (1441:40,0 [62] ) +Generated Location: (1449:40,0 [62] ) |(value => { ParentValue = value; return Task.CompletedTask; })| Source Location: (135:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1742:51,0 [50] ) +Generated Location: (1750:51,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs index f3e042efa30..bb422b76863 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)(async __value => { ParentValue = __value; await global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)(async __value => { ParentValue = __value; await global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate( #nullable restore #line (1,63)-(1,69) "x:\dir\subdir\Test\TestComponent.cshtml" Update diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt index 196efd4fa84..4b6ab91b9d3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt @@ -10,7 +10,7 @@ Generated Location: (1144:31,0 [11] ) Source Location: (62:0,62 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Update| -Generated Location: (1615:40,0 [6] ) +Generated Location: (1631:40,0 [6] ) |Update| Source Location: (81:1,7 [101] x:\dir\subdir\Test\TestComponent.cshtml) @@ -19,7 +19,7 @@ Source Location: (81:1,7 [101] x:\dir\subdir\Test\TestComponent.cshtml) public Task Update() => Task.CompletedTask; | -Generated Location: (1864:51,0 [101] ) +Generated Location: (1880:51,0 [101] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs index 49e65646f4e..c925f792b53 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)(async __value => { ParentValue = __value; await global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)(async __value => { ParentValue = __value; await global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate( #nullable restore #line (1,63)-(1,99) "x:\dir\subdir\Test\TestComponent.cshtml" () => { return Task.CompletedTask; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt index 7a0348f8e2d..24f207033e2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt @@ -10,14 +10,14 @@ Generated Location: (1144:31,0 [11] ) Source Location: (62:0,62 [36] x:\dir\subdir\Test\TestComponent.cshtml) |() => { return Task.CompletedTask; }| -Generated Location: (1615:40,0 [36] ) +Generated Location: (1631:40,0 [36] ) |() => { return Task.CompletedTask; }| Source Location: (111:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1894:51,0 [50] ) +Generated Location: (1910:51,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs index bfb36b475d7..6e26b464c7b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( #nullable restore #line (1,61)-(1,72) "x:\dir\subdir\Test\TestComponent.cshtml" UpdateValue diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt index 94d87a1d84d..a04298cae65 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt @@ -10,7 +10,7 @@ Generated Location: (1144:31,0 [11] ) Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) |UpdateValue| -Generated Location: (1440:40,0 [11] ) +Generated Location: (1448:40,0 [11] ) |UpdateValue| Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) @@ -19,7 +19,7 @@ Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) public void UpdateValue(int value) => ParentValue = value; | -Generated Location: (1690:51,0 [116] ) +Generated Location: (1698:51,0 [116] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs index 21f622ba370..96ff2c3df0f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Action)( #nullable restore #line (1,61)-(1,89) "x:\dir\subdir\Test\TestComponent.cshtml" value => ParentValue = value diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt index dfbb63429bc..4240393425d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt @@ -10,14 +10,14 @@ Generated Location: (1144:31,0 [11] ) Source Location: (60:0,60 [28] x:\dir\subdir\Test\TestComponent.cshtml) |value => ParentValue = value| -Generated Location: (1440:40,0 [28] ) +Generated Location: (1448:40,0 [28] ) |value => ParentValue = value| Source Location: (101:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1707:51,0 [50] ) +Generated Location: (1715:51,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs index 361d55a95a8..0edba25ee85 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ))); - __builder.AddAttribute(2, nameof(global::Test.MyComponent.ValueChanged), (object)((global::System.Action)( + __builder.AddAttribute(2, nameof(global::Test.MyComponent.ValueChanged), (object)((global::System.Action)( #nullable restore #line (1,61)-(1,72) "x:\dir\subdir\Test\TestComponent.cshtml" UpdateValue diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt index 0e4155e0284..cf93f168453 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt @@ -10,7 +10,7 @@ Generated Location: (1144:31,0 [11] ) Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) |UpdateValue| -Generated Location: (1441:40,0 [11] ) +Generated Location: (1449:40,0 [11] ) |UpdateValue| Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) @@ -19,7 +19,7 @@ Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) public void UpdateValue(int value) => ParentValue = value; | -Generated Location: (1692:51,0 [116] ) +Generated Location: (1700:51,0 [116] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs index a43e5220dc5..3d8becd8513 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)( #nullable restore #line (1,61)-(1,72) "x:\dir\subdir\Test\TestComponent.cshtml" UpdateValue diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt index e2045b99fdd..1d2d804a1b9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt @@ -10,7 +10,7 @@ Generated Location: (1144:31,0 [11] ) Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) |UpdateValue| -Generated Location: (1467:40,0 [11] ) +Generated Location: (1483:40,0 [11] ) |UpdateValue| Source Location: (84:1,7 [144] x:\dir\subdir\Test\TestComponent.cshtml) @@ -19,7 +19,7 @@ Source Location: (84:1,7 [144] x:\dir\subdir\Test\TestComponent.cshtml) public Task UpdateValue(int value) { ParentValue = value; return Task.CompletedTask; } | -Generated Location: (1717:51,0 [144] ) +Generated Location: (1733:51,0 [144] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs index 358e53a3b9a..47034cd4373 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)( + __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.ValueChanged), (global::System.Func)( #nullable restore #line (1,61)-(1,121) "x:\dir\subdir\Test\TestComponent.cshtml" value => { ParentValue = value; return Task.CompletedTask; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt index 70a99a8556f..15ba3e4b8a4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt @@ -10,14 +10,14 @@ Generated Location: (1144:31,0 [11] ) Source Location: (60:0,60 [60] x:\dir\subdir\Test\TestComponent.cshtml) |value => { ParentValue = value; return Task.CompletedTask; }| -Generated Location: (1468:40,0 [60] ) +Generated Location: (1484:40,0 [60] ) |value => { ParentValue = value; return Task.CompletedTask; }| Source Location: (133:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1767:51,0 [50] ) +Generated Location: (1783:51,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.codegen.cs index c72983ec8e4..9d8396d5234 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.codegen.cs @@ -35,7 +35,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); - __builder.AddComponentParameter(2, nameof(global::Test.InputText.ValueChanged), (global::System.Action)(__value => person.Name = __value)); + __builder.AddComponentParameter(2, nameof(global::Test.InputText.ValueChanged), (global::System.Action)(__value => person.Name = __value)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.mappings.txt index 3db547b9f8f..24815817773 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.mappings.txt @@ -12,7 +12,7 @@ Source Location: (56:3,1 [37] x:\dir\subdir\Test\TestComponent.cshtml) | Person person = new Person(); | -Generated Location: (1559:43,0 [37] ) +Generated Location: (1567:43,0 [37] ) | Person person = new Person(); | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.codegen.cs index d79cfac0416..41c76497504 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.codegen.cs @@ -55,7 +55,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - ), (global::Microsoft.AspNetCore.Components.RenderFragment)( + ), (global::Microsoft.AspNetCore.Components.RenderFragment)( #nullable restore #line (2,22)-(2,28) "x:\dir\subdir\Test\TestComponent.cshtml" header diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.mappings.txt index 21b82df25e8..6f6fcfe1b87 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.mappings.txt @@ -20,6 +20,6 @@ Generated Location: (1567:52,0 [6] ) Source Location: (113:1,21 [6] x:\dir\subdir\Test\TestComponent.cshtml) |header| -Generated Location: (1796:60,0 [6] ) +Generated Location: (1804:60,0 [6] ) |header| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.codegen.cs index 2a4aab4d08f..ccb3b82a12e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.codegen.cs @@ -55,7 +55,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - ), (global::Microsoft.AspNetCore.Components.RenderFragment)( + ), (global::Microsoft.AspNetCore.Components.RenderFragment)( #nullable restore #line (2,22)-(2,28) "x:\dir\subdir\Test\TestComponent.cshtml" header diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.mappings.txt index 21b82df25e8..6f6fcfe1b87 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.mappings.txt @@ -20,6 +20,6 @@ Generated Location: (1567:52,0 [6] ) Source Location: (113:1,21 [6] x:\dir\subdir\Test\TestComponent.cshtml) |header| -Generated Location: (1796:60,0 [6] ) +Generated Location: (1804:60,0 [6] ) |header| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs index 7d5ef13cd70..dde5917e7ee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.codegen.cs @@ -26,7 +26,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - ), (global::System.Action)( + ), (global::System.Action)( #nullable restore #line (1,24)-(1,33) "x:\dir\subdir\Test\TestComponent.cshtml" Increment diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt index 0cf47482c50..94c96b14b11 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.mappings.txt @@ -5,7 +5,7 @@ Generated Location: (884:23,0 [7] ) Source Location: (23:0,23 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Increment| -Generated Location: (1084:31,0 [9] ) +Generated Location: (1092:31,0 [9] ) |Increment| Source Location: (46:2,7 [98] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +15,7 @@ Source Location: (46:2,7 [98] x:\dir\subdir\Test\TestComponent.cshtml) counter++; } | -Generated Location: (1332:42,0 [98] ) +Generated Location: (1340:42,0 [98] ) | private int counter; private void Increment(EventArgs e) { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.codegen.cs index b36feb64fc2..eb8ecdc2c31 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.codegen.cs @@ -18,7 +18,7 @@ public partial class TestComponent : global::Microsoft.AspNetCore.Components.Com protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { __builder.OpenComponent(0); - __builder.AddAttribute(1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { + __builder.AddAttribute(1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.AddContent(2, #nullable restore #line (1,29)-(1,36) "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.mappings.txt index ef18bd95183..4324daa4efc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.mappings.txt @@ -1,5 +1,5 @@ Source Location: (28:0,28 [7] x:\dir\subdir\Test\TestComponent.cshtml) |context| -Generated Location: (1004:24,0 [7] ) +Generated Location: (1012:24,0 [7] ) |context| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.codegen.cs index e5f348b8403..9d7566ec435 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.codegen.cs @@ -27,7 +27,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ), "abc"); - __builder.AddAttribute(2, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { + __builder.AddAttribute(2, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.AddContent(3, "Some text"); __builder2.OpenElement(4, "some-child"); __builder2.AddAttribute(5, "a", "1"); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.mappings.txt index 50912aabae5..37d668a476a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.mappings.txt @@ -5,6 +5,6 @@ Generated Location: (884:23,0 [6] ) Source Location: (54:0,54 [26] x:\dir\subdir\Test\TestComponent.cshtml) |context.ToLowerInvariant()| -Generated Location: (1418:36,0 [26] ) +Generated Location: (1426:36,0 [26] ) |context.ToLowerInvariant()| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.codegen.cs index 44ea67ef970..32b57b02572 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.codegen.cs @@ -27,7 +27,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ), "abc"); - __builder.AddAttribute(2, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { + __builder.AddAttribute(2, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { __builder2.AddMarkupContent(3, "\r\n Some text"); __builder2.OpenElement(4, "some-child"); __builder2.AddAttribute(5, "a", "1"); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.mappings.txt index 776d0225c13..7a4d7657a6d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.mappings.txt @@ -5,6 +5,6 @@ Generated Location: (884:23,0 [6] ) Source Location: (93:2,32 [23] x:\dir\subdir\Test\TestComponent.cshtml) |item.ToLowerInvariant()| -Generated Location: (1429:36,0 [23] ) +Generated Location: (1437:36,0 [23] ) |item.ToLowerInvariant()| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.codegen.cs index 44ea67ef970..32b57b02572 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.codegen.cs @@ -27,7 +27,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ), "abc"); - __builder.AddAttribute(2, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { + __builder.AddAttribute(2, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((item) => (__builder2) => { __builder2.AddMarkupContent(3, "\r\n Some text"); __builder2.OpenElement(4, "some-child"); __builder2.AddAttribute(5, "a", "1"); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.mappings.txt index 776d0225c13..7a4d7657a6d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.mappings.txt @@ -5,6 +5,6 @@ Generated Location: (884:23,0 [6] ) Source Location: (93:2,32 [23] x:\dir\subdir\Test\TestComponent.cshtml) |item.ToLowerInvariant()| -Generated Location: (1429:36,0 [23] ) +Generated Location: (1437:36,0 [23] ) |item.ToLowerInvariant()| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs index 4877f647ddb..9d3de935495 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.codegen.cs @@ -26,7 +26,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - ), (global::System.Action)( + ), (global::System.Action)( #nullable restore #line (1,25)-(1,46) "x:\dir\subdir\Test\TestComponent.cshtml" e => { Increment(); } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt index e26ef4a8636..9e81c5f14dc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.mappings.txt @@ -5,7 +5,7 @@ Generated Location: (884:23,0 [7] ) Source Location: (24:0,24 [21] x:\dir\subdir\Test\TestComponent.cshtml) |e => { Increment(); }| -Generated Location: (1084:31,0 [21] ) +Generated Location: (1092:31,0 [21] ) |e => { Increment(); }| Source Location: (60:2,7 [87] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +15,7 @@ Source Location: (60:2,7 [87] x:\dir\subdir\Test\TestComponent.cshtml) counter++; } | -Generated Location: (1344:42,0 [87] ) +Generated Location: (1352:42,0 [87] ) | private int counter; private void Increment() { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs index f38948c9970..0fa8152e78e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs @@ -31,7 +31,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. __builder.CloseComponent(); __builder.AddMarkupContent(3, "\r\n"); __builder.OpenComponent(4); - __builder.AddAttribute(5, "Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { + __builder.AddAttribute(5, "Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.AddContent(6, #nullable restore #line (7,14)-(7,21) "x:\dir\subdir\Test\TestComponent.cshtml" @@ -53,7 +53,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. __builder.CloseComponent(); __builder.AddMarkupContent(11, "\r\n"); __builder.OpenComponent(12); - __builder.AddAttribute(13, "Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { + __builder.AddAttribute(13, "Footer", (global::Microsoft.AspNetCore.Components.RenderFragment)((context) => (__builder2) => { __builder2.AddContent(14, #nullable restore #line (13,14)-(13,21) "x:\dir\subdir\Test\TestComponent.cshtml" diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt index 731c3314644..9ce8d189e21 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt @@ -7,11 +7,11 @@ Generated Location: (371:12,0 [19] ) Source Location: (119:6,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |context| -Generated Location: (1500:37,0 [7] ) +Generated Location: (1508:37,0 [7] ) |context| Source Location: (276:12,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |context| -Generated Location: (2438:59,0 [7] ) +Generated Location: (2454:59,0 [7] ) |context| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.codegen.cs index 49c1f8db49d..6eaef762d1c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.codegen.cs @@ -26,7 +26,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<(System.Int32 Horizontal, System.Int32 Vertical)>( + ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<(global::System.Int32 Horizontal, global::System.Int32 Vertical)>( #nullable restore #line (5,24)-(5,32) "x:\dir\subdir\Test\TestComponent.cshtml" (32, 16) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.mappings.txt index b75023acb7c..e1507a1b339 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.mappings.txt @@ -5,14 +5,14 @@ Generated Location: (888:23,0 [6] ) Source Location: (113:4,23 [8] x:\dir\subdir\Test\TestComponent.cshtml) |(32, 16)| -Generated Location: (1177:31,0 [8] ) +Generated Location: (1193:31,0 [8] ) |(32, 16)| Source Location: (7:0,7 [78] x:\dir\subdir\Test\TestComponent.cshtml) | [Parameter] public (int Horizontal, int Vertical) Gutter { get; set; } | -Generated Location: (1424:42,0 [78] ) +Generated Location: (1440:42,0 [78] ) | [Parameter] public (int Horizontal, int Vertical) Gutter { get; set; } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.codegen.cs index 912e12b4529..d92a7cd12b6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.codegen.cs @@ -53,7 +53,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #nullable disable )); __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.MessageChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => message = __value, message)))); - __builder.AddComponentParameter(4, nameof(global::Test.MyComponent.MessageExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message)); + __builder.AddComponentParameter(4, nameof(global::Test.MyComponent.MessageExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.mappings.txt index 0b6febc8b85..d1ca801dd40 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.mappings.txt @@ -22,7 +22,7 @@ Source Location: (73:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) | string message = "hi"; | -Generated Location: (2673:61,0 [30] ) +Generated Location: (2689:61,0 [30] ) | string message = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.codegen.cs index 66d476bcf1b..2b1d46948bf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.codegen.cs @@ -53,7 +53,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #nullable disable )); __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.MessageChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => message = __value, message)))); - __builder.AddComponentParameter(4, nameof(global::Test.MyComponent.MessageExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message)); + __builder.AddComponentParameter(4, nameof(global::Test.MyComponent.MessageExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.mappings.txt index 924aed3be4a..3fb5998d483 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.mappings.txt @@ -22,7 +22,7 @@ Source Location: (84:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) | string message = "hi"; | -Generated Location: (2836:61,0 [30] ) +Generated Location: (2852:61,0 [30] ) | string message = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.codegen.cs index 2e4a9d50315..de3f01d6ce7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.codegen.cs @@ -26,7 +26,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>( + ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>( #nullable restore #line (1,60)-(1,69) "x:\dir\subdir\Test\TestComponent.cshtml" (s) => {} @@ -53,7 +53,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #nullable disable )); __builder.AddComponentParameter(3, nameof(global::Test.MyComponent.MessageChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, __value => message = __value, message)))); - __builder.AddComponentParameter(4, nameof(global::Test.MyComponent.MessageExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message)); + __builder.AddComponentParameter(4, nameof(global::Test.MyComponent.MessageExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>>(() => message)); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.mappings.txt index 16fac7b9e88..5587b5952ad 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.mappings.txt @@ -5,24 +5,24 @@ Generated Location: (884:23,0 [17] ) Source Location: (59:0,59 [9] x:\dir\subdir\Test\TestComponent.cshtml) |(s) => {}| -Generated Location: (1208:31,0 [9] ) +Generated Location: (1224:31,0 [9] ) |(s) => {}| Source Location: (19:0,19 [7] x:\dir\subdir\Test\TestComponent.cshtml) |Message| -Generated Location: (1449:40,0 [7] ) +Generated Location: (1465:40,0 [7] ) |Message| Source Location: (29:0,29 [7] x:\dir\subdir\Test\TestComponent.cshtml) |message| -Generated Location: (1712:48,0 [7] ) +Generated Location: (1728:48,0 [7] ) |message| Source Location: (87:1,12 [30] x:\dir\subdir\Test\TestComponent.cshtml) | string message = "hi"; | -Generated Location: (2736:61,0 [30] ) +Generated Location: (2768:61,0 [30] ) | string message = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.codegen.cs new file mode 100644 index 00000000000..bb2b60e9920 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.codegen.cs @@ -0,0 +1,60 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __builder.OpenComponent(0); + __builder.AddComponentParameter(1, nameof(global::Test.TestComponent. +#nullable restore +#line (1,16)-(1,20) "x:\dir\subdir\Test\TestComponent.cshtml" +Data + +#line default +#line hidden +#nullable disable + ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck>( +#nullable restore +#line (1,22)-(1,26) "x:\dir\subdir\Test\TestComponent.cshtml" +null + +#line default +#line hidden +#nullable disable + )); + __builder.CloseComponent(); + } + #pragma warning restore 1998 +#nullable restore +#line (3,8)-(13,1) "x:\dir\subdir\Test\TestComponent.cshtml" + + private class System + { + private class String + { + } + } + + [Parameter] + public List Data { get; set; } + +#line default +#line hidden +#nullable disable + + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt new file mode 100644 index 00000000000..e3d0d35fdb7 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt @@ -0,0 +1,14 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [22] ) - global::System + UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [27] ) - global::System.Linq + UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree + Component - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentAttribute - (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Data - Data - AttributeStructure.DoubleQuotes + LazyIntermediateToken - (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - null + CSharpCode - (40:2,7 [172] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (40:2,7 [172] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n private class System\n {\n private class String\n {\n }\n }\n\n [Parameter]\n public List Data { get; set; }\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.mappings.txt new file mode 100644 index 00000000000..419d824f7ea --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.mappings.txt @@ -0,0 +1,35 @@ +Source Location: (15:0,15 [4] x:\dir\subdir\Test\TestComponent.cshtml) +|Data| +Generated Location: (888:23,0 [4] ) +|Data| + +Source Location: (21:0,21 [4] x:\dir\subdir\Test\TestComponent.cshtml) +|null| +Generated Location: (1189:31,0 [4] ) +|null| + +Source Location: (40:2,7 [172] x:\dir\subdir\Test\TestComponent.cshtml) +| + private class System + { + private class String + { + } + } + + [Parameter] + public List Data { get; set; } +| +Generated Location: (1433:42,0 [172] ) +| + private class System + { + private class String + { + } + } + + [Parameter] + public List Data { get; set; } +| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.codegen.cs index 379a952c6bf..3cb6fe273dd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.codegen.cs @@ -66,7 +66,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - ), (global::Microsoft.AspNetCore.Components.RenderFragment)( + ), (global::Microsoft.AspNetCore.Components.RenderFragment)( #nullable restore #line (2,25)-(2,33) "x:\dir\subdir\Test\TestComponent.cshtml" template diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.mappings.txt index 90e2fb31129..fd9f1d737da 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.mappings.txt @@ -25,6 +25,6 @@ Generated Location: (1881:63,0 [8] ) Source Location: (136:1,24 [8] x:\dir\subdir\Test\TestComponent.cshtml) |template| -Generated Location: (2111:71,0 [8] ) +Generated Location: (2119:71,0 [8] ) |template| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.codegen.cs index 22754f76221..83487236b4f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.codegen.cs @@ -55,7 +55,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line default #line hidden #nullable disable - ), (global::Microsoft.AspNetCore.Components.RenderFragment)( + ), (global::Microsoft.AspNetCore.Components.RenderFragment)( #nullable restore #line (2,31)-(2,39) "x:\dir\subdir\Test\TestComponent.cshtml" template diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.mappings.txt index 6c66253d0b8..91318bfbc45 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.mappings.txt @@ -20,6 +20,6 @@ Generated Location: (1553:52,0 [14] ) Source Location: (108:1,30 [8] x:\dir\subdir\Test\TestComponent.cshtml) |template| -Generated Location: (1788:60,0 [8] ) +Generated Location: (1796:60,0 [8] ) |template| diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentDesignTimeNodeWriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentDesignTimeNodeWriter.cs index 8702653d9ae..e5a7c050f4e 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentDesignTimeNodeWriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentDesignTimeNodeWriter.cs @@ -801,7 +801,7 @@ private void WriteComponentAttributeInnards(CodeRenderingContext context, Compon if (canTypeCheck) { context.CodeWriter.Write("new "); - TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); + WriteGloballyQualifiedTypeName(context, node); context.CodeWriter.Write("("); } context.CodeWriter.WriteLine(); @@ -883,15 +883,7 @@ private void WriteComponentAttributeInnards(CodeRenderingContext context, Compon { context.CodeWriter.Write(ComponentsApi.RuntimeHelpers.TypeCheck); context.CodeWriter.Write("<"); - var explicitType = (bool?)node.Annotations[ComponentMetadata.Component.ExplicitTypeNameKey]; - if (explicitType == true) - { - context.CodeWriter.Write(node.TypeName); - } - else - { - TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); - } + WriteGloballyQualifiedTypeName(context, node); context.CodeWriter.Write(">"); context.CodeWriter.Write("("); } @@ -964,7 +956,7 @@ public override void WriteComponentChildContent(CodeRenderingContext context, Co BeginWriteAttribute(context, node.AttributeName); context.CodeWriter.WriteParameterSeparator(); context.CodeWriter.Write("("); - TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); + WriteGloballyQualifiedTypeName(context, node); context.CodeWriter.Write(")("); WriteComponentChildContentInnards(context, node); diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentNodeWriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentNodeWriter.cs index 9e924a6b382..79b270262fb 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentNodeWriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentNodeWriter.cs @@ -483,6 +483,36 @@ protected static void WriteAddComponentRenderMode(CodeRenderingContext context, context.CodeWriter.WriteLine(); } + protected static void WriteGloballyQualifiedTypeName(CodeRenderingContext context, ComponentAttributeIntermediateNode node) + { + var explicitType = (bool?)node.Annotations[ComponentMetadata.Component.ExplicitTypeNameKey]; + if (explicitType == true) + { + context.CodeWriter.Write(node.TypeName); + } + else if (node.BoundAttribute?.GetGloballyQualifiedTypeName() is string typeName) + { + context.CodeWriter.Write(typeName); + } + else + { + TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); + } + } + + protected static void WriteGloballyQualifiedTypeName(CodeRenderingContext context, ComponentChildContentIntermediateNode node) + { + if (node.BoundAttribute?.GetGloballyQualifiedTypeName() is string typeName && + !node.BoundAttribute.IsGenericTypedProperty()) + { + context.CodeWriter.Write(typeName); + } + else + { + TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); + } + } + protected class TypeInferenceMethodParameter { public string SeqName { get; private set; } diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentRuntimeNodeWriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentRuntimeNodeWriter.cs index bd0b77cab0f..8cb57354a54 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentRuntimeNodeWriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentRuntimeNodeWriter.cs @@ -654,7 +654,7 @@ private void WriteComponentAttributeInnards(CodeRenderingContext context, Compon if (canTypeCheck) { context.CodeWriter.Write("("); - TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); + WriteGloballyQualifiedTypeName(context, node); context.CodeWriter.Write(")"); context.CodeWriter.Write("("); } @@ -726,15 +726,7 @@ private void WriteComponentAttributeInnards(CodeRenderingContext context, Compon { context.CodeWriter.Write(ComponentsApi.RuntimeHelpers.TypeCheck); context.CodeWriter.Write("<"); - var explicitType = (bool?)node.Annotations[ComponentMetadata.Component.ExplicitTypeNameKey]; - if (explicitType == true) - { - context.CodeWriter.Write(node.TypeName); - } - else - { - TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); - } + WriteGloballyQualifiedTypeName(context, node); context.CodeWriter.Write(">"); context.CodeWriter.Write("("); } @@ -813,7 +805,7 @@ public override void WriteComponentChildContent(CodeRenderingContext context, Co BeginWriteAttribute(context, node.AttributeName); context.CodeWriter.WriteParameterSeparator(); context.CodeWriter.Write("("); - TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); + WriteGloballyQualifiedTypeName(context, node); context.CodeWriter.Write(")("); WriteComponentChildContentInnards(context, node); From fdda4bbae9261f96d1eb15cca92566c7bf5792c4 Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Thu, 5 Sep 2024 15:42:30 -0700 Subject: [PATCH 287/386] CodeQL suppressions (#10845) --- .../src/Language/CodeGeneration/DefaultDocumentWriter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/CodeGeneration/DefaultDocumentWriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/CodeGeneration/DefaultDocumentWriter.cs index 550e32ca7ea..afc161e7cc3 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/CodeGeneration/DefaultDocumentWriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/CodeGeneration/DefaultDocumentWriter.cs @@ -71,6 +71,7 @@ public override void VisitDocument(DocumentIntermediateNode node) } else { + // CodeQL [SM02196] This is supported by the underlying Roslyn APIs and as consumers we must also support it. string?[] supportedAlgorithms = [HashAlgorithmName.SHA1.Name, HashAlgorithmName.SHA256.Name]; var message = Resources.FormatUnsupportedChecksumAlgorithm( From d37da8b3de44606d1b1907483aff07640d324755 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 6 Sep 2024 11:51:26 +1000 Subject: [PATCH 288/386] Bump to real Roslyn version --- eng/Version.Details.xml | 76 ++++++++++++++++++++--------------------- eng/Versions.props | 38 ++++++++++----------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a879142cf4a..b9aa7509484 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,82 +11,82 @@ 6bcf90f99d13da86c5e9753a6f34b6484673d0a0 - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb diff --git a/eng/Versions.props b/eng/Versions.props index 5df1d73efbd..b17446f0174 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,25 +53,25 @@ 9.0.0-beta.24453.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 - + https://github.com/dotnet/roslyn - 0ec44d9775c80a6861b811d8af637ee36e3315e1 + 9f86520c46f67d2a8a59af189f8fd87e35c574bb diff --git a/eng/Versions.props b/eng/Versions.props index c4680833301..c5cbdff6fd3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,25 +53,25 @@ 9.0.0-beta.24426.3 1.0.0-beta.23475.1 1.0.0-beta.23475.1 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 - 4.12.0-2.24419.3 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 + 4.12.0-3.24454.5 - + https://github.com/dotnet/source-build-reference-packages - 6bcf90f99d13da86c5e9753a6f34b6484673d0a0 + ad3c9aa85596f42c6a483233c50fab8cee8c412a diff --git a/eng/Versions.props b/eng/Versions.props index b17446f0174..707ebbb49ad 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 10.0.0-alpha.1.24428.1 + 10.0.0-alpha.1.24455.1 9.0.0-beta.24453.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From 8ffc0fc7d3da749c0f52cd02991b58ab6d8da84d Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Mon, 9 Sep 2024 15:39:38 -0700 Subject: [PATCH 319/386] Add Collection Best Practices in Razor document --- docs/CollectionBestPractices.md | 360 ++++++++++++++++++++++++++++++++ 1 file changed, 360 insertions(+) create mode 100644 docs/CollectionBestPractices.md diff --git a/docs/CollectionBestPractices.md b/docs/CollectionBestPractices.md new file mode 100644 index 00000000000..047103f2047 --- /dev/null +++ b/docs/CollectionBestPractices.md @@ -0,0 +1,360 @@ +# Collection Best Practices in Razor + +- [Imperative Collections](#imperative-collections) +- [Immutable Collections](#immutable-collections) + - [Using Builders](#using-builders) + - [`ImmutableArray`](#immutablearrayt) + - [Using `ImmutableArray.Builder`](#using-immutablearraytbuilder) + - [Frozen Collections](#frozen-collections) +- [Array Pools](#array-pools) +- [Object Pools](#object-pools) +- [✨It’s Magic! `PooledArrayBuilder`](#its-magic-pooledarraybuildert) +- [Using LINQ](#using-linq) + - [Best Practices](#best-practices) +- [Meta Tips](#meta-tips) + +# Imperative Collections +- .NET provides many collection types with different characteristics for different purposes. +- Collections from the System.Collections namespace should be avoided. Never use these unless in some legacy scenario. +- The collections in System.Collections.Generic are considered the “work horse” collection types for .NET and are + suitable for most purposes. They have years of hardening that make them highly efficient choices for most work. +- Popular imperative collection types include the ones we all use on a regular basis `List`, `HashSet`, + `Dictionary`, `Stack`. +- System.Collections.Concurrent contains collections that are designed for use when thread-safety is needed. + In general, these should only be used in particular situations. + +> [!WARNING] +> **Beware of collection growth** +> +> The imperative collections generally have more internal storage than needed to allow more items to be added. (This is +> what is meant by "capacity” vs. “count”). When enough items are added, the internal storage will need to grow. This +> requires creating larger storage, releasing the previous storage for garbage collection, and copying the existing +> contents into it, which consumes CPU time. For a larger collection, this can potential happen many times, so it’s +> important to set the capacity up front to avoid unnecessary internal storage growth. + +> [!WARNING] +> **Avoid exposing collection interfaces** +> +> Avoid exposing collections directly via interfaces, such as `IReadOnlyList` and +> `IReadOnlyDictionary`. The primary reason for this is that these interfaces can result in allocations +> when they are foreach’d. In general, collections provide a struct enumerator that can be used to foreach that +> collection without allocating an `IEnumertor` on the heap. However, when going through a collection interface, +> there isn’t a struct enumerator, so an allocation is likely required to foreach. In fact, many collections, such as +> `List`, are implemented to just return their struct enumerator when accessed via collection interfaces, resulting +> in an allocation when the struct enumerator is boxed. +> - If exposing a collection is necessary, consider whether it might be better to expose a more optimal read-only +> collection. Instead of `IReadOnlyList`, consider [`ImmutableArray`](#immutablearrayt). +> - There aren’t many other options when an API calls for exposing an `IReadOnlyDictionary`. In these +> cases, consider whether it might be better to just avoid exposing the collection altogether and provide APIs that +> access it. Or, in some cases, it might be necessary to create entirely new collection types. (This is why Razor +> `TagHelperDescriptors` expose a `MetadataCollection`.) + +> [!WARNING] +> **Be mindful of ToArray()** +> +> Calling `ToArray()` on a collection will create a new array and copy content from the collection into it. So, when +> the exact capacity is known up front, it is an anti-pattern to create a `List` withwout that capacity, fill it +> with items and then call `ToArray()` at the end. This results in extra allocations that could be avoided by creating +> an array and filling it. + +# Immutable Collections +- The .NET immutable collections are provided by the System.Collections.Immutable NuGet package, which provides + implementations for .NET, .NET Framework, and .NET Standard 2.0. +- The collections in the System.Collections.Immutable namespace have a very specific purpose. +- They are intended to be *persistent* data structures; that is, a data structure that always preserves the previous + version of itself when it is modified. Such data structures are effectively immutable, but it might have been better + for the namespace to have been called, System.Collections.Persistent. + - The term “persistent data structure” was introduced by the 1986 paper, + “Making Data Structures Persistent” ([PDF](https://www.cs.cmu.edu/~sleator/papers/making-data-structures-persistent.pdf)). + - A highly influential book in the area of persistent data structures is “Purely Functional Data Structures” (1999) + by Chris Okasaki ([Amazon](https://www.amazon.com/Purely-Functional-Data-Structures-Okasaki/dp/0521663504)). + Okasaki’s original dissertation is available from CMU’s website ([PDF](https://www.cs.cmu.edu/~rwh/students/okasaki.pdf)). +- Because of their persistency, nearly all of the immutable collections have very different implementations than their + imperative counterparts. For example, `List` is implemented using an array, while `ImmutableList` is implemented + using a binary tree. +- Mutating methods on an immutable collection perform “non-destructive mutation”. Instead, of mutating the underlying + object, a mutating method like `Add` produces a new instance of the immutable collection. This is similar to how the + `String.Replace(...)` API is used. +- The difference in implementation affects the asymptotic complexity of many standard operations. For example, indexing + into a `List` is O(1) but indexing into an `ImmutableList` is O(log n). +- Significant effort has been made to ensure that immutable collections are as efficient as they can be, while + maintaining their persistence characteristics. However, they are generally assumed to be slower than imperative + collections. + +> [!CAUTION] +> **ToImmutableX() extension methods are not “freeze” methods!** +> +> The System.Immutable.Collections package provides several extension methods that produce an immutable collection from +> an existing collection or sequence. These methods aren’t optimized to reuse the internal storage of other collections +> in any way. Because of this, the following code is an anti-pattern. In this example, each element is added to a +> `HashSet` and then the elements of that set are added to a new `ImmutableHashSet`. +> +> ```C# +> var array = new[] { "One", "Two", "Two", "One", "Three" }; +> var set = new HashSet(array).ToImmutableHashSet(); +> ``` + +## Using Builders +- When creating an immutable collection with a lot of mutation, use a builder. Builders are optimized to populate the + internal storage of an immutable collection. +- The following code achieves the expected result but inefficiently creates several intermediate `ImmutableList` + instances. + +```C# +ImmutableList CreateList() +{ + var list = ImmutableList.Empty; + for (var i = 0; i < 10; i++) + { + list = list.Add(i); + } + + return list; +} +``` + +- The version below populates an `ImmutableList.Builder` and creates just a single `ImmutableList` instance + at the end. + +```C# +ImmutableList CreateList() +{ + var builder = ImmutableList.CreateBuilder(); + + for (var i = 0; i < 10; i++) + { + builder.Add(i); + } + + return builder.ToImmutable(); +} +``` + +## `ImmutableArray` +- `ImmutableArray` is very different than the other immutable collections. It is the only struct collection type, + and is not optimized for persistence. (In hindsight, perhaps a more appropriate name would have been + `FrozenArray`?) +- `ImmutableArray` is a relatively simple struct that provides read-only access to an internal array. + +> [!WARNING] +> **Be aware of copies!** +> +> In order to maintain its immutability semantics, `ImmutableArray` *always* creates a copy of the array it is +> wrapping internally. If it didn’t, external changes to the array would be reflected in the `ImmutableArray`. +> +> Because a new array copy is created for every `ImmutableArray` it is important to be mindful of chaining methods +> that produce immutable arrays to avoid unnecessary intermediate array copies. +> +> In addition, as of System.Immutable.Collections 8.0.0, there is a new `ImmutableCollectionsMarshal` class that can +> provide access to the internal array of an `ImmutableArray` or to create an new `ImmutableArray` that wraps an +> existing array without copying. These can be used in high performance scenarios, but should be employed carefully to +> avoid introducing subtle bugs. + +- Because `ImmutableArray` is a struct that wraps a single field of a reference type, it is essentially free to copy + at runtime. However, this also leaves a bit of a usability wart because, as a struct, an `ImmutableArray` reference + can never be null, but it can has its default, zeroed-out value where the internal array reference is null. For this + reason, an `IsDefault` property is provided to check if an `ImmutableArray` is actually wrapping an array. +- `ImmutableArray` *can* be used as a persistent data structure via non-destructive mutation, but mutating methods + are generally implemented to copy the elements of the internal array. For example, `Add` will create a copy of the + internal array storage with an additional element and return it as an `ImmutableArray`. + +> [!NOTE] +> **A Little History** +> +> `ImmutableArray` was not part of System.Collections.Immutable when originally conceived. It was developed out of +> necessity by Roslyn to expose array data while avoiding the inherent problems of exposing an array. (At the time, +> .NET arrays didn’t even implement `IReadOnlyList`, which didn’t ship until .NET Framework 4.5.) +> System.Collections.Immutable itself was inspired by the many persistent data structures used internally by Roslyn and +> was intended to be used within Visual Studio for asynchronous code. However, the NuGet package became so popular that +> it was ultimately pulled into the .NET runtime. + +### Using `ImmutableArray.Builder` +- The Builder type for `ImmutableArray` provides a couple of features not provided by other immutable collection + builders. +- `ToImmutable()`: Like other builders, creates a new `ImmutableArray` that wraps a copy of the filled portion of + internal array buffer used by the builder. +- `MoveToImmutable()`: Creates a new `ImmutableArray` that wraps the internal array buffer used by the builder. Note + that this requires that the builder’s capacity is the same as its count. In other words, the builder’s internal array + buffer must be completely filled, or this will throw an `InvalidOperationException`. If the operation is successful, + the internal buffer is set to an empty array. +- `DrainToImmutable()`: This is sort of like a combination of `ToImmutable()` and `MoveToImmutable()`. This operation + “drains” the builder by checking if the capacity equals the count. If true, it returns a new `ImmutableArray` that + wraps the internal array buffer. If false, it returns a new `ImmutableArray` that wraps a copy of the filled + portion of the internal array buffer. In either case, the internal buffer is set to an empty array. + +> [!CAUTION] +> **Immutable collections as static data** +> +> Because of their performance characteristics, most of the immutable collections are *not* suitable for static +> collections. In fact, `ImmutableArray` is really the only immutable collection that should be used for static data, +> since accessing it is essentially the same as accessing an array. +> +> When creating a static lookup table it can be tempting to reach for an `ImmutableHashSet` or an +> `ImmutableDictionary`, but that temptation should be resisted! Lookup will always be slower than using +> he imperative counterpart because of the internal tree structures employed for immutable collections. +> +> There are several tricks that can be used to encapsulate imperative collections as static data. For example, a nested +> static class could hide a `HashSet` or `Dictionary` behind static methods that access the +> collections. However, a better solution available today is to use a [frozen collection](#Frozen-Collections). + +## Frozen Collections +- The System.Collections.Frozen namespace became available starting with version 8.0.0 of the + System.Collections.Immutable NuGet package. +- Currently, there are two frozen collection types: `FrozenSet` and `FrozenDictionary`. +- The frozen collections are not persistent; in fact, they can’t be mutated at all! Instead, frozen collections are + optimized for faster lookup operations — faster than their imperative counterparts. +- Frozen collections provide faster lookup by performing up-front analysis and selecting an optimal implementation for + the content. This means that they are much more expensive to create. +- Because of their higher creation cost and improved lookup performance, frozen collections are best suited for + static data. + +# Array Pools +- When a temporary array is needed to perform work and the lifetime of the array is bounded, consider acquiring a + pooled array. `ArrayPool` can be used to acquire an array of some minimum length that can be returned to the pool + when the work is done. + +> [!WARNING] +> **Be mindful of the array size!** +> +> The size of an array acquired from an `ArrayPool` is guaranteed to be at least as large as the minimum length that +> was requested. However, it is likely that a larger array will have been returned. So, care should be taken to avoid +> using the acquired array’s length, unless that’s what’s needed. + +- Razor provides a handful of helper extension methods that acquire pooled arrays and return them within the scope of a +using statement: + +```C# +var pool = ArrayPool.Shared; + +using (pool.GetPooledArray(minimumLength: 42, out var array) +{ + // When using array but be careful that array.Length >= minimumLength. +} + +using (pool.GetPooledArraySpan(minimumLength: 42, out var span) +{ + // span is array.AsSpan(0, minimumLength) to help avoid subtle bugs. +} +``` + +# Object Pools +- Razor provides object pooling facilities based on + [Microsoft.Extensions.ObjectPool](https://www.nuget.org/packages/Microsoft.Extensions.ObjectPool/) (which was + originally based on Roslyn’s `ObjectPool`) along with several premade pools for many collection types in the + [Microsoft.AspNetCore.Razor.PooledObjects](https://github.com/dotnet/razor/tree/5c0677ad275e64300b897de0f6e8856ebe13f07b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects) + namespace. These can be used to acquire temporary collections to use for work and return when finished. + +```C# +using var _ = ListPool.GetPooledObject(out var list); + +// Use list here. It'll be returned to the pool at the end of the using +// statement's scope. +``` + +- Pooled collections provide a couple of benefits. + 1. Pooled collections decrease pressure on the garbage collector by reusing collection instances. + 2. Pooled collections avoid growing a collection’s internal storage. For example, when the `List` acquired from + `ListPool` in the code sample above is returned to the pool, it will be cleared. However, the capacity of its + internal storage will only be trimmed if it is larger than 512. So, lists acquired from the pool are likely to + already have a larger capacity than needed for most work. + +# ✨It’s Magic! `PooledArrayBuilder` + +- Razor’s [`PooledArrayBuilder`](https://github.com/dotnet/razor/blob/5c0677ad275e64300b897de0f6e8856ebe13f07b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder%601.cs) + is heavily inspired by Roslyn’s [`TemporaryArray`](https://github.com/dotnet/roslyn/blob/d176f9b5a7220cd95a6d5811ba1c49ac392a2fdc/src/Compilers/Core/Portable/Collections/TemporaryArray%601.cs). +- The important feature of this type (and the reason we’ve started using it all over Razor) is that it stores the first + 4 elements of the array being built inline as fields. After 4 elements have been added, it will acquire a pooled + `ImmutableArray.Builder`. This makes it extremely cheap to use for small arrays and reduces pressure on the object + pools. +- Because `PooledArrayBuilder` is a struct, it must be passed by-reference. Otherwise, any elements added by a method + it’s passed to won’t be reflected back at the call-site. +- To avoid writing buggy code that accidentally copies a `PooledArrayBuilder`, it is marked with a `[NonCopyable]` + attribute. A Roslyn analyzer tracks types decorated with that attribute and ensures that instances are never copied. +- Because `PooledArrayBuilder` _may_ acquire a pooled `ImmutableArray.Builder`, it is disposable and should + generally be created within a using statement. However, that makes it a bit more awkward to pass by reference, so a + special `AsRef()` extension method is provided. +- In the following code example, an `ImmutableArray.Builder` will never be acquired from the pool because the + `PooledArrayBuilder` only ever contains three elements. + +```C# +ImmutableArray BuildStrings() +{ + using var builder = new PooledArrayBuilder(); + AddElements(ref builder.AsRef()); + + return builder.DrainToImmutable(); +} + +void AddElements(ref PooledArrayBuilder builder) +{ + builder.Add("One"); + builder.Add("Two"); + builder.Add("Three"); +} +``` + +# Using LINQ +- LINQ (that is, LINQ to Objects) is a bit of a tricky subject. It has been used extensively throughout Razor for a long + time. It’s certainly not off limits but should be used with an understanding of the hidden costs: + - Every lambda expression represents at least one allocation — the delegate that holds it. + - A lambda that accesses variables or instance data from an outer scope will result in a closure being allocated each + time the delegate is invoked. + - Many LINQ methods allocate an iterator instance. + - Because Razor tooling runs in Visual Studio, it runs on .NET Framework and doesn’t benefit from many LINQ + optimizations made in modern .NET. + - Because LINQ methods target `IEnumerable` instances, they can trigger additional allocations depending on how + `GetEnumerator()` is implemented. For example, a simple call like `Queue.Any()` might seem innocuous—it doesn’t + even have a lambda! However, the implementation of + [`Enumerable.Any()`](https://referencesource.microsoft.com/#System.Core/System/Linq/Enumerable.cs,1288) on .NET + Framework doesn’t have any fast paths and simply calls `GetEnumerator()`. So, `Any()` boxes `Queue`’s struct + enumerator, resulting an allocation every time it’s called. In a tight loop, that could be disastrous! + - LINQ can obfuscate algorithmic complexity. It can be hard to see that introducing a LINQ expression has made an + algorithm O(n^2). + +## Best Practices +- Consider whether LINQ could have a negative performance impact for a particular scenario. Is this a hot path? Is it + happening in a loop? +- Always try to use static lambdas to ensure closures aren’t created and delegates are cached and reused. +- What collection type is being targeted? Do we have specialized LINQ methods that could be used? Razor provides a few + for `ImmutableArray` and `IReadOnlyList`. + +# Using Collection Expressions +- C# 12 introduced collection expressions as a language-level abstraction to generate collection-based code. It is a + goal of collection expressions to produce efficient code. +- Collection expressions are generally very good. They are especially helpful for combining collections or even query + expressions. + +```C# +int[] Combine(List list, HashSet set) +{ + return [..list, ..set]; +} + +int[] Squares(List list, HashSet set) +{ + return [ + ..from x in list select x * x, + ..from x in set select x * x + ]; +} +``` + +> [!WARNING] +> +> Below are a few issues to consider when using a collection expression: +> - Sometimes, a collection expression might create a new temporary collection instance, such as a `List`. However, +> it will not acquire a temporary collection from Razor’s object pools ([SharpLab](https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0ATEBqAPgAQAYACfARhQG4BYAKHwGZSAmYgYWIG87jfSmAlgDsALgG0AusQCyACnIMAPMJEA+YgGcYARwCuMIWBgBKLjz4X8AdmJiAdHc079hmBJq0LAXzpegA=)). +> - There are pathological collection expressions to be avoided. For example, never use a collection expression to +> replace a call to `ImmutableArray.Builder.ToImmutable()` ([SharpLab](https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0ATEBqAPgAQAYACfARgDoBhCAG1pjABcBLCAOwGcKBJAWz4BXJgENgDANwBYAFD4AzKQBMxKsQDes4ttKL+Q0eJgBBKFBEBPADwt2TAHzEAsgApbTANoBdYiLOWASg0tHVCANz9iYEEWWgwYKGIAXmJ9YTEGU3MLalgRJhgAIRi4hJs7excA6RlQ0OjY+KgKYwwMACURdgBzGBc/bOqQuuJhuvwAdmIPCgookqavGtCAX1kVoA=)). + +# Meta Tips + +- Always be aware of the memory layout, features, and performance characteristics of the data structure you are using. +- If you have an implementation question for a .NET collection type, check out the source code using the + [.NET Source Browser](https://source.dot.net/)for modern .NET, or the + [.NET Framework Reference Source](https://referencesource.microsoft.com/). And of course, the .NET runtime repo is + available at [dotnet/runtime](https://github.com/dotnet/runtime). +- Several reflection-based tools exist for exploring .NET assemblies, such as + [ILSpy](https://github.com/icsharpcode/ILSpy) or dotPeek (from JetBrains). +- Use https://sharplab.io to see how code will be compiled. This can be especially useful for collection expressions, + which are usually very efficient do have pathological cases to avoid. \ No newline at end of file From 4f1a297954e18d5ca2f95e82642b7eff3eec88cd Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 10 Sep 2024 13:25:26 +1000 Subject: [PATCH 320/386] PR Feedback --- .../Extensions/LinePositionSpanExtensions.cs | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LinePositionSpanExtensions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LinePositionSpanExtensions.cs index be8281fc4ca..4ae8ede32f2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LinePositionSpanExtensions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/LinePositionSpanExtensions.cs @@ -31,23 +31,19 @@ public static bool OverlapsWith(this LinePositionSpan span, LinePositionSpan oth public static bool LineOverlapsWith(this LinePositionSpan span, LinePositionSpan other) { - var overlapStart = span.Start.Line; - if (span.Start.Line.CompareTo(other.Start.Line) < 0) - { - overlapStart = other.Start.Line; - } + var overlapStart = span.Start.Line < other.Start.Line + ? other.Start.Line + : span.Start.Line; - var overlapEnd = span.End.Line; - if (span.End.Line.CompareTo(other.End.Line) > 0) - { - overlapEnd = other.End.Line; - } + var overlapEnd = span.End.Line > other.End.Line + ? other.End.Line + : span.End.Line; - return overlapStart.CompareTo(overlapEnd) <= 0; + return overlapStart <= overlapEnd; } public static bool Contains(this LinePositionSpan span, LinePositionSpan other) { - return span.Start.CompareTo(other.Start) <= 0 && span.End.CompareTo(other.End) >= 0; + return span.Start <= other.Start && span.End >= other.End; } } From 05e317fc9877d9358923eaaf05030333c67b8cdf Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 10 Sep 2024 14:07:22 +1000 Subject: [PATCH 321/386] Fix after merge --- .../Formatting/DocumentOnTypeFormattingEndpoint.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs index 9d6e1422d22..7012b8173d7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs @@ -5,6 +5,7 @@ using System.Collections.Frozen; using System.Collections.Immutable; using System.Diagnostics; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; From a3fe4c96d958a9ca1ea69bb986308002f929dd3e Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 10 Sep 2024 08:11:42 -0700 Subject: [PATCH 322/386] Tweak text for consistency Co-authored-by: Jared Parsons --- docs/CollectionBestPractices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CollectionBestPractices.md b/docs/CollectionBestPractices.md index 047103f2047..f44d364c3fc 100644 --- a/docs/CollectionBestPractices.md +++ b/docs/CollectionBestPractices.md @@ -15,7 +15,7 @@ # Imperative Collections - .NET provides many collection types with different characteristics for different purposes. -- Collections from the System.Collections namespace should be avoided. Never use these unless in some legacy scenario. +- The collections from the System.Collections namespace should be avoided. Never use these unless in some legacy scenario. - The collections in System.Collections.Generic are considered the “work horse” collection types for .NET and are suitable for most purposes. They have years of hardening that make them highly efficient choices for most work. - Popular imperative collection types include the ones we all use on a regular basis `List`, `HashSet`, From 665e11649c8736d4680cba39a605f8ccaf941f58 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 10 Sep 2024 08:11:53 -0700 Subject: [PATCH 323/386] Fix typo Co-authored-by: Jared Parsons --- docs/CollectionBestPractices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CollectionBestPractices.md b/docs/CollectionBestPractices.md index f44d364c3fc..921dc85dc44 100644 --- a/docs/CollectionBestPractices.md +++ b/docs/CollectionBestPractices.md @@ -53,7 +53,7 @@ > **Be mindful of ToArray()** > > Calling `ToArray()` on a collection will create a new array and copy content from the collection into it. So, when -> the exact capacity is known up front, it is an anti-pattern to create a `List` withwout that capacity, fill it +> the exact capacity is known up front, it is an anti-pattern to create a `List` without that capacity, fill it > with items and then call `ToArray()` at the end. This results in extra allocations that could be avoided by creating > an array and filling it. From ac21c4df72160d4fad4bd470ac189579f2003ffd Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Tue, 10 Sep 2024 08:12:08 -0700 Subject: [PATCH 324/386] Add missing space Co-authored-by: David Wengier --- docs/CollectionBestPractices.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CollectionBestPractices.md b/docs/CollectionBestPractices.md index 921dc85dc44..ea250a0f6c8 100644 --- a/docs/CollectionBestPractices.md +++ b/docs/CollectionBestPractices.md @@ -351,7 +351,7 @@ int[] Squares(List list, HashSet set) - Always be aware of the memory layout, features, and performance characteristics of the data structure you are using. - If you have an implementation question for a .NET collection type, check out the source code using the - [.NET Source Browser](https://source.dot.net/)for modern .NET, or the + [.NET Source Browser](https://source.dot.net/) for modern .NET, or the [.NET Framework Reference Source](https://referencesource.microsoft.com/). And of course, the .NET runtime repo is available at [dotnet/runtime](https://github.com/dotnet/runtime). - Several reflection-based tools exist for exploring .NET assemblies, such as From 1f78fd1f699ecf33494768cfdacbdf2395dcc57e Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 11 Sep 2024 07:53:33 +1000 Subject: [PATCH 325/386] Rename file --- ...PresentationEndpoint.cs => CohostDocumentHighlightEndpoint.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/{CohostDocumentHighlightPresentationEndpoint.cs => CohostDocumentHighlightEndpoint.cs} (100%) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightEndpoint.cs similarity index 100% rename from src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightPresentationEndpoint.cs rename to src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentHighlightEndpoint.cs From d8b0c499230283b82e3c332e150a571fc0ce7eda Mon Sep 17 00:00:00 2001 From: Alex Gavrilov Date: Tue, 10 Sep 2024 19:23:08 -0400 Subject: [PATCH 326/386] Cleanup default RemoteAutoInsertOptions (#10852) * Using default constructor per David's suggestion to avoid having two copies of default values * More PR feedback * PR feedback - formatting --- .../Remote/RemoteAutoInsertOptions.cs | 11 +++-------- .../Cohost/CohostOnAutoInsertEndpoint.cs | 4 +++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RemoteAutoInsertOptions.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RemoteAutoInsertOptions.cs index 9281506849c..75455fd0a2c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RemoteAutoInsertOptions.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RemoteAutoInsertOptions.cs @@ -1,7 +1,6 @@ using System.Runtime.Serialization; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.Settings; -using Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.CodeAnalysis.Razor.Remote; @@ -15,21 +14,17 @@ internal readonly record struct RemoteAutoInsertOptions public bool FormatOnType { get; init; } = true; [DataMember(Order = 2)] - public RazorFormattingOptions FormattingOptions { get; init; } = new RazorFormattingOptions() - { - InsertSpaces = true, - TabSize = 4 - }; + public RazorFormattingOptions FormattingOptions { get; init; } = new(); public RemoteAutoInsertOptions() { } - public static RemoteAutoInsertOptions From(ClientSettings clientSettings, FormattingOptions formattingOptions) + public static RemoteAutoInsertOptions From(ClientSettings clientSettings, RazorFormattingOptions formattingOptions) => new() { EnableAutoClosingTags = clientSettings.AdvancedSettings.AutoClosingTags, FormatOnType = clientSettings.AdvancedSettings.FormatOnType, - FormattingOptions = RazorFormattingOptions.From(formattingOptions, codeBlockBraceOnNextLine: false) + FormattingOptions = formattingOptions }; } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs index 55385ec7dae..bab6951f6c6 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostOnAutoInsertEndpoint.cs @@ -12,6 +12,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; using Microsoft.CodeAnalysis.Razor.AutoInsert; +using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.Protocol.AutoInsert; using Microsoft.CodeAnalysis.Razor.Remote; @@ -92,7 +93,8 @@ private static ImmutableArray CalculateTriggerChars(IEnumerable( From a782f9e8e3fd31678e13c85ea6b6ce3bea40a9cd Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 11 Sep 2024 16:50:50 +1000 Subject: [PATCH 327/386] Create basic service and endpoints to gather diagnostics and pass them over to OOP Wanted to validate my Roslyn code would work first, before moving our services around, in case the order of this work seems backwards to usual :) --- eng/targets/Services.props | 1 + .../RazorLanguageServer.cs | 4 +- .../Remote/IRemoteDiagnosticsService.cs | 20 ++ .../Remote/RazorServices.cs | 1 + .../Diagnostics/RemoteDiagnosticsService.cs | 43 ++++ .../CohostDocumentPullDiagnosticsEndpoint.cs | 205 ++++++++++++++++++ 6 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDiagnosticsService.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteDiagnosticsService.cs create mode 100644 src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs diff --git a/eng/targets/Services.props b/eng/targets/Services.props index fc2acc27dfa..0501df0e116 100644 --- a/eng/targets/Services.props +++ b/eng/targets/Services.props @@ -32,5 +32,6 @@ +
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index be86fe01409..70d4fcd1351 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -131,7 +131,6 @@ protected override ILspServices ConstructLspServices() services.AddLifeCycleServices(this, _clientConnection, _lspServerActivationTracker); - services.AddDiagnosticServices(); services.AddSemanticTokensServices(featureOptions); services.AddDocumentManagementServices(featureOptions); services.AddCompletionServices(); @@ -143,6 +142,9 @@ protected override ILspServices ConstructLspServices() if (!featureOptions.UseRazorCohostServer) { + // Diagnostics + services.AddDiagnosticServices(); + // Auto insert services.AddSingleton(); services.AddSingleton(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDiagnosticsService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDiagnosticsService.cs new file mode 100644 index 00000000000..65d6cc876c6 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDiagnosticsService.cs @@ -0,0 +1,20 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using RoslynLspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic; + +namespace Microsoft.CodeAnalysis.Razor.Remote; + +internal interface IRemoteDiagnosticsService : IRemoteJsonService +{ + ValueTask> GetDiagnosticsAsync( + JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, + JsonSerializableDocumentId documentId, + ImmutableArray csharpDiagnostics, + ImmutableArray htmlDiagnostics, + CancellationToken cancellationToken); +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs index 4ede4292572..2e4257cdb3c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs @@ -35,6 +35,7 @@ internal static class RazorServices (typeof(IRemoteDocumentSymbolService), null), (typeof(IRemoteRenameService), null), (typeof(IRemoteGoToImplementationService), null), + (typeof(IRemoteDiagnosticsService), null), ]; private const string ComponentName = "Razor"; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteDiagnosticsService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteDiagnosticsService.cs new file mode 100644 index 00000000000..cb95569cd29 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteDiagnosticsService.cs @@ -0,0 +1,43 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Immutable; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; +using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic; + +namespace Microsoft.CodeAnalysis.Remote.Razor; + +internal sealed class RemoteDiagnosticsService(in ServiceArgs args) : RazorDocumentServiceBase(in args), IRemoteDiagnosticsService +{ + internal sealed class Factory : FactoryBase + { + protected override IRemoteDiagnosticsService CreateService(in ServiceArgs args) + => new RemoteDiagnosticsService(in args); + } + + public ValueTask> GetDiagnosticsAsync( + JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, + JsonSerializableDocumentId documentId, + ImmutableArray csharpDiagnostics, + ImmutableArray htmlDiagnostics, + CancellationToken cancellationToken) + => RunServiceAsync( + solutionInfo, + documentId, + context => GetDiagnosticsAsync(context, csharpDiagnostics, htmlDiagnostics, cancellationToken), + cancellationToken); + + private async ValueTask> GetDiagnosticsAsync( + RemoteDocumentContext context, + ImmutableArray csharpDiagnostics, + ImmutableArray htmlDiagnostics, + CancellationToken cancellationToken) + { + // TODO: More work! + return htmlDiagnostics; + } +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs new file mode 100644 index 00000000000..37493d18731 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs @@ -0,0 +1,205 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Composition; +using System.Linq; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; +using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.AspNetCore.Razor.Threading; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; +using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Remote; +using Microsoft.CodeAnalysis.Razor.Workspaces; +using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; +using RoslynLspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic; +using RoslynVSInternalDiagnosticReport = Roslyn.LanguageServer.Protocol.VSInternalDiagnosticReport; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +#pragma warning disable RS0030 // Do not use banned APIs +[Shared] +[CohostEndpoint(VSInternalMethods.DocumentPullDiagnosticName)] +[Export(typeof(IDynamicRegistrationProvider))] +[ExportCohostStatelessLspService(typeof(CohostDocumentPullDiagnosticsEndpoint))] +[method: ImportingConstructor] +#pragma warning restore RS0030 // Do not use banned APIs +internal class CohostDocumentPullDiagnosticsEndpoint( + IRemoteServiceInvoker remoteServiceInvoker, + IHtmlDocumentSynchronizer htmlDocumentSynchronizer, + LSPRequestInvoker requestInvoker, + IFilePathService filePathService, + ILoggerFactory loggerFactory) + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider +{ + private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; + private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; + private readonly LSPRequestInvoker _requestInvoker = requestInvoker; + private readonly IFilePathService _filePathService = filePathService; + private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); + + protected override bool MutatesSolutionState => false; + + protected override bool RequiresLSPSolution => true; + + public Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext) + { + // TODO: if (clientCapabilities.TextDocument?.Diagnostic?.DynamicRegistration is true) + { + return new Registration() + { + Method = VSInternalMethods.DocumentPullDiagnosticName, + RegisterOptions = new VSInternalDiagnosticRegistrationOptions() + { + DocumentSelector = filter, + DiagnosticKinds = [VSInternalDiagnosticKind.Syntax] + } + }; + } + + // return null; + } + + protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(VSInternalDocumentDiagnosticsParams request) + => request.TextDocument?.ToRazorTextDocumentIdentifier(); + + protected override Task HandleRequestAsync(VSInternalDocumentDiagnosticsParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + => HandleRequestAsync(context.TextDocument.AssumeNotNull(), cancellationToken); + + private async Task HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken) + { + // Diagnostics is a little different, because Roslyn is not designed to run diagnostics in OOP. Their system will transition to OOP + // as it needs, but we have to start here in devenv. This is not as big a problem as it sounds, specifically for diagnostics, because + // we only need to tell Roslyn the document we need diagnostics for. If we had to map positions or ranges etc. it would be worse + // because we'd have to transition to our OOP to find out that info, then back here to get the diagnostics, then back to OOP to process. + _logger.LogDebug($"Getting diagnostics for {razorDocument.FilePath}"); + + var csharpTask = GetCSharpDiagnosticsAsync(razorDocument, cancellationToken); + var htmlTask = GetHtmlDiagnosticsAsync(razorDocument, cancellationToken); + + try + { + await Task.WhenAll(htmlTask, csharpTask).ConfigureAwait(false); + } + catch (Exception e) + { + if (e is not OperationCanceledException) + { + _logger.LogError(e, $"Exception thrown in PullDiagnostic delegation"); + } + // Return null if any of the tasks getting diagnostics results in an error + return null; + } + + var csharpDiagnostics = await csharpTask.ConfigureAwait(false); + var htmlDiagnostics = await htmlTask.ConfigureAwait(false); + + _logger.LogDebug($"Calling OOP with the {csharpDiagnostics.Length} C# and {htmlDiagnostics.Length} Html diagnostics"); + var diagnostics = await _remoteServiceInvoker.TryInvokeAsync>( + razorDocument.Project.Solution, + (service, solutionInfo, cancellationToken) => service.GetDiagnosticsAsync(solutionInfo, razorDocument.Id, csharpDiagnostics, htmlDiagnostics, cancellationToken), + cancellationToken).ConfigureAwait(false); + + if (diagnostics.IsDefaultOrEmpty) + { + return null; + } + + return + [ + new() + { + Diagnostics = diagnostics.ToArray(), + ResultId = Guid.NewGuid().ToString() + } + ]; + } + + private Task> GetCSharpDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) + { + // TODO: This code will not work when the source generator is hooked up. + // How do we get the source generated C# document without OOP? Can we reverse engineer a file path? + var projectKey = razorDocument.Project.ToProjectKey(); + var csharpFilePath = _filePathService.GetRazorCSharpFilePath(projectKey, razorDocument.FilePath.AssumeNotNull()); + // We put the project Id in the generated document path, so there can only be one document + if (razorDocument.Project.Solution.GetDocumentIdsWithFilePath(csharpFilePath) is not [{ } generatedDocumentId] || + razorDocument.Project.GetDocument(generatedDocumentId) is not { } generatedDocument) + { + return SpecializedTasks.EmptyImmutableArray(); + } + + _logger.LogDebug($"Getting C# diagnostics for {generatedDocument.FilePath}"); + return ExternalHandlers.Diagnostics.GetDocumentDiagnosticsAsync(generatedDocument, supportsVisualStudioExtensions: true, cancellationToken); + } + + private async Task> GetHtmlDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) + { + var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); + if (htmlDocument is null) + { + return []; + } + + var diagnosticsParams = new VSInternalDocumentDiagnosticsParams + { + TextDocument = new TextDocumentIdentifier { Uri = htmlDocument.Uri } + }; + + _logger.LogDebug($"Getting Html diagnostics for {htmlDocument.Uri}"); + + var result = await _requestInvoker.ReinvokeRequestOnServerAsync( + htmlDocument.Buffer, + VSInternalMethods.DocumentPullDiagnosticName, + RazorLSPConstants.HtmlLanguageServerName, + diagnosticsParams, + cancellationToken).ConfigureAwait(false); + + if (result?.Response is null) + { + return []; + } + + // This is, to say the least, not ideal. In future we're going to normalize on to Roslyn LSP types, and this can go. + var options = new JsonSerializerOptions(); + foreach (var converter in RazorServiceDescriptorsWrapper.GetLspConverters()) + { + options.Converters.Add(converter); + } + + var hmlDiagnostics = JsonSerializer.Deserialize(JsonSerializer.SerializeToDocument(result.Response), options); + if (hmlDiagnostics is not { } convertedHtmlDiagnostics) + { + return []; + } + + using var allDiagnostics = new PooledArrayBuilder(); + foreach (var report in convertedHtmlDiagnostics) + { + if (report.Diagnostics is not null) + { + allDiagnostics.AddRange(report.Diagnostics); + } + } + + return allDiagnostics.ToImmutable(); + } + + internal TestAccessor GetTestAccessor() => new(this); + + internal readonly struct TestAccessor(CohostDocumentPullDiagnosticsEndpoint instance) + { + public Task HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken) + => instance.HandleRequestAsync(razorDocument, cancellationToken); + } +} + From 0d5879a1cb32113785776e00ac1d1d62587b0f3a Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Wed, 11 Sep 2024 11:44:44 -0700 Subject: [PATCH 328/386] Tune up CollectionBestPractices.md based on review feedback --- docs/CollectionBestPractices.md | 66 ++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/docs/CollectionBestPractices.md b/docs/CollectionBestPractices.md index ea250a0f6c8..65e702dbbb6 100644 --- a/docs/CollectionBestPractices.md +++ b/docs/CollectionBestPractices.md @@ -60,10 +60,10 @@ # Immutable Collections - The .NET immutable collections are provided by the System.Collections.Immutable NuGet package, which provides implementations for .NET, .NET Framework, and .NET Standard 2.0. -- The collections in the System.Collections.Immutable namespace have a very specific purpose. -- They are intended to be *persistent* data structures; that is, a data structure that always preserves the previous - version of itself when it is modified. Such data structures are effectively immutable, but it might have been better - for the namespace to have been called, System.Collections.Persistent. +- The collections in the System.Collections.Immutable namespace have a very specific purpose. They are intended to be + *persistent* data structures; that is, a data structure that always preserves the previous version of itself when it + is modified. Such data structures are effectively immutable, but in hindsight, maybe it would have been better for + this namespace to have been called, System.Collections.Persistent? - The term “persistent data structure” was introduced by the 1986 paper, “Making Data Structures Persistent” ([PDF](https://www.cs.cmu.edu/~sleator/papers/making-data-structures-persistent.pdf)). - A highly influential book in the area of persistent data structures is “Purely Functional Data Structures” (1999) @@ -75,11 +75,23 @@ - Mutating methods on an immutable collection perform “non-destructive mutation”. Instead, of mutating the underlying object, a mutating method like `Add` produces a new instance of the immutable collection. This is similar to how the `String.Replace(...)` API is used. -- The difference in implementation affects the asymptotic complexity of many standard operations. For example, indexing - into a `List` is O(1) but indexing into an `ImmutableList` is O(log n). -- Significant effort has been made to ensure that immutable collections are as efficient as they can be, while - maintaining their persistence characteristics. However, they are generally assumed to be slower than imperative - collections. +- Significant effort has been made to ensure that immutable collections are as efficient as they can be. However, the + cost of persistence means that immutable collections are generally assumed to be slower than imperative counterparts. + +> [!CAUTION] +> +> Because the immutable collections are often implemented using binary trees to achieve persistence, the asymptotic +> complexity of standard operations can be very surprising. For example, `ImmutableDictionary` access is +> O(log n) rather than the usual O(1) that would be expected when accessing a hash table data structure, such as +> `Dictionary`. A similar difference in performance characteristics exists across the various collection +> types. The following table shows the complexity of accessing a few popular collections types using their indexer. +> +> | Immutable collection type | Complexity | Imperative collection type | Complexity | +> | ----------------------------------------- | ---------- | -------------------------------- | ---------- | +> | `ImmutableDictionary` | O(log n) | `Dictionary` | O(1) | +> | `ImmutableHashSet` | O(log n) | `HashSet` | O(1) | +> | `ImmutableList` | O(log n) | `List` | O(1) | +> | `ImmutableSortedDictionary` | O(log n) | `SortedDictionary` | O(log n) | > [!CAUTION] > **ToImmutableX() extension methods are not “freeze” methods!** @@ -258,6 +270,33 @@ using var _ = ListPool.GetPooledObject(out var list); internal storage will only be trimmed if it is larger than 512. So, lists acquired from the pool are likely to already have a larger capacity than needed for most work. +> [!WARNING] +> **Don't allow pooled objects to escape their scope!** +> +> Consider the following code: +> +> ```C# +> List M() +> { +> using var _ = ListPool.GetPooledObject(out var list); +> +> // use list... +> +> return list; +> } +> ``` +> +> The compiler won't complain if a pooled `List` escapes its scope. In the code above, the `List` will be +> returned to the pool at the end of the using statement's scope but is returned from the method. This results +> several problems: +> +> 1. The list will be cleared when returned to the pool. So, the caller will find it to be empty. +> 2. If the caller adds items to the list, other code acquiring a pooled list might receive the mutated list! +> 3. Likewise, if the caller holds onto the list, other code acquiring a pooled list might receive the same list and +> mutate it! +> +> In essence, a pooled object that escapes its scope can corrupt the pool in came from. + # ✨It’s Magic! `PooledArrayBuilder` - Razor’s [`PooledArrayBuilder`](https://github.com/dotnet/razor/blob/5c0677ad275e64300b897de0f6e8856ebe13f07b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/PooledObjects/PooledArrayBuilder%601.cs) @@ -340,12 +379,19 @@ int[] Squares(List list, HashSet set) ``` > [!WARNING] +> **Considerations when using collection expressions** > -> Below are a few issues to consider when using a collection expression: > - Sometimes, a collection expression might create a new temporary collection instance, such as a `List`. However, > it will not acquire a temporary collection from Razor’s object pools ([SharpLab](https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0ATEBqAPgAQAYACfARhQG4BYAKHwGZSAmYgYWIG87jfSmAlgDsALgG0AusQCyACnIMAPMJEA+YgGcYARwCuMIWBgBKLjz4X8AdmJiAdHc079hmBJq0LAXzpegA=)). > - There are pathological collection expressions to be avoided. For example, never use a collection expression to > replace a call to `ImmutableArray.Builder.ToImmutable()` ([SharpLab](https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0ATEBqAPgAQAYACfARgDoBhCAG1pjABcBLCAOwGcKBJAWz4BXJgENgDANwBYAFD4AzKQBMxKsQDes4ttKL+Q0eJgBBKFBEBPADwt2TAHzEAsgApbTANoBdYiLOWASg0tHVCANz9iYEEWWgwYKGIAXmJ9YTEGU3MLalgRJhgAIRi4hJs7excA6RlQ0OjY+KgKYwwMACURdgBzGBc/bOqQuuJhuvwAdmIPCgookqavGtCAX1kVoA=)). +> When using a collection expression in a new scenario or with an uncommon type, it's a good idea to try it out on +> https://sharplab.io first. + +- Empty collection expression generally produces very efficient code and can be used without concern ([SharpLab](https://sharplab.io/#v2:EYLgtghglgdgPgAQEwEYCwAoBAGABAlAOgGEB7AG3IFMBjAFylJgGcBuTHfFAFnazwIkK1eoxaEAkmDABXOhGDU+nQQBlYAR2UCiAJRkwGYKkLAAHKNQBOAZSpWAblBpU2mDgGZ8SXMVwBvTFxg/C8EblwAWQAKAEoAoJCkgDkUaIBRGBljKwVqQnTzOgBPAB5YOgA+ONi+JJS0gEErXOKCorKK6tjaxPrcVOiAbQBdXox+4OSkYbG6yeSPWfGkgF8+3A2EMIjBgg9yw0rcZioNGSoYF3jAiZD1u+CtnYGZqVl5RSpm1sOq3AgLQgxRuGweSWe+F2S2IMmYdFIYF0VAgABMAPIwcjFdTw3DkKDw0GPXAPB6YIZkSi0BhMABCMksqPs0RKZiopAAZtFYfDEci0Zjsbi6LEADS4ABExCsKLoVElsRGnhOKOoqO8vjhCKRKIxWJxhLo0TMgIgYGYuAF+uxNlNMD+xwcEHIF2Y8RAuAk1qFhvhjswtySZisUGd8twsrRTGxuAqo1wAH1na7XLgALy4FNuwgAFVIP2BcT4kIquDoAAtCUMy7BmQAPEYZ47Jl1umswBsjebBbZxwy+UgGOjNpPZ1yEVSXADmlZLJL7Eky2XsEARVkduAA4lQ6MucmvSFY4hsg5NOUeUTQK7hos6rFm21R+2On+6Nkkz5MQgQUPgAOyPqmPb1OC9zuCSS5ZAe65cB4hA7nu0GruuJ4kkk6bHIh+4oUexYQUkfYEAAbFqfK6oKBoir4UbytEPoGnaEAOl0Jz2rEH4hJhuAwFQADu0TMOxfCrEAA=)). +- It is expected that collection expressions will improve over time. At the time of writing, there are + [several open issues](https://github.com/dotnet/roslyn/issues?q=is%3Aissue+is%3Aopen+%22collection+expression%22+label%3AArea-Compilers+label%3A%22Code+Gen+Quality%22) + tracking collection expression enhancements. # Meta Tips From 4736846c586230b1f42095fe31c9d68fef3fa669 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 11 Sep 2024 20:59:45 +1000 Subject: [PATCH 329/386] Move RazorDocumentConverter and RazorTranslateDiagnosticsService down to workspaces layer --- .../RazorDiagnosticsBenchmark.cs | 1 + .../DocumentPullDiagnosticsEndpoint.cs | 17 +++-- .../Diagnostics/RazorDiagnosticsPublisher.cs | 3 +- .../IServiceCollectionExtensions.cs | 1 + .../Diagnostics}/CSSErrorCodes.cs | 2 +- .../Diagnostics}/HTMLErrorCodes.cs | 2 +- .../Diagnostics/RazorDiagnosticConverter.cs | 22 +++--- .../RazorTranslateDiagnosticsService.cs | 73 +++++++++---------- .../CSharpDiagnosticsEndToEndTest.cs | 1 + .../DocumentPullDiagnosticsEndpointTest.cs | 1 + .../RazorDiagnosticConverterTest.cs | 1 + .../RazorDiagnosticsPublisherTest.cs | 1 + 12 files changed, 68 insertions(+), 57 deletions(-) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics}/CSSErrorCodes.cs (89%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics}/HTMLErrorCodes.cs (97%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces}/Diagnostics/RazorDiagnosticConverter.cs (71%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces}/Diagnostics/RazorTranslateDiagnosticsService.cs (87%) diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs index 1733e5058fa..7071c1986f1 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; +using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.ProjectSystem; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs index eba0c7da011..5e39d98c2f4 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.Telemetry; +using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Protocol.Diagnostics; @@ -72,7 +73,9 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentDiagno return null; } - var razorDiagnostics = await GetRazorDiagnosticsAsync(documentContext, cancellationToken).ConfigureAwait(false); + var documentSnapshot = documentContext.Snapshot; + + var razorDiagnostics = await GetRazorDiagnosticsAsync(documentSnapshot).ConfigureAwait(false); var (csharpDiagnostics, htmlDiagnostics) = await GetHtmlCSharpDiagnosticsAsync(documentContext, correlationId, cancellationToken).ConfigureAwait(false); @@ -96,7 +99,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentDiagno { if (report.Diagnostics is not null) { - var mappedDiagnostics = await _translateDiagnosticsService.TranslateAsync(RazorLanguageKind.CSharp, report.Diagnostics, documentContext, cancellationToken).ConfigureAwait(false); + var mappedDiagnostics = await _translateDiagnosticsService.TranslateAsync(RazorLanguageKind.CSharp, report.Diagnostics, documentSnapshot).ConfigureAwait(false); report.Diagnostics = mappedDiagnostics; } @@ -110,7 +113,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentDiagno { if (report.Diagnostics is not null) { - var mappedDiagnostics = await _translateDiagnosticsService.TranslateAsync(RazorLanguageKind.Html, report.Diagnostics, documentContext, cancellationToken).ConfigureAwait(false); + var mappedDiagnostics = await _translateDiagnosticsService.TranslateAsync(RazorLanguageKind.Html, report.Diagnostics, documentSnapshot).ConfigureAwait(false); report.Diagnostics = mappedDiagnostics; } @@ -121,10 +124,10 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentDiagno return allDiagnostics.ToArray(); } - private static async Task GetRazorDiagnosticsAsync(DocumentContext documentContext, CancellationToken cancellationToken) + private static async Task GetRazorDiagnosticsAsync(IDocumentSnapshot documentSnapshot) { - var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var sourceText = await documentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false); + var codeDocument = await documentSnapshot.GetGeneratedOutputAsync().ConfigureAwait(false); + var sourceText = codeDocument.Source.Text; var csharpDocument = codeDocument.GetCSharpDocument(); var diagnostics = csharpDocument.Diagnostics; @@ -133,7 +136,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalDocumentDiagno return null; } - var convertedDiagnostics = RazorDiagnosticConverter.Convert(diagnostics, sourceText, documentContext.Snapshot); + var convertedDiagnostics = RazorDiagnosticConverter.Convert(diagnostics, sourceText, documentSnapshot); return [ diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs index 1f3320294e5..204b03658af 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsPublisher.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.Utilities; using Microsoft.CodeAnalysis.Razor; +using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; @@ -187,7 +188,7 @@ .. csharpDiagnostics ?? [] if (_documentContextFactory.Value.TryCreate(delegatedParams.TextDocument.Uri, projectContext: null, out var documentContext)) { return await _translateDiagnosticsService.Value - .TranslateAsync(RazorLanguageKind.CSharp, fullDiagnostics.Items, documentContext, token) + .TranslateAsync(RazorLanguageKind.CSharp, fullDiagnostics.Items, documentContext.Snapshot) .ConfigureAwait(false); } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs index 8f12aff65d8..df9b7b61097 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs @@ -22,6 +22,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Tooltip; using Microsoft.AspNetCore.Razor.ProjectEngineHost; using Microsoft.CodeAnalysis.Razor.Completion; +using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CSSErrorCodes.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/CSSErrorCodes.cs similarity index 89% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CSSErrorCodes.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/CSSErrorCodes.cs index bafb8675ab1..658f918272f 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/CSSErrorCodes.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/CSSErrorCodes.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Razor.LanguageServer; +namespace Microsoft.CodeAnalysis.Razor.Diagnostics; // Note: This type should be kept in sync with WTE's ErrorCodes.cs internal static class CSSErrorCodes diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/HTMLErrorCodes.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/HTMLErrorCodes.cs similarity index 97% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/HTMLErrorCodes.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/HTMLErrorCodes.cs index 015feacef97..dc0042a9dd7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/HTMLErrorCodes.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/HTMLErrorCodes.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -namespace Microsoft.AspNetCore.Razor.LanguageServer; +namespace Microsoft.CodeAnalysis.Razor.Diagnostics; // Note: This type should be kept in sync with WTE's ErrorCodes.cs internal static class HtmlErrorCodes diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorDiagnosticConverter.cs similarity index 71% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorDiagnosticConverter.cs index 1ee9556ff92..bbbacbee1d5 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticConverter.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorDiagnosticConverter.cs @@ -2,15 +2,17 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; -using System.Collections.Generic; +using System.Collections.Immutable; using System.Globalization; using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; +using LspDiagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; +using LspDiagnosticSeverity = Microsoft.VisualStudio.LanguageServer.Protocol.DiagnosticSeverity; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; -namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; +namespace Microsoft.CodeAnalysis.Razor.Diagnostics; internal static class RazorDiagnosticConverter { @@ -46,9 +48,9 @@ public static VSDiagnosticProjectInformation[] GetProjectInformation(IDocumentSn }]; } - internal static Diagnostic[] Convert(IReadOnlyList diagnostics, SourceText sourceText, IDocumentSnapshot documentSnapshot) + internal static LspDiagnostic[] Convert(ImmutableArray diagnostics, SourceText sourceText, IDocumentSnapshot documentSnapshot) { - var convertedDiagnostics = new Diagnostic[diagnostics.Count]; + var convertedDiagnostics = new LspDiagnostic[diagnostics.Length]; var i = 0; foreach (var diagnostic in diagnostics) @@ -60,18 +62,18 @@ internal static Diagnostic[] Convert(IReadOnlyList diagnostics, } // Internal for testing - internal static DiagnosticSeverity ConvertSeverity(RazorDiagnosticSeverity severity) + internal static LspDiagnosticSeverity ConvertSeverity(RazorDiagnosticSeverity severity) { return severity switch { - RazorDiagnosticSeverity.Error => DiagnosticSeverity.Error, - RazorDiagnosticSeverity.Warning => DiagnosticSeverity.Warning, - _ => DiagnosticSeverity.Information, + RazorDiagnosticSeverity.Error => LspDiagnosticSeverity.Error, + RazorDiagnosticSeverity.Warning => LspDiagnosticSeverity.Warning, + _ => LspDiagnosticSeverity.Information, }; } // Internal for testing - internal static Range? ConvertSpanToRange(SourceSpan sourceSpan, SourceText sourceText) + internal static LspRange? ConvertSpanToRange(SourceSpan sourceSpan, SourceText sourceText) { if (sourceSpan == SourceSpan.Undefined) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorTranslateDiagnosticsService.cs similarity index 87% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorTranslateDiagnosticsService.cs index 11fc9b5f5aa..b662d2ca2b3 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorTranslateDiagnosticsService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Diagnostics/RazorTranslateDiagnosticsService.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Syntax; @@ -18,12 +17,14 @@ using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; -using Diagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; -using DiagnosticSeverity = Microsoft.VisualStudio.LanguageServer.Protocol.DiagnosticSeverity; -using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range; -using SyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; +using LspDiagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; +using LspDiagnosticSeverity = Microsoft.VisualStudio.LanguageServer.Protocol.DiagnosticSeverity; +using LspRange = Microsoft.VisualStudio.LanguageServer.Protocol.Range; -namespace Microsoft.AspNetCore.Razor.LanguageServer.Diagnostics; +namespace Microsoft.CodeAnalysis.Razor.Diagnostics; + +using RazorDiagnosticFactory = AspNetCore.Razor.Language.RazorDiagnosticFactory; +using SyntaxNode = AspNetCore.Razor.Language.Syntax.SyntaxNode; /// /// Contains several methods for mapping and filtering Razor and C# diagnostics. It allows for @@ -48,16 +49,14 @@ internal class RazorTranslateDiagnosticsService(IDocumentMappingService document /// /// The `RazorLanguageKind` of the `Diagnostic` objects included in `diagnostics`. /// An array of `Diagnostic` objects to translate. - /// The `DocumentContext` for the code document associated with the diagnostics. - /// A `CancellationToken` to observe while waiting for the task to complete. + /// The `DocumentContext` for the code document associated with the diagnostics. /// An array of translated diagnostics - internal async Task TranslateAsync( + internal async Task TranslateAsync( RazorLanguageKind diagnosticKind, - Diagnostic[] diagnostics, - DocumentContext documentContext, - CancellationToken cancellationToken) + LspDiagnostic[] diagnostics, + IDocumentSnapshot documentSnapshot) { - var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + var codeDocument = await documentSnapshot.GetGeneratedOutputAsync().ConfigureAwait(false); if (codeDocument.IsUnsupported() != false) { _logger.LogInformation($"Unsupported code document."); @@ -78,20 +77,20 @@ internal async Task TranslateAsync( var mappedDiagnostics = MapDiagnostics( diagnosticKind, filteredDiagnostics, - documentContext.Snapshot, + documentSnapshot, codeDocument); return mappedDiagnostics; } - private Diagnostic[] FilterCSharpDiagnostics(Diagnostic[] unmappedDiagnostics, RazorCodeDocument codeDocument) + private LspDiagnostic[] FilterCSharpDiagnostics(LspDiagnostic[] unmappedDiagnostics, RazorCodeDocument codeDocument) { return unmappedDiagnostics.Where(d => !ShouldFilterCSharpDiagnosticBasedOnErrorCode(d, codeDocument)).ToArray(); } - private static Diagnostic[] FilterHTMLDiagnostics( - Diagnostic[] unmappedDiagnostics, + private static LspDiagnostic[] FilterHTMLDiagnostics( + LspDiagnostic[] unmappedDiagnostics, RazorCodeDocument codeDocument) { var syntaxTree = codeDocument.GetSyntaxTree(); @@ -110,14 +109,14 @@ private static Diagnostic[] FilterHTMLDiagnostics( return filteredDiagnostics; } - private Diagnostic[] MapDiagnostics( + private LspDiagnostic[] MapDiagnostics( RazorLanguageKind languageKind, - Diagnostic[] diagnostics, + LspDiagnostic[] diagnostics, IDocumentSnapshot documentSnapshot, RazorCodeDocument codeDocument) { var projects = RazorDiagnosticConverter.GetProjectInformation(documentSnapshot); - using var mappedDiagnostics = new PooledArrayBuilder(); + using var mappedDiagnostics = new PooledArrayBuilder(); foreach (var diagnostic in diagnostics) { @@ -146,7 +145,7 @@ private Diagnostic[] MapDiagnostics( } private static bool InCSharpLiteral( - Diagnostic d, + LspDiagnostic d, SourceText sourceText, RazorSyntaxTree syntaxTree) { @@ -177,7 +176,7 @@ or SyntaxKind.CSharpStatementLiteral or SyntaxKind.CSharpEphemeralTextLiteral; } - private static bool AppliesToTagHelperTagName(Diagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) + private static bool AppliesToTagHelperTagName(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) { // Goal of this method is to filter diagnostics that touch TagHelper tag names. Reason being is TagHelpers can output anything. Meaning // If you have a TagHelper like: @@ -214,7 +213,7 @@ private static bool AppliesToTagHelperTagName(Diagnostic diagnostic, SourceText return true; } - private static bool ShouldFilterHtmlDiagnosticBasedOnErrorCode(Diagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) + private static bool ShouldFilterHtmlDiagnosticBasedOnErrorCode(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) { if (!diagnostic.Code.HasValue) { @@ -235,7 +234,7 @@ private static bool ShouldFilterHtmlDiagnosticBasedOnErrorCode(Diagnostic diagno _ => false, }; - static bool IsCSharpInStyleBlock(Diagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) + static bool IsCSharpInStyleBlock(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) { // C# in a style block causes diagnostics because the HTML background document replaces C# with "~" var owner = syntaxTree.FindInnermostNode(sourceText, diagnostic.Range.Start); @@ -253,7 +252,7 @@ static bool IsCSharpInStyleBlock(Diagnostic diagnostic, SourceText sourceText, R // Ideally this would be solved instead by not emitting the "!" at the HTML backing file, // but we don't currently have a system to accomplish that - static bool IsAnyFilteredTooFewElementsError(Diagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) + static bool IsAnyFilteredTooFewElementsError(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) { var owner = syntaxTree.FindInnermostNode(sourceText, diagnostic.Range.Start); if (owner is null) @@ -282,7 +281,7 @@ static bool IsAnyFilteredTooFewElementsError(Diagnostic diagnostic, SourceText s // Ideally this would be solved instead by not emitting the "!" at the HTML backing file, // but we don't currently have a system to accomplish that - static bool IsHtmlWithBangAndMatchingTags(Diagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) + static bool IsHtmlWithBangAndMatchingTags(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) { var owner = syntaxTree.FindInnermostNode(sourceText, diagnostic.Range.Start); if (owner is null) @@ -306,11 +305,11 @@ static bool IsHtmlWithBangAndMatchingTags(Diagnostic diagnostic, SourceText sour return haveBang && namesEquivalent; } - static bool IsAnyFilteredInvalidNestingError(Diagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) + static bool IsAnyFilteredInvalidNestingError(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) => IsInvalidNestingWarningWithinComponent(diagnostic, sourceText, syntaxTree) || IsInvalidNestingFromBody(diagnostic, sourceText, syntaxTree); - static bool IsInvalidNestingWarningWithinComponent(Diagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) + static bool IsInvalidNestingWarningWithinComponent(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) { var owner = syntaxTree.FindInnermostNode(sourceText, diagnostic.Range.Start); if (owner is null) @@ -325,7 +324,7 @@ static bool IsInvalidNestingWarningWithinComponent(Diagnostic diagnostic, Source // Ideally this would be solved instead by not emitting the "!" at the HTML backing file, // but we don't currently have a system to accomplish that - static bool IsInvalidNestingFromBody(Diagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) + static bool IsInvalidNestingFromBody(LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree) { var owner = syntaxTree.FindInnermostNode(sourceText, diagnostic.Range.Start); if (owner is null) @@ -350,7 +349,7 @@ static bool IsInvalidNestingFromBody(Diagnostic diagnostic, SourceText sourceTex } private static bool InAttributeContainingCSharp( - Diagnostic diagnostic, + LspDiagnostic diagnostic, SourceText sourceText, RazorSyntaxTree syntaxTree, Dictionary processedAttributes) @@ -400,7 +399,7 @@ n is GenericBlockSyntax || } } - private bool ShouldFilterCSharpDiagnosticBasedOnErrorCode(Diagnostic diagnostic, RazorCodeDocument codeDocument) + private bool ShouldFilterCSharpDiagnosticBasedOnErrorCode(LspDiagnostic diagnostic, RazorCodeDocument codeDocument) { if (diagnostic.Code is not { } code || !code.TryGetSecond(out var str) || @@ -413,10 +412,10 @@ private bool ShouldFilterCSharpDiagnosticBasedOnErrorCode(Diagnostic diagnostic, { "CS1525" => ShouldIgnoreCS1525(diagnostic, codeDocument), _ => s_cSharpDiagnosticsToIgnore.Contains(str) && - diagnostic.Severity != DiagnosticSeverity.Error + diagnostic.Severity != LspDiagnosticSeverity.Error }; - bool ShouldIgnoreCS1525(Diagnostic diagnostic, RazorCodeDocument codeDocument) + bool ShouldIgnoreCS1525(LspDiagnostic diagnostic, RazorCodeDocument codeDocument) { if (CheckIfDocumentHasRazorDiagnostic(codeDocument, RazorDiagnosticFactory.TagHelper_EmptyBoundAttribute.Id) && TryGetOriginalDiagnosticRange(diagnostic, codeDocument, out var originalRange) && @@ -440,7 +439,7 @@ private static bool CheckIfDocumentHasRazorDiagnostic(RazorCodeDocument codeDocu return codeDocument.GetSyntaxTree().Diagnostics.Any(razorDiagnosticCode, static (d, code) => d.Id == code); } - private bool TryGetOriginalDiagnosticRange(Diagnostic diagnostic, RazorCodeDocument codeDocument, [NotNullWhen(true)] out Range? originalRange) + private bool TryGetOriginalDiagnosticRange(LspDiagnostic diagnostic, RazorCodeDocument codeDocument, [NotNullWhen(true)] out LspRange? originalRange) { if (IsRudeEditDiagnostic(diagnostic)) { @@ -460,7 +459,7 @@ private bool TryGetOriginalDiagnosticRange(Diagnostic diagnostic, RazorCodeDocum { // Couldn't remap the range correctly. // If this isn't an `Error` Severity Diagnostic we can discard it. - if (diagnostic.Severity != DiagnosticSeverity.Error) + if (diagnostic.Severity != LspDiagnosticSeverity.Error) { return false; } @@ -474,14 +473,14 @@ private bool TryGetOriginalDiagnosticRange(Diagnostic diagnostic, RazorCodeDocum return true; } - private static bool IsRudeEditDiagnostic(Diagnostic diagnostic) + private static bool IsRudeEditDiagnostic(LspDiagnostic diagnostic) { return diagnostic.Code.HasValue && diagnostic.Code.Value.TryGetSecond(out var str) && str.StartsWith("ENC"); } - private bool TryRemapRudeEditRange(Range diagnosticRange, RazorCodeDocument codeDocument, [NotNullWhen(true)] out Range? remappedRange) + private bool TryRemapRudeEditRange(LspRange diagnosticRange, RazorCodeDocument codeDocument, [NotNullWhen(true)] out LspRange? remappedRange) { // This is a rude edit diagnostic that has already been mapped to the Razor document. The mapping isn't absolutely correct though, // it's based on the runtime code generation of the Razor document therefore we need to re-map the already mapped diagnostic in a diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/CSharpDiagnosticsEndToEndTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/CSharpDiagnosticsEndToEndTest.cs index 8122d21ac0e..6a650134e75 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/CSharpDiagnosticsEndToEndTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/CSharpDiagnosticsEndToEndTest.cs @@ -9,6 +9,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; +using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs index ecbadccdd23..c930ee00dd7 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/DocumentPullDiagnosticsEndpointTest.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; +using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs index 4e670005541..b62496963d5 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticConverterTest.cs @@ -6,6 +6,7 @@ using System.Globalization; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; +using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs index 869786c9280..c3f9cf2eb0a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorDiagnosticsPublisherTest.cs @@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Razor.Test.Common.ProjectSystem; using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Razor.Diagnostics; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Razor.ProjectSystem; From 37ca60742972f7c3eacfb9502f1550a46b573202 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 11 Sep 2024 21:50:06 +1000 Subject: [PATCH 330/386] Combine, translate and report diagnostics from the OOP service Also switch from Roslyn LSP types to VS LSP types so we can call the shared code --- .../Remote/IRemoteDiagnosticsService.cs | 6 +- .../Diagnostics/RemoteDiagnosticsService.cs | 30 +++++++--- .../RemoteRazorTranslateDiagnosticsService.cs | 17 ++++++ .../CohostDocumentPullDiagnosticsEndpoint.cs | 56 +++++++++---------- 4 files changed, 71 insertions(+), 38 deletions(-) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteRazorTranslateDiagnosticsService.cs diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDiagnosticsService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDiagnosticsService.cs index 65d6cc876c6..e8f841af660 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDiagnosticsService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteDiagnosticsService.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.ExternalAccess.Razor; -using RoslynLspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic; +using RoslynLspDiagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; namespace Microsoft.CodeAnalysis.Razor.Remote; @@ -14,7 +14,7 @@ internal interface IRemoteDiagnosticsService : IRemoteJsonService ValueTask> GetDiagnosticsAsync( JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId documentId, - ImmutableArray csharpDiagnostics, - ImmutableArray htmlDiagnostics, + RoslynLspDiagnostic[] csharpDiagnostics, + RoslynLspDiagnostic[] htmlDiagnostics, CancellationToken cancellationToken); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteDiagnosticsService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteDiagnosticsService.cs index cb95569cd29..cd907a8f1b4 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteDiagnosticsService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteDiagnosticsService.cs @@ -4,10 +4,14 @@ using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Razor.Diagnostics; +using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; -using LspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic; +using LspDiagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -19,11 +23,13 @@ protected override IRemoteDiagnosticsService CreateService(in ServiceArgs args) => new RemoteDiagnosticsService(in args); } + private readonly RazorTranslateDiagnosticsService _translateDiagnosticsService = args.ExportProvider.GetExportedValue(); + public ValueTask> GetDiagnosticsAsync( JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo, JsonSerializableDocumentId documentId, - ImmutableArray csharpDiagnostics, - ImmutableArray htmlDiagnostics, + LspDiagnostic[] csharpDiagnostics, + LspDiagnostic[] htmlDiagnostics, CancellationToken cancellationToken) => RunServiceAsync( solutionInfo, @@ -33,11 +39,21 @@ public ValueTask> GetDiagnosticsAsync( private async ValueTask> GetDiagnosticsAsync( RemoteDocumentContext context, - ImmutableArray csharpDiagnostics, - ImmutableArray htmlDiagnostics, + LspDiagnostic[] csharpDiagnostics, + LspDiagnostic[] htmlDiagnostics, CancellationToken cancellationToken) { - // TODO: More work! - return htmlDiagnostics; + // We've got C# and Html, lets get Razor diagnostics + var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + // Yes, CSharpDocument.Documents are the Razor diagnostics. Don't ask. + var razorDiagnostics = codeDocument.GetCSharpDocument().Diagnostics; + + using var allDiagnostics = new PooledArrayBuilder(capacity: razorDiagnostics.Length + csharpDiagnostics.Length + htmlDiagnostics.Length); + + allDiagnostics.AddRange(RazorDiagnosticConverter.Convert(razorDiagnostics, codeDocument.Source.Text, context.Snapshot)); + allDiagnostics.AddRange(await _translateDiagnosticsService.TranslateAsync(RazorLanguageKind.CSharp, csharpDiagnostics, context.Snapshot)); + allDiagnostics.AddRange(await _translateDiagnosticsService.TranslateAsync(RazorLanguageKind.Html, htmlDiagnostics, context.Snapshot)); + + return allDiagnostics.DrainToImmutable(); } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteRazorTranslateDiagnosticsService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteRazorTranslateDiagnosticsService.cs new file mode 100644 index 00000000000..78ae0833889 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Diagnostics/RemoteRazorTranslateDiagnosticsService.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using Microsoft.CodeAnalysis.Razor.Diagnostics; +using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Logging; + +namespace Microsoft.CodeAnalysis.Remote.Razor.Diagnostics; + +[Export(typeof(RazorTranslateDiagnosticsService)), Shared] +[method: ImportingConstructor] +internal sealed class RemoteRazorTranslateDiagnosticsService( + IDocumentMappingService documentMappingService, + ILoggerFactory loggerFactory) : RazorTranslateDiagnosticsService(documentMappingService, loggerFactory) +{ +} diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs index 37493d18731..7fbff3e7b8f 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs @@ -11,7 +11,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.PooledObjects; -using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; @@ -22,8 +21,7 @@ using Microsoft.VisualStudio.LanguageServer.ContainedLanguage; using Microsoft.VisualStudio.LanguageServer.Protocol; using ExternalHandlers = Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers; -using RoslynLspDiagnostic = Roslyn.LanguageServer.Protocol.Diagnostic; -using RoslynVSInternalDiagnosticReport = Roslyn.LanguageServer.Protocol.VSInternalDiagnosticReport; +using LspDiagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic; namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; @@ -40,7 +38,7 @@ internal class CohostDocumentPullDiagnosticsEndpoint( LSPRequestInvoker requestInvoker, IFilePathService filePathService, ILoggerFactory loggerFactory) - : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider + : AbstractRazorCohostDocumentRequestHandler, IDynamicRegistrationProvider { private readonly IRemoteServiceInvoker _remoteServiceInvoker = remoteServiceInvoker; private readonly IHtmlDocumentSynchronizer _htmlDocumentSynchronizer = htmlDocumentSynchronizer; @@ -73,10 +71,10 @@ internal class CohostDocumentPullDiagnosticsEndpoint( protected override RazorTextDocumentIdentifier? GetRazorTextDocumentIdentifier(VSInternalDocumentDiagnosticsParams request) => request.TextDocument?.ToRazorTextDocumentIdentifier(); - protected override Task HandleRequestAsync(VSInternalDocumentDiagnosticsParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) + protected override Task HandleRequestAsync(VSInternalDocumentDiagnosticsParams request, RazorCohostRequestContext context, CancellationToken cancellationToken) => HandleRequestAsync(context.TextDocument.AssumeNotNull(), cancellationToken); - private async Task HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken) + private async Task HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken) { // Diagnostics is a little different, because Roslyn is not designed to run diagnostics in OOP. Their system will transition to OOP // as it needs, but we have to start here in devenv. This is not as big a problem as it sounds, specifically for diagnostics, because @@ -105,7 +103,7 @@ internal class CohostDocumentPullDiagnosticsEndpoint( var htmlDiagnostics = await htmlTask.ConfigureAwait(false); _logger.LogDebug($"Calling OOP with the {csharpDiagnostics.Length} C# and {htmlDiagnostics.Length} Html diagnostics"); - var diagnostics = await _remoteServiceInvoker.TryInvokeAsync>( + var diagnostics = await _remoteServiceInvoker.TryInvokeAsync>( razorDocument.Project.Solution, (service, solutionInfo, cancellationToken) => service.GetDiagnosticsAsync(solutionInfo, razorDocument.Id, csharpDiagnostics, htmlDiagnostics, cancellationToken), cancellationToken).ConfigureAwait(false); @@ -115,6 +113,7 @@ internal class CohostDocumentPullDiagnosticsEndpoint( return null; } + _logger.LogDebug($"Reporting {diagnostics.Length} diagnostics back to the client"); return [ new() @@ -125,7 +124,7 @@ internal class CohostDocumentPullDiagnosticsEndpoint( ]; } - private Task> GetCSharpDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) + private async Task GetCSharpDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) { // TODO: This code will not work when the source generator is hooked up. // How do we get the source generated C# document without OOP? Can we reverse engineer a file path? @@ -135,14 +134,28 @@ private Task> GetCSharpDiagnosticsAsync(Text if (razorDocument.Project.Solution.GetDocumentIdsWithFilePath(csharpFilePath) is not [{ } generatedDocumentId] || razorDocument.Project.GetDocument(generatedDocumentId) is not { } generatedDocument) { - return SpecializedTasks.EmptyImmutableArray(); + return []; } _logger.LogDebug($"Getting C# diagnostics for {generatedDocument.FilePath}"); - return ExternalHandlers.Diagnostics.GetDocumentDiagnosticsAsync(generatedDocument, supportsVisualStudioExtensions: true, cancellationToken); + var csharpDiagnostics = await ExternalHandlers.Diagnostics.GetDocumentDiagnosticsAsync(generatedDocument, supportsVisualStudioExtensions: true, cancellationToken).ConfigureAwait(false); + + // This is, to say the least, not ideal. In future we're going to normalize on to Roslyn LSP types, and this can go. + var options = new JsonSerializerOptions(); + foreach (var converter in RazorServiceDescriptorsWrapper.GetLspConverters()) + { + options.Converters.Add(converter); + } + + if (JsonSerializer.Deserialize(JsonSerializer.SerializeToDocument(csharpDiagnostics), options) is not { } convertedDiagnostics) + { + return []; + } + + return convertedDiagnostics; } - private async Task> GetHtmlDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) + private async Task GetHtmlDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken) { var htmlDocument = await _htmlDocumentSynchronizer.TryGetSynchronizedHtmlDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false); if (htmlDocument is null) @@ -169,21 +182,8 @@ private async Task> GetHtmlDiagnosticsAsync( return []; } - // This is, to say the least, not ideal. In future we're going to normalize on to Roslyn LSP types, and this can go. - var options = new JsonSerializerOptions(); - foreach (var converter in RazorServiceDescriptorsWrapper.GetLspConverters()) - { - options.Converters.Add(converter); - } - - var hmlDiagnostics = JsonSerializer.Deserialize(JsonSerializer.SerializeToDocument(result.Response), options); - if (hmlDiagnostics is not { } convertedHtmlDiagnostics) - { - return []; - } - - using var allDiagnostics = new PooledArrayBuilder(); - foreach (var report in convertedHtmlDiagnostics) + using var allDiagnostics = new PooledArrayBuilder(); + foreach (var report in result.Response) { if (report.Diagnostics is not null) { @@ -191,14 +191,14 @@ private async Task> GetHtmlDiagnosticsAsync( } } - return allDiagnostics.ToImmutable(); + return allDiagnostics.ToArray(); } internal TestAccessor GetTestAccessor() => new(this); internal readonly struct TestAccessor(CohostDocumentPullDiagnosticsEndpoint instance) { - public Task HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken) + public Task HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken) => instance.HandleRequestAsync(razorDocument, cancellationToken); } } From 462d9a4ff417dc0669f2185a1b37ba2b58317080 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 12 Sep 2024 22:08:17 +1000 Subject: [PATCH 331/386] Add diagnostics test Writing the code: Easy Writing the test: Easy Getting the MEF stuff to work: I've lost even more hair --- .../CohostDocumentPullDiagnosticsEndpoint.cs | 3 +- .../CSharpTestLspServerHelpers.cs | 2 +- .../Mef/ExportProviderExtensions.cs | 72 +++++++++------- .../TestCode.cs | 3 + .../CohostDocumentPullDiagnosticsTest.cs | 60 ++++++++++++++ .../Cohost/CohostEndpointTestBase.cs | 83 +++++++++++++++---- .../Cohost/TestBrokeredServiceInterceptor.cs | 14 ++++ .../Cohost/TestRemoteServiceInvoker.cs | 5 ++ .../LanguageClient/TestLSPRequestInvoker.cs | 3 +- 9 files changed, 197 insertions(+), 48 deletions(-) create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs index 7fbff3e7b8f..2959ef1a0b9 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Cohost/CohostDocumentPullDiagnosticsEndpoint.cs @@ -94,9 +94,8 @@ internal class CohostDocumentPullDiagnosticsEndpoint( if (e is not OperationCanceledException) { _logger.LogError(e, $"Exception thrown in PullDiagnostic delegation"); + throw; } - // Return null if any of the tasks getting diagnostics results in an error - return null; } var csharpDiagnostics = await csharpTask.ConfigureAwait(false); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs index ecf351fe1e8..83a05dc1abb 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs @@ -172,7 +172,7 @@ private static AdhocWorkspace CreateCSharpTestWorkspace( return workspace; } - private static void AddAnalyzersToWorkspace(Workspace workspace, ExportProvider exportProvider) + public static void AddAnalyzersToWorkspace(Workspace workspace, ExportProvider exportProvider) { var analyzerLoader = RazorTestAnalyzerLoader.CreateAnalyzerAssemblyLoader(); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderExtensions.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderExtensions.cs index 05540f3862b..18d5c5dd654 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderExtensions.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderExtensions.cs @@ -3,12 +3,12 @@ using System; using System.Collections.Generic; -using System.Composition.Hosting.Core; using System.Composition; +using System.Composition.Hosting.Core; using System.Diagnostics.CodeAnalysis; using System.Linq; -using Microsoft.VisualStudio.Composition; using System.Reflection; +using Microsoft.VisualStudio.Composition; namespace Microsoft.AspNetCore.Razor.Test.Common.Mef; @@ -31,43 +31,55 @@ public CompositionContextShim(ExportProvider exportProvider) public override bool TryGetExport(CompositionContract contract, [NotNullWhen(true)] out object? export) { var importMany = contract.MetadataConstraints.Contains(new KeyValuePair("IsImportMany", true)); - var (contractType, metadataType) = GetContractType(contract.ContractType, importMany); + var (contractType, metadataType, isLazy) = GetContractType(contract.ContractType, importMany); - if (metadataType != null) + var method = (metadataType, isLazy) switch { - var methodInfo = (from method in _exportProvider.GetType().GetTypeInfo().GetMethods() - where method.Name == nameof(ExportProvider.GetExports) - where method.IsGenericMethod && method.GetGenericArguments().Length == 2 - where method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(string) - select method).Single(); - var parameterizedMethod = methodInfo.MakeGenericMethod(contractType, metadataType); - export = parameterizedMethod.Invoke(_exportProvider, new[] { contract.ContractName }); - Assumes.NotNull(export); + (not null, true) => GetExportProviderGenericMethod(nameof(ExportProvider.GetExports), contractType, metadataType), + (null, true) => GetExportProviderGenericMethod(nameof(ExportProvider.GetExports), contractType), + (null, false) => GetExportProviderGenericMethod(nameof(ExportProvider.GetExportedValues), contractType), + _ => null + }; + + if (method is null) + { + export = null; + return false; } - else + + export = method.Invoke(_exportProvider, [contract.ContractName]); + Assumes.NotNull(export); + + return true; + + static MethodInfo GetExportProviderGenericMethod(string methodName, params Type[] typeArguments) { - var methodInfo = (from method in _exportProvider.GetType().GetTypeInfo().GetMethods() - where method.Name == nameof(ExportProvider.GetExports) - where method.IsGenericMethod && method.GetGenericArguments().Length == 1 + var methodInfo = (from method in typeof(ExportProvider).GetTypeInfo().GetMethods() + where method.Name == methodName + where method.IsGenericMethod && method.GetGenericArguments().Length == typeArguments.Length where method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(string) select method).Single(); - var parameterizedMethod = methodInfo.MakeGenericMethod(contractType); - export = parameterizedMethod.Invoke(_exportProvider, new[] { contract.ContractName }); - Assumes.NotNull(export); - } - return true; + return methodInfo.MakeGenericMethod(typeArguments); + } } - private static (Type exportType, Type? metadataType) GetContractType(Type contractType, bool importMany) + private static (Type exportType, Type? metadataType, bool isLazy) GetContractType(Type contractType, bool importMany) { - if (importMany && contractType.IsConstructedGenericType) + if (importMany) { - if (contractType.GetGenericTypeDefinition() == typeof(IList<>) - || contractType.GetGenericTypeDefinition() == typeof(ICollection<>) - || contractType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) + if (contractType.IsConstructedGenericType) + { + if (contractType.GetGenericTypeDefinition() == typeof(IList<>) + || contractType.GetGenericTypeDefinition() == typeof(ICollection<>) + || contractType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) + { + contractType = contractType.GenericTypeArguments[0]; + } + } + else if (contractType.IsArray) { - contractType = contractType.GenericTypeArguments[0]; + contractType = contractType.GetElementType().AssumeNotNull(); } } @@ -75,11 +87,11 @@ private static (Type exportType, Type? metadataType) GetContractType(Type contra { if (contractType.GetGenericTypeDefinition() == typeof(Lazy<>)) { - return (contractType.GenericTypeArguments[0], null); + return (contractType.GenericTypeArguments[0], null, true); } else if (contractType.GetGenericTypeDefinition() == typeof(Lazy<,>)) { - return (contractType.GenericTypeArguments[0], contractType.GenericTypeArguments[1]); + return (contractType.GenericTypeArguments[0], contractType.GenericTypeArguments[1], true); } else { @@ -87,7 +99,7 @@ private static (Type exportType, Type? metadataType) GetContractType(Type contra } } - throw new NotSupportedException(); + return (contractType, null, false); } } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs index 6930bda0d33..9374bd108ab 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/TestCode.cs @@ -47,6 +47,9 @@ public TextSpan Span public ImmutableArray Spans => GetNamedSpans(string.Empty); + public ImmutableDictionary> NamedSpans + => _nameToSpanMap; + public ImmutableArray GetNamedSpans(string name) => _nameToSpanMap[name]; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs new file mode 100644 index 00000000000..84b1d414ffd --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs @@ -0,0 +1,60 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.AspNetCore.Razor.Test.Common.Mef; +using Microsoft.CodeAnalysis.Testing; +using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.LanguageServer.Protocol; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +[UseExportProvider] +public class CohostDocumentPullDiagnosticsTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +{ + [Fact] + public Task IfStatements() + => VerifyDiagnosticsAsync(""" +
+ + @code + { + public void IJustMetYou() + { + {|CS0103:CallMeMaybe|}(); + } + } + """); + + private async Task VerifyDiagnosticsAsync(TestCode input) + { + var document = await CreateProjectAndRazorDocumentAsync(input.Text, createSeparateRemoteAndLocalWorkspaces: true); + var inputText = await document.GetTextAsync(DisposalToken); + + var requestInvoker = new TestLSPRequestInvoker(); + + var endpoint = new CohostDocumentPullDiagnosticsEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker, FilePathService, LoggerFactory); + + var result = await endpoint.GetTestAccessor().HandleRequestAsync(document, DisposalToken); + var actual = result!.SelectMany(d => d.Diagnostics!).ToArray(); + + if (input.NamedSpans.Count == 0) + { + Assert.Null(result); + return; + } + + Assert.Equal(input.NamedSpans.Count, actual.Length); + + foreach (var (code, spans) in input.NamedSpans) + { + var diagnostic = Assert.Single(actual, d => d.Code == code); + Assert.Equal(spans.First(), inputText.GetTextSpan(diagnostic.Range)); + } + } +} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs index 3573e1badf6..abd502ca203 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs @@ -9,10 +9,15 @@ using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; +using Microsoft.AspNetCore.Razor.Test.Common.Mef; +using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor; +using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.Composition; using Xunit.Abstractions; @@ -68,7 +73,7 @@ private protected void UpdateClientInitializationOptions(Func CreateProjectAndRazorDocumentAsync(string contents, string? fileKind = null, (string fileName, string contents)[]? additionalFiles = null, bool createSeparateRemoteAndLocalWorkspaces = false) { // Using IsLegacy means null == component, so easier for test authors var isComponent = !FileKinds.IsLegacy(fileKind); @@ -82,20 +87,70 @@ protected TextDocument CreateProjectAndRazorDocument(string contents, string? fi var projectId = ProjectId.CreateNewId(debugName: projectName); var documentId = DocumentId.CreateNewId(projectId, debugName: documentFilePath); + var remoteWorkspace = RemoteWorkspaceAccessor.GetWorkspace(); + var remoteDocument = CreateProjectAndRazorDocument(remoteWorkspace, projectId, projectName, documentId, documentFilePath, contents, additionalFiles); + + if (createSeparateRemoteAndLocalWorkspaces) + { + // Usually its fine to just use the remote workspace, but sometimes we need to also have things available in the + // "devenv" side of Roslyn, which is a different workspace with a different set of services. We don't have any + // actual solution syncing set up for testing, and don't really use a service broker, but since we also would + // expect to never make changes to a workspace, it should be fine to simply create duplicated solutions as part + // of test setup. + return CreateLocalProjectAndRazorDocumentAsync(remoteDocument.Project.Solution, projectId, projectName, documentId, documentFilePath, contents, additionalFiles); + } + + // If we're just creating one workspace, then its the remote one and we just return the remote document + // and assume that the endpoint under test doesn't need to do anything on the devenv side. This makes it + // easier for tests to mutate solutions + return Task.FromResult(remoteDocument); + } + + private async Task CreateLocalProjectAndRazorDocumentAsync(Solution remoteSolution, ProjectId projectId, string projectName, DocumentId documentId, string documentFilePath, string contents, (string fileName, string contents)[]? additionalFiles) + { + var exportProvider = TestComposition.Roslyn.ExportProviderFactory.CreateExportProvider(); + AddDisposable(exportProvider); + var hostServices = MefHostServices.Create(exportProvider.AsCompositionContext()); + var workspace = TestWorkspace.Create(hostServices); + AddDisposable(workspace); + // Adding analyzers modifies the workspace, so important to do it before creating the first project + CSharpTestLspServerHelpers.AddAnalyzersToWorkspace(workspace, exportProvider); + + var razorDocument = CreateProjectAndRazorDocument(workspace, projectId, projectName, documentId, documentFilePath, contents, additionalFiles); + + // Until the source generator is hooked up, the workspace representing "local" projects doesn't have anything + // to actually compile the Razor to C#, so we just do it now at creation + var solution = razorDocument.Project.Solution; + // We're cheating a bit here and using the remote export provider to get something to do the compilation + var factory = _exportProvider.AssumeNotNull().GetExportedValue(); + var snapshot = factory.GetOrCreate(razorDocument); + // Compile the Razor file + var codeDocument = await snapshot.GetGeneratedOutputAsync(false); + // Update the generated doc contents + var generatedDocumentIds = solution.GetDocumentIdsWithFilePath(documentFilePath + CSharpVirtualDocumentSuffix); + solution = solution.WithDocumentText(generatedDocumentIds, codeDocument.GetCSharpSourceText()); + razorDocument = solution.GetAdditionalDocument(documentId).AssumeNotNull(); + + // If we're creating remote and local workspaces, then we'll return the local document, and have to allow + // the remote service invoker to map from the local solution to the remote one. + RemoteServiceInvoker.MapSolutionIdToRemote(razorDocument.Project.Solution.Id, remoteSolution); + + return razorDocument; + } + + private static TextDocument CreateProjectAndRazorDocument(CodeAnalysis.Workspace workspace, ProjectId projectId, string projectName, DocumentId documentId, string documentFilePath, string contents, (string fileName, string contents)[]? additionalFiles) + { var projectInfo = ProjectInfo - .Create( - projectId, - VersionStamp.Create(), - name: projectName, - assemblyName: projectName, - LanguageNames.CSharp, - documentFilePath) - .WithDefaultNamespace(TestProjectData.SomeProject.RootNamespace) - .WithMetadataReferences(AspNet80.ReferenceInfos.All.Select(r => r.Reference)); - - // Importantly, we use Roslyn's remote workspace here so that when our OOP services call into Roslyn, their code - // will be able to access their services. - var workspace = RemoteWorkspaceAccessor.GetWorkspace(); + .Create( + projectId, + VersionStamp.Create(), + name: projectName, + assemblyName: projectName, + LanguageNames.CSharp, + documentFilePath) + .WithDefaultNamespace(TestProjectData.SomeProject.RootNamespace) + .WithMetadataReferences(AspNet80.ReferenceInfos.All.Select(r => r.Reference)); + var solution = workspace.CurrentSolution.AddProject(projectInfo); solution = solution diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/TestBrokeredServiceInterceptor.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/TestBrokeredServiceInterceptor.cs index 7d0da662311..fffa4b394c6 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/TestBrokeredServiceInterceptor.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/TestBrokeredServiceInterceptor.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; @@ -14,6 +15,7 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; internal sealed class TestBrokeredServiceInterceptor : IRazorBrokeredServiceInterceptor { private readonly TestSolutionStore _solutionStore = new(); + private readonly Dictionary _localToRemoteSolutionMap = []; public Task GetSolutionInfoAsync(Solution solution, CancellationToken cancellationToken) => _solutionStore.AddAsync(solution, cancellationToken); @@ -32,6 +34,18 @@ public ValueTask RunServiceAsync( Assert.NotNull(solution); + // Rather than actually syncing assets, we just let the test author directly map from a local solution + // to a remote solution; + if (_localToRemoteSolutionMap.TryGetValue(solution.Id, out var remoteSolution)) + { + solution = remoteSolution; + } + return implementation(solution); } + + internal void MapSolutionIdToRemote(SolutionId localSolutionId, Solution remoteSolution) + { + _localToRemoteSolutionMap.Add(localSolutionId, remoteSolution); + } } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/TestRemoteServiceInvoker.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/TestRemoteServiceInvoker.cs index 9e5c8651aac..581d08f35a4 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/TestRemoteServiceInvoker.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/TestRemoteServiceInvoker.cs @@ -57,6 +57,11 @@ private async Task GetOrCreateServiceAsync() return await invocation(service, solutionInfo, cancellationToken); } + public void MapSolutionIdToRemote(SolutionId localSolutionId, Solution remoteSolution) + { + _serviceInterceptor.MapSolutionIdToRemote(localSolutionId, remoteSolution); + } + public void Dispose() { _reentrantSemaphore.Dispose(); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestLSPRequestInvoker.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestLSPRequestInvoker.cs index 3bbf1c56ee0..c4d01769a9f 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestLSPRequestInvoker.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/LanguageClient/TestLSPRequestInvoker.cs @@ -111,7 +111,8 @@ public async override Task> ReinvokeRequestOnServerAs return new ReinvocationResponse(languageClientName: RazorLSPConstants.RazorCSharpLanguageServerName, result); } - if (_htmlResponses.TryGetValue(method, out var response)) + if (_htmlResponses is not null && + _htmlResponses.TryGetValue(method, out var response)) { return new ReinvocationResponse(languageClientName: "html", (TOut)response); } From 8f7e1f8d7f45beca3330226694b097d766ee2d33 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 12 Sep 2024 22:27:44 +1000 Subject: [PATCH 332/386] Update all of the other tests --- .../Cohost/CohostDocumentFormattingEndpointTest.cs | 2 +- .../Cohost/CohostDocumentHighlightEndpointTest.cs | 2 +- .../Cohost/CohostDocumentSpellCheckEndpointTest.cs | 2 +- .../Cohost/CohostDocumentSymbolEndpointTest.cs | 2 +- .../Cohost/CohostFoldingRangeEndpointTest.cs | 3 +-- .../Cohost/CohostGoToDefinitionEndpointTest.cs | 11 +++++------ .../Cohost/CohostGoToImplementationEndpointTest.cs | 4 ++-- .../Cohost/CohostInlayHintEndpointTest.cs | 2 +- .../Cohost/CohostLinkedEditingRangeEndpointTest.cs | 2 +- .../Cohost/CohostOnAutoInsertEndpointTest.cs | 2 +- .../Cohost/CohostOnTypeFormattingEndpointTest.cs | 2 +- .../Cohost/CohostRangeFormattingEndpointTest.cs | 2 +- .../Cohost/CohostRenameEndpointTest.cs | 2 +- .../Cohost/CohostSemanticTokensRangeEndpointTest.cs | 2 +- .../Cohost/CohostSignatureHelpEndpointTest.cs | 2 +- .../Cohost/CohostTextPresentationEndpointTest.cs | 2 +- .../Cohost/CohostUriPresentationEndpointTest.cs | 2 +- .../Cohost/RazorComponentDefinitionServiceTest.cs | 2 +- 18 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs index 3c8f9b268b0..bc9bb3a4507 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs @@ -108,7 +108,7 @@ private void M(string thisIsMyString) private async Task VerifyDocumentFormattingAsync(string input, string expected) { - var document = CreateProjectAndRazorDocument(input); + var document = await CreateProjectAndRazorDocumentAsync(input); var inputText = await document.GetTextAsync(DisposalToken); var htmlDocumentPublisher = new HtmlDocumentPublisher(RemoteServiceInvoker, StrictMock.Of(), StrictMock.Of(), LoggerFactory); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs index ce044474c00..65de7ed10a9 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentHighlightEndpointTest.cs @@ -147,7 +147,7 @@ @inject [|IDis$$posable|] Disposable private async Task VerifyDocumentHighlightsAsync(string input, DocumentHighlight[]? htmlResponse = null) { TestFileMarkupParser.GetPositionAndSpans(input, out var source, out int cursorPosition, out ImmutableArray spans); - var document = CreateProjectAndRazorDocument(source); + var document = await CreateProjectAndRazorDocumentAsync(source); var inputText = await document.GetTextAsync(DisposalToken); var position = inputText.GetPosition(cursorPosition); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSpellCheckEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSpellCheckEndpointTest.cs index 6711a4bdc2b..51c5d3d28a9 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSpellCheckEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSpellCheckEndpointTest.cs @@ -57,7 +57,7 @@ Eat more chickin. private async Task VerifySemanticTokensAsync(TestCode input) { - var document = CreateProjectAndRazorDocument(input.Text); + var document = await CreateProjectAndRazorDocumentAsync(input.Text); var sourceText = await document.GetTextAsync(DisposalToken); var endpoint = new CohostDocumentSpellCheckEndpoint(RemoteServiceInvoker); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs index 0f008bc6ef2..2cc98c4c923 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentSymbolEndpointTest.cs @@ -69,7 +69,7 @@ public Task DocumentSymbols_CSharpMethods(bool hierarchical) private async Task VerifyDocumentSymbolsAsync(string input, bool hierarchical = false) { TestFileMarkupParser.GetSpans(input, out input, out ImmutableDictionary> spansDict); - var document = CreateProjectAndRazorDocument(input); + var document = await CreateProjectAndRazorDocumentAsync(input); var endpoint = new CohostDocumentSymbolEndpoint(RemoteServiceInvoker); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs index 08ad6977496..1bfb8b299cd 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostFoldingRangeEndpointTest.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -218,7 +217,7 @@ public void M() {[| private async Task VerifyFoldingRangesAsync(string input, string? fileKind = null) { TestFileMarkupParser.GetSpans(input, out var source, out ImmutableDictionary> spans); - var document = CreateProjectAndRazorDocument(source, fileKind); + var document = await CreateProjectAndRazorDocumentAsync(source, fileKind); var inputText = await document.GetTextAsync(DisposalToken); var htmlSpans = spans.GetValueOrDefault("html").NullToEmpty(); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs index b97fe4ef07a..f5b8b6e77e3 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToDefinitionEndpointTest.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.ExternalAccess.Razor; -using Microsoft.CodeAnalysis.Remote.Razor; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; using Xunit; @@ -313,7 +312,7 @@ public async Task Html() """; - var document = CreateProjectAndRazorDocument(input.Text); + var document = await CreateProjectAndRazorDocumentAsync(input.Text); var inputText = await document.GetTextAsync(DisposalToken); var htmlResponse = new SumType?(new Location[] @@ -333,7 +332,7 @@ private static string FileName(string projectRelativeFileName) private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = null, SumType? htmlResponse = null) { - var document = CreateProjectAndRazorDocument(input.Text, fileKind); + var document = await CreateProjectAndRazorDocumentAsync(input.Text, fileKind); var result = await GetGoToDefinitionResultAsync(document, input, htmlResponse); Assumes.NotNull(result); @@ -349,11 +348,11 @@ private async Task VerifyGoToDefinitionAsync(TestCode input, string? fileKind = Assert.Equal(document.CreateUri(), location.Uri); } - private Task?> GetGoToDefinitionResultAsync( + private async Task?> GetGoToDefinitionResultAsync( TestCode input, string? fileKind = null, params (string fileName, string contents)[]? additionalFiles) { - var document = CreateProjectAndRazorDocument(input.Text, fileKind, additionalFiles); - return GetGoToDefinitionResultAsync(document, input, htmlResponse: null); + var document = await CreateProjectAndRazorDocumentAsync(input.Text, fileKind, additionalFiles); + return await GetGoToDefinitionResultAsync(document, input, htmlResponse: null); } private async Task?> GetGoToDefinitionResultAsync( diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs index 4ee5dab2c8d..b6c91a29bea 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostGoToImplementationEndpointTest.cs @@ -100,7 +100,7 @@ public async Task Html() """; - var document = CreateProjectAndRazorDocument(input.Text); + var document = await CreateProjectAndRazorDocumentAsync(input.Text); var inputText = await document.GetTextAsync(DisposalToken); var htmlResponse = new SumType?(new LspLocation[] @@ -119,7 +119,7 @@ public async Task Html() private async Task VerifyCSharpGoToImplementationAsync(TestCode input) { - var document = CreateProjectAndRazorDocument(input.Text); + var document = await CreateProjectAndRazorDocumentAsync(input.Text); var requestInvoker = new TestLSPRequestInvoker(); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlayHintEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlayHintEndpointTest.cs index f7a3df1d975..05c9b4486ec 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlayHintEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostInlayHintEndpointTest.cs @@ -131,7 +131,7 @@ public Task InlayHints_ComponentAttributes() private async Task VerifyInlayHintsAsync(string input, Dictionary toolTipMap, string output, bool displayAllOverride = false) { TestFileMarkupParser.GetSpans(input, out input, out ImmutableDictionary> spansDict); - var document = CreateProjectAndRazorDocument(input); + var document = await CreateProjectAndRazorDocumentAsync(input); var inputText = await document.GetTextAsync(DisposalToken); var endpoint = new CohostInlayHintEndpoint(RemoteServiceInvoker); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs index 28c05827166..865f5101125 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostLinkedEditingRangeEndpointTest.cs @@ -159,7 +159,7 @@ The end. private async Task VerifyLinkedEditingRangeAsync(string input) { TestFileMarkupParser.GetPositionAndSpans(input, out input, out int cursorPosition, out ImmutableArray spans); - var document = CreateProjectAndRazorDocument(input); + var document = await CreateProjectAndRazorDocumentAsync(input); var sourceText = await document.GetTextAsync(DisposalToken); var endpoint = new CohostLinkedEditingRangeEndpoint(RemoteServiceInvoker); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs index b7dbb70194a..74d5036d454 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs @@ -196,7 +196,7 @@ private async Task VerifyOnAutoInsertAsync( bool formatOnType = true, bool autoClosingTags = true) { - var document = CreateProjectAndRazorDocument(input.Text); + var document = await CreateProjectAndRazorDocumentAsync(input.Text); var sourceText = await document.GetTextAsync(DisposalToken); var clientSettingsManager = new ClientSettingsManager([], null, null); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs index 7a1e3d913f3..3363c7a2ed6 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs @@ -103,7 +103,7 @@ await VerifyOnTypeFormattingAsync( private async Task VerifyOnTypeFormattingAsync(TestCode input, string expected, char triggerCharacter, bool html = false) { - var document = CreateProjectAndRazorDocument(input.Text); + var document = await CreateProjectAndRazorDocumentAsync(input.Text); var inputText = await document.GetTextAsync(DisposalToken); var position = inputText.GetPosition(input.Position); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs index 32d03e28002..2b6a6005b8f 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs @@ -102,7 +102,7 @@ private void M(string thisIsMyString) private async Task VerifyRangeFormattingAsync(TestCode input, string expected) { - var document = CreateProjectAndRazorDocument(input.Text); + var document = await CreateProjectAndRazorDocumentAsync(input.Text); var inputText = await document.GetTextAsync(DisposalToken); var htmlDocumentPublisher = new HtmlDocumentPublisher(RemoteServiceInvoker, StrictMock.Of(), StrictMock.Of(), LoggerFactory); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs index 9328744f2ae..6e1af1d4f06 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRenameEndpointTest.cs @@ -198,7 +198,7 @@ public class Component : Microsoft.AspNetCore.Components.ComponentBase private async Task VerifyRenamesAsync(string input, string newName, string expected, string? fileKind = null, (string fileName, string contents)[]? additionalFiles = null, (string oldName, string newName)[]? renames = null) { TestFileMarkupParser.GetPosition(input, out var source, out var cursorPosition); - var document = CreateProjectAndRazorDocument(source, fileKind, additionalFiles); + var document = await CreateProjectAndRazorDocumentAsync(source, fileKind, additionalFiles); var inputText = await document.GetTextAsync(DisposalToken); var position = inputText.GetPosition(cursorPosition); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSemanticTokensRangeEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSemanticTokensRangeEndpointTest.cs index 42b792b7ad5..7f841c9b12d 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSemanticTokensRangeEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSemanticTokensRangeEndpointTest.cs @@ -90,7 +90,7 @@ @section MySection { private async Task VerifySemanticTokensAsync(string input, bool colorBackground, bool precise, string? fileKind = null, [CallerMemberName] string? testName = null) { - var document = CreateProjectAndRazorDocument(input, fileKind); + var document = await CreateProjectAndRazorDocumentAsync(input, fileKind); var sourceText = await document.GetTextAsync(DisposalToken); var legend = TestRazorSemanticTokensLegendService.Instance; diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs index 7c599b0a3ed..8facef4127a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostSignatureHelpEndpointTest.cs @@ -91,7 +91,7 @@ void Act() private async Task VerifySignatureHelpAsync(string input, string expected, bool autoListParams = true, SignatureHelpTriggerKind? triggerKind = null) { TestFileMarkupParser.GetPosition(input, out input, out var cursorPosition); - var document = CreateProjectAndRazorDocument(input); + var document = await CreateProjectAndRazorDocumentAsync(input); var sourceText = await document.GetTextAsync(DisposalToken); var clientSettingsManager = new ClientSettingsManager([], null, null); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs index f946a642581..f2a4acc5b67 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostTextPresentationEndpointTest.cs @@ -55,7 +55,7 @@ private static string File(string projectRelativeFileName) private async Task VerifyUriPresentationAsync(string input, string text, string? expected, WorkspaceEdit? htmlResponse = null) { TestFileMarkupParser.GetSpan(input, out input, out var span); - var document = CreateProjectAndRazorDocument(input); + var document = await CreateProjectAndRazorDocumentAsync(input); var sourceText = await document.GetTextAsync(DisposalToken); var requestInvoker = new TestLSPRequestInvoker([(VSInternalMethods.TextDocumentTextPresentationName, htmlResponse)]); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs index d1f965f0b76..68b3be9565a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostUriPresentationEndpointTest.cs @@ -286,7 +286,7 @@ private static string File(string projectRelativeFileName) private async Task VerifyUriPresentationAsync(string input, Uri[] uris, string? expected, WorkspaceEdit? htmlResponse = null, (string fileName, string contents)[]? additionalFiles = null) { TestFileMarkupParser.GetSpan(input, out input, out var span); - var document = CreateProjectAndRazorDocument(input, additionalFiles: additionalFiles); + var document = await CreateProjectAndRazorDocumentAsync(input, additionalFiles: additionalFiles); var sourceText = await document.GetTextAsync(DisposalToken); var requestInvoker = new TestLSPRequestInvoker([(VSInternalMethods.TextDocumentUriPresentationName, htmlResponse)]); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs index 041b95c6eee..c7b1fd79b4c 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/RazorComponentDefinitionServiceTest.cs @@ -76,7 +76,7 @@ await VerifyDefinitionAsync(input, surveyPrompt, (FileName("SurveyPrompt.razor") private async Task VerifyDefinitionAsync(TestCode input, TestCode expectedDocument, params (string fileName, string contents)[]? additionalFiles) { - var document = CreateProjectAndRazorDocument(input.Text, FileKinds.Component, additionalFiles); + var document = await CreateProjectAndRazorDocumentAsync(input.Text, FileKinds.Component, additionalFiles); var service = OOPExportProvider.GetExportedValue(); var documentSnapshotFactory = OOPExportProvider.GetExportedValue(); From 923c016bff1ccd3a899719af181b04f4ea5fea8b Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 13 Sep 2024 09:38:00 +1000 Subject: [PATCH 333/386] Convert HtmlFormatting to a service, have it own its export provider, and create a fixture so we can still share an instance --- ...SharpStatementBlockOnTypeFormattingTest.cs | 5 +++- .../CodeActionFormattingTest.cs | 5 +++- .../CodeDirectiveFormattingTest.cs | 5 +++- .../CodeDirectiveOnTypeFormattingTest.cs | 5 +++- .../FormattingLanguageServerClient.cs | 7 ++--- .../Formatting_NetFx/FormattingTestBase.cs | 12 ++++++--- .../HtmlFormattingCollection.cs | 13 ++++++++++ .../Formatting_NetFx/HtmlFormattingTest.cs | 4 ++- .../Formatting_NetFx/RazorFormattingTest.cs | 4 ++- .../Formatting_NetFx/HtmlFormattingFixture.cs | 18 +++++++++++++ ...Formatting.cs => HtmlFormattingService.cs} | 26 ++++++++++++++----- .../CohostDocumentFormattingEndpointTest.cs | 8 +++--- .../CohostOnTypeFormattingEndpointTest.cs | 8 +++--- .../CohostRangeFormattingEndpointTest.cs | 8 +++--- .../Cohost/HtmlFormattingCollection.cs | 13 ++++++++++ 15 files changed, 109 insertions(+), 32 deletions(-) create mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingCollection.cs create mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingFixture.cs rename src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/{HtmlFormatting.cs => HtmlFormattingService.cs} (78%) create mode 100644 src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/HtmlFormattingCollection.cs diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CSharpStatementBlockOnTypeFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CSharpStatementBlockOnTypeFormattingTest.cs index 9e769c37366..9354fecb02c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CSharpStatementBlockOnTypeFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CSharpStatementBlockOnTypeFormattingTest.cs @@ -4,12 +4,15 @@ #nullable disable using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.Formatting; using Xunit; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -public class CSharpStatementBlockOnTypeFormattingTest(ITestOutputHelper testOutput) : FormattingTestBase(testOutput) +[Collection(HtmlFormattingCollection.Name)] +public class CSharpStatementBlockOnTypeFormattingTest(HtmlFormattingFixture fixture, ITestOutputHelper testOutput) + : FormattingTestBase(fixture.Service, testOutput) { [Fact] public async Task CloseCurly_IfBlock_SingleLineAsync() diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeActionFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeActionFormattingTest.cs index c7067eae067..b5f33ec5aa6 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeActionFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeActionFormattingTest.cs @@ -4,12 +4,15 @@ #nullable disable using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Razor.Formatting; using Xunit; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -public class CodeActionFormattingTest(ITestOutputHelper testOutput) : FormattingTestBase(testOutput) +[Collection(HtmlFormattingCollection.Name)] +public class CodeActionFormattingTest(HtmlFormattingFixture fixture, ITestOutputHelper testOutput) + : FormattingTestBase(fixture.Service, testOutput) { [Fact] public async Task AddDebuggerDisplay() diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveFormattingTest.cs index 24ca9cf007a..fbccac31ee2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveFormattingTest.cs @@ -5,12 +5,15 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis.Razor.Formatting; using Xunit; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -public class CodeDirectiveFormattingTest(ITestOutputHelper testOutput) : FormattingTestBase(testOutput) +[Collection(HtmlFormattingCollection.Name)] +public class CodeDirectiveFormattingTest(HtmlFormattingFixture fixture, ITestOutputHelper testOutput) + : FormattingTestBase(fixture.Service, testOutput) { internal override bool UseTwoPhaseCompilation => true; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveOnTypeFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveOnTypeFormattingTest.cs index e879f2b59cd..37992612a07 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveOnTypeFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/CodeDirectiveOnTypeFormattingTest.cs @@ -5,12 +5,15 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis.Razor.Formatting; using Xunit; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -public class CodeDirectiveOnTypeFormattingTest(ITestOutputHelper testOutput) : FormattingTestBase(testOutput) +[Collection(HtmlFormattingCollection.Name)] +public class CodeDirectiveOnTypeFormattingTest(HtmlFormattingFixture fixture, ITestOutputHelper testOutput) + : FormattingTestBase(fixture.Service, testOutput) { [Fact] public async Task FormatsIfStatementInComponent() diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs index f647e7d31d6..5779ad5aa30 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingLanguageServerClient.cs @@ -18,8 +18,9 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -internal class FormattingLanguageServerClient(ILoggerFactory loggerFactory) : IClientConnection +internal class FormattingLanguageServerClient(HtmlFormattingService htmlFormattingService, ILoggerFactory loggerFactory) : IClientConnection { + private readonly HtmlFormattingService _htmlFormattingService = htmlFormattingService; private readonly Dictionary _documents = []; private readonly ILoggerFactory _loggerFactory = loggerFactory; @@ -36,7 +37,7 @@ private async Task FormatAsync(DocumentOnTypeFo { var generatedHtml = GetGeneratedHtml(@params.TextDocument.Uri); - var edits = await HtmlFormatting.GetOnTypeFormattingEditsAsync(_loggerFactory, @params.TextDocument.Uri, generatedHtml, @params.Position, @params.Options.InsertSpaces, @params.Options.TabSize); + var edits = await _htmlFormattingService.GetOnTypeFormattingEditsAsync(_loggerFactory, @params.TextDocument.Uri, generatedHtml, @params.Position, @params.Options.InsertSpaces, @params.Options.TabSize); return new() { @@ -48,7 +49,7 @@ private async Task FormatAsync(DocumentFormatti { var generatedHtml = GetGeneratedHtml(@params.TextDocument.Uri); - var edits = await HtmlFormatting.GetDocumentFormattingEditsAsync(_loggerFactory, @params.TextDocument.Uri, generatedHtml, @params.Options.InsertSpaces, @params.Options.TabSize); + var edits = await _htmlFormattingService.GetDocumentFormattingEditsAsync(_loggerFactory, @params.TextDocument.Uri, generatedHtml, @params.Options.InsertSpaces, @params.Options.TabSize); return new() { diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index 6c3b299990b..8e070db10f5 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -34,10 +34,14 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; public class FormattingTestBase : RazorToolingIntegrationTestBase { - public FormattingTestBase(ITestOutputHelper testOutput) + private readonly HtmlFormattingService _htmlFormattingService; + + internal FormattingTestBase(HtmlFormattingService htmlFormattingService, ITestOutputHelper testOutput) : base(testOutput) { ITestOnlyLoggerExtensions.TestOnlyLoggingEnabled = true; + + _htmlFormattingService = htmlFormattingService; } private protected async Task RunFormattingTestAsync( @@ -94,7 +98,7 @@ private async Task RunFormattingTestInternalAsync(string input, string expected, var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, razorLSPOptions); var documentContext = new DocumentContext(uri, documentSnapshot, projectContext: null); - var client = new FormattingLanguageServerClient(LoggerFactory); + var client = new FormattingLanguageServerClient(_htmlFormattingService, LoggerFactory); client.AddCodeDocument(codeDocument); var htmlFormatter = new HtmlFormatter(client); @@ -159,7 +163,7 @@ private protected async Task RunOnTypeFormattingTestAsync( } else { - var client = new FormattingLanguageServerClient(LoggerFactory); + var client = new FormattingLanguageServerClient(_htmlFormattingService, LoggerFactory); client.AddCodeDocument(codeDocument); var htmlFormatter = new HtmlFormatter(client); @@ -168,7 +172,7 @@ private protected async Task RunOnTypeFormattingTestAsync( } // Assert - var edited = razorSourceText.WithChanges( changes); + var edited = razorSourceText.WithChanges(changes); var actual = edited.ToString(); AssertEx.EqualOrDiff(expected, actual); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingCollection.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingCollection.cs new file mode 100644 index 00000000000..c8eacf6f87d --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingCollection.cs @@ -0,0 +1,13 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using Microsoft.CodeAnalysis.Razor.Formatting; +using Xunit; + +namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; + +[CollectionDefinition(Name)] +public class HtmlFormattingCollection : ICollectionFixture +{ + public const string Name = nameof(HtmlFormattingCollection); +} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs index 300f2fc42c1..593b32dd64e 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/HtmlFormattingTest.cs @@ -14,7 +14,9 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -public class HtmlFormattingTest(ITestOutputHelper testOutput) : FormattingTestBase(testOutput) +[Collection(HtmlFormattingCollection.Name)] +public class HtmlFormattingTest(HtmlFormattingFixture fixture, ITestOutputHelper testOutput) + : FormattingTestBase(fixture.Service, testOutput) { internal override bool UseTwoPhaseCompilation => true; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs index 27bb6dc6e7c..6a3cd641b89 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs @@ -7,12 +7,14 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.CodeAnalysis.Razor.Formatting; using Xunit; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting; -public class RazorFormattingTest(ITestOutputHelper testOutput) : FormattingTestBase(testOutput) +[Collection(HtmlFormattingCollection.Name)] +public class RazorFormattingTest(HtmlFormattingFixture fixture, ITestOutputHelper testOutput) : FormattingTestBase(fixture.Service, testOutput) { [Fact] public async Task Section_BraceOnNextLine() diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingFixture.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingFixture.cs new file mode 100644 index 00000000000..13881a19c93 --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingFixture.cs @@ -0,0 +1,18 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; + +namespace Microsoft.CodeAnalysis.Razor.Formatting; + +public class HtmlFormattingFixture : IDisposable +{ + private readonly HtmlFormattingService _htmlFormattingService = new(); + + internal HtmlFormattingService Service => _htmlFormattingService; + + public void Dispose() + { + _htmlFormattingService.Dispose(); + } +} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormatting.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingService.cs similarity index 78% rename from src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormatting.cs rename to src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingService.cs index 1879dfadf1d..7c082b276cc 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormatting.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Formatting_NetFx/HtmlFormattingService.cs @@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis.Razor.Logging; using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.Composition; using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Utilities; @@ -17,9 +18,21 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; -internal static class HtmlFormatting +internal sealed class HtmlFormattingService : IDisposable { - public static Task GetDocumentFormattingEditsAsync(ILoggerFactory loggerFactory, Uri uri, string generatedHtml, bool insertSpaces, int tabSize) + private ExportProvider? _exportProvider; + + private ExportProvider ExportProvider => _exportProvider ?? (_exportProvider = TestComposition.Editor.ExportProviderFactory.CreateExportProvider()); + + public void Dispose() + { + if (_exportProvider is not null) + { + _exportProvider.Dispose(); + } + } + + public Task GetDocumentFormattingEditsAsync(ILoggerFactory loggerFactory, Uri uri, string generatedHtml, bool insertSpaces, int tabSize) { var request = $$""" { @@ -37,7 +50,7 @@ internal static class HtmlFormatting return CallWebToolsApplyFormattedEditsHandlerAsync(loggerFactory, request, uri, generatedHtml); } - public static Task GetOnTypeFormattingEditsAsync(ILoggerFactory loggerFactory, Uri uri, string generatedHtml, Position position, bool insertSpaces, int tabSize) + public Task GetOnTypeFormattingEditsAsync(ILoggerFactory loggerFactory, Uri uri, string generatedHtml, Position position, bool insertSpaces, int tabSize) { var generatedHtmlSource = SourceText.From(generatedHtml, Encoding.UTF8); var absoluteIndex = generatedHtmlSource.GetRequiredAbsoluteIndex(position); @@ -64,10 +77,9 @@ internal static class HtmlFormatting return CallWebToolsApplyFormattedEditsHandlerAsync(loggerFactory, request, uri, generatedHtml); } - private static async Task CallWebToolsApplyFormattedEditsHandlerAsync(ILoggerFactory loggerFactory, string serializedValue, Uri documentUri, string generatedHtml) + private async Task CallWebToolsApplyFormattedEditsHandlerAsync(ILoggerFactory loggerFactory, string serializedValue, Uri documentUri, string generatedHtml) { - var exportProvider = TestComposition.Editor.ExportProviderFactory.CreateExportProvider(); - var contentTypeService = exportProvider.GetExportedValue(); + var contentTypeService = ExportProvider.GetExportedValue(); lock (contentTypeService) { @@ -77,7 +89,7 @@ internal static class HtmlFormatting } } - var textBufferFactoryService = (ITextBufferFactoryService3)exportProvider.GetExportedValue(); + var textBufferFactoryService = (ITextBufferFactoryService3)ExportProvider.GetExportedValue(); var bufferManager = WebTools.BufferManager.New(contentTypeService, textBufferFactoryService, []); var logger = loggerFactory.GetOrCreateLogger("ApplyFormattedEditsHandler"); var applyFormatEditsHandler = WebTools.ApplyFormatEditsHandler.New(textBufferFactoryService, bufferManager, logger); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs index bc9bb3a4507..7370b711fc1 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.Formatting; @@ -19,8 +18,9 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; -[UseExportProvider] -public class CohostDocumentFormattingEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +[Collection(HtmlFormattingCollection.Name)] +public class CohostDocumentFormattingEndpointTest(HtmlFormattingFixture htmlFormattingFixture, ITestOutputHelper testOutputHelper) + : CohostEndpointTestBase(testOutputHelper) { // All of the formatting tests in the language server exercise the formatting engine and cover various edge cases // and provide regression prevention. The tests here are not exhaustive, but they validate the the cohost endpoints @@ -116,7 +116,7 @@ private async Task VerifyDocumentFormattingAsync(string input, string expected) Assert.NotNull(generatedHtml); var uri = new Uri(document.CreateUri(), $"{document.FilePath}{FeatureOptions.HtmlVirtualDocumentSuffix}"); - var htmlEdits = await HtmlFormatting.GetDocumentFormattingEditsAsync(LoggerFactory, uri, generatedHtml, insertSpaces: true, tabSize: 4); + var htmlEdits = await htmlFormattingFixture.Service.GetDocumentFormattingEditsAsync(LoggerFactory, uri, generatedHtml, insertSpaces: true, tabSize: 4); var requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentFormattingName, htmlEdits)]); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs index 3363c7a2ed6..1919956dad4 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.Formatting; @@ -19,8 +18,9 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; -[UseExportProvider] -public class CohostOnTypeFormattingEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +[Collection(HtmlFormattingCollection.Name)] +public class CohostOnTypeFormattingEndpointTest(HtmlFormattingFixture htmlFormattingFixture, ITestOutputHelper testOutputHelper) + : CohostEndpointTestBase(testOutputHelper) { [Fact] public async Task InvalidTrigger() @@ -115,7 +115,7 @@ private async Task VerifyOnTypeFormattingAsync(TestCode input, string expected, Assert.NotNull(generatedHtml); var uri = new Uri(document.CreateUri(), $"{document.FilePath}{FeatureOptions.HtmlVirtualDocumentSuffix}"); - var htmlEdits = await HtmlFormatting.GetOnTypeFormattingEditsAsync(LoggerFactory, uri, generatedHtml, position, insertSpaces: true, tabSize: 4); + var htmlEdits = await htmlFormattingFixture.Service.GetOnTypeFormattingEditsAsync(LoggerFactory, uri, generatedHtml, position, insertSpaces: true, tabSize: 4); requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentOnTypeFormattingName, htmlEdits)]); } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs index 2b6a6005b8f..97b3db3fd79 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostRangeFormattingEndpointTest.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.Formatting; @@ -19,8 +18,9 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; -[UseExportProvider] -public class CohostRangeFormattingEndpointTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) +[Collection(HtmlFormattingCollection.Name)] +public class CohostRangeFormattingEndpointTest(HtmlFormattingFixture htmlFormattingFixture, ITestOutputHelper testOutputHelper) + : CohostEndpointTestBase(testOutputHelper) { [Fact] public Task RangeFormatting() @@ -110,7 +110,7 @@ private async Task VerifyRangeFormattingAsync(TestCode input, string expected) Assert.NotNull(generatedHtml); var uri = new Uri(document.CreateUri(), $"{document.FilePath}{FeatureOptions.HtmlVirtualDocumentSuffix}"); - var htmlEdits = await HtmlFormatting.GetDocumentFormattingEditsAsync(LoggerFactory, uri, generatedHtml, insertSpaces: true, tabSize: 4); + var htmlEdits = await htmlFormattingFixture.Service.GetDocumentFormattingEditsAsync(LoggerFactory, uri, generatedHtml, insertSpaces: true, tabSize: 4); var requestInvoker = new TestLSPRequestInvoker([(Methods.TextDocumentFormattingName, htmlEdits)]); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/HtmlFormattingCollection.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/HtmlFormattingCollection.cs new file mode 100644 index 00000000000..0380b2d5675 --- /dev/null +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/HtmlFormattingCollection.cs @@ -0,0 +1,13 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using Microsoft.CodeAnalysis.Razor.Formatting; +using Xunit; + +namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; + +[CollectionDefinition(Name)] +public class HtmlFormattingCollection : ICollectionFixture +{ + public const string Name = nameof(HtmlFormattingCollection); +} From f3062e7106c6c3e6e6e8fbaf2c5b77d0f7724034 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 13 Sep 2024 09:50:31 +1000 Subject: [PATCH 334/386] Have our test service dispose of its export provider --- .../LanguageServer/CSharpTestLspServer.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs index 2b20c842cf4..f095947c978 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServer.cs @@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; public sealed class CSharpTestLspServer : IAsyncDisposable { private readonly AdhocWorkspace _testWorkspace; - private readonly IRazorLanguageServerTarget _languageServer; + private readonly ExportProvider _exportProvider; private readonly JsonRpc _clientRpc; private readonly JsonRpc _serverRpc; @@ -41,6 +41,7 @@ private CSharpTestLspServer( CancellationToken cancellationToken) { _testWorkspace = testWorkspace; + _exportProvider = exportProvider; _cancellationToken = cancellationToken; var (clientStream, serverStream) = FullDuplexStream.CreatePair(); @@ -67,7 +68,7 @@ private CSharpTestLspServer( _clientRpc.StartListening(); - _languageServer = CreateLanguageServer(_serverRpc, _serverMessageFormatter.JsonSerializerOptions, testWorkspace, languageServerFactory, exportProvider, serverCapabilities); + _ = CreateLanguageServer(_serverRpc, _serverMessageFormatter.JsonSerializerOptions, testWorkspace, languageServerFactory, exportProvider, serverCapabilities); static SystemTextJsonFormatter CreateSystemTextJsonMessageFormatter(AbstractRazorLanguageServerFactoryWrapper languageServerFactory) { @@ -146,6 +147,7 @@ internal Task ExecuteRequestAsync( public async ValueTask DisposeAsync() { _testWorkspace.Dispose(); + _exportProvider.Dispose(); _clientRpc.Dispose(); _clientMessageFormatter.Dispose(); From 851405f3270f88ed341378184e9aec3fa1d6ace9 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 13 Sep 2024 11:42:33 +1000 Subject: [PATCH 335/386] Remove static caches for export providers Also delete all of the if-def-ed out and redundant code as a result. If we need to do any caching of things, lets just use xunit features and not odd static stuff with custom test attributes etc. --- ...legatedCompletionItemResolverTest.NetFx.cs | 2 - .../DelegatedCompletionListProviderTest.cs | 2 - .../DocumentHighlightEndpointTest.cs | 2 - .../Hover/HoverServiceTest.cs | 2 - .../MapCode/MapCodeTest.cs | 2 - .../RenameEndpointDelegationTest.cs | 2 - .../Refactoring/RenameEndpointTest.cs | 2 - .../Semantic/SemanticTokensTest.cs | 2 - .../SingleServerDelegatingEndpointTestBase.cs | 2 - .../RazorToolingIntegrationTestBase.cs | 2 - .../Mef/ExportProviderCache.cs | 207 ++-------------- .../Mef/TestComposition.cs | 31 +-- .../Mef/UseExportProviderAttribute.cs | 232 ------------------ .../CohostDocumentPullDiagnosticsTest.cs | 2 - 14 files changed, 29 insertions(+), 463 deletions(-) delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/UseExportProviderAttribute.cs diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs index 06fcc14d264..8aeefbf6e87 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionItemResolverTest.NetFx.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Formatting; using Microsoft.AspNetCore.Razor.LanguageServer.Test; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; @@ -26,7 +25,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; -[UseExportProvider] public class DelegatedCompletionItemResolverTest : LanguageServerTestBase { private readonly VSInternalClientCapabilities _clientCapabilities; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs index cc82c40eb4d..faf9392f1f1 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Completion/Delegation/DelegatedCompletionListProviderTest.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Testing; @@ -21,7 +20,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion.Delegation; -[UseExportProvider] public class DelegatedCompletionListProviderTest : LanguageServerTestBase { private readonly TestDelegatedCompletionListProvider _provider; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs index 655f2796130..6510f2dd7ee 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentHighlighting/DocumentHighlightEndpointTest.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Testing; @@ -23,7 +22,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.DocumentHighlighting; -[UseExportProvider] public class DocumentHighlightEndpointTest(ITestOutputHelper testOutput) : LanguageServerTestBase(testOutput) { [Fact] diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs index 246335632f0..c884946e106 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Hover/HoverServiceTest.cs @@ -13,7 +13,6 @@ using Microsoft.AspNetCore.Razor.ProjectSystem; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.AspNetCore.Razor.Test.Common.ProjectSystem; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; @@ -29,7 +28,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Test.Hover; -[UseExportProvider] public class HoverServiceTest(ITestOutputHelper testOutput) : TagHelperServiceTestBase(testOutput) { private static VSInternalClientCapabilities CreateMarkDownCapabilities() diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs index 31ea7e1b81e..0fa73622a5a 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/MapCode/MapCodeTest.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.LanguageServer.MapCode; using Microsoft.AspNetCore.Razor.Telemetry; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; using Microsoft.CodeAnalysis.Testing; @@ -22,7 +21,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Test.MapCode; -[UseExportProvider] public class MapCodeTest(ITestOutputHelper testOutput) : LanguageServerTestBase(testOutput) { private const string RazorFilePath = "C:/path/to/file.razor"; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs index e96dbb8b141..0a06da92a94 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointDelegationTest.cs @@ -7,7 +7,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Rename; using Microsoft.CodeAnalysis.Razor.Workspaces; @@ -19,7 +18,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Refactoring; -[UseExportProvider] public class RenameEndpointDelegationTest(ITestOutputHelper testOutput) : SingleServerDelegatingEndpointTestBase(testOutput) { [Fact] diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs index 1ff45c926a5..2bb699fdf80 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Refactoring/RenameEndpointTest.cs @@ -17,7 +17,6 @@ using Microsoft.AspNetCore.Razor.ProjectSystem; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; @@ -33,7 +32,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Refactoring; -[UseExportProvider] public class RenameEndpointTest(ITestOutputHelper testOutput) : LanguageServerTestBase(testOutput) { private static readonly string s_project1BasePath = PathUtilities.CreateRootedPath("First"); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs index 455da63ae60..3f0365de187 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokensTest.cs @@ -19,7 +19,6 @@ using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; @@ -35,7 +34,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic; -[UseExportProvider] public partial class SemanticTokensTest(ITestOutputHelper testOutput) : TagHelperServiceTestBase(testOutput) { private readonly Mock _clientConnection = new(MockBehavior.Strict); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs index 49c4fbb7423..c2c8405e394 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/SingleServerDelegatingEndpointTestBase.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.AspNetCore.Razor.Test.Common.ProjectSystem; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.ProjectSystem; @@ -19,7 +18,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; -[UseExportProvider] public abstract partial class SingleServerDelegatingEndpointTestBase(ITestOutputHelper testOutput) : LanguageServerTestBase(testOutput) { private protected IDocumentContextFactory? DocumentContextFactory { get; private set; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs index 8d4d088e7d9..c7ad99dc1b7 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Language/IntegrationTests/RazorToolingIntegrationTestBase.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Razor; @@ -22,7 +21,6 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests; -[UseExportProvider] public class RazorToolingIntegrationTestBase : ToolingTestBase { internal const string ArbitraryWindowsPath = "x:\\dir\\subdir\\Test"; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderCache.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderCache.cs index 2b2a62815a7..e8937fd4a96 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderCache.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/ExportProviderCache.cs @@ -2,14 +2,10 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; -using System.Collections.Concurrent; using System.Collections.Generic; -using System.Collections.Immutable; using System.Linq; using System.Reflection; -using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.VisualStudio.Composition; namespace Microsoft.AspNetCore.Razor.Test.Common.Mef; @@ -18,60 +14,6 @@ public static class ExportProviderCache { private static readonly PartDiscovery s_partDiscovery = CreatePartDiscovery(Resolver.DefaultInstance); - private static readonly TestComposition s_defaultHostExportProviderComposition = TestComposition.Empty - .AddAssemblies(MefHostServices.DefaultAssemblies); - private static readonly ConcurrentDictionary s_scopes = new(); - private const string DefaultScope = "default"; - - private static readonly object s_lock = new(); - - internal static bool Enabled { get; private set; } - - internal static ExportProvider[] ExportProvidersForCleanup - { - get - { - var scopes = s_scopes.Values.ToArray(); - var defaultScope = scopes.Where(scope => scope.Name == DefaultScope); - var allButDefault = scopes.Where(scope => scope.Name != DefaultScope); - - // Make sure to return the default scope as the last element - return allButDefault.Concat(defaultScope) - .Where(scope => scope._currentExportProvider is { }) - .Select(scope => scope._currentExportProvider!) - .ToArray(); - } - } - - internal static void SetEnabled_OnlyUseExportProviderAttributeCanCall(bool value) - { - lock (s_lock) - { - Enabled = value; - if (!Enabled) - { - foreach (var scope in s_scopes.Values.ToArray()) - { - scope.Clear(); - } - } - } - } - - /// - /// Use to create for default instances of . - /// - public static IExportProviderFactory GetOrCreateExportProviderFactory(IEnumerable assemblies) - { - if (assemblies is ImmutableArray assembliesArray && - assembliesArray == MefHostServices.DefaultAssemblies) - { - return s_defaultHostExportProviderComposition.ExportProviderFactory; - } - - return CreateExportProviderFactory(CreateAssemblyCatalog(assemblies), scopeName: DefaultScope); - } - public static ComposableCatalog CreateAssemblyCatalog(IEnumerable assemblies, Resolver? resolver = null) { var discovery = resolver is null ? s_partDiscovery : CreatePartDiscovery(resolver); @@ -125,151 +67,48 @@ bool IsExcludedPart(ComposablePartDefinition part) } } - public static IExportProviderFactory CreateExportProviderFactory(ComposableCatalog catalog, string? scopeName = null) + public static IExportProviderFactory CreateExportProviderFactory(ComposableCatalog catalog) { - var scope = s_scopes.GetOrAdd(scopeName ?? DefaultScope, scopeName => new Scope(scopeName)); var configuration = CompositionConfiguration.Create(catalog.WithCompositionService()); + ValidateConfiguration(configuration); + var runtimeComposition = RuntimeComposition.CreateRuntimeComposition(configuration); var exportProviderFactory = runtimeComposition.CreateExportProviderFactory(); - return new SingleExportProviderFactory(scope, catalog, configuration, exportProviderFactory); + return exportProviderFactory; } - private sealed class SingleExportProviderFactory : IExportProviderFactory + private static void ValidateConfiguration(CompositionConfiguration configuration) { - private readonly Scope _scope; - private readonly ComposableCatalog _catalog; - private readonly CompositionConfiguration _configuration; - private readonly IExportProviderFactory _exportProviderFactory; - - public SingleExportProviderFactory(Scope scope, ComposableCatalog catalog, CompositionConfiguration configuration, IExportProviderFactory exportProviderFactory) + foreach (var errorCollection in configuration.CompositionErrors) { - _scope = scope; - _catalog = catalog; - _configuration = configuration; - _exportProviderFactory = exportProviderFactory; - } - - private ExportProvider GetOrCreateExportProvider() - { - if (!Enabled) - { - // The [UseExportProvider] attribute on tests ensures that the pre- and post-conditions of methods - // in this type are met during test conditions. - throw new InvalidOperationException($"{nameof(ExportProviderCache)} may only be used from tests marked with {nameof(UseExportProviderAttribute)}"); - } - - var expectedCatalog = Interlocked.CompareExchange(ref _scope._expectedCatalog, _catalog, null) ?? _catalog; - RequireForSingleExportProvider(expectedCatalog == _catalog); - - var expected = _scope._expectedProviderForCatalog; - if (expected is null) + foreach (var error in errorCollection) { - foreach (var errorCollection in _configuration.CompositionErrors) + foreach (var part in error.Parts) { - foreach (var error in errorCollection) + foreach (var pair in part.SatisfyingExports) { - foreach (var part in error.Parts) + var (importBinding, exportBindings) = (pair.Key, pair.Value); + if (exportBindings.Count <= 1) { - foreach (var pair in part.SatisfyingExports) - { - var (importBinding, exportBindings) = (pair.Key, pair.Value); - if (exportBindings.Count <= 1) - { - // Ignore composition errors for missing parts - continue; - } + // Ignore composition errors for missing parts + continue; + } - if (importBinding.ImportDefinition.Cardinality != ImportCardinality.ZeroOrMore) - { - // This failure occurs when a binding fails because multiple exports were - // provided but only a single one (at most) is expected. This typically occurs - // when a test ExportProvider is created with a mock implementation without - // first removing a value provided by default. - throw new InvalidOperationException( - "Failed to construct the MEF catalog for testing. Multiple exports were found for a part for which only one export is expected:" + Environment.NewLine - + error.Message); - } - } + if (importBinding.ImportDefinition.Cardinality != ImportCardinality.ZeroOrMore) + { + // This failure occurs when a binding fails because multiple exports were + // provided but only a single one (at most) is expected. This typically occurs + // when a test ExportProvider is created with a mock implementation without + // first removing a value provided by default. + throw new InvalidOperationException( + "Failed to construct the MEF catalog for testing. Multiple exports were found for a part for which only one export is expected:" + Environment.NewLine + + error.Message); } } } - - expected = _exportProviderFactory.CreateExportProvider(); - expected = Interlocked.CompareExchange(ref _scope._expectedProviderForCatalog, expected, null) ?? expected; - Interlocked.CompareExchange(ref _scope._currentExportProvider, expected, null); - } - - var exportProvider = _scope._currentExportProvider; - RequireForSingleExportProvider(exportProvider == expected); - - return exportProvider!; - } - - ExportProvider IExportProviderFactory.CreateExportProvider() - { - // Currently this implementation deviates from the typical behavior of IExportProviderFactory. For the - // duration of a single test, an instance of SingleExportProviderFactory will continue returning the - // same ExportProvider instance each time this method is called. - // - // It may be clearer to refactor the implementation to only allow one call to CreateExportProvider in - // the context of a single test. https://github.com/dotnet/roslyn/issues/25863 - lock (s_lock) - { - return GetOrCreateExportProvider(); } } - - private void RequireForSingleExportProvider(bool condition) - { - if (!condition) - { - // The ExportProvider provides services that act as singleton instances in the context of an - // application (this include cases of multiple exports, where the 'singleton' is the list of all - // exports matching the contract). When reasoning about the behavior of test code, it is valuable to - // know service instances will be used in a consistent manner throughout the execution of a test, - // regardless of whether they are passed as arguments or obtained through requests to the - // ExportProvider. - // - // Restricting a test to a single ExportProvider guarantees that objects that *look* like singletons - // will *behave* like singletons for the duration of the test. Each test is expected to create and - // use its ExportProvider in a consistent manner. - // - // A test that validates remote services is allowed to create a couple of ExportProviders: - // one for local workspace and the other for the remote one. - // - // When this exception is thrown by a test, it typically means one of the following occurred: - // - // * A test failed to pass an ExportProvider via an optional argument to a method, resulting in the - // method attempting to create a default ExportProvider which did not match the one assigned to - // the test. - // * A test attempted to perform multiple test sequences in the context of a single test method, - // rather than break up the test into distinct tests for each case. - // * A test referenced different predefined ExportProvider instances within the context of a test. - // Each test is expected to use the same ExportProvider throughout the test. - throw new InvalidOperationException($"Only one {_scope.Name} {nameof(ExportProvider)} can be created in the context of a single test."); - } - } - } - - private sealed class Scope - { - public readonly string Name; - public ExportProvider? _currentExportProvider; - public ComposableCatalog? _expectedCatalog; - public ExportProvider? _expectedProviderForCatalog; - - public Scope(string name) - { - Name = name; - } - - public void Clear() - { - _currentExportProvider = null; - _expectedCatalog = null; - _expectedProviderForCatalog = null; - } } private sealed class SimpleAssemblyLoader : IAssemblyLoader diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/TestComposition.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/TestComposition.cs index 4144af3544b..d73f291ca9c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/TestComposition.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/TestComposition.cs @@ -22,8 +22,7 @@ public sealed partial class TestComposition public static readonly TestComposition Empty = new( ImmutableHashSet.Empty, ImmutableHashSet.Empty, - ImmutableHashSet.Empty, - scope: null); + ImmutableHashSet.Empty); public static readonly TestComposition Roslyn = Empty .AddAssemblies(MefHostServices.DefaultAssemblies) @@ -102,32 +101,17 @@ public override int GetHashCode() ///
public readonly ImmutableHashSet Parts; - /// - /// The scope in which to create the export provider, or to use the default scope. - /// - public readonly string? Scope; - private readonly Lazy _exportProviderFactory; - private TestComposition(ImmutableHashSet assemblies, ImmutableHashSet parts, ImmutableHashSet excludedPartTypes, string? scope) + private TestComposition(ImmutableHashSet assemblies, ImmutableHashSet parts, ImmutableHashSet excludedPartTypes) { Assemblies = assemblies; Parts = parts; ExcludedPartTypes = excludedPartTypes; - Scope = scope; _exportProviderFactory = new Lazy(GetOrCreateFactory); } -#if false -/// -/// Returns a new instance of for the composition. This will either be a MEF composition or VS MEF composition host, -/// depending on what layer the composition is for. Editor Features and VS layers use VS MEF composition while anything else uses System.Composition. -/// -public HostServices GetHostServices() - => VisualStudioMefHostServices.Create(ExportProviderFactory.CreateExportProvider()); -#endif - /// /// VS MEF . /// @@ -145,7 +129,7 @@ private IExportProviderFactory GetOrCreateFactory() } } - var newFactory = ExportProviderCache.CreateExportProviderFactory(GetCatalog(), Scope); + var newFactory = ExportProviderCache.CreateExportProviderFactory(GetCatalog()); lock (s_factoryCache) { @@ -215,7 +199,7 @@ public TestComposition WithAssemblies(ImmutableHashSet assemblies) var testAssembly = assemblies.FirstOrDefault(IsTestAssembly); Verify.Operation(testAssembly is null, $"Test assemblies are not allowed in test composition: {testAssembly}. Specify explicit test parts instead."); - return new TestComposition(assemblies, Parts, ExcludedPartTypes, Scope); + return new TestComposition(assemblies, Parts, ExcludedPartTypes); static bool IsTestAssembly(Assembly assembly) { @@ -230,13 +214,10 @@ static bool IsTestAssembly(Assembly assembly) } public TestComposition WithParts(ImmutableHashSet parts) - => parts == Parts ? this : new TestComposition(Assemblies, parts, ExcludedPartTypes, Scope); + => parts == Parts ? this : new TestComposition(Assemblies, parts, ExcludedPartTypes); public TestComposition WithExcludedPartTypes(ImmutableHashSet excludedPartTypes) - => excludedPartTypes == ExcludedPartTypes ? this : new TestComposition(Assemblies, Parts, excludedPartTypes, Scope); - - public TestComposition WithScope(string? scope) - => scope == Scope ? this : new TestComposition(Assemblies, Parts, ExcludedPartTypes, scope); + => excludedPartTypes == ExcludedPartTypes ? this : new TestComposition(Assemblies, Parts, excludedPartTypes); /// /// Use for VS MEF composition troubleshooting. diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/UseExportProviderAttribute.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/UseExportProviderAttribute.cs deleted file mode 100644 index 8f2d7ba28f3..00000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Mef/UseExportProviderAttribute.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using System.Reflection; -using Microsoft.CodeAnalysis.Host; -using Microsoft.VisualStudio.Composition; -using Xunit.Sdk; - -namespace Microsoft.AspNetCore.Razor.Test.Common.Mef; - -/// -/// This attribute supports tests that need to use a MEF container () directly or -/// indirectly during the test sequence. It ensures production code uniformly handles the export provider created -/// during a test, and cleans up the state before the test completes. -/// -/// -/// This attribute serves several important functions for tests that use state variables which are otherwise -/// shared at runtime: -/// -/// Ensures implementations all use the same , which is -/// the one created by the test. -/// Clears static cached values in production code holding instances of , or any -/// object obtained from it or one of its related interfaces such as . -/// Isolates tests by waiting for asynchronous operations to complete before a test is considered -/// complete. -/// When required, provides a separate for the -/// executing in the test process. If this provider is created during testing, it is cleaned up with the primary -/// export provider during test teardown. -/// -/// -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] -public class UseExportProviderAttribute : BeforeAfterTestAttribute -{ - /// - /// Asynchronous operations are expected to be cancelled at the end of the test that started them. Operations - /// cancelled by the test are cleaned up immediately. The remaining operations are given an opportunity to run - /// to completion. If this timeout is exceeded by the asynchronous operations running after a test completes, - /// the test is failed. - /// - private static readonly TimeSpan s_cleanupTimeout = TimeSpan.FromMinutes(1); - -#if false -private MefHostServices? _hostServices; -#endif - - public override void Before(MethodInfo? methodUnderTest) - { -#if false - MefHostServices.TestAccessor.HookServiceCreation(CreateMefHostServices); - - // make sure we enable this for all unit tests - AsynchronousOperationListenerProvider.Enable(enable: true, diagnostics: true); -#endif - - ExportProviderCache.SetEnabled_OnlyUseExportProviderAttributeCanCall(true); - } - - /// - /// To the extent reasonably possible, this method resets the state of the test environment to the same state as - /// it started, ensuring that tests running in sequence cannot influence the outcome of later tests. - /// - /// - /// The test cleanup runs in two primary steps: - /// - /// Waiting for asynchronous operations started by the test to complete. - /// Disposing of mutable resources created by the test. - /// Clearing static state variables related to the use of MEF during a test. - /// - /// - public override void After(MethodInfo? methodUnderTest) - { - try - { - foreach (var exportProvider in ExportProviderCache.ExportProvidersForCleanup) - { - DisposeExportProvider(exportProvider); - } - } - finally - { -#if false - // Replace hooks with ones that always throw exceptions. These hooks detect cases where code executing - // after the end of a test attempts to create an ExportProvider. - MefHostServices.TestAccessor.HookServiceCreation(DenyMefHostServicesCreationBetweenTests); -#endif - - // Reset static state variables. -#if false - _hostServices = null; -#endif - ExportProviderCache.SetEnabled_OnlyUseExportProviderAttributeCanCall(false); - } - } - - private static void DisposeExportProvider(ExportProvider? exportProvider) - { - if (exportProvider is null) - { - return; - } - - // Dispose of the export provider, including calling Dispose for any IDisposable services created during the test. - using var _ = exportProvider; - -#if false - if (exportProvider.GetExportedValues().SingleOrDefault() is { } listenerProvider) - { - if (exportProvider.GetExportedValues().SingleOrDefault()?.HasMainThread ?? false) - { - // Immediately clear items from the foreground notification service for which cancellation is - // requested. This service maintains a queue separately from Tasks, and work items scheduled for - // execution after a delay are not immediately purged when cancellation is requested. This code - // instructs the service to walk the list of queued work items and immediately cancel and purge any - // which are already cancelled. - var foregroundNotificationService = exportProvider.GetExportedValues().SingleOrDefault() as ForegroundNotificationService; - foregroundNotificationService?.ReleaseCancelledItems(); - } - - // Verify the synchronization context was not used incorrectly - var testExportJoinableTaskContext = exportProvider.GetExportedValues().SingleOrDefault(); - var denyExecutionSynchronizationContext = testExportJoinableTaskContext?.SynchronizationContext as TestExportJoinableTaskContext.DenyExecutionSynchronizationContext; - - // Join remaining operations with a timeout - using (var timeoutTokenSource = new CancellationTokenSource(s_cleanupTimeout)) - { - if (denyExecutionSynchronizationContext is object) - { - // Immediately cancel the test if the synchronization context is improperly used - denyExecutionSynchronizationContext.InvalidSwitch += delegate { timeoutTokenSource.CancelAfter(0); }; - denyExecutionSynchronizationContext.ThrowIfSwitchOccurred(); - } - - try - { - // This attribute cleans up the in-process and out-of-process export providers separately, so we - // don't need to provide a workspace when waiting for operations to complete. - var waiter = ((AsynchronousOperationListenerProvider)listenerProvider).WaitAllDispatcherOperationAndTasksAsync(workspace: null); - waiter.JoinUsingDispatcher(timeoutTokenSource.Token); - } - catch (OperationCanceledException ex) when (timeoutTokenSource.IsCancellationRequested) - { - // If the failure was caused by an invalid thread change, throw that exception - denyExecutionSynchronizationContext?.ThrowIfSwitchOccurred(); - - var messageBuilder = new StringBuilder("Failed to clean up listeners in a timely manner."); - foreach (var token in ((AsynchronousOperationListenerProvider)listenerProvider).GetTokens()) - { - messageBuilder.AppendLine().Append($" {token}"); - } - - throw new TimeoutException(messageBuilder.ToString(), ex); - } - } - - denyExecutionSynchronizationContext?.ThrowIfSwitchOccurred(); - - foreach (var testErrorHandler in exportProvider.GetExportedValues()) - { - var exceptions = testErrorHandler.Exceptions; - if (exceptions.Count > 0) - { - throw new AggregateException("Tests threw unexpected exceptions", exceptions); - } - } - } -#endif - } - -#if false -private MefHostServices CreateMefHostServices(IEnumerable assemblies) -{ - ExportProvider exportProvider; - - if (assemblies is ImmutableArray array && - array == MefHostServices.DefaultAssemblies && - ExportProviderCache.LocalExportProviderForCleanup != null) - { - if (_hostServices != null) - { - return _hostServices; - } - - exportProvider = ExportProviderCache.LocalExportProviderForCleanup; - } - else - { - exportProvider = ExportProviderCache.GetOrCreateExportProviderFactory(assemblies).CreateExportProvider(); - } - - Interlocked.CompareExchange( - ref _hostServices, - new ExportProviderMefHostServices(exportProvider), - null); - - return _hostServices; -} - -private static MefHostServices DenyMefHostServicesCreationBetweenTests(IEnumerable assemblies) -{ - // If you hit this, one of three situations occurred: - // - // 1. A test method that uses ExportProvider is not marked with UseExportProviderAttribute (can also be - // applied to the containing type or a base type. - // 2. A test attempted to create an ExportProvider during the test cleanup operations after the - // ExportProvider was already disposed. - // 3. A test attempted to use an ExportProvider in the constructor of the test, or during the initialization - // of a field in the test class. - throw new InvalidOperationException("Cannot create host services after test tear down."); -} - -private class ExportProviderMefHostServices : MefHostServices, IMefHostExportProvider -{ - private readonly VisualStudioMefHostServices _vsHostServices; - - public ExportProviderMefHostServices(ExportProvider exportProvider) - : base(new ContainerConfiguration().CreateContainer()) - { - _vsHostServices = VisualStudioMefHostServices.Create(exportProvider); - } - - protected internal override HostWorkspaceServices CreateWorkspaceServices(Workspace workspace) - => _vsHostServices.CreateWorkspaceServices(workspace); - - IEnumerable> IMefHostExportProvider.GetExports() - => _vsHostServices.GetExports(); - - IEnumerable> IMefHostExportProvider.GetExports() - => _vsHostServices.GetExports(); -} -#endif -} diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs index 84b1d414ffd..3895dc088fc 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -14,7 +13,6 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; -[UseExportProvider] public class CohostDocumentPullDiagnosticsTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) { [Fact] From b36d507968ac380353cc18aebce1d50d92ac8465 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 13 Sep 2024 13:36:30 +1000 Subject: [PATCH 336/386] More tests and better validation --- .../CohostDocumentPullDiagnosticsTest.cs | 95 +++++++++++++++---- 1 file changed, 79 insertions(+), 16 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs index 3895dc088fc..1bc8fd332cc 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentPullDiagnosticsTest.cs @@ -4,10 +4,11 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; +using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; @@ -16,10 +17,10 @@ namespace Microsoft.VisualStudio.Razor.LanguageClient.Cohost; public class CohostDocumentPullDiagnosticsTest(ITestOutputHelper testOutputHelper) : CohostEndpointTestBase(testOutputHelper) { [Fact] - public Task IfStatements() + public Task CSharp() => VerifyDiagnosticsAsync("""
- + @code { public void IJustMetYou() @@ -29,30 +30,92 @@ public void IJustMetYou() } """); - private async Task VerifyDiagnosticsAsync(TestCode input) + [Fact] + public Task Razor() + => VerifyDiagnosticsAsync(""" +
+ + {|RZ10012:|} + +
+ """); + + [Fact] + public Task Html() + { + TestCode input = """ +
+ + {|HTM1337:|} + +
+ """; + + return VerifyDiagnosticsAsync(input, + htmlResponse: [new VSInternalDiagnosticReport + { + Diagnostics = + [ + new Diagnostic + { + Code = "HTM1337", + Range = SourceText.From(input.Text).GetRange(input.NamedSpans.First().Value.First()) + } + ] + }]); + } + + [Fact] + public Task CombinedAndNestedDiagnostics() + => VerifyDiagnosticsAsync(""" + @using System.Threading.Tasks; + +
+ + {|RZ10012:|} + + @code + { + public void IJustMetYou() + { + {|CS0103:CallMeMaybe|}(); + } + } + +
+ @{ + {|CS4033:await Task.{|CS1501:Delay|}()|}; + } + + {|RZ9980:

|} +

+ +
+ """); + + private async Task VerifyDiagnosticsAsync(TestCode input, VSInternalDiagnosticReport[]? htmlResponse = null) { var document = await CreateProjectAndRazorDocumentAsync(input.Text, createSeparateRemoteAndLocalWorkspaces: true); var inputText = await document.GetTextAsync(DisposalToken); - var requestInvoker = new TestLSPRequestInvoker(); + var requestInvoker = new TestLSPRequestInvoker([(VSInternalMethods.DocumentPullDiagnosticName, htmlResponse)]); var endpoint = new CohostDocumentPullDiagnosticsEndpoint(RemoteServiceInvoker, TestHtmlDocumentSynchronizer.Instance, requestInvoker, FilePathService, LoggerFactory); var result = await endpoint.GetTestAccessor().HandleRequestAsync(document, DisposalToken); - var actual = result!.SelectMany(d => d.Diagnostics!).ToArray(); - if (input.NamedSpans.Count == 0) - { - Assert.Null(result); - return; - } + var markers = result!.SelectMany(d => d.Diagnostics.AssumeNotNull()).SelectMany(d => + new[] { + (index: inputText.GetTextSpan(d.Range).Start, text: $"{{|{d.Code!.Value.Second}:"), + (index: inputText.GetTextSpan(d.Range).End, text:"|}") + }); - Assert.Equal(input.NamedSpans.Count, actual.Length); - - foreach (var (code, spans) in input.NamedSpans) + var testOutput = input.Text; + foreach (var (index, text) in markers.OrderByDescending(i => i.index)) { - var diagnostic = Assert.Single(actual, d => d.Code == code); - Assert.Equal(spans.First(), inputText.GetTextSpan(diagnostic.Range)); + testOutput = testOutput.Insert(index, text); } + + AssertEx.EqualOrDiff(input.OriginalInput, testOutput); } } From bce408a66db744d0c2c8064195d474750d55e108 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Fri, 13 Sep 2024 14:03:43 +1000 Subject: [PATCH 337/386] Move helper method to somewhere central --- ...ft.AspNetCore.Razor.Microbenchmarks.csproj | 3 ++ .../CSharpTestLspServerHelpers.cs | 32 +------------- ...spNetCore.Razor.Test.Common.Tooling.csproj | 4 -- .../Workspaces/TestWorkspace.cs | 44 +++++++++++++++++++ .../Cohost/CohostEndpointTestBase.cs | 7 +-- 5 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj index 1010350dd29..d3179687681 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj @@ -43,6 +43,9 @@ TestServices\%(FileName)%(Extension) + + TestServices\%(FileName)%(Extension) + diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs index 83a05dc1abb..52a5b146126 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/LanguageServer/CSharpTestLspServerHelpers.cs @@ -6,7 +6,6 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; -using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -14,9 +13,7 @@ using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.AspNetCore.Razor.Threading; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.ExternalAccess.Razor; -using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Testing; using Microsoft.CodeAnalysis.Text; @@ -109,8 +106,7 @@ private static AdhocWorkspace CreateCSharpTestWorkspace( IRazorSpanMappingService razorSpanMappingService, bool multiTargetProject) { - var hostServices = MefHostServices.Create(exportProvider.AsCompositionContext()); - var workspace = TestWorkspace.Create(hostServices); + var workspace = TestWorkspace.CreateWithDiagnosticAnalyzers(exportProvider); // Add project and solution to workspace var projectInfoNet60 = ProjectInfo.Create( @@ -142,8 +138,6 @@ private static AdhocWorkspace CreateCSharpTestWorkspace( workspace.AddSolution(solutionInfo); - AddAnalyzersToWorkspace(workspace, exportProvider); - // Add document to workspace. We use an IVT method to create the DocumentInfo variable because there's // a special constructor in Roslyn that will help identify the document as belonging to Razor. var languageServerFactory = exportProvider.GetExportedValue(); @@ -172,30 +166,6 @@ private static AdhocWorkspace CreateCSharpTestWorkspace( return workspace; } - public static void AddAnalyzersToWorkspace(Workspace workspace, ExportProvider exportProvider) - { - var analyzerLoader = RazorTestAnalyzerLoader.CreateAnalyzerAssemblyLoader(); - - var analyzerPaths = new DirectoryInfo(AppContext.BaseDirectory).GetFiles("*.dll") - .Where(f => f.Name.StartsWith("Microsoft.CodeAnalysis.", StringComparison.Ordinal) && !f.Name.Contains("LanguageServer") && !f.Name.Contains("Test.Utilities")) - .Select(f => f.FullName) - .ToImmutableArray(); - var references = new List(); - foreach (var analyzerPath in analyzerPaths) - { - if (File.Exists(analyzerPath)) - { - references.Add(new AnalyzerFileReference(analyzerPath, analyzerLoader)); - } - } - - workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(references)); - - // Make sure Roslyn is producing diagnostics for our workspace - var razorTestAnalyzerLoader = exportProvider.GetExportedValue(); - razorTestAnalyzerLoader.InitializeDiagnosticsServices(workspace); - } - private record CSharpFile(Uri DocumentUri, SourceText CSharpSourceText); private class EmptyMappingService : IRazorSpanMappingService diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj index 89019499fa8..6683bf95cdb 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj @@ -89,10 +89,6 @@ - - - - diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/TestWorkspace.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/TestWorkspace.cs index cae18632e56..ffb3c8de509 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/TestWorkspace.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common.Tooling/Workspaces/TestWorkspace.cs @@ -2,8 +2,17 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.IO; +using System.Linq; +using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.VisualStudio.Composition; namespace Microsoft.AspNetCore.Razor.Test.Common.Workspaces; @@ -14,6 +23,17 @@ public static class TestWorkspace public static Workspace Create(Action? configure = null) => Create(services: null, configure: configure); + public static AdhocWorkspace CreateWithDiagnosticAnalyzers(ExportProvider exportProvider) + { + var hostServices = MefHostServices.Create(exportProvider.AsCompositionContext()); + + var workspace = Create(hostServices); + + AddAnalyzersToWorkspace(workspace, exportProvider); + + return workspace; + } + public static AdhocWorkspace Create(HostServices? services, Action? configure = null) { lock (s_workspaceLock) @@ -27,4 +47,28 @@ public static AdhocWorkspace Create(HostServices? services, Action f.Name.StartsWith("Microsoft.CodeAnalysis.", StringComparison.Ordinal) && !f.Name.Contains("LanguageServer") && !f.Name.Contains("Test.Utilities")) + .Select(f => f.FullName) + .ToImmutableArray(); + var references = new List(); + foreach (var analyzerPath in analyzerPaths) + { + if (File.Exists(analyzerPath)) + { + references.Add(new AnalyzerFileReference(analyzerPath, analyzerLoader)); + } + } + + workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences(references)); + + // Make sure Roslyn is producing diagnostics for our workspace + var razorTestAnalyzerLoader = exportProvider.GetExportedValue(); + razorTestAnalyzerLoader.InitializeDiagnosticsServices(workspace); + } } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs index abd502ca203..bb50863d647 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs @@ -9,11 +9,9 @@ using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Test.Common; -using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.AspNetCore.Razor.Test.Common.Mef; using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Razor.Remote; using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Remote.Razor; @@ -110,11 +108,8 @@ private async Task CreateLocalProjectAndRazorDocumentAsync(Solutio { var exportProvider = TestComposition.Roslyn.ExportProviderFactory.CreateExportProvider(); AddDisposable(exportProvider); - var hostServices = MefHostServices.Create(exportProvider.AsCompositionContext()); - var workspace = TestWorkspace.Create(hostServices); + var workspace = TestWorkspace.CreateWithDiagnosticAnalyzers(exportProvider); AddDisposable(workspace); - // Adding analyzers modifies the workspace, so important to do it before creating the first project - CSharpTestLspServerHelpers.AddAnalyzersToWorkspace(workspace, exportProvider); var razorDocument = CreateProjectAndRazorDocument(workspace, projectId, projectName, documentId, documentFilePath, contents, additionalFiles); From 120997fa7512a88b7fb32dcffb84067697062054 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Fri, 13 Sep 2024 10:27:34 +0200 Subject: [PATCH 338/386] Remove toolset compiler workaround (#10876) --- Directory.Build.props | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 69a3cd1524c..59e18288ab2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -43,12 +43,6 @@ true net472 - - - false - diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor/test/TagHelperDescriptorFactoryTagHelpers.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor/test/TagHelperDescriptorFactoryTagHelpers.cs index 325e4d4bd94..347654bd950 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor/test/TagHelperDescriptorFactoryTagHelpers.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor/test/TagHelperDescriptorFactoryTagHelpers.cs @@ -3,462 +3,470 @@ #nullable disable +namespace Microsoft.CodeAnalysis.Razor; + +internal static class TagHelperDescriptorFactoryTagHelpers +{ + public const string Code = """ using System.Collections.Generic; using System.ComponentModel; using Microsoft.AspNetCore.Razor.TagHelpers; -namespace Microsoft.CodeAnalysis.Razor.Workspaces.Test; - -public enum CustomEnum +namespace TestNamespace { - FirstValue, - SecondValue -} - -public class EnumTagHelper : TagHelper -{ - public int NonEnumProperty { get; set; } + public enum CustomEnum + { + FirstValue, + SecondValue + } - public CustomEnum EnumProperty { get; set; } -} + public class EnumTagHelper : TagHelper + { + public int NonEnumProperty { get; set; } -[HtmlTargetElement("p")] -[HtmlTargetElement("input")] -public class MultiEnumTagHelper : EnumTagHelper -{ -} + public CustomEnum EnumProperty { get; set; } + } -public class NestedEnumTagHelper : EnumTagHelper -{ - public NestedEnum NestedEnumProperty { get; set; } + [HtmlTargetElement("p")] + [HtmlTargetElement("input")] + public class MultiEnumTagHelper : EnumTagHelper + { + } - public enum NestedEnum + public class NestedEnumTagHelper : EnumTagHelper { - NestedOne, - NestedTwo + public NestedEnum NestedEnumProperty { get; set; } + + public enum NestedEnum + { + NestedOne, + NestedTwo + } } -} -[HtmlTargetElement("input", ParentTag = "div")] -public class RequiredParentTagHelper : TagHelper -{ -} + [HtmlTargetElement("input", ParentTag = "div")] + public class RequiredParentTagHelper : TagHelper + { + } -[HtmlTargetElement("p", ParentTag = "div")] -[HtmlTargetElement("input", ParentTag = "section")] -public class MultiSpecifiedRequiredParentTagHelper : TagHelper -{ -} + [HtmlTargetElement("p", ParentTag = "div")] + [HtmlTargetElement("input", ParentTag = "section")] + public class MultiSpecifiedRequiredParentTagHelper : TagHelper + { + } -[HtmlTargetElement("p")] -[HtmlTargetElement("input", ParentTag = "div")] -public class MultiWithUnspecifiedRequiredParentTagHelper : TagHelper -{ -} + [HtmlTargetElement("p")] + [HtmlTargetElement("input", ParentTag = "div")] + public class MultiWithUnspecifiedRequiredParentTagHelper : TagHelper + { + } -[RestrictChildren("p")] -public class RestrictChildrenTagHelper -{ -} + [RestrictChildren("p")] + public class RestrictChildrenTagHelper + { + } -[RestrictChildren("p", "strong")] -public class DoubleRestrictChildrenTagHelper -{ -} + [RestrictChildren("p", "strong")] + public class DoubleRestrictChildrenTagHelper + { + } -[HtmlTargetElement("p")] -[HtmlTargetElement("div")] -[RestrictChildren("p", "strong")] -public class MultiTargetRestrictChildrenTagHelper -{ -} + [HtmlTargetElement("p")] + [HtmlTargetElement("div")] + [RestrictChildren("p", "strong")] + public class MultiTargetRestrictChildrenTagHelper + { + } -[HtmlTargetElement("input", TagStructure = TagStructure.WithoutEndTag)] -public class TagStructureTagHelper : TagHelper -{ -} + [HtmlTargetElement("input", TagStructure = TagStructure.WithoutEndTag)] + public class TagStructureTagHelper : TagHelper + { + } -[HtmlTargetElement("p", TagStructure = TagStructure.NormalOrSelfClosing)] -[HtmlTargetElement("input", TagStructure = TagStructure.WithoutEndTag)] -public class MultiSpecifiedTagStructureTagHelper : TagHelper -{ -} + [HtmlTargetElement("p", TagStructure = TagStructure.NormalOrSelfClosing)] + [HtmlTargetElement("input", TagStructure = TagStructure.WithoutEndTag)] + public class MultiSpecifiedTagStructureTagHelper : TagHelper + { + } -[HtmlTargetElement("p")] -[HtmlTargetElement("input", TagStructure = TagStructure.WithoutEndTag)] -public class MultiWithUnspecifiedTagStructureTagHelper : TagHelper -{ -} + [HtmlTargetElement("p")] + [HtmlTargetElement("input", TagStructure = TagStructure.WithoutEndTag)] + public class MultiWithUnspecifiedTagStructureTagHelper : TagHelper + { + } -[EditorBrowsable(EditorBrowsableState.Always)] -public class DefaultEditorBrowsableTagHelper : TagHelper -{ [EditorBrowsable(EditorBrowsableState.Always)] - public int Property { get; set; } -} + public class DefaultEditorBrowsableTagHelper : TagHelper + { + [EditorBrowsable(EditorBrowsableState.Always)] + public int Property { get; set; } + } -public class HiddenPropertyEditorBrowsableTagHelper : TagHelper -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public int Property { get; set; } -} + public class HiddenPropertyEditorBrowsableTagHelper : TagHelper + { + [EditorBrowsable(EditorBrowsableState.Never)] + public int Property { get; set; } + } -public class MultiPropertyEditorBrowsableTagHelper : TagHelper -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public int Property { get; set; } + public class MultiPropertyEditorBrowsableTagHelper : TagHelper + { + [EditorBrowsable(EditorBrowsableState.Never)] + public int Property { get; set; } - public virtual int Property2 { get; set; } -} + public virtual int Property2 { get; set; } + } -public class OverriddenPropertyEditorBrowsableTagHelper : MultiPropertyEditorBrowsableTagHelper -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public override int Property2 { get; set; } -} + public class OverriddenPropertyEditorBrowsableTagHelper : MultiPropertyEditorBrowsableTagHelper + { + [EditorBrowsable(EditorBrowsableState.Never)] + public override int Property2 { get; set; } + } -[EditorBrowsable(EditorBrowsableState.Never)] -public class EditorBrowsableTagHelper : TagHelper -{ [EditorBrowsable(EditorBrowsableState.Never)] - public virtual int Property { get; set; } -} + public class EditorBrowsableTagHelper : TagHelper + { + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual int Property { get; set; } + } -public class InheritedEditorBrowsableTagHelper : EditorBrowsableTagHelper -{ - public override int Property { get; set; } -} + public class InheritedEditorBrowsableTagHelper : EditorBrowsableTagHelper + { + public override int Property { get; set; } + } -[EditorBrowsable(EditorBrowsableState.Advanced)] -public class OverriddenEditorBrowsableTagHelper : EditorBrowsableTagHelper -{ [EditorBrowsable(EditorBrowsableState.Advanced)] - public override int Property { get; set; } -} + public class OverriddenEditorBrowsableTagHelper : EditorBrowsableTagHelper + { + [EditorBrowsable(EditorBrowsableState.Advanced)] + public override int Property { get; set; } + } -[HtmlTargetElement("p")] -[HtmlTargetElement("div")] -[EditorBrowsable(EditorBrowsableState.Never)] -public class MultiEditorBrowsableTagHelper : TagHelper -{ -} + [HtmlTargetElement("p")] + [HtmlTargetElement("div")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class MultiEditorBrowsableTagHelper : TagHelper + { + } -[HtmlTargetElement(Attributes = "class*")] -public class AttributeWildcardTargetingTagHelper : TagHelper -{ -} + [HtmlTargetElement(Attributes = "class*")] + public class AttributeWildcardTargetingTagHelper : TagHelper + { + } -[HtmlTargetElement(Attributes = "class*,style*")] -public class MultiAttributeWildcardTargetingTagHelper : TagHelper -{ -} + [HtmlTargetElement(Attributes = "class*,style*")] + public class MultiAttributeWildcardTargetingTagHelper : TagHelper + { + } -[HtmlTargetElement(Attributes = "class")] -public class AttributeTargetingTagHelper : TagHelper -{ -} + [HtmlTargetElement(Attributes = "class")] + public class AttributeTargetingTagHelper : TagHelper + { + } -[HtmlTargetElement(Attributes = "class,style")] -public class MultiAttributeTargetingTagHelper : TagHelper -{ -} + [HtmlTargetElement(Attributes = "class,style")] + public class MultiAttributeTargetingTagHelper : TagHelper + { + } -[HtmlTargetElement(Attributes = "custom")] -[HtmlTargetElement(Attributes = "class,style")] -public class MultiAttributeAttributeTargetingTagHelper : TagHelper -{ -} + [HtmlTargetElement(Attributes = "custom")] + [HtmlTargetElement(Attributes = "class,style")] + public class MultiAttributeAttributeTargetingTagHelper : TagHelper + { + } -[HtmlTargetElement(Attributes = "style")] -public class InheritedAttributeTargetingTagHelper : AttributeTargetingTagHelper -{ -} + [HtmlTargetElement(Attributes = "style")] + public class InheritedAttributeTargetingTagHelper : AttributeTargetingTagHelper + { + } -[HtmlTargetElement("input", Attributes = "class")] -public class RequiredAttributeTagHelper : TagHelper -{ -} + [HtmlTargetElement("input", Attributes = "class")] + public class RequiredAttributeTagHelper : TagHelper + { + } -[HtmlTargetElement("div", Attributes = "class")] -public class InheritedRequiredAttributeTagHelper : RequiredAttributeTagHelper -{ -} + [HtmlTargetElement("div", Attributes = "class")] + public class InheritedRequiredAttributeTagHelper : RequiredAttributeTagHelper + { + } -[HtmlTargetElement("div", Attributes = "class")] -[HtmlTargetElement("input", Attributes = "class")] -public class MultiAttributeRequiredAttributeTagHelper : TagHelper -{ -} + [HtmlTargetElement("div", Attributes = "class")] + [HtmlTargetElement("input", Attributes = "class")] + public class MultiAttributeRequiredAttributeTagHelper : TagHelper + { + } -[HtmlTargetElement("input", Attributes = "style")] -[HtmlTargetElement("input", Attributes = "class")] -public class MultiAttributeSameTagRequiredAttributeTagHelper : TagHelper -{ -} + [HtmlTargetElement("input", Attributes = "style")] + [HtmlTargetElement("input", Attributes = "class")] + public class MultiAttributeSameTagRequiredAttributeTagHelper : TagHelper + { + } -[HtmlTargetElement("input", Attributes = "class,style")] -public class MultiRequiredAttributeTagHelper : TagHelper -{ -} + [HtmlTargetElement("input", Attributes = "class,style")] + public class MultiRequiredAttributeTagHelper : TagHelper + { + } -[HtmlTargetElement("div", Attributes = "style")] -public class InheritedMultiRequiredAttributeTagHelper : MultiRequiredAttributeTagHelper -{ -} + [HtmlTargetElement("div", Attributes = "style")] + public class InheritedMultiRequiredAttributeTagHelper : MultiRequiredAttributeTagHelper + { + } -[HtmlTargetElement("div", Attributes = "class,style")] -[HtmlTargetElement("input", Attributes = "class,style")] -public class MultiTagMultiRequiredAttributeTagHelper : TagHelper -{ -} + [HtmlTargetElement("div", Attributes = "class,style")] + [HtmlTargetElement("input", Attributes = "class,style")] + public class MultiTagMultiRequiredAttributeTagHelper : TagHelper + { + } -[HtmlTargetElement("p")] -[HtmlTargetElement("div")] -public class MultiTagTagHelper -{ - public string ValidAttribute { get; set; } -} + [HtmlTargetElement("p")] + [HtmlTargetElement("div")] + public class MultiTagTagHelper + { + public string ValidAttribute { get; set; } + } -public class InheritedMultiTagTagHelper : MultiTagTagHelper -{ -} + public class InheritedMultiTagTagHelper : MultiTagTagHelper + { + } -[HtmlTargetElement("p")] -[HtmlTargetElement("p")] -[HtmlTargetElement("div")] -[HtmlTargetElement("div")] -public class DuplicateTagNameTagHelper -{ -} + [HtmlTargetElement("p")] + [HtmlTargetElement("p")] + [HtmlTargetElement("div")] + [HtmlTargetElement("div")] + public class DuplicateTagNameTagHelper + { + } -[HtmlTargetElement("data-condition")] -public class OverrideNameTagHelper -{ -} + [HtmlTargetElement("data-condition")] + public class OverrideNameTagHelper + { + } -public class InheritedSingleAttributeTagHelper : SingleAttributeTagHelper -{ -} + public class InheritedSingleAttributeTagHelper : SingleAttributeTagHelper + { + } -public class DuplicateAttributeNameTagHelper -{ - public string MyNameIsLegion { get; set; } + public class DuplicateAttributeNameTagHelper + { + public string MyNameIsLegion { get; set; } - [HtmlAttributeName("my-name-is-legion")] - public string Fred { get; set; } -} + [HtmlAttributeName("my-name-is-legion")] + public string Fred { get; set; } + } -public class NotBoundAttributeTagHelper -{ - public object BoundProperty { get; set; } + public class NotBoundAttributeTagHelper + { + public object BoundProperty { get; set; } - [HtmlAttributeNotBound] - public string NotBoundProperty { get; set; } + [HtmlAttributeNotBound] + public string NotBoundProperty { get; set; } - [HtmlAttributeName("unused")] - [HtmlAttributeNotBound] - public string NamedNotBoundProperty { get; set; } -} + [HtmlAttributeName("unused")] + [HtmlAttributeNotBound] + public string NamedNotBoundProperty { get; set; } + } -public class OverriddenAttributeTagHelper -{ - [HtmlAttributeName("SomethingElse")] - public virtual string ValidAttribute1 { get; set; } + public class OverriddenAttributeTagHelper + { + [HtmlAttributeName("SomethingElse")] + public virtual string ValidAttribute1 { get; set; } - [HtmlAttributeName("Something-Else")] - public string ValidAttribute2 { get; set; } -} + [HtmlAttributeName("Something-Else")] + public string ValidAttribute2 { get; set; } + } -public class InheritedOverriddenAttributeTagHelper : OverriddenAttributeTagHelper -{ - public override string ValidAttribute1 { get; set; } -} + public class InheritedOverriddenAttributeTagHelper : OverriddenAttributeTagHelper + { + public override string ValidAttribute1 { get; set; } + } -public class InheritedNotOverriddenAttributeTagHelper : OverriddenAttributeTagHelper -{ -} + public class InheritedNotOverriddenAttributeTagHelper : OverriddenAttributeTagHelper + { + } -public class ALLCAPSTAGHELPER : TagHelper -{ - public int ALLCAPSATTRIBUTE { get; set; } -} + public class ALLCAPSTAGHELPER : TagHelper + { + public int ALLCAPSATTRIBUTE { get; set; } + } -public class CAPSOnOUTSIDETagHelper : TagHelper -{ - public int CAPSOnOUTSIDEATTRIBUTE { get; set; } -} + public class CAPSOnOUTSIDETagHelper : TagHelper + { + public int CAPSOnOUTSIDEATTRIBUTE { get; set; } + } -public class capsONInsideTagHelper : TagHelper -{ - public int capsONInsideattribute { get; set; } -} + public class capsONInsideTagHelper : TagHelper + { + public int capsONInsideattribute { get; set; } + } -public class One1Two2Three3TagHelper : TagHelper -{ - public int One1Two2Three3Attribute { get; set; } -} + public class One1Two2Three3TagHelper : TagHelper + { + public int One1Two2Three3Attribute { get; set; } + } -public class ONE1TWO2THREE3TagHelper : TagHelper -{ - public int ONE1TWO2THREE3Attribute { get; set; } -} + public class ONE1TWO2THREE3TagHelper : TagHelper + { + public int ONE1TWO2THREE3Attribute { get; set; } + } -public class First_Second_ThirdHiTagHelper : TagHelper -{ - public int First_Second_ThirdAttribute { get; set; } -} + public class First_Second_ThirdHiTagHelper : TagHelper + { + public int First_Second_ThirdAttribute { get; set; } + } -public class UNSuffixedCLASS : TagHelper -{ - public int UNSuffixedATTRIBUTE { get; set; } -} + public class UNSuffixedCLASS : TagHelper + { + public int UNSuffixedATTRIBUTE { get; set; } + } -public class InvalidBoundAttribute : TagHelper -{ - public string DataSomething { get; set; } -} + public class InvalidBoundAttribute : TagHelper + { + public string DataSomething { get; set; } + } -public class InvalidBoundAttributeWithValid : SingleAttributeTagHelper -{ - public string DataSomething { get; set; } -} + public class InvalidBoundAttributeWithValid : SingleAttributeTagHelper + { + public string DataSomething { get; set; } + } -public class OverriddenInvalidBoundAttributeWithValid : TagHelper -{ - [HtmlAttributeName("valid-something")] - public string DataSomething { get; set; } -} + public class OverriddenInvalidBoundAttributeWithValid : TagHelper + { + [HtmlAttributeName("valid-something")] + public string DataSomething { get; set; } + } -public class OverriddenValidBoundAttributeWithInvalid : TagHelper -{ - [HtmlAttributeName("data-something")] - public string ValidSomething { get; set; } -} + public class OverriddenValidBoundAttributeWithInvalid : TagHelper + { + [HtmlAttributeName("data-something")] + public string ValidSomething { get; set; } + } -public class OverriddenValidBoundAttributeWithInvalidUpperCase : TagHelper -{ - [HtmlAttributeName("DATA-SOMETHING")] - public string ValidSomething { get; set; } -} + public class OverriddenValidBoundAttributeWithInvalidUpperCase : TagHelper + { + [HtmlAttributeName("DATA-SOMETHING")] + public string ValidSomething { get; set; } + } -public class DefaultValidHtmlAttributePrefix : TagHelper -{ - public IDictionary DictionaryProperty { get; set; } -} + public class DefaultValidHtmlAttributePrefix : TagHelper + { + public IDictionary DictionaryProperty { get; set; } + } -public class SingleValidHtmlAttributePrefix : TagHelper -{ - [HtmlAttributeName("valid-name")] - public IDictionary DictionaryProperty { get; set; } -} + public class SingleValidHtmlAttributePrefix : TagHelper + { + [HtmlAttributeName("valid-name")] + public IDictionary DictionaryProperty { get; set; } + } -public class MultipleValidHtmlAttributePrefix : TagHelper -{ - [HtmlAttributeName("valid-name1", DictionaryAttributePrefix = "valid-prefix1-")] - public Dictionary DictionaryProperty { get; set; } + public class MultipleValidHtmlAttributePrefix : TagHelper + { + [HtmlAttributeName("valid-name1", DictionaryAttributePrefix = "valid-prefix1-")] + public Dictionary DictionaryProperty { get; set; } - [HtmlAttributeName("valid-name2", DictionaryAttributePrefix = "valid-prefix2-")] - public DictionarySubclass DictionarySubclassProperty { get; set; } + [HtmlAttributeName("valid-name2", DictionaryAttributePrefix = "valid-prefix2-")] + public DictionarySubclass DictionarySubclassProperty { get; set; } - [HtmlAttributeName("valid-name3", DictionaryAttributePrefix = "valid-prefix3-")] - public DictionaryWithoutParameterlessConstructor DictionaryWithoutParameterlessConstructorProperty { get; set; } + [HtmlAttributeName("valid-name3", DictionaryAttributePrefix = "valid-prefix3-")] + public DictionaryWithoutParameterlessConstructor DictionaryWithoutParameterlessConstructorProperty { get; set; } - [HtmlAttributeName("valid-name4", DictionaryAttributePrefix = "valid-prefix4-")] - public GenericDictionarySubclass GenericDictionarySubclassProperty { get; set; } + [HtmlAttributeName("valid-name4", DictionaryAttributePrefix = "valid-prefix4-")] + public GenericDictionarySubclass GenericDictionarySubclassProperty { get; set; } - [HtmlAttributeName("valid-name5", DictionaryAttributePrefix = "valid-prefix5-")] - public SortedDictionary SortedDictionaryProperty { get; set; } + [HtmlAttributeName("valid-name5", DictionaryAttributePrefix = "valid-prefix5-")] + public SortedDictionary SortedDictionaryProperty { get; set; } - [HtmlAttributeName("valid-name6")] - public string StringProperty { get; set; } + [HtmlAttributeName("valid-name6")] + public string StringProperty { get; set; } - public IDictionary GetOnlyDictionaryProperty { get; } + public IDictionary GetOnlyDictionaryProperty { get; } - [HtmlAttributeName(DictionaryAttributePrefix = "valid-prefix6")] - public IDictionary GetOnlyDictionaryPropertyWithAttributePrefix { get; } -} + [HtmlAttributeName(DictionaryAttributePrefix = "valid-prefix6")] + public IDictionary GetOnlyDictionaryPropertyWithAttributePrefix { get; } + } -public class SingleInvalidHtmlAttributePrefix : TagHelper -{ - [HtmlAttributeName("valid-name", DictionaryAttributePrefix = "valid-prefix")] - public string StringProperty { get; set; } -} + public class SingleInvalidHtmlAttributePrefix : TagHelper + { + [HtmlAttributeName("valid-name", DictionaryAttributePrefix = "valid-prefix")] + public string StringProperty { get; set; } + } -public class MultipleInvalidHtmlAttributePrefix : TagHelper -{ - [HtmlAttributeName("valid-name1")] - public long LongProperty { get; set; } + public class MultipleInvalidHtmlAttributePrefix : TagHelper + { + [HtmlAttributeName("valid-name1")] + public long LongProperty { get; set; } - [HtmlAttributeName("valid-name2", DictionaryAttributePrefix = "valid-prefix2-")] - public Dictionary DictionaryOfIntProperty { get; set; } + [HtmlAttributeName("valid-name2", DictionaryAttributePrefix = "valid-prefix2-")] + public Dictionary DictionaryOfIntProperty { get; set; } - [HtmlAttributeName("valid-name3", DictionaryAttributePrefix = "valid-prefix3-")] - public IReadOnlyDictionary ReadOnlyDictionaryProperty { get; set; } + [HtmlAttributeName("valid-name3", DictionaryAttributePrefix = "valid-prefix3-")] + public IReadOnlyDictionary ReadOnlyDictionaryProperty { get; set; } - [HtmlAttributeName("valid-name4", DictionaryAttributePrefix = "valid-prefix4-")] - public int IntProperty { get; set; } + [HtmlAttributeName("valid-name4", DictionaryAttributePrefix = "valid-prefix4-")] + public int IntProperty { get; set; } - [HtmlAttributeName("valid-name5", DictionaryAttributePrefix = "valid-prefix5-")] - public DictionaryOfIntSubclass DictionaryOfIntSubclassProperty { get; set; } + [HtmlAttributeName("valid-name5", DictionaryAttributePrefix = "valid-prefix5-")] + public DictionaryOfIntSubclass DictionaryOfIntSubclassProperty { get; set; } - [HtmlAttributeName(DictionaryAttributePrefix = "valid-prefix6")] - public IDictionary GetOnlyDictionaryAttributePrefix { get; } + [HtmlAttributeName(DictionaryAttributePrefix = "valid-prefix6")] + public IDictionary GetOnlyDictionaryAttributePrefix { get; } - [HtmlAttributeName("invalid-name7")] - public IDictionary GetOnlyDictionaryPropertyWithAttributeName { get; } -} + [HtmlAttributeName("invalid-name7")] + public IDictionary GetOnlyDictionaryPropertyWithAttributeName { get; } + } -public class DictionarySubclass : Dictionary -{ -} + public class DictionarySubclass : Dictionary + { + } -public class DictionaryWithoutParameterlessConstructor : Dictionary -{ - public DictionaryWithoutParameterlessConstructor(int count) - : base() + public class DictionaryWithoutParameterlessConstructor : Dictionary { + public DictionaryWithoutParameterlessConstructor(int count) + : base() + { + } } -} -public class DictionaryOfIntSubclass : Dictionary -{ -} + public class DictionaryOfIntSubclass : Dictionary + { + } -public class GenericDictionarySubclass : Dictionary -{ -} + public class GenericDictionarySubclass : Dictionary + { + } -[OutputElementHint("strong")] -public class OutputElementHintTagHelper : TagHelper -{ -} + [OutputElementHint("strong")] + public class OutputElementHintTagHelper : TagHelper + { + } -[HtmlTargetElement("a")] -[HtmlTargetElement("p")] -[OutputElementHint("div")] -public class MultipleDescriptorTagHelperWithOutputElementHint : TagHelper -{ -} + [HtmlTargetElement("a")] + [HtmlTargetElement("p")] + [OutputElementHint("div")] + public class MultipleDescriptorTagHelperWithOutputElementHint : TagHelper + { + } -public class NonPublicAccessorTagHelper : TagHelper -{ - public string ValidAttribute { get; set; } - public string InvalidPrivateSetAttribute { get; private set; } - public string InvalidPrivateGetAttribute { private get; set; } - protected string InvalidProtectedAttribute { get; set; } - internal string InvalidInternalAttribute { get; set; } - protected internal string InvalidProtectedInternalAttribute { get; set; } -} + public class NonPublicAccessorTagHelper : TagHelper + { + public string ValidAttribute { get; set; } + public string InvalidPrivateSetAttribute { get; private set; } + public string InvalidPrivateGetAttribute { private get; set; } + protected string InvalidProtectedAttribute { get; set; } + internal string InvalidInternalAttribute { get; set; } + protected internal string InvalidProtectedInternalAttribute { get; set; } + } -public class SingleAttributeTagHelper : TagHelper -{ - public int IntAttribute { get; set; } -} + public class SingleAttributeTagHelper : TagHelper + { + public int IntAttribute { get; set; } + } -public class MissingAccessorTagHelper : TagHelper -{ - public string ValidAttribute { get; set; } - public string InvalidNoGetAttribute { set { } } - public string InvalidNoSetAttribute { get { return string.Empty; } } + public class MissingAccessorTagHelper : TagHelper + { + public string ValidAttribute { get; set; } + public string InvalidNoGetAttribute { set { } } + public string InvalidNoSetAttribute { get { return string.Empty; } } + } +} +"""; } diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor/test/TagHelperTypeVisitorTest.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor/test/TagHelperTypeVisitorTest.cs index 2f9eb46f588..b02afeda409 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor/test/TagHelperTypeVisitorTest.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor/test/TagHelperTypeVisitorTest.cs @@ -4,26 +4,28 @@ #nullable disable using System.Collections.Generic; -using System.Reflection; -using Microsoft.AspNetCore.Razor.TagHelpers; using Xunit; namespace Microsoft.CodeAnalysis.Razor.Workspaces; -public class TagHelperTypeVisitorTest +public class TagHelperTypeVisitorTest : TagHelperDescriptorProviderTestBase { - private static readonly Assembly _assembly = typeof(TagHelperTypeVisitorTest).GetTypeInfo().Assembly; + public TagHelperTypeVisitorTest() : base(AdditionalCode) + { + Compilation = BaseCompilation; + ITagHelperSymbol = Compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper); + } - private static Compilation Compilation { get; } = TestCompilation.Create(_assembly); + private Compilation Compilation { get; } - private static INamedTypeSymbol ITagHelperSymbol { get; } = Compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper); + private INamedTypeSymbol ITagHelperSymbol { get; } [Fact] public void IsTagHelper_PlainTagHelper_ReturnsTrue() { // Arrange var testVisitor = new TagHelperTypeVisitor(ITagHelperSymbol, new List()); - var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Valid_PlainTagHelper).FullName); + var tagHelperSymbol = Compilation.GetTypeByMetadataName("TestNamespace.Valid_PlainTagHelper"); // Act var isTagHelper = testVisitor.IsTagHelper(tagHelperSymbol); @@ -37,7 +39,7 @@ public void IsTagHelper_InheritedTagHelper_ReturnsTrue() { // Arrange var testVisitor = new TagHelperTypeVisitor(ITagHelperSymbol, new List()); - var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Valid_InheritedTagHelper).FullName); + var tagHelperSymbol = Compilation.GetTypeByMetadataName("TestNamespace.Valid_InheritedTagHelper"); // Act var isTagHelper = testVisitor.IsTagHelper(tagHelperSymbol); @@ -51,7 +53,7 @@ public void IsTagHelper_AbstractTagHelper_ReturnsFalse() { // Arrange var testVisitor = new TagHelperTypeVisitor(ITagHelperSymbol, new List()); - var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Invalid_AbstractTagHelper).FullName); + var tagHelperSymbol = Compilation.GetTypeByMetadataName("TestNamespace.Invalid_AbstractTagHelper"); // Act var isTagHelper = testVisitor.IsTagHelper(tagHelperSymbol); @@ -65,7 +67,7 @@ public void IsTagHelper_GenericTagHelper_ReturnsFalse() { // Arrange var testVisitor = new TagHelperTypeVisitor(ITagHelperSymbol, new List()); - var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Invalid_GenericTagHelper<>).FullName); + var tagHelperSymbol = Compilation.GetTypeByMetadataName("TestNamespace.Invalid_GenericTagHelper`1"); // Act var isTagHelper = testVisitor.IsTagHelper(tagHelperSymbol); @@ -79,7 +81,7 @@ public void IsTagHelper_InternalTagHelper_ReturnsFalse() { // Arrange var testVisitor = new TagHelperTypeVisitor(ITagHelperSymbol, new List()); - var tagHelperSymbol = Compilation.GetTypeByMetadataName(typeof(Invalid_InternalTagHelper).FullName); + var tagHelperSymbol = Compilation.GetTypeByMetadataName("TestNamespace.Invalid_InternalTagHelper"); // Act var isTagHelper = testVisitor.IsTagHelper(tagHelperSymbol); @@ -88,32 +90,40 @@ public void IsTagHelper_InternalTagHelper_ReturnsFalse() Assert.False(isTagHelper); } - public class Invalid_NestedPublicTagHelper : TagHelper - { - } - - public class Valid_NestedPublicViewComponent - { - public string Invoke(string foo) => null; - } -} - -public abstract class Invalid_AbstractTagHelper : TagHelper -{ -} - -public class Invalid_GenericTagHelper : TagHelper -{ -} - -internal class Invalid_InternalTagHelper : TagHelper -{ -} - -public class Valid_PlainTagHelper : TagHelper -{ -} - -public class Valid_InheritedTagHelper : Valid_PlainTagHelper -{ + private const string AdditionalCode = + """ + using Microsoft.AspNetCore.Razor.TagHelpers; + + namespace TestNamespace + { + public class Invalid_NestedPublicTagHelper : TagHelper + { + } + + public class Valid_NestedPublicViewComponent + { + public string Invoke(string foo) => null; + } + + public abstract class Invalid_AbstractTagHelper : TagHelper + { + } + + public class Invalid_GenericTagHelper : TagHelper + { + } + + internal class Invalid_InternalTagHelper : TagHelper + { + } + + public class Valid_PlainTagHelper : TagHelper + { + } + + public class Valid_InheritedTagHelper : Valid_PlainTagHelper + { + } + } + """; } diff --git a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Microsoft.CodeAnalysis.Razor.Workspaces.Test.csproj b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Microsoft.CodeAnalysis.Razor.Workspaces.Test.csproj index e8a6418c986..232456c3724 100644 --- a/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Microsoft.CodeAnalysis.Razor.Workspaces.Test.csproj +++ b/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/Microsoft.CodeAnalysis.Razor.Workspaces.Test.csproj @@ -13,7 +13,6 @@ - diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/ReferenceUtil.cs b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/ReferenceUtil.cs index c1329b54189..4e7429e9dbf 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/ReferenceUtil.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/ReferenceUtil.cs @@ -12,5 +12,7 @@ internal static class ReferenceUtil { public static ImmutableArray AspNetLatestAll { get; } = AspNetLatest.References.All; public static PortableExecutableReference AspNetLatestComponents { get; } = AspNetLatest.References.MicrosoftAspNetCoreComponents; + public static PortableExecutableReference AspNetLatestRazor { get; } = AspNetLatest.References.MicrosoftAspNetCoreRazor; public static ImmutableArray NetLatestAll { get; } = NetLatest.References.All; + public static PortableExecutableReference NetLatestSystemRuntime { get; } = NetLatest.References.SystemRuntime; } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/TestCompilation.cs b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/TestCompilation.cs index 137ad28eb93..f150526bc8a 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/TestCompilation.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/TestCompilation.cs @@ -9,6 +9,7 @@ using System.IO; using System.Linq; using System.Reflection; +using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Extensions.DependencyModel; using Xunit; @@ -58,6 +59,8 @@ private static IEnumerable ResolvePaths(CompilationLibrary library) public static string AssemblyName => "TestAssembly"; + // When we use Basic.Reference.Assemblies everywhere, this overload should be removed. + // Tracked by https://github.com/dotnet/razor/issues/10343. public static CSharpCompilation Create(Assembly assembly, SyntaxTree syntaxTree = null) { IEnumerable syntaxTrees = null; @@ -80,6 +83,19 @@ public static CSharpCompilation Create(Assembly assembly, SyntaxTree syntaxTree return compilation; } + public static CSharpCompilation Create(IEnumerable syntaxTrees, IEnumerable references) + { + var compilation = CSharpCompilation.Create( + AssemblyName, + syntaxTrees, + [..references, ..ReferenceUtil.AspNetLatestAll], + new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + + EnsureValidCompilation(compilation); + + return compilation; + } + private static void EnsureValidCompilation(CSharpCompilation compilation) { using (var stream = new MemoryStream()) From ca91065e454fadd031eb7eb74f4a5ffc5e8953cc Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 13 Sep 2024 10:32:10 -0700 Subject: [PATCH 340/386] Switch to new VMR control schema. (#10883) Now that razor is on .NET 9 arcade, it can switch over to the new control schema. For this repo, this is roughly: - DotNetBuildFromSource -> DotNetBuildSourceOnly - Building a source-only build. - DotnetBuildFromSourceFlavor == Product -> DotNetBuildOrchestrator == true - Building in the VMR, could be source-only or MS's build. - ArcadeBuildFromSource -> DotNetBuildRepo == true -> Indicates an outer repo build. --- Directory.Build.props | 6 +++--- eng/AfterSigning.targets | 4 ++-- eng/Publishing.props | 2 +- eng/configure-toolset.sh | 2 +- eng/scripts/ci-source-build.sh | 2 +- src/Compiler/Directory.Build.props | 2 +- src/Compiler/Directory.Packages.props | 2 +- src/Shared/Directory.Build.props | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 59e18288ab2..04449588c74 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -24,7 +24,7 @@ true true $(MSBuildThisFileDirectory) - true + true true true @@ -55,7 +55,7 @@ necessary as the output of this leg is used in other CI source build legs. Those could be targeting NetCurrent or NetPrevious hence we must produce both. --> - + $(NetCurrent) $(DefaultNetCoreTargetFramework);$(NetPrevious) @@ -65,7 +65,7 @@ - + $(NetCurrent) $(DefaultNetCoreTargetFramework) diff --git a/eng/AfterSigning.targets b/eng/AfterSigning.targets index e334d9498ec..68095f7bcf0 100644 --- a/eng/AfterSigning.targets +++ b/eng/AfterSigning.targets @@ -1,6 +1,6 @@  - + $(ArtifactsDir)VSSetup\ Microsoft.VisualStudio.RazorExtension.vsix @@ -27,7 +27,7 @@ AfterTargets="GenerateVisualStudioInsertionManifests" Inputs="$(_RazorAssemblyVersion)" Outputs="$(_DependentAssemblyVersionsFile)" - Condition="'$(OS)'=='WINDOWS_NT' AND '$(ArcadeBuildFromSource)' != 'true'"> + Condition="'$(OS)'=='WINDOWS_NT' AND '$(DotNetBuildSourceOnly)' != 'true'"> <_AssemblyVersionEntry Include="RazorRuntimeAssembly" /> <_AssemblyVersionEntry Include="RazorToolingAssembly" /> diff --git a/eng/Publishing.props b/eng/Publishing.props index 3df1479c419..9344f044ddc 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -27,7 +27,7 @@ - + false diff --git a/eng/configure-toolset.sh b/eng/configure-toolset.sh index ea92acd6a37..d2960729c45 100644 --- a/eng/configure-toolset.sh +++ b/eng/configure-toolset.sh @@ -2,6 +2,6 @@ # We could potentially try to find an existing installation that has all the required runtimes, # but it's unlikely one will be available. -if [ "${DotNetBuildFromSource:-false}" = false ]; then +if [ "${DotNetBuildSourceOnly:-false}" = false ]; then use_installed_dotnet_cli="false" fi diff --git a/eng/scripts/ci-source-build.sh b/eng/scripts/ci-source-build.sh index e5a239038f2..ab089ab3804 100755 --- a/eng/scripts/ci-source-build.sh +++ b/eng/scripts/ci-source-build.sh @@ -9,7 +9,7 @@ set -euo pipefail scriptroot="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" reporoot="$(dirname "$(dirname "$scriptroot")")" -export DotNetBuildFromSource='true' +export DotNetBuildSourceOnly='true' # Build repo tasks "$reporoot/eng/common/build.sh" --restore --build --ci --configuration Release /p:ProjectToBuild=$reporoot/eng/tools/RepoTasks/RepoTasks.csproj "$@" diff --git a/src/Compiler/Directory.Build.props b/src/Compiler/Directory.Build.props index 763964e802d..a88dd817d68 100644 --- a/src/Compiler/Directory.Build.props +++ b/src/Compiler/Directory.Build.props @@ -37,7 +37,7 @@ $(WarningsNotAsErrors);xUnit1004 - + diff --git a/src/Compiler/Directory.Packages.props b/src/Compiler/Directory.Packages.props index 7154276a074..d451245fac9 100644 --- a/src/Compiler/Directory.Packages.props +++ b/src/Compiler/Directory.Packages.props @@ -1,7 +1,7 @@  <_RoslynPackageVersion>4.9.2 - <_RoslynPackageVersion Condition="'$(DotNetBuildFromSource)' == 'true'">$(MicrosoftCodeAnalysisCommonPackageVersion) + <_RoslynPackageVersion Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(MicrosoftCodeAnalysisCommonPackageVersion) diff --git a/src/Shared/Directory.Build.props b/src/Shared/Directory.Build.props index 22e7f16332f..e269e4a7fe1 100644 --- a/src/Shared/Directory.Build.props +++ b/src/Shared/Directory.Build.props @@ -14,7 +14,7 @@ LatestMajor - + From 5a6fde922b194e3b136c37310db5237002eaa5da Mon Sep 17 00:00:00 2001 From: David Wengier Date: Sat, 14 Sep 2024 17:05:15 +1000 Subject: [PATCH 341/386] Disable test parallelisation in language services, because it uses ExportProviderFactory which has static state --- .../Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj index 266d9132319..7a7dbddfdb0 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Microsoft.VisualStudio.LanguageServices.Razor.Test.csproj @@ -30,4 +30,8 @@ + + + + From bc0e2afe46c55eae20b0760ea4e013bb99c2c8e0 Mon Sep 17 00:00:00 2001 From: Alex Gavrilov Date: Sun, 15 Sep 2024 20:05:47 -0700 Subject: [PATCH 342/386] Fixing WrapWithDiv bug (#10871) * Fixing WrapWithDive bug https://github.com/dotnet/razor/issues/10819 * Adding and fixing tests 1. All existing tests were calling Verify on client connection without marking setup Verifyable, so it was a no-op (did nothing) 2. Two tests were erroneously verifying the opposite of what they should've - they were trying to verify that we made a delegated server call when we shouldn't have made one. I made sure all setups are marked verifyable, and that we verify that calls weren't made when they shouldn't have been made. --- .../WrapWithTag/WrapWithTagEndpoint.cs | 13 +++++++ .../WrapWithTag/WrapWithTagEndpointTests.cs | 38 ++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs index 0923e486b01..67359999a29 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/WrapWithTag/WrapWithTagEndpoint.cs @@ -63,6 +63,19 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(WrapWithTagParams reques // Instead of C#, which certainly would be expected to go in an if statement, we'll see HTML, which obviously // is the better choice for this operation. var languageKind = codeDocument.GetLanguageKind(hostDocumentIndex, rightAssociative: true); + + // However, reverse scenario is possible as well, when we have + //
+ // |@if (true) {} + //

+ //
+ // in which case right-associative GetLanguageKind will return Razor and left-associative will return HTML + // We should hand that case as well, see https://github.com/dotnet/razor/issues/10819 + if (languageKind is RazorLanguageKind.Razor) + { + languageKind = codeDocument.GetLanguageKind(hostDocumentIndex, rightAssociative: false); + } + if (languageKind is not RazorLanguageKind.Html) { // In general, we don't support C# for obvious reasons, but we can support implicit expressions. ie diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs index cb174425556..53072c32790 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/WrapWithTag/WrapWithTagEndpointTests.cs @@ -68,7 +68,7 @@ public async Task Handle_CSharp_ReturnsNull() var wrapWithDivParams = new WrapWithTagParams(new() { Uri = uri }) { - Range = VsLspFactory.CreateSingleLineRange(start: (0, 0), length: 2), + Range = VsLspFactory.CreateSingleLineRange(start: (0, 1), length: 2), }; var requestContext = CreateRazorRequestContext(documentContext); @@ -112,6 +112,42 @@ public async Task Handle_CSharp_WholeImplicitStatement_ReturnsResult() Mock.Get(clientConnection).Verify(); } + [Fact] + public async Task Handle_RazorBlockStart_ReturnsResult() + { + // Arrange + var input = new TestCode(""" + [|@if (true) { } +
+
|] + """); + var codeDocument = CreateCodeDocument(input.Text); + var uri = new Uri("file://path/test.razor"); + var documentContext = CreateDocumentContext(uri, codeDocument); + var response = new WrapWithTagResponse(); + + var clientConnection = TestMocks.CreateClientConnection(builder => + { + builder.SetupSendRequest(LanguageServerConstants.RazorWrapWithTagEndpoint, response: new(), verifiable: true); + }); + + var endpoint = new WrapWithTagEndpoint(clientConnection, LoggerFactory); + + var range = codeDocument.Source.Text.GetRange(input.Span); + var wrapWithDivParams = new WrapWithTagParams(new TextDocumentIdentifier { Uri = uri }) + { + Range = range + }; + var requestContext = CreateRazorRequestContext(documentContext); + + // Act + var result = await endpoint.HandleRequestAsync(wrapWithDivParams, requestContext, DisposalToken); + + // Assert + Assert.NotNull(result); + Mock.Get(clientConnection).Verify(); + } + [Fact] public async Task Handle_CSharp_PartOfImplicitStatement_ReturnsNull() { From 4207fcf417978c9b5c38bac8c9e00e721a309ee8 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 16 Sep 2024 14:28:12 +1000 Subject: [PATCH 343/386] Remove unused parameter --- .../AdhocWorkspaceFactory.cs | 8 +++----- .../IAdhocWorkspaceFactory.cs | 4 +--- .../RemoteAdhocWorkspaceFactory.cs | 7 ++----- .../TestAdhocWorkspaceFactory.cs | 6 ++---- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AdhocWorkspaceFactory.cs index b279b5959db..1050e6ca971 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AdhocWorkspaceFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AdhocWorkspaceFactory.cs @@ -11,14 +11,12 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; internal sealed class AdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : IAdhocWorkspaceFactory { - public AdhocWorkspace Create(params IWorkspaceService[] workspaceServices) + public AdhocWorkspace Create() { - workspaceServices ??= []; - var fallbackServices = hostServicesProvider.GetServices(); var services = AdhocServices.Create( - workspaceServices: workspaceServices.ToImmutableArray(), - languageServices: ImmutableArray.Empty, + workspaceServices: [], + languageServices: [], fallbackServices); return new AdhocWorkspace(services); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IAdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IAdhocWorkspaceFactory.cs index d84d3f46073..26ae985f46b 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IAdhocWorkspaceFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IAdhocWorkspaceFactory.cs @@ -1,11 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using Microsoft.CodeAnalysis.Host; - namespace Microsoft.CodeAnalysis.Razor.Workspaces; internal interface IAdhocWorkspaceFactory { - AdhocWorkspace Create(params IWorkspaceService[] workspaceServices); + AdhocWorkspace Create(); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs index 9abf7da6394..4b76a4153f3 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs @@ -1,9 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Collections.Immutable; using System.Composition; -using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Razor.Workspaces; namespace Microsoft.CodeAnalysis.Remote.Razor; @@ -11,13 +9,12 @@ namespace Microsoft.CodeAnalysis.Remote.Razor; [Export(typeof(IAdhocWorkspaceFactory)), Shared] internal sealed class RemoteAdhocWorkspaceFactory() : IAdhocWorkspaceFactory { - public AdhocWorkspace Create(params IWorkspaceService[] workspaceServices) + public AdhocWorkspace Create() { - workspaceServices ??= []; var hostServices = RemoteWorkspaceAccessor.GetWorkspace().Services.HostServices; var services = AdhocServices.Create( - workspaceServices: workspaceServices.ToImmutableArray(), + workspaceServices: [], languageServices: [], fallbackServices: hostServices); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestAdhocWorkspaceFactory.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestAdhocWorkspaceFactory.cs index 6011f4a4982..8918b3cc933 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestAdhocWorkspaceFactory.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestAdhocWorkspaceFactory.cs @@ -1,10 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Linq; using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Razor.Workspaces; namespace Microsoft.AspNetCore.Razor.LanguageServer.Test; @@ -17,9 +15,9 @@ private TestAdhocWorkspaceFactory() { } - public AdhocWorkspace Create(params IWorkspaceService[] workspaceServices) + public AdhocWorkspace Create() { - var services = TestServices.Create(workspaceServices, Enumerable.Empty()); + var services = TestServices.Create(workspaceServices: [], razorLanguageServices: []); var workspace = TestWorkspace.Create(services); return workspace; } From c1f8fd5d6bf576c70bd44e6783b4ede482fb16bd Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 16 Sep 2024 14:37:08 +1000 Subject: [PATCH 344/386] Move code down, and share the factory code --- .../DefaultHostServicesProvider.cs | 1 + .../AdhocWorkspaceFactory.cs | 10 ++-------- .../IHostServicesProvider.cs | 2 +- .../RemoteAdhocWorkspaceFactory.cs | 13 +------------ .../RemoteHostServicesProvider.cs | 17 +++++++++++++++++ 5 files changed, 22 insertions(+), 21 deletions(-) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer => Microsoft.CodeAnalysis.Razor.Workspaces}/AdhocWorkspaceFactory.cs (55%) rename src/Razor/src/{Microsoft.AspNetCore.Razor.LanguageServer/Hosting => Microsoft.CodeAnalysis.Razor.Workspaces}/IHostServicesProvider.cs (81%) create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteHostServicesProvider.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultHostServicesProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultHostServicesProvider.cs index 355e9afe62b..95642353d8e 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultHostServicesProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultHostServicesProvider.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Razor.Workspaces; namespace Microsoft.AspNetCore.Razor.LanguageServer; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs similarity index 55% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AdhocWorkspaceFactory.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs index 1050e6ca971..b6e30fb47fb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AdhocWorkspaceFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs @@ -1,15 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. -using System.Collections.Immutable; -using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Host; -using Microsoft.CodeAnalysis.Razor.Workspaces; +namespace Microsoft.CodeAnalysis.Razor.Workspaces; -namespace Microsoft.AspNetCore.Razor.LanguageServer; - -internal sealed class AdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : IAdhocWorkspaceFactory +internal class AdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : IAdhocWorkspaceFactory { public AdhocWorkspace Create() { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/IHostServicesProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IHostServicesProvider.cs similarity index 81% rename from src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/IHostServicesProvider.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IHostServicesProvider.cs index ed7b2c2a24b..87860a9fd33 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hosting/IHostServicesProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IHostServicesProvider.cs @@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.Host; -namespace Microsoft.AspNetCore.Razor.LanguageServer.Hosting; +namespace Microsoft.CodeAnalysis.Razor.Workspaces; internal interface IHostServicesProvider { diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs index 4b76a4153f3..621f0b91496 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs @@ -7,17 +7,6 @@ namespace Microsoft.CodeAnalysis.Remote.Razor; [Export(typeof(IAdhocWorkspaceFactory)), Shared] -internal sealed class RemoteAdhocWorkspaceFactory() : IAdhocWorkspaceFactory +internal sealed class RemoteAdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : AdhocWorkspaceFactory(hostServicesProvider) { - public AdhocWorkspace Create() - { - var hostServices = RemoteWorkspaceAccessor.GetWorkspace().Services.HostServices; - - var services = AdhocServices.Create( - workspaceServices: [], - languageServices: [], - fallbackServices: hostServices); - - return new AdhocWorkspace(services); - } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteHostServicesProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteHostServicesProvider.cs new file mode 100644 index 00000000000..f490a128a76 --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteHostServicesProvider.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System.Composition; +using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Razor.Workspaces; + +namespace Microsoft.CodeAnalysis.Remote.Razor; + +[Export(typeof(IHostServicesProvider)), Shared] +internal sealed class RemoteHostServicesProvider() : IHostServicesProvider +{ + public HostServices GetServices() + { + return RemoteWorkspaceAccessor.GetWorkspace().Services.HostServices; + } +} From c12873008149cb869d16b7ee7f92eb47179beda4 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 16 Sep 2024 15:00:12 +1000 Subject: [PATCH 345/386] Remove AdhocWorkspaceFactory from DI, and make it fully own the workspace it creates --- .../InlineCompletionEndPoint.cs | 13 +++++----- .../LspWorkspaceProvider.cs | 9 ++++--- .../RazorLanguageServer.cs | 1 - .../AdhocWorkspaceFactory.cs | 21 ++++++++++++++-- .../Formatting/FormattingContext.cs | 22 +++++------------ .../Formatting/RazorFormattingService.cs | 18 +++++++------- .../IAdhocWorkspaceFactory.cs | 9 ------- .../RemoteRazorFormattingService.cs | 4 ++-- .../RemoteAdhocWorkspaceFactory.cs | 12 ---------- .../FormattingContentValidationPassTest.cs | 10 ++++---- .../FormattingDiagnosticValidationPassTest.cs | 9 +++---- .../TestRazorFormattingService.cs | 4 ++-- .../TestAdhocWorkspaceFactory.cs | 24 ------------------- 13 files changed, 60 insertions(+), 96 deletions(-) delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IAdhocWorkspaceFactory.cs delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestAdhocWorkspaceFactory.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs index 671a119fa53..322158c4b0a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs @@ -29,7 +29,7 @@ internal sealed class InlineCompletionEndpoint( IDocumentMappingService documentMappingService, IClientConnection clientConnection, IFormattingCodeDocumentProvider formattingCodeDocumentProvider, - IAdhocWorkspaceFactory adhocWorkspaceFactory, + IHostServicesProvider hostServicesProvider, RazorLSPOptionsMonitor optionsMonitor, ILoggerFactory loggerFactory) : IRazorRequestHandler, ICapabilitiesProvider @@ -39,10 +39,10 @@ internal sealed class InlineCompletionEndpoint( "if", "indexer", "interface", "invoke", "iterator", "iterindex", "lock", "mbox", "namespace", "#if", "#region", "prop", "propfull", "propg", "sim", "struct", "svm", "switch", "try", "tryf", "unchecked", "unsafe", "using", "while"); - private readonly IDocumentMappingService _documentMappingService = documentMappingService ?? throw new ArgumentNullException(nameof(documentMappingService)); - private readonly IClientConnection _clientConnection = clientConnection ?? throw new ArgumentNullException(nameof(clientConnection)); + private readonly IDocumentMappingService _documentMappingService = documentMappingService; + private readonly IClientConnection _clientConnection = clientConnection; private readonly IFormattingCodeDocumentProvider _formattingCodeDocumentProvider = formattingCodeDocumentProvider; - private readonly IAdhocWorkspaceFactory _adhocWorkspaceFactory = adhocWorkspaceFactory ?? throw new ArgumentNullException(nameof(adhocWorkspaceFactory)); + private readonly IHostServicesProvider _hostServicesProvider = hostServicesProvider; private readonly RazorLSPOptionsMonitor _optionsMonitor = optionsMonitor; private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); @@ -128,13 +128,14 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalInlineCompleti } var options = RazorFormattingOptions.From(request.Options, _optionsMonitor.CurrentValue.CodeBlockBraceOnNextLine); - using var formattingContext = FormattingContext.Create( + using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(_hostServicesProvider); + var formattingContext = FormattingContext.Create( request.TextDocument.Uri, documentContext.Snapshot, codeDocument, options, _formattingCodeDocumentProvider, - _adhocWorkspaceFactory); + adhocWorkspaceFactory); if (!TryGetSnippetWithAdjustedIndentation(formattingContext, item.Text, hostDocumentIndex, out var newSnippetText)) { continue; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs index e6e0e83aeb8..a30b8246343 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs @@ -7,11 +7,10 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; -internal sealed class LspWorkspaceProvider(IAdhocWorkspaceFactory workspaceFactory) : IWorkspaceProvider, IDisposable +internal sealed class LspWorkspaceProvider(IHostServicesProvider hostServicesProvider) : IWorkspaceProvider, IDisposable { - private readonly IAdhocWorkspaceFactory _workspaceFactory = workspaceFactory; + private readonly AdhocWorkspaceFactory _workspaceFactory = new AdhocWorkspaceFactory(hostServicesProvider); - private Workspace? _workspace; private bool _disposed; void IDisposable.Dispose() @@ -21,7 +20,7 @@ void IDisposable.Dispose() return; } - _workspace?.Dispose(); + _workspaceFactory.Dispose(); _disposed = true; } @@ -32,6 +31,6 @@ public Workspace GetWorkspace() throw new ObjectDisposedException(nameof(LspWorkspaceProvider)); } - return _workspace ??= _workspaceFactory.Create(); + return _workspaceFactory.GetOrCreate(); } } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index be86fe01409..e072f6fefe1 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -119,7 +119,6 @@ protected override ILspServices ConstructLspServices() // Add the logger as a service in case anything in CLaSP pulls it out to do logging services.AddSingleton(Logger); - services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs index b6e30fb47fb..cae437367a2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs @@ -1,11 +1,15 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; + namespace Microsoft.CodeAnalysis.Razor.Workspaces; -internal class AdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : IAdhocWorkspaceFactory +internal sealed class AdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : IDisposable { - public AdhocWorkspace Create() + private readonly Lazy _lazyWorkspace = new(() => CreateWorkspace(hostServicesProvider)); + + private static AdhocWorkspace CreateWorkspace(IHostServicesProvider hostServicesProvider) { var fallbackServices = hostServicesProvider.GetServices(); var services = AdhocServices.Create( @@ -15,4 +19,17 @@ public AdhocWorkspace Create() return new AdhocWorkspace(services); } + + public AdhocWorkspace GetOrCreate() + { + return _lazyWorkspace.Value; + } + + public void Dispose() + { + if (_lazyWorkspace.IsValueCreated) + { + _lazyWorkspace.Value.Dispose(); + } + } } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs index e0a16ef90d4..fddc6c3e9a2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs @@ -18,20 +18,19 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; -internal sealed class FormattingContext : IDisposable +internal sealed class FormattingContext { - private readonly IAdhocWorkspaceFactory _workspaceFactory; + private readonly AdhocWorkspaceFactory _workspaceFactory; private readonly IFormattingCodeDocumentProvider _codeDocumentProvider; private Document? _csharpWorkspaceDocument; - private AdhocWorkspace? _csharpWorkspace; private IReadOnlyList? _formattingSpans; private IReadOnlyDictionary? _indentations; private FormattingContext( IFormattingCodeDocumentProvider codeDocumentProvider, - IAdhocWorkspaceFactory workspaceFactory, + AdhocWorkspaceFactory workspaceFactory, Uri uri, IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, @@ -83,7 +82,7 @@ public Document CSharpWorkspaceDocument } } - public AdhocWorkspace CSharpWorkspace => _csharpWorkspace ??= _workspaceFactory.Create(); + public AdhocWorkspace CSharpWorkspace => _workspaceFactory.GetOrCreate(); /// A Dictionary of int (line number) to IndentationContext. /// @@ -252,15 +251,6 @@ public bool TryGetFormattingSpan(int absoluteIndex, [NotNullWhen(true)] out Form return false; } - public void Dispose() - { - _csharpWorkspace?.Dispose(); - if (_csharpWorkspaceDocument != null) - { - _csharpWorkspaceDocument = null; - } - } - public async Task WithTextAsync(SourceText changedText) { var changedSnapshot = OriginalSnapshot.WithText(changedText); @@ -307,7 +297,7 @@ public static FormattingContext CreateForOnTypeFormatting( RazorCodeDocument codeDocument, RazorFormattingOptions options, IFormattingCodeDocumentProvider codeDocumentProvider, - IAdhocWorkspaceFactory workspaceFactory, + AdhocWorkspaceFactory workspaceFactory, bool automaticallyAddUsings, int hostDocumentIndex, char triggerCharacter) @@ -330,7 +320,7 @@ public static FormattingContext Create( RazorCodeDocument codeDocument, RazorFormattingOptions options, IFormattingCodeDocumentProvider codeDocumentProvider, - IAdhocWorkspaceFactory workspaceFactory) + AdhocWorkspaceFactory workspaceFactory) { return new FormattingContext( codeDocumentProvider, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index 8a15e2cb327..94100dedd3a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -30,7 +30,7 @@ internal class RazorFormattingService : IRazorFormattingService private static readonly FrozenSet s_htmlTriggerCharacterSet = FrozenSet.ToFrozenSet(["\n", "{", "}", ";"], StringComparer.Ordinal); private readonly IFormattingCodeDocumentProvider _codeDocumentProvider; - private readonly IAdhocWorkspaceFactory _workspaceFactory; + private readonly IHostServicesProvider _hostServicesProvider; private readonly ImmutableArray _documentFormattingPasses; private readonly ImmutableArray _validationPasses; @@ -40,11 +40,11 @@ internal class RazorFormattingService : IRazorFormattingService public RazorFormattingService( IFormattingCodeDocumentProvider codeDocumentProvider, IDocumentMappingService documentMappingService, - IAdhocWorkspaceFactory workspaceFactory, + IHostServicesProvider hostServicesProvider, ILoggerFactory loggerFactory) { _codeDocumentProvider = codeDocumentProvider; - _workspaceFactory = workspaceFactory; + _hostServicesProvider = hostServicesProvider; _htmlOnTypeFormattingPass = new HtmlOnTypeFormattingPass(loggerFactory); _csharpOnTypeFormattingPass = new CSharpOnTypeFormattingPass(documentMappingService, loggerFactory); @@ -97,13 +97,14 @@ public async Task> GetDocumentFormattingChangesAsync( var uri = documentContext.Uri; var documentSnapshot = documentContext.Snapshot; var hostDocumentVersion = documentContext.Snapshot.Version; - using var context = FormattingContext.Create( + using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(_hostServicesProvider); + var context = FormattingContext.Create( uri, documentSnapshot, codeDocument, options, _codeDocumentProvider, - _workspaceFactory); + adhocWorkspaceFactory); var originalText = context.SourceText; var result = htmlChanges; @@ -225,14 +226,15 @@ private async Task> ApplyFormattedChangesAsync( var documentSnapshot = documentContext.Snapshot; var uri = documentContext.Uri; var codeDocument = await _codeDocumentProvider.GetCodeDocumentAsync(documentSnapshot).ConfigureAwait(false); - using var context = FormattingContext.CreateForOnTypeFormatting( + using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(_hostServicesProvider); + var context = FormattingContext.CreateForOnTypeFormatting( uri, documentSnapshot, codeDocument, options, _codeDocumentProvider, - _workspaceFactory, - automaticallyAddUsings: automaticallyAddUsings, + adhocWorkspaceFactory, + automaticallyAddUsings, hostDocumentIndex, triggerCharacter); var result = generatedDocumentChanges; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IAdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IAdhocWorkspaceFactory.cs deleted file mode 100644 index 26ae985f46b..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/IAdhocWorkspaceFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -namespace Microsoft.CodeAnalysis.Razor.Workspaces; - -internal interface IAdhocWorkspaceFactory -{ - AdhocWorkspace Create(); -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs index 6974dabd019..7de42441ecc 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Formatting/RemoteRazorFormattingService.cs @@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Remote.Razor.Formatting; [Export(typeof(IRazorFormattingService)), Shared] [method: ImportingConstructor] -internal sealed class RemoteRazorFormattingService(IFormattingCodeDocumentProvider codeDocumentProvider, IDocumentMappingService documentMappingService, IAdhocWorkspaceFactory adhocWorkspaceFactory, ILoggerFactory loggerFactory) - : RazorFormattingService(codeDocumentProvider, documentMappingService, adhocWorkspaceFactory, loggerFactory) +internal sealed class RemoteRazorFormattingService(IFormattingCodeDocumentProvider codeDocumentProvider, IDocumentMappingService documentMappingService, IHostServicesProvider hostServicesProvider, ILoggerFactory loggerFactory) + : RazorFormattingService(codeDocumentProvider, documentMappingService, hostServicesProvider, loggerFactory) { } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs deleted file mode 100644 index 621f0b91496..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteAdhocWorkspaceFactory.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System.Composition; -using Microsoft.CodeAnalysis.Razor.Workspaces; - -namespace Microsoft.CodeAnalysis.Remote.Razor; - -[Export(typeof(IAdhocWorkspaceFactory)), Shared] -internal sealed class RemoteAdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : AdhocWorkspaceFactory(hostServicesProvider) -{ -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs index 119c16efd7b..0de25f1066f 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs @@ -6,13 +6,12 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.LanguageServer.Test; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; -using Microsoft.VisualStudio.LanguageServer.Protocol; using Moq; using Xunit; using Xunit.Abstractions; @@ -30,7 +29,7 @@ public async Task Execute_NonDestructiveEdit_Allowed() [||]public class Foo { } } """; - using var context = CreateFormattingContext(source); + var context = CreateFormattingContext(source); var edits = ImmutableArray.Create(new TextChange(source.Span, " ")); var input = edits; var pass = GetPass(); @@ -51,7 +50,7 @@ public async Task Execute_DestructiveEdit_Rejected() [|public class Foo { } |]} """; - using var context = CreateFormattingContext(source); + var context = CreateFormattingContext(source); var edits = ImmutableArray.Create(new TextChange(source.Span, " ")); var input = edits; var pass = GetPass(); @@ -85,13 +84,14 @@ private static FormattingContext CreateFormattingContext(TestCode input, int tab InsertSpaces = insertSpaces, }; + using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(new DefaultHostServicesProvider()); var context = FormattingContext.Create( uri, documentSnapshot, codeDocument, options, new LspFormattingCodeDocumentProvider(), - TestAdhocWorkspaceFactory.Instance); + adhocWorkspaceFactory); return context; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs index d3c305d51d9..e449640ef50 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs @@ -5,11 +5,11 @@ using System.Collections.Immutable; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.LanguageServer.Test; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Xunit; using Xunit.Abstractions; @@ -27,7 +27,7 @@ public async Task ExecuteAsync_NonDestructiveEdit_Allowed() [||]public class Foo { } } """; - using var context = CreateFormattingContext(source); + var context = CreateFormattingContext(source); var edits = ImmutableArray.Create(new TextChange(source.Span, " ")); var input = edits; var pass = GetPass(); @@ -49,7 +49,7 @@ public async Task ExecuteAsync_DestructiveEdit_Rejected() public class Foo { } } """; - using var context = CreateFormattingContext(source); + var context = CreateFormattingContext(source); var badEdit = new TextChange(source.Span, "@ "); // Creates a diagnostic var pass = GetPass(); @@ -82,13 +82,14 @@ private static FormattingContext CreateFormattingContext(TestCode input, int tab InsertSpaces = insertSpaces, }; + using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(new DefaultHostServicesProvider()); var context = FormattingContext.Create( uri, documentSnapshot, codeDocument, options, new LspFormattingCodeDocumentProvider(), - TestAdhocWorkspaceFactory.Instance); + adhocWorkspaceFactory); return context; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs index fc10917be71..217024e2dca 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/TestRazorFormattingService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; -using Microsoft.AspNetCore.Razor.LanguageServer.Test; using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; using Microsoft.CodeAnalysis.Razor.Formatting; @@ -40,7 +39,8 @@ public static async Task CreateWithFullSupportAsync( } var formattingCodeDocumentProvider = new LspFormattingCodeDocumentProvider(); + var hostServicesProvider = new DefaultHostServicesProvider(); - return new RazorFormattingService(formattingCodeDocumentProvider, mappingService, TestAdhocWorkspaceFactory.Instance, loggerFactory); + return new RazorFormattingService(formattingCodeDocumentProvider, mappingService, hostServicesProvider, loggerFactory); } } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestAdhocWorkspaceFactory.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestAdhocWorkspaceFactory.cs deleted file mode 100644 index 8918b3cc933..00000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/TestAdhocWorkspaceFactory.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using Microsoft.AspNetCore.Razor.Test.Common.Workspaces; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Razor.Workspaces; - -namespace Microsoft.AspNetCore.Razor.LanguageServer.Test; - -internal class TestAdhocWorkspaceFactory : IAdhocWorkspaceFactory -{ - public static readonly TestAdhocWorkspaceFactory Instance = new(); - - private TestAdhocWorkspaceFactory() - { - } - - public AdhocWorkspace Create() - { - var services = TestServices.Create(workspaceServices: [], razorLanguageServices: []); - var workspace = TestWorkspace.Create(services); - return workspace; - } -} From b29a1c3f3475fa51a0dde6f77bedb201c9f3d686 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 16 Sep 2024 15:00:31 +1000 Subject: [PATCH 346/386] Rename type to better indicate its new role And remove the Uri property as it was almost entirely unused --- .../InlineCompletionEndPoint.cs | 5 ++-- .../LspWorkspaceProvider.cs | 2 +- ...ceFactory.cs => AdhocWorkspaceProvider.cs} | 2 +- .../Formatting/FormattingContext.cs | 26 +++++++------------ .../Passes/CSharpOnTypeFormattingPass.cs | 2 +- .../Formatting/RazorFormattingService.cs | 11 +++----- .../FormattingContentValidationPassTest.cs | 5 ++-- .../FormattingDiagnosticValidationPassTest.cs | 5 ++-- 8 files changed, 22 insertions(+), 36 deletions(-) rename src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/{AdhocWorkspaceFactory.cs => AdhocWorkspaceProvider.cs} (90%) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs index 322158c4b0a..8ad5771952a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs @@ -128,14 +128,13 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalInlineCompleti } var options = RazorFormattingOptions.From(request.Options, _optionsMonitor.CurrentValue.CodeBlockBraceOnNextLine); - using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(_hostServicesProvider); + using var workspaceProvider = new AdhocWorkspaceProvider(_hostServicesProvider); var formattingContext = FormattingContext.Create( - request.TextDocument.Uri, documentContext.Snapshot, codeDocument, options, _formattingCodeDocumentProvider, - adhocWorkspaceFactory); + workspaceProvider); if (!TryGetSnippetWithAdjustedIndentation(formattingContext, item.Text, hostDocumentIndex, out var newSnippetText)) { continue; diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs index a30b8246343..f0dbbbb5f56 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer; internal sealed class LspWorkspaceProvider(IHostServicesProvider hostServicesProvider) : IWorkspaceProvider, IDisposable { - private readonly AdhocWorkspaceFactory _workspaceFactory = new AdhocWorkspaceFactory(hostServicesProvider); + private readonly AdhocWorkspaceProvider _workspaceFactory = new AdhocWorkspaceProvider(hostServicesProvider); private bool _disposed; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceProvider.cs similarity index 90% rename from src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs rename to src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceProvider.cs index cae437367a2..726a9fbfded 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceFactory.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceProvider.cs @@ -5,7 +5,7 @@ namespace Microsoft.CodeAnalysis.Razor.Workspaces; -internal sealed class AdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : IDisposable +internal sealed class AdhocWorkspaceProvider(IHostServicesProvider hostServicesProvider) : IDisposable { private readonly Lazy _lazyWorkspace = new(() => CreateWorkspace(hostServicesProvider)); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs index fddc6c3e9a2..c3c459fcbcf 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs @@ -20,7 +20,7 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; internal sealed class FormattingContext { - private readonly AdhocWorkspaceFactory _workspaceFactory; + private readonly AdhocWorkspaceProvider _workspaceProvider; private readonly IFormattingCodeDocumentProvider _codeDocumentProvider; private Document? _csharpWorkspaceDocument; @@ -30,8 +30,7 @@ internal sealed class FormattingContext private FormattingContext( IFormattingCodeDocumentProvider codeDocumentProvider, - AdhocWorkspaceFactory workspaceFactory, - Uri uri, + AdhocWorkspaceProvider workspaceProvider, IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, RazorFormattingOptions options, @@ -40,8 +39,7 @@ private FormattingContext( char triggerCharacter) { _codeDocumentProvider = codeDocumentProvider; - _workspaceFactory = workspaceFactory; - Uri = uri; + _workspaceProvider = workspaceProvider; OriginalSnapshot = originalSnapshot; CodeDocument = codeDocument; Options = options; @@ -52,7 +50,6 @@ private FormattingContext( public static bool SkipValidateComponents { get; set; } - public Uri Uri { get; } public IDocumentSnapshot OriginalSnapshot { get; } public RazorCodeDocument CodeDocument { get; } public RazorFormattingOptions Options { get; } @@ -82,7 +79,7 @@ public Document CSharpWorkspaceDocument } } - public AdhocWorkspace CSharpWorkspace => _workspaceFactory.GetOrCreate(); + public AdhocWorkspace CSharpWorkspace => _workspaceProvider.GetOrCreate(); /// A Dictionary of int (line number) to IndentationContext. /// @@ -261,8 +258,7 @@ public async Task WithTextAsync(SourceText changedText) var newContext = new FormattingContext( _codeDocumentProvider, - _workspaceFactory, - Uri, + _workspaceProvider, OriginalSnapshot, codeDocument, Options, @@ -292,20 +288,18 @@ private static void DEBUG_ValidateComponents(RazorCodeDocument oldCodeDocument, } public static FormattingContext CreateForOnTypeFormatting( - Uri uri, IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, RazorFormattingOptions options, IFormattingCodeDocumentProvider codeDocumentProvider, - AdhocWorkspaceFactory workspaceFactory, + AdhocWorkspaceProvider workspaceProvider, bool automaticallyAddUsings, int hostDocumentIndex, char triggerCharacter) { return new FormattingContext( codeDocumentProvider, - workspaceFactory, - uri, + workspaceProvider, originalSnapshot, codeDocument, options, @@ -315,17 +309,15 @@ public static FormattingContext CreateForOnTypeFormatting( } public static FormattingContext Create( - Uri uri, IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, RazorFormattingOptions options, IFormattingCodeDocumentProvider codeDocumentProvider, - AdhocWorkspaceFactory workspaceFactory) + AdhocWorkspaceProvider workspaceProvider) { return new FormattingContext( codeDocumentProvider, - workspaceFactory, - uri, + workspaceProvider, originalSnapshot, codeDocument, options, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpOnTypeFormattingPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpOnTypeFormattingPass.cs index cad882f26b9..1d698b246d9 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpOnTypeFormattingPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpOnTypeFormattingPass.cs @@ -42,7 +42,7 @@ public async override Task> ExecuteAsync(FormattingCo { if (!DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetCSharpDocument(), context.HostDocumentIndex, out _, out var projectedIndex)) { - _logger.LogWarning($"Failed to map to projected position for document {context.Uri}."); + _logger.LogWarning($"Failed to map to projected position for document {context.OriginalSnapshot.FilePath}."); return changes; } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index 94100dedd3a..7e820e29593 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -97,14 +97,13 @@ public async Task> GetDocumentFormattingChangesAsync( var uri = documentContext.Uri; var documentSnapshot = documentContext.Snapshot; var hostDocumentVersion = documentContext.Snapshot.Version; - using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(_hostServicesProvider); + using var workspaceProvider = new AdhocWorkspaceProvider(_hostServicesProvider); var context = FormattingContext.Create( - uri, documentSnapshot, codeDocument, options, _codeDocumentProvider, - adhocWorkspaceFactory); + workspaceProvider); var originalText = context.SourceText; var result = htmlChanges; @@ -224,16 +223,14 @@ private async Task> ApplyFormattedChangesAsync( collapseChanges |= generatedDocumentChanges.Length == 1; var documentSnapshot = documentContext.Snapshot; - var uri = documentContext.Uri; var codeDocument = await _codeDocumentProvider.GetCodeDocumentAsync(documentSnapshot).ConfigureAwait(false); - using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(_hostServicesProvider); + using var workspaceProvider = new AdhocWorkspaceProvider(_hostServicesProvider); var context = FormattingContext.CreateForOnTypeFormatting( - uri, documentSnapshot, codeDocument, options, _codeDocumentProvider, - adhocWorkspaceFactory, + workspaceProvider, automaticallyAddUsings, hostDocumentIndex, triggerCharacter); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs index 0de25f1066f..6ad41e23b3c 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs @@ -84,14 +84,13 @@ private static FormattingContext CreateFormattingContext(TestCode input, int tab InsertSpaces = insertSpaces, }; - using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(new DefaultHostServicesProvider()); + using var workspaceProvider = new AdhocWorkspaceProvider(new DefaultHostServicesProvider()); var context = FormattingContext.Create( - uri, documentSnapshot, codeDocument, options, new LspFormattingCodeDocumentProvider(), - adhocWorkspaceFactory); + workspaceProvider); return context; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs index e449640ef50..0fe0538a84d 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs @@ -82,14 +82,13 @@ private static FormattingContext CreateFormattingContext(TestCode input, int tab InsertSpaces = insertSpaces, }; - using var adhocWorkspaceFactory = new AdhocWorkspaceFactory(new DefaultHostServicesProvider()); + using var workspaceProvider = new AdhocWorkspaceProvider(new DefaultHostServicesProvider()); var context = FormattingContext.Create( - uri, documentSnapshot, codeDocument, options, new LspFormattingCodeDocumentProvider(), - adhocWorkspaceFactory); + workspaceProvider); return context; } From f217326ffd9d14bfbecef91b1b255c76913a6bfb Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 16 Sep 2024 15:05:46 +1000 Subject: [PATCH 347/386] Remove unused service --- .../LspWorkspaceProvider.cs | 36 ------------------- .../RazorLanguageServer.cs | 2 -- 2 files changed, 38 deletions(-) delete mode 100644 src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs deleted file mode 100644 index f0dbbbb5f56..00000000000 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/LspWorkspaceProvider.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Razor.Workspaces; - -namespace Microsoft.AspNetCore.Razor.LanguageServer; - -internal sealed class LspWorkspaceProvider(IHostServicesProvider hostServicesProvider) : IWorkspaceProvider, IDisposable -{ - private readonly AdhocWorkspaceProvider _workspaceFactory = new AdhocWorkspaceProvider(hostServicesProvider); - - private bool _disposed; - - void IDisposable.Dispose() - { - if (_disposed) - { - return; - } - - _workspaceFactory.Dispose(); - _disposed = true; - } - - public Workspace GetWorkspace() - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(LspWorkspaceProvider)); - } - - return _workspaceFactory.GetOrCreate(); - } -} diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs index e072f6fefe1..889207c811c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs @@ -119,8 +119,6 @@ protected override ILspServices ConstructLspServices() // Add the logger as a service in case anything in CLaSP pulls it out to do logging services.AddSingleton(Logger); - services.AddSingleton(); - services.AddSingleton(); var featureOptions = _featureOptions ?? new DefaultLanguageServerFeatureOptions(); From 26fb68c1030d7ef110f9d25dce0250a72c260f86 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Mon, 16 Sep 2024 16:59:10 +1000 Subject: [PATCH 348/386] Since we don't own the workspace, it would be rude to add documents to it. --- .../Formatting/FormattingContext.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs index c3c459fcbcf..c0ac5e7ddc2 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs @@ -70,9 +70,9 @@ public Document CSharpWorkspaceDocument if (_csharpWorkspaceDocument is null) { var workspace = CSharpWorkspace; - var project = workspace.AddProject("TestProject", LanguageNames.CSharp); + var project = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp); var csharpSourceText = CodeDocument.GetCSharpSourceText(); - _csharpWorkspaceDocument = workspace.AddDocument(project.Id, "TestDocument", csharpSourceText); + _csharpWorkspaceDocument = project.AddDocument("TestDocument", csharpSourceText); } return _csharpWorkspaceDocument; From 821c789c706a5dd2b34614c769d11ee32b33e93a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 16 Sep 2024 12:52:10 +0000 Subject: [PATCH 349/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240909.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 10.0.0-alpha.1.24455.1 -> To Version 10.0.0-alpha.1.24459.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7ea417466f4..6c7a951c3e1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - ad3c9aa85596f42c6a483233c50fab8cee8c412a + 08649fed58d668737a54913f7d4c649a8da5dc6e diff --git a/eng/Versions.props b/eng/Versions.props index 707ebbb49ad..ba085bfeaef 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 10.0.0-alpha.1.24455.1 + 10.0.0-alpha.1.24459.1 9.0.0-beta.24453.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From 90f05d84a9f430e19cb29356243c9aa5df424463 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 16 Sep 2024 17:23:49 +0000 Subject: [PATCH 350/386] Update dependencies from https://github.com/dotnet/arcade build 20240913.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24426.3 -> To Version 9.0.0-beta.24463.2 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 613a3732666..48af69b8681 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - e3bdd9a0f2a65fe037ba1adb2261eea48a840fa4 + bcba6939456aa552554eae9ea9538a039cc98d96 - + https://github.com/dotnet/arcade - e3bdd9a0f2a65fe037ba1adb2261eea48a840fa4 + bcba6939456aa552554eae9ea9538a039cc98d96 diff --git a/eng/Versions.props b/eng/Versions.props index b85d386b58b..f16a1f34e72 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24426.3 + 9.0.0-beta.24463.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.12.0-2.24419.3 diff --git a/global.json b/global.json index 2e613368edb..572464c35ba 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "9.0.100-preview.7.24407.12", + "dotnet": "9.0.100-rc.1.24452.12", "runtimes": { "dotnet": [ "2.1.30", @@ -17,12 +17,12 @@ } }, "sdk": { - "version": "9.0.100-preview.7.24407.12", + "version": "9.0.100-rc.1.24452.12", "allowPrerelease": false, "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24426.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24463.2", "Microsoft.Build.NoTargets": "3.7.0" } } From c38fc3b9d28fc9513ee68c3a113cc636bf362e96 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 16 Sep 2024 14:40:48 -0700 Subject: [PATCH 351/386] ExcludeFromSourceBuild->ExcludeFromSourceOnlyBuild (#10892) --- Directory.Build.props | 4 ++-- .../Razor.Diagnostics.Analyzers.csproj | 2 +- .../src/Microsoft.CodeAnalysis.Razor.Compiler.csproj | 2 +- .../Microsoft.NET.Sdk.Razor.SourceGenerators.Transport.csproj | 2 +- .../Microsoft.Net.Compilers.Razor.Toolset.csproj | 2 +- ...Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler.csproj | 2 +- src/Compiler/test/Directory.Build.props | 2 +- ...ft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal.csproj | 2 +- .../Microsoft.CodeAnalysis.Razor.Tooling.Internal.csproj | 2 +- .../tools/RazorSyntaxGenerator/RazorSyntaxGenerator.csproj | 2 +- .../Microsoft.AspNetCore.Razor.Microbenchmarks.csproj | 2 +- .../Microsoft.AspNetCore.Razor.ProjectEngineHost.csproj | 2 +- .../Microsoft.CodeAnalysis.Razor.Workspaces.csproj | 2 +- .../Microsoft.CodeAnalysis.Remote.Razor.csproj | 2 +- ...osoft.VisualStudio.LanguageServer.ContainedLanguage.csproj | 4 ++-- .../Microsoft.VisualStudio.LanguageServices.Razor.csproj | 2 +- .../Microsoft.VisualStudio.LegacyEditor.Razor.csproj | 2 +- .../Microsoft.VisualStudio.RazorExtension.Dependencies.csproj | 2 +- .../Microsoft.VisualStudio.RazorExtension.csproj | 4 ++-- src/Razor/test/Directory.Build.props | 2 +- .../Microsoft.AspNetCore.Razor.Utilities.Shared.csproj | 2 +- 21 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 04449588c74..3556b512a08 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -22,7 +22,7 @@ true true true - true + true $(MSBuildThisFileDirectory) true true @@ -40,7 +40,7 @@ false - true + true net472
diff --git a/src/Analyzers/Razor.Diagnostics.Analyzers/Razor.Diagnostics.Analyzers.csproj b/src/Analyzers/Razor.Diagnostics.Analyzers/Razor.Diagnostics.Analyzers.csproj index 44ae5fb263a..345b7c9363f 100644 --- a/src/Analyzers/Razor.Diagnostics.Analyzers/Razor.Diagnostics.Analyzers.csproj +++ b/src/Analyzers/Razor.Diagnostics.Analyzers/Razor.Diagnostics.Analyzers.csproj @@ -4,7 +4,7 @@ netstandard2.0 false true - false + false false diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Microsoft.CodeAnalysis.Razor.Compiler.csproj b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Microsoft.CodeAnalysis.Razor.Compiler.csproj index deca9b6930d..6f611c0c931 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Microsoft.CodeAnalysis.Razor.Compiler.csproj +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Microsoft.CodeAnalysis.Razor.Compiler.csproj @@ -3,7 +3,7 @@ Razor is a markup syntax for adding server-side logic to web pages. This package contains the Razor compiler. $(DefaultNetCoreTargetFramework);netstandard2.0 - false + false - false + false diff --git a/src/Compiler/Microsoft.Net.Compilers.Razor.Toolset/Microsoft.Net.Compilers.Razor.Toolset.csproj b/src/Compiler/Microsoft.Net.Compilers.Razor.Toolset/Microsoft.Net.Compilers.Razor.Toolset.csproj index 32fc1ff170c..5aeeccbf89b 100644 --- a/src/Compiler/Microsoft.Net.Compilers.Razor.Toolset/Microsoft.Net.Compilers.Razor.Toolset.csproj +++ b/src/Compiler/Microsoft.Net.Compilers.Razor.Toolset/Microsoft.Net.Compilers.Razor.Toolset.csproj @@ -11,7 +11,7 @@ true false true - true + true .NET Compilers Razor Toolset Package. Referencing this package will cause the project to be built using the Razor compilers and source generator contained in the package, as opposed to the version installed with the SDK. diff --git a/src/Compiler/perf/Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler.csproj b/src/Compiler/perf/Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler.csproj index ff25b1f3ace..879da42abbc 100644 --- a/src/Compiler/perf/Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler.csproj +++ b/src/Compiler/perf/Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler.csproj @@ -5,7 +5,7 @@ Exe true true - true + true false diff --git a/src/Compiler/test/Directory.Build.props b/src/Compiler/test/Directory.Build.props index 7af57e829d4..838e522f0f9 100644 --- a/src/Compiler/test/Directory.Build.props +++ b/src/Compiler/test/Directory.Build.props @@ -8,6 +8,6 @@ --> true false - true + true diff --git a/src/Compiler/tools/Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal/Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal.csproj b/src/Compiler/tools/Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal/Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal.csproj index fc904636846..584c2711ab5 100644 --- a/src/Compiler/tools/Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal/Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal.csproj +++ b/src/Compiler/tools/Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal/Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal.csproj @@ -6,7 +6,7 @@ false false true - false + false diff --git a/src/Compiler/tools/Microsoft.CodeAnalysis.Razor.Tooling.Internal/Microsoft.CodeAnalysis.Razor.Tooling.Internal.csproj b/src/Compiler/tools/Microsoft.CodeAnalysis.Razor.Tooling.Internal/Microsoft.CodeAnalysis.Razor.Tooling.Internal.csproj index 582b2166ce9..45c3032e4ba 100644 --- a/src/Compiler/tools/Microsoft.CodeAnalysis.Razor.Tooling.Internal/Microsoft.CodeAnalysis.Razor.Tooling.Internal.csproj +++ b/src/Compiler/tools/Microsoft.CodeAnalysis.Razor.Tooling.Internal/Microsoft.CodeAnalysis.Razor.Tooling.Internal.csproj @@ -6,7 +6,7 @@ false false true - false + false true diff --git a/src/Compiler/tools/RazorSyntaxGenerator/RazorSyntaxGenerator.csproj b/src/Compiler/tools/RazorSyntaxGenerator/RazorSyntaxGenerator.csproj index 614004aed9a..ffe509a8e85 100644 --- a/src/Compiler/tools/RazorSyntaxGenerator/RazorSyntaxGenerator.csproj +++ b/src/Compiler/tools/RazorSyntaxGenerator/RazorSyntaxGenerator.csproj @@ -9,7 +9,7 @@ false false - true + true diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj index 1010350dd29..3a4c8eb9ed4 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks.csproj @@ -7,7 +7,7 @@ true true false - true + true false diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Microsoft.AspNetCore.Razor.ProjectEngineHost.csproj b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Microsoft.AspNetCore.Razor.ProjectEngineHost.csproj index a1b367de03d..3e1f302dc61 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Microsoft.AspNetCore.Razor.ProjectEngineHost.csproj +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Microsoft.AspNetCore.Razor.ProjectEngineHost.csproj @@ -6,7 +6,7 @@ Microsoft.AspNetCore.Razor false false - true + true false true diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj index e47366a1ae2..dd983e0656d 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj @@ -5,7 +5,7 @@ Razor is a markup syntax for adding server-side logic to web pages. This package contains the Razor design-time infrastructure. false false - true + true false diff --git a/src/Razor/src/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj b/src/Razor/src/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj index d616ecdca89..bbee7f242dc 100644 --- a/src/Razor/src/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj +++ b/src/Razor/src/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj @@ -18,7 +18,7 @@ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true + true false true @@ -44,7 +44,7 @@ - + diff --git a/src/Razor/test/Directory.Build.props b/src/Razor/test/Directory.Build.props index a0207c093ee..0b4ec55df46 100644 --- a/src/Razor/test/Directory.Build.props +++ b/src/Razor/test/Directory.Build.props @@ -2,7 +2,7 @@ - true + true $(DefaultNetCoreTargetFrameworks) $(DeveloperBuildTestTfms) $(StandardTestTfms) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.csproj b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.csproj index 18d42c533aa..15d4b337497 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.csproj +++ b/src/Shared/Microsoft.AspNetCore.Razor.Utilities.Shared/Microsoft.AspNetCore.Razor.Utilities.Shared.csproj @@ -5,7 +5,7 @@ Razor is a markup syntax for adding server-side logic to web pages. This package contains the language server library assets. false false - false + false Microsoft.AspNetCore.Razor false true From f994272410377700f3310275bc672e9f697c9486 Mon Sep 17 00:00:00 2001 From: Derek Gray Date: Mon, 16 Sep 2024 18:07:36 -0500 Subject: [PATCH 352/386] Fix #10891 - Formatting does not respect indentation within Razor comment blocks --- .../Passes/HtmlFormattingPassBase.cs | 25 ++++++++++++++++++- .../Formatting_NetFx/RazorFormattingTest.cs | 25 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/HtmlFormattingPassBase.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/HtmlFormattingPassBase.cs index a2f62eecec6..855ed04b4ab 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/HtmlFormattingPassBase.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/HtmlFormattingPassBase.cs @@ -30,7 +30,9 @@ public virtual async Task> ExecuteAsync(FormattingCon if (changes.Length > 0) { - changedText = originalText.WithChanges(changes); + var filteredChanges = FilterIncomingChanges(changedContext, changes); + + changedText = originalText.WithChanges(filteredChanges); // Create a new formatting context for the changed razor document. changedContext = await context.WithTextAsync(changedText).ConfigureAwait(false); @@ -48,6 +50,27 @@ public virtual async Task> ExecuteAsync(FormattingCon return changedText.GetTextChangesArray(originalText); } + private static ImmutableArray FilterIncomingChanges(FormattingContext context, ImmutableArray changes) + { + var syntaxTree = context.CodeDocument.GetSyntaxTree(); + + using var changesToKeep = new PooledArrayBuilder(capacity: changes.Length); + + for (var i = 0; i < changes.Length; i++) + { + // Don't keep changes that start inside of a razor comment block. + var comment = syntaxTree.Root.FindInnermostNode(changes[i].Span.Start)?.FirstAncestorOrSelf(); + if (comment is not null) + { + continue; + } + + changesToKeep.Add(changes[i]); + } + + return changesToKeep.DrainToImmutable(); + } + private static ImmutableArray AdjustRazorIndentation(FormattingContext context) { // Assume HTML formatter has already run at this point and HTML is relatively indented correctly. diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs index 27bb6dc6e7c..04acfc57758 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs @@ -705,6 +705,31 @@ await RunFormattingTestAsync( fileKind: FileKinds.Legacy); } + [Fact] + public async Task MultiLineComment_WithinHtml () + { + await RunFormattingTestAsync( + input: """ +
+ @* +
+ This comment's indentation will be preserved +
+ *@ +
+ """, + expected: """ +
+ @* +
+ This comment's indentation will be preserved +
+ *@ +
+ """, + fileKind: FileKinds.Legacy); + } + // Regression prevention tests: [Fact] public async Task Using() From 763f6994ac3aa0f6738e10f83c4763f5d1326868 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 17 Sep 2024 11:39:52 +1000 Subject: [PATCH 353/386] Move workspace creation down even lower so the lifetime is contrained to a single formatting operation --- .../InlineCompletionEndPoint.cs | 12 +---- .../AdhocWorkspaceProvider.cs | 35 --------------- .../Formatting/CSharpFormatter.cs | 20 +++++---- .../Formatting/FormattingContext.cs | 31 +------------ .../Formatting/Passes/CSharpFormattingPass.cs | 19 +++++--- ...ormattingPassBase.RoslynWorkspaceHelper.cs | 45 +++++++++++++++++++ .../Passes/CSharpFormattingPassBase.cs | 17 +++++-- .../Passes/CSharpOnTypeFormattingPass.cs | 10 +++-- .../Formatting/RazorFormattingService.cs | 12 ++--- .../FormattingContentValidationPassTest.cs | 5 +-- .../FormattingDiagnosticValidationPassTest.cs | 5 +-- 11 files changed, 95 insertions(+), 116 deletions(-) delete mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceProvider.cs create mode 100644 src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs index 8ad5771952a..03ff37b121a 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/InlineCompletion/InlineCompletionEndPoint.cs @@ -29,7 +29,6 @@ internal sealed class InlineCompletionEndpoint( IDocumentMappingService documentMappingService, IClientConnection clientConnection, IFormattingCodeDocumentProvider formattingCodeDocumentProvider, - IHostServicesProvider hostServicesProvider, RazorLSPOptionsMonitor optionsMonitor, ILoggerFactory loggerFactory) : IRazorRequestHandler, ICapabilitiesProvider @@ -42,7 +41,6 @@ internal sealed class InlineCompletionEndpoint( private readonly IDocumentMappingService _documentMappingService = documentMappingService; private readonly IClientConnection _clientConnection = clientConnection; private readonly IFormattingCodeDocumentProvider _formattingCodeDocumentProvider = formattingCodeDocumentProvider; - private readonly IHostServicesProvider _hostServicesProvider = hostServicesProvider; private readonly RazorLSPOptionsMonitor _optionsMonitor = optionsMonitor; private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); @@ -63,10 +61,7 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalInlineCompleti public async Task HandleRequestAsync(VSInternalInlineCompletionRequest request, RazorRequestContext requestContext, CancellationToken cancellationToken) { - if (request is null) - { - throw new ArgumentNullException(nameof(request)); - } + ArgHelper.ThrowIfNull(request); _logger.LogInformation($"Starting request for {request.TextDocument.Uri} at {request.Position}."); @@ -118,7 +113,6 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalInlineCompleti using var items = new PooledArrayBuilder(list.Items.Length); foreach (var item in list.Items) { - var containsSnippet = item.TextFormat == InsertTextFormat.Snippet; var range = item.Range ?? projectedPosition.ToZeroWidthRange(); if (!_documentMappingService.TryMapToHostDocumentRange(codeDocument.GetCSharpDocument(), range, out var rangeInRazorDoc)) @@ -128,13 +122,11 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSInternalInlineCompleti } var options = RazorFormattingOptions.From(request.Options, _optionsMonitor.CurrentValue.CodeBlockBraceOnNextLine); - using var workspaceProvider = new AdhocWorkspaceProvider(_hostServicesProvider); var formattingContext = FormattingContext.Create( documentContext.Snapshot, codeDocument, options, - _formattingCodeDocumentProvider, - workspaceProvider); + _formattingCodeDocumentProvider); if (!TryGetSnippetWithAdjustedIndentation(formattingContext, item.Text, hostDocumentIndex, out var newSnippetText)) { continue; diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceProvider.cs deleted file mode 100644 index 726a9fbfded..00000000000 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/AdhocWorkspaceProvider.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the MIT license. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.CodeAnalysis.Razor.Workspaces; - -internal sealed class AdhocWorkspaceProvider(IHostServicesProvider hostServicesProvider) : IDisposable -{ - private readonly Lazy _lazyWorkspace = new(() => CreateWorkspace(hostServicesProvider)); - - private static AdhocWorkspace CreateWorkspace(IHostServicesProvider hostServicesProvider) - { - var fallbackServices = hostServicesProvider.GetServices(); - var services = AdhocServices.Create( - workspaceServices: [], - languageServices: [], - fallbackServices); - - return new AdhocWorkspace(services); - } - - public AdhocWorkspace GetOrCreate() - { - return _lazyWorkspace.Value; - } - - public void Dispose() - { - if (_lazyWorkspace.IsValueCreated) - { - _lazyWorkspace.Value.Dispose(); - } - } -} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/CSharpFormatter.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/CSharpFormatter.cs index 67971c72e4b..1dd52b3e7b3 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/CSharpFormatter.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/CSharpFormatter.cs @@ -12,6 +12,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.ExternalAccess.Razor; +using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -24,14 +25,14 @@ internal sealed class CSharpFormatter(IDocumentMappingService documentMappingSer private readonly IDocumentMappingService _documentMappingService = documentMappingService; - public async Task> FormatAsync(FormattingContext context, LinePositionSpan spanToFormat, CancellationToken cancellationToken) + public async Task> FormatAsync(HostWorkspaceServices hostWorkspaceServices, Document csharpDocument, FormattingContext context, LinePositionSpan spanToFormat, CancellationToken cancellationToken) { if (!_documentMappingService.TryMapToGeneratedDocumentRange(context.CodeDocument.GetCSharpDocument(), spanToFormat, out var projectedSpan)) { return []; } - var edits = await GetFormattingEditsAsync(context, projectedSpan, cancellationToken).ConfigureAwait(false); + var edits = await GetFormattingEditsAsync(hostWorkspaceServices, csharpDocument, projectedSpan, context.Options.ToIndentationOptions(), cancellationToken).ConfigureAwait(false); var mappedEdits = MapEditsToHostDocument(context.CodeDocument, edits); return mappedEdits; } @@ -39,13 +40,14 @@ public async Task> FormatAsync(FormattingContext cont public static async Task> GetCSharpIndentationAsync( FormattingContext context, HashSet projectedDocumentLocations, + HostWorkspaceServices hostWorkspaceServices, CancellationToken cancellationToken) { // Sorting ensures we count the marker offsets correctly. // We also want to ensure there are no duplicates to avoid duplicate markers. var filteredLocations = projectedDocumentLocations.OrderAsArray(); - var indentations = await GetCSharpIndentationCoreAsync(context, filteredLocations, cancellationToken).ConfigureAwait(false); + var indentations = await GetCSharpIndentationCoreAsync(context, filteredLocations, hostWorkspaceServices, cancellationToken).ConfigureAwait(false); return indentations; } @@ -56,18 +58,18 @@ private ImmutableArray MapEditsToHostDocument(RazorCodeDocument code return actualEdits.ToImmutableArray(); } - private static async Task> GetFormattingEditsAsync(FormattingContext context, LinePositionSpan projectedSpan, CancellationToken cancellationToken) + private static async Task> GetFormattingEditsAsync(HostWorkspaceServices hostWorkspaceServices, Document csharpDocument, LinePositionSpan projectedSpan, RazorIndentationOptions indentationOptions, CancellationToken cancellationToken) { - var csharpSourceText = context.CodeDocument.GetCSharpSourceText(); + var root = await csharpDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); + var csharpSourceText = await csharpDocument.GetTextAsync(cancellationToken).ConfigureAwait(false); var spanToFormat = csharpSourceText.GetTextSpan(projectedSpan); - var root = await context.CSharpWorkspaceDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); Assumes.NotNull(root); - var changes = RazorCSharpFormattingInteractionService.GetFormattedTextChanges(context.CSharpWorkspace.Services, root, spanToFormat, context.Options.ToIndentationOptions(), cancellationToken); + var changes = RazorCSharpFormattingInteractionService.GetFormattedTextChanges(hostWorkspaceServices, root, spanToFormat, indentationOptions, cancellationToken); return changes.ToImmutableArray(); } - private static async Task> GetCSharpIndentationCoreAsync(FormattingContext context, ImmutableArray projectedDocumentLocations, CancellationToken cancellationToken) + private static async Task> GetCSharpIndentationCoreAsync(FormattingContext context, ImmutableArray projectedDocumentLocations, HostWorkspaceServices hostWorkspaceServices, CancellationToken cancellationToken) { // No point calling the C# formatting if we won't be interested in any of its work anyway if (projectedDocumentLocations.Length == 0) @@ -83,7 +85,7 @@ private static async Task> GetCSharpIndentationCoreAsync(Fo // At this point, we have added all the necessary markers and attached annotations. // Let's invoke the C# formatter and hope for the best. - var formattedRoot = RazorCSharpFormattingInteractionService.Format(context.CSharpWorkspace.Services, root, context.Options.ToIndentationOptions(), cancellationToken); + var formattedRoot = RazorCSharpFormattingInteractionService.Format(hostWorkspaceServices, root, context.Options.ToIndentationOptions(), cancellationToken); var formattedText = formattedRoot.GetText(); var desiredIndentationMap = new Dictionary(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs index c0ac5e7ddc2..bfae1b89b6a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/FormattingContext.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -20,17 +19,13 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; internal sealed class FormattingContext { - private readonly AdhocWorkspaceProvider _workspaceProvider; private readonly IFormattingCodeDocumentProvider _codeDocumentProvider; - private Document? _csharpWorkspaceDocument; - private IReadOnlyList? _formattingSpans; private IReadOnlyDictionary? _indentations; private FormattingContext( IFormattingCodeDocumentProvider codeDocumentProvider, - AdhocWorkspaceProvider workspaceProvider, IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, RazorFormattingOptions options, @@ -39,7 +34,6 @@ private FormattingContext( char triggerCharacter) { _codeDocumentProvider = codeDocumentProvider; - _workspaceProvider = workspaceProvider; OriginalSnapshot = originalSnapshot; CodeDocument = codeDocument; Options = options; @@ -63,24 +57,6 @@ private FormattingContext( public string NewLineString => Environment.NewLine; - public Document CSharpWorkspaceDocument - { - get - { - if (_csharpWorkspaceDocument is null) - { - var workspace = CSharpWorkspace; - var project = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp); - var csharpSourceText = CodeDocument.GetCSharpSourceText(); - _csharpWorkspaceDocument = project.AddDocument("TestDocument", csharpSourceText); - } - - return _csharpWorkspaceDocument; - } - } - - public AdhocWorkspace CSharpWorkspace => _workspaceProvider.GetOrCreate(); - /// A Dictionary of int (line number) to IndentationContext. /// /// Don't use this to discover the indentation level you should have, use @@ -258,7 +234,6 @@ public async Task WithTextAsync(SourceText changedText) var newContext = new FormattingContext( _codeDocumentProvider, - _workspaceProvider, OriginalSnapshot, codeDocument, Options, @@ -292,14 +267,12 @@ public static FormattingContext CreateForOnTypeFormatting( RazorCodeDocument codeDocument, RazorFormattingOptions options, IFormattingCodeDocumentProvider codeDocumentProvider, - AdhocWorkspaceProvider workspaceProvider, bool automaticallyAddUsings, int hostDocumentIndex, char triggerCharacter) { return new FormattingContext( codeDocumentProvider, - workspaceProvider, originalSnapshot, codeDocument, options, @@ -312,12 +285,10 @@ public static FormattingContext Create( IDocumentSnapshot originalSnapshot, RazorCodeDocument codeDocument, RazorFormattingOptions options, - IFormattingCodeDocumentProvider codeDocumentProvider, - AdhocWorkspaceProvider workspaceProvider) + IFormattingCodeDocumentProvider codeDocumentProvider) { return new FormattingContext( codeDocumentProvider, - workspaceProvider, originalSnapshot, codeDocument, options, diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPass.cs index efea0297972..591573959bb 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPass.cs @@ -8,8 +8,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.Razor.Formatting; @@ -19,13 +21,14 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; /// internal sealed class CSharpFormattingPass( IDocumentMappingService documentMappingService, + IHostServicesProvider hostServicesProvider, ILoggerFactory loggerFactory) - : CSharpFormattingPassBase(documentMappingService, isFormatOnType: false) + : CSharpFormattingPassBase(documentMappingService, hostServicesProvider, isFormatOnType: false) { - private readonly CSharpFormatter _csharpFormatter = new CSharpFormatter(documentMappingService); + private readonly CSharpFormatter _csharpFormatter = new(documentMappingService); private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); - public async override Task> ExecuteAsync(FormattingContext context, ImmutableArray changes, CancellationToken cancellationToken) + protected async override Task> ExecuteCoreAsync(FormattingContext context, RoslynWorkspaceHelper roslynWorkspaceHelper, ImmutableArray changes, CancellationToken cancellationToken) { // Apply previous edits if any. var originalText = context.SourceText; @@ -40,7 +43,8 @@ public async override Task> ExecuteAsync(FormattingCo cancellationToken.ThrowIfCancellationRequested(); // Apply original C# edits - var csharpChanges = await FormatCSharpAsync(changedContext, cancellationToken).ConfigureAwait(false); + var csharpDocument = roslynWorkspaceHelper.CreateCSharpDocument(changedContext.CodeDocument); + var csharpChanges = await FormatCSharpAsync(changedContext, roslynWorkspaceHelper.HostWorkspaceServices, csharpDocument, cancellationToken).ConfigureAwait(false); if (csharpChanges.Length > 0) { changedText = changedText.WithChanges(csharpChanges); @@ -51,7 +55,7 @@ public async override Task> ExecuteAsync(FormattingCo cancellationToken.ThrowIfCancellationRequested(); - var indentationChanges = await AdjustIndentationAsync(changedContext, startLine: 0, endLineInclusive: changedText.Lines.Count - 1, cancellationToken).ConfigureAwait(false); + var indentationChanges = await AdjustIndentationAsync(changedContext, startLine: 0, endLineInclusive: changedText.Lines.Count - 1, roslynWorkspaceHelper.HostWorkspaceServices, cancellationToken).ConfigureAwait(false); if (indentationChanges.Length > 0) { // Apply the edits that modify indentation. @@ -65,7 +69,7 @@ public async override Task> ExecuteAsync(FormattingCo return changedText.GetTextChangesArray(originalText); } - private async Task> FormatCSharpAsync(FormattingContext context, CancellationToken cancellationToken) + private async Task> FormatCSharpAsync(FormattingContext context, HostWorkspaceServices hostWorkspaceServices, Document csharpDocument, CancellationToken cancellationToken) { var sourceText = context.SourceText; @@ -81,7 +85,8 @@ private async Task> FormatCSharpAsync(FormattingConte // These should already be remapped. var spanToFormat = sourceText.GetLinePositionSpan(span); - var changes = await _csharpFormatter.FormatAsync(context, spanToFormat, cancellationToken).ConfigureAwait(false); + + var changes = await _csharpFormatter.FormatAsync(hostWorkspaceServices, csharpDocument, context, spanToFormat, cancellationToken).ConfigureAwait(false); csharpChanges.AddRange(changes.Where(e => spanToFormat.Contains(sourceText.GetLinePositionSpan(e.Span)))); } diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs new file mode 100644 index 00000000000..76daf81ca9d --- /dev/null +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs @@ -0,0 +1,45 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the MIT license. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Razor.Language; +using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Razor.Workspaces; + +namespace Microsoft.CodeAnalysis.Razor.Formatting; + +internal abstract partial class CSharpFormattingPassBase +{ + protected class RoslynWorkspaceHelper(IHostServicesProvider hostServicesProvider) : IDisposable + { + private readonly Lazy _lazyWorkspace = new(() => CreateWorkspace(hostServicesProvider)); + + public HostWorkspaceServices HostWorkspaceServices => _lazyWorkspace.Value.Services; + + public Document CreateCSharpDocument(RazorCodeDocument codeDocument) + { + var project = _lazyWorkspace.Value.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp); + var csharpSourceText = codeDocument.GetCSharpSourceText(); + return project.AddDocument("TestDocument", csharpSourceText); + } + + private static AdhocWorkspace CreateWorkspace(IHostServicesProvider hostServicesProvider) + { + var fallbackServices = hostServicesProvider.GetServices(); + var services = AdhocServices.Create( + workspaceServices: [], + languageServices: [], + fallbackServices); + + return new AdhocWorkspace(services); + } + + public void Dispose() + { + if (_lazyWorkspace.IsValueCreated) + { + _lazyWorkspace.Value.Dispose(); + } + } + } +} diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.cs index a88cfc0faba..b9a476872fe 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.cs @@ -13,22 +13,31 @@ using Microsoft.AspNetCore.Razor.Language.Extensions; using Microsoft.AspNetCore.Razor.Language.Syntax; using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Razor.DocumentMapping; +using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; using RazorSyntaxNode = Microsoft.AspNetCore.Razor.Language.Syntax.SyntaxNode; namespace Microsoft.CodeAnalysis.Razor.Formatting; -internal abstract class CSharpFormattingPassBase(IDocumentMappingService documentMappingService, bool isFormatOnType) : IFormattingPass +internal abstract partial class CSharpFormattingPassBase(IDocumentMappingService documentMappingService, IHostServicesProvider hostServicesProvider, bool isFormatOnType) : IFormattingPass { private readonly bool _isFormatOnType = isFormatOnType; protected IDocumentMappingService DocumentMappingService { get; } = documentMappingService; - public abstract Task> ExecuteAsync(FormattingContext context, ImmutableArray changes, CancellationToken cancellationToken); + public async Task> ExecuteAsync(FormattingContext context, ImmutableArray changes, CancellationToken cancellationToken) + { + using var roslynWorkspaceHelper = new RoslynWorkspaceHelper(hostServicesProvider); + + return await ExecuteCoreAsync(context, roslynWorkspaceHelper, changes, cancellationToken).ConfigureAwait(false); + } + + protected abstract Task> ExecuteCoreAsync(FormattingContext context, RoslynWorkspaceHelper roslynWorkspaceHelper, ImmutableArray changes, CancellationToken cancellationToken); - protected async Task> AdjustIndentationAsync(FormattingContext context, int startLine, int endLineInclusive, CancellationToken cancellationToken) + protected async Task> AdjustIndentationAsync(FormattingContext context, int startLine, int endLineInclusive, HostWorkspaceServices hostWorkspaceServices, CancellationToken cancellationToken) { // In this method, the goal is to make final adjustments to the indentation of each line. // We will take into account the following, @@ -113,7 +122,7 @@ protected async Task> AdjustIndentationAsync(Formatti } // Now, invoke the C# formatter to obtain the CSharpDesiredIndentation for all significant locations. - var significantLocationIndentation = await CSharpFormatter.GetCSharpIndentationAsync(context, significantLocations, cancellationToken).ConfigureAwait(false); + var significantLocationIndentation = await CSharpFormatter.GetCSharpIndentationAsync(context, significantLocations, hostWorkspaceServices, cancellationToken).ConfigureAwait(false); // Build source mapping indentation scopes. var sourceMappingIndentations = new SortedDictionary(); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpOnTypeFormattingPass.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpOnTypeFormattingPass.cs index 1d698b246d9..df2f821b088 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpOnTypeFormattingPass.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpOnTypeFormattingPass.cs @@ -17,6 +17,7 @@ using Microsoft.CodeAnalysis.ExternalAccess.Razor; using Microsoft.CodeAnalysis.Razor.DocumentMapping; using Microsoft.CodeAnalysis.Razor.Logging; +using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; @@ -27,12 +28,13 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; /// internal sealed class CSharpOnTypeFormattingPass( IDocumentMappingService documentMappingService, + IHostServicesProvider hostServicesProvider, ILoggerFactory loggerFactory) - : CSharpFormattingPassBase(documentMappingService, isFormatOnType: true) + : CSharpFormattingPassBase(documentMappingService, hostServicesProvider, isFormatOnType: true) { private readonly ILogger _logger = loggerFactory.GetOrCreateLogger(); - public async override Task> ExecuteAsync(FormattingContext context, ImmutableArray changes, CancellationToken cancellationToken) + protected async override Task> ExecuteCoreAsync(FormattingContext context, RoslynWorkspaceHelper roslynWorkspaceHelper, ImmutableArray changes, CancellationToken cancellationToken) { // Normalize and re-map the C# edits. var codeDocument = context.CodeDocument; @@ -51,7 +53,7 @@ public async override Task> ExecuteAsync(FormattingCo formatOnReturn: true, formatOnTyping: true, formatOnSemicolon: true, formatOnCloseBrace: true); var formattingChanges = await RazorCSharpFormattingInteractionService.GetFormattingChangesAsync( - context.CSharpWorkspaceDocument, + roslynWorkspaceHelper.CreateCSharpDocument(context.CodeDocument), typedChar: context.TriggerCharacter, projectedIndex, context.Options.ToIndentationOptions(), @@ -167,7 +169,7 @@ public async override Task> ExecuteAsync(FormattingCo Debug.Assert(cleanedText.Lines.Count > endLineInclusive, "Invalid range. This is unexpected."); - var indentationChanges = await AdjustIndentationAsync(changedContext, startLine, endLineInclusive, cancellationToken).ConfigureAwait(false); + var indentationChanges = await AdjustIndentationAsync(changedContext, startLine, endLineInclusive, roslynWorkspaceHelper.HostWorkspaceServices, cancellationToken).ConfigureAwait(false); if (indentationChanges.Length > 0) { // Apply the edits that modify indentation. diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs index 7e820e29593..23110dab756 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingService.cs @@ -30,7 +30,6 @@ internal class RazorFormattingService : IRazorFormattingService private static readonly FrozenSet s_htmlTriggerCharacterSet = FrozenSet.ToFrozenSet(["\n", "{", "}", ";"], StringComparer.Ordinal); private readonly IFormattingCodeDocumentProvider _codeDocumentProvider; - private readonly IHostServicesProvider _hostServicesProvider; private readonly ImmutableArray _documentFormattingPasses; private readonly ImmutableArray _validationPasses; @@ -44,10 +43,9 @@ public RazorFormattingService( ILoggerFactory loggerFactory) { _codeDocumentProvider = codeDocumentProvider; - _hostServicesProvider = hostServicesProvider; _htmlOnTypeFormattingPass = new HtmlOnTypeFormattingPass(loggerFactory); - _csharpOnTypeFormattingPass = new CSharpOnTypeFormattingPass(documentMappingService, loggerFactory); + _csharpOnTypeFormattingPass = new CSharpOnTypeFormattingPass(documentMappingService, hostServicesProvider, loggerFactory); _validationPasses = [ new FormattingDiagnosticValidationPass(loggerFactory), @@ -57,7 +55,7 @@ public RazorFormattingService( [ new HtmlFormattingPass(loggerFactory), new RazorFormattingPass(), - new CSharpFormattingPass(documentMappingService, loggerFactory), + new CSharpFormattingPass(documentMappingService, hostServicesProvider, loggerFactory), .. _validationPasses ]; } @@ -97,13 +95,11 @@ public async Task> GetDocumentFormattingChangesAsync( var uri = documentContext.Uri; var documentSnapshot = documentContext.Snapshot; var hostDocumentVersion = documentContext.Snapshot.Version; - using var workspaceProvider = new AdhocWorkspaceProvider(_hostServicesProvider); var context = FormattingContext.Create( documentSnapshot, codeDocument, options, - _codeDocumentProvider, - workspaceProvider); + _codeDocumentProvider); var originalText = context.SourceText; var result = htmlChanges; @@ -224,13 +220,11 @@ private async Task> ApplyFormattedChangesAsync( var documentSnapshot = documentContext.Snapshot; var codeDocument = await _codeDocumentProvider.GetCodeDocumentAsync(documentSnapshot).ConfigureAwait(false); - using var workspaceProvider = new AdhocWorkspaceProvider(_hostServicesProvider); var context = FormattingContext.CreateForOnTypeFormatting( documentSnapshot, codeDocument, options, _codeDocumentProvider, - workspaceProvider, automaticallyAddUsings, hostDocumentIndex, triggerCharacter); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs index 6ad41e23b3c..69ef7632120 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingContentValidationPassTest.cs @@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Moq; using Xunit; @@ -84,13 +83,11 @@ private static FormattingContext CreateFormattingContext(TestCode input, int tab InsertSpaces = insertSpaces, }; - using var workspaceProvider = new AdhocWorkspaceProvider(new DefaultHostServicesProvider()); var context = FormattingContext.Create( documentSnapshot, codeDocument, options, - new LspFormattingCodeDocumentProvider(), - workspaceProvider); + new LspFormattingCodeDocumentProvider()); return context; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs index 0fe0538a84d..85801cf1020 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingDiagnosticValidationPassTest.cs @@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Razor.Test.Common.LanguageServer; using Microsoft.CodeAnalysis.Razor.Formatting; using Microsoft.CodeAnalysis.Razor.ProjectSystem; -using Microsoft.CodeAnalysis.Razor.Workspaces; using Microsoft.CodeAnalysis.Text; using Xunit; using Xunit.Abstractions; @@ -82,13 +81,11 @@ private static FormattingContext CreateFormattingContext(TestCode input, int tab InsertSpaces = insertSpaces, }; - using var workspaceProvider = new AdhocWorkspaceProvider(new DefaultHostServicesProvider()); var context = FormattingContext.Create( documentSnapshot, codeDocument, options, - new LspFormattingCodeDocumentProvider(), - workspaceProvider); + new LspFormattingCodeDocumentProvider()); return context; } From 614d5e4412aa0ca62894b565956d8734d5f789c6 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 17 Sep 2024 11:40:01 +1000 Subject: [PATCH 354/386] PR feedback --- .../RemoteHostServicesProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteHostServicesProvider.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteHostServicesProvider.cs index f490a128a76..fcacdb3afa6 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteHostServicesProvider.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteHostServicesProvider.cs @@ -8,7 +8,7 @@ namespace Microsoft.CodeAnalysis.Remote.Razor; [Export(typeof(IHostServicesProvider)), Shared] -internal sealed class RemoteHostServicesProvider() : IHostServicesProvider +internal sealed class RemoteHostServicesProvider : IHostServicesProvider { public HostServices GetServices() { From 103645feb25602550daf53e5b6c967ce9bac17d0 Mon Sep 17 00:00:00 2001 From: David Wengier Date: Tue, 17 Sep 2024 12:49:27 +1000 Subject: [PATCH 355/386] =?UTF-8?q?=F0=9F=A6=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs index 76daf81ca9d..3ad4bfee98a 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPassBase.RoslynWorkspaceHelper.cs @@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.Razor.Formatting; internal abstract partial class CSharpFormattingPassBase { - protected class RoslynWorkspaceHelper(IHostServicesProvider hostServicesProvider) : IDisposable + protected sealed class RoslynWorkspaceHelper(IHostServicesProvider hostServicesProvider) : IDisposable { private readonly Lazy _lazyWorkspace = new(() => CreateWorkspace(hostServicesProvider)); From 4467256ff7f08a5b0a2b9965823b8d6f44df3fcc Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Tue, 17 Sep 2024 09:52:55 +0200 Subject: [PATCH 356/386] Use Basic.Reference.Assemblies in Mvc Extension tests (#10888) * Use Basic.Reference.Assemblies in Mvc Extension tests * Remove unused shim projects --- Razor.Slim.slnf | 1 - Razor.sln | 22 -- docs/ProjectsAndLayering.md | 2 +- .../CodeGenerationIntegrationTest.cs | 77 +++--- ...spNetCore.Mvc.Razor.Extensions.Test.csproj | 19 +- .../test/MvcShim.cs | 46 ---- .../RazorView_Layout_WithCssScope.codegen.cs | 56 +++- .../RazorView_Layout_WithCssScope.ir.txt | 78 +++--- ...ComponentTagHelperDescriptorFactoryTest.cs | 258 +++++++++--------- ...omponentTagHelperDescriptorProviderTest.cs | 2 +- ...azor.Test.MvcShim.ClassLib.Compiler.csproj | 18 -- ...NetCore.Razor.Test.MvcShim.Compiler.csproj | 15 - .../TestCompilation.cs | 4 +- 13 files changed, 272 insertions(+), 326 deletions(-) delete mode 100644 src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/MvcShim.cs delete mode 100644 src/Compiler/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.Compiler.csproj delete mode 100644 src/Compiler/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.Compiler.csproj diff --git a/Razor.Slim.slnf b/Razor.Slim.slnf index 0563c409be2..0b7ce028aee 100644 --- a/Razor.Slim.slnf +++ b/Razor.Slim.slnf @@ -15,7 +15,6 @@ "src\\Compiler\\Microsoft.Net.Compilers.Razor.Toolset\\Microsoft.Net.Compilers.Razor.Toolset.csproj", "src\\Compiler\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.Compiler.csproj", "src\\Compiler\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.Compiler.csproj", - "src\\Compiler\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim\\Microsoft.AspNetCore.Razor.Test.MvcShim.Compiler.csproj", "src\\Compiler\\test\\Microsoft.NET.Sdk.Razor.SourceGenerators.Tests\\Microsoft.NET.Sdk.Razor.SourceGenerators.Test.csproj", "src\\Compiler\\tools\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal.csproj", "src\\Compiler\\tools\\Microsoft.CodeAnalysis.Razor.Tooling.Internal\\Microsoft.CodeAnalysis.Razor.Tooling.Internal.csproj", diff --git a/Razor.sln b/Razor.sln index c9338fafeb3..9e4df49add7 100644 --- a/Razor.sln +++ b/Razor.sln @@ -100,10 +100,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Sdk.Razor.Sou EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Sdk.Razor.SourceGenerators.Test", "src\Compiler\test\Microsoft.NET.Sdk.Razor.SourceGenerators.Tests\Microsoft.NET.Sdk.Razor.SourceGenerators.Test.csproj", "{BD96BB0F-84DE-4A5F-8832-C8EADA36F43A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Test.MvcShim.Compiler", "src\Compiler\test\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.Compiler.csproj", "{2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.Compiler", "src\Compiler\test\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.Compiler.csproj", "{9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.Compiler", "src\Compiler\test\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.Compiler.csproj", "{A0867F6B-3DBB-4743-B241-F59878BFA15D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.Compiler", "src\Compiler\test\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.Compiler.csproj", "{B040B919-D8E3-4656-BD85-88A541AA893D}" @@ -410,22 +406,6 @@ Global {BD96BB0F-84DE-4A5F-8832-C8EADA36F43A}.Release|Any CPU.Build.0 = Release|Any CPU {BD96BB0F-84DE-4A5F-8832-C8EADA36F43A}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU {BD96BB0F-84DE-4A5F-8832-C8EADA36F43A}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}.Release|Any CPU.Build.0 = Release|Any CPU - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}.Release|Any CPU.Build.0 = Release|Any CPU - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU {A0867F6B-3DBB-4743-B241-F59878BFA15D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A0867F6B-3DBB-4743-B241-F59878BFA15D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A0867F6B-3DBB-4743-B241-F59878BFA15D}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU @@ -660,8 +640,6 @@ Global {FB7C870E-A173-4F75-BE63-4EF39C79A759} = {5B60F564-4AD7-4B70-A887-7D91496799A2} {F5017FD5-EA78-4CD2-A1B6-F534910683F8} = {AA4EE974-E765-4B97-AF35-F734BF9830F6} {BD96BB0F-84DE-4A5F-8832-C8EADA36F43A} = {AA4EE974-E765-4B97-AF35-F734BF9830F6} - {2CB7D554-49CE-45AC-97DF-7F8C597BDFA7} = {A5E2E4FA-6087-4C16-BB7A-89E23AA0F4E3} - {9FE4A38F-F0E7-45BD-94C1-1DC6FA55BB4A} = {A5E2E4FA-6087-4C16-BB7A-89E23AA0F4E3} {A0867F6B-3DBB-4743-B241-F59878BFA15D} = {A5E2E4FA-6087-4C16-BB7A-89E23AA0F4E3} {B040B919-D8E3-4656-BD85-88A541AA893D} = {A5E2E4FA-6087-4C16-BB7A-89E23AA0F4E3} {907EDA43-B4D9-40DA-BA07-8E00DD89FA33} = {FB7C870E-A173-4F75-BE63-4EF39C79A759} diff --git a/docs/ProjectsAndLayering.md b/docs/ProjectsAndLayering.md index 29c85730d64..e95f1b8efbe 100644 --- a/docs/ProjectsAndLayering.md +++ b/docs/ProjectsAndLayering.md @@ -119,7 +119,7 @@ target the broadest set of frameworks. - Microsoft.AspNetCore.Razor.Test.MvcShim (`net8.0`;`net472`) - Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib (`netstandard2.0`) - Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X (`net8.0`;`net472`) -- Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X (`net8.0`;`net4720`) +- Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X (`net8.0`;`net472`) ### Tooling Core Tests diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/IntegrationTests/CodeGenerationIntegrationTest.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/IntegrationTests/CodeGenerationIntegrationTest.cs index 36a5ecf0f63..49dbbb3f985 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/IntegrationTests/CodeGenerationIntegrationTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/IntegrationTests/CodeGenerationIntegrationTest.cs @@ -6,7 +6,6 @@ using System.Linq; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.IntegrationTests; -using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Test.Utilities; @@ -17,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests; public class CodeGenerationIntegrationTest : IntegrationTestBase { - private static readonly CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode"); + private static readonly CSharpCompilation DefaultBaseCompilation = TestCompilation.Create().WithAssemblyName("AppCode"); private RazorConfiguration _configuration; @@ -239,11 +238,11 @@ public void BasicComponent_Runtime() public void Sections_Runtime() { // Arrange - AddCSharpSyntaxTree($$""" + AddCSharpSyntaxTree(""" using Microsoft.AspNetCore.Mvc.ViewFeatures; - public class InputTestTagHelper : {{typeof(TagHelper).FullName}} + public class InputTestTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public ModelExpression For { get; set; } } @@ -389,10 +388,10 @@ public void Model_Runtime() public void ModelExpressionTagHelper_Runtime() { // Arrange - AddCSharpSyntaxTree($$""" + AddCSharpSyntaxTree(""" using Microsoft.AspNetCore.Mvc.ViewFeatures; - public class InputTestTagHelper : {{typeof(TagHelper).FullName}} + public class InputTestTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public ModelExpression For { get; set; } } @@ -413,8 +412,8 @@ public class InputTestTagHelper : {{typeof(TagHelper).FullName}} public void RazorPages_Runtime() { // Arrange - AddCSharpSyntaxTree($$""" - public class DivTagHelper : {{typeof(TagHelper).FullName}} + AddCSharpSyntaxTree(""" + public class DivTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { } @@ -450,8 +449,8 @@ public void RazorPagesWithRouteTemplate_Runtime() public void RazorPagesWithoutModel_Runtime() { // Arrange - AddCSharpSyntaxTree($$""" - public class DivTagHelper : {{typeof(TagHelper).FullName}} + AddCSharpSyntaxTree(""" + public class DivTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { } @@ -502,7 +501,7 @@ public void ViewWithNamespace_Runtime() public void ViewComponentTagHelper_Runtime() { // Arrange - AddCSharpSyntaxTree($$""" + AddCSharpSyntaxTree(""" public class TestViewComponent { public string Invoke(string firstName) @@ -511,8 +510,8 @@ public string Invoke(string firstName) } } - [{{typeof(HtmlTargetElementAttribute).FullName}}] - public class AllTagHelper : {{typeof(TagHelper).FullName}} + [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute] + public class AllTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public string Bar { get; set; } } @@ -599,15 +598,15 @@ public void RazorPageWithNoLeadingPageDirective_Runtime() public void RazorPage_WithCssScope() { // Arrange - AddCSharpSyntaxTree($$""" - [{{typeof(HtmlTargetElementAttribute).FullName}}("all")] - public class AllTagHelper : {{typeof(TagHelper).FullName}} + AddCSharpSyntaxTree(""" + [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("all")] + public class AllTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public string Bar { get; set; } } - [{{typeof(HtmlTargetElementAttribute).FullName}}("form")] - public class FormTagHelper : {{typeof(TagHelper).FullName}} + [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("form")] + public class FormTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { } """); @@ -643,15 +642,15 @@ public class FormTagHelper : {{typeof(TagHelper).FullName}} public void RazorView_WithCssScope() { // Arrange - AddCSharpSyntaxTree($$""" - [{{typeof(HtmlTargetElementAttribute).FullName}}("all")] - public class AllTagHelper : {{typeof(TagHelper).FullName}} + AddCSharpSyntaxTree(""" + [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("all")] + public class AllTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public string Bar { get; set; } } - [{{typeof(HtmlTargetElementAttribute).FullName}}("form")] - public class FormTagHelper : {{typeof(TagHelper).FullName}} + [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("form")] + public class FormTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { } """); @@ -686,14 +685,14 @@ public class FormTagHelper : {{typeof(TagHelper).FullName}} public void RazorView_Layout_WithCssScope() { // Arrange - AddCSharpSyntaxTree($$""" - [{{typeof(HtmlTargetElementAttribute).FullName}}("all")] - public class AllTagHelper : {{typeof(TagHelper).FullName}} + AddCSharpSyntaxTree(""" + [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("all")] + public class AllTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public string Bar { get; set; } } - [{{typeof(HtmlTargetElementAttribute).FullName}}("form")] - public class FormTagHelper : {{typeof(TagHelper).FullName}} + [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute("form")] + public class FormTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { } """); @@ -1109,10 +1108,10 @@ public void BasicComponent_DesignTime() public void Sections_DesignTime() { // Arrange - AddCSharpSyntaxTree($$""" + AddCSharpSyntaxTree(""" using Microsoft.AspNetCore.Mvc.ViewFeatures; - public class InputTestTagHelper : {{typeof(TagHelper).FullName}} + public class InputTestTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public ModelExpression For { get; set; } } @@ -1294,10 +1293,10 @@ public class ThisShouldBeGenerated public void ModelExpressionTagHelper_DesignTime() { // Arrange - AddCSharpSyntaxTree($$""" + AddCSharpSyntaxTree(""" using Microsoft.AspNetCore.Mvc.ViewFeatures; - public class InputTestTagHelper : {{typeof(TagHelper).FullName}} + public class InputTestTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public ModelExpression For { get; set; } } @@ -1320,8 +1319,8 @@ public class InputTestTagHelper : {{typeof(TagHelper).FullName}} public void RazorPages_DesignTime() { // Arrange - AddCSharpSyntaxTree($$""" - public class DivTagHelper : {{typeof(TagHelper).FullName}} + AddCSharpSyntaxTree(""" + public class DivTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { } @@ -1361,8 +1360,8 @@ public void RazorPagesWithRouteTemplate_DesignTime() public void RazorPagesWithoutModel_DesignTime() { // Arrange - AddCSharpSyntaxTree($$""" - public class DivTagHelper : {{typeof(TagHelper).FullName}} + AddCSharpSyntaxTree(""" + public class DivTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { } @@ -1419,7 +1418,7 @@ public void ViewWithNamespace_DesignTime() public void ViewComponentTagHelper_DesignTime() { // Arrange - AddCSharpSyntaxTree($$""" + AddCSharpSyntaxTree(""" public class TestViewComponent { public string Invoke(string firstName) @@ -1428,8 +1427,8 @@ public string Invoke(string firstName) } } - [{{typeof(HtmlTargetElementAttribute).FullName}}] - public class AllTagHelper : {{typeof(TagHelper).FullName}} + [Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElementAttribute] + public class AllTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper { public string Bar { get; set; } } diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj index 1bcc1a603d1..10e94b55c0d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj @@ -1,4 +1,4 @@ - + $(DefaultNetCoreTargetFrameworks) @@ -18,7 +18,6 @@ - @@ -30,20 +29,4 @@ - - - - - - - - - - - - - - - - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/MvcShim.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/MvcShim.cs deleted file mode 100644 index cfd89e43690..00000000000 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/MvcShim.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System.IO; -using System.Reflection; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions; - -internal static class MvcShim -{ - public static readonly string AssemblyName = "Microsoft.AspNetCore.Razor.Test.MvcShim.Compiler"; - - private static Assembly _assembly; - private static CSharpCompilation _baseCompilation; - - public static Assembly Assembly - { - get - { - if (_assembly == null) - { - var filePath = Path.Combine(Directory.GetCurrentDirectory(), AssemblyName + ".dll"); - _assembly = Assembly.LoadFrom(filePath); - } - - return _assembly; - } - } - - public static CSharpCompilation BaseCompilation - { - get - { - if (_baseCompilation == null) - { - _baseCompilation = TestCompilation.Create(Assembly); - } - - return _baseCompilation; - } - } -} diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.codegen.cs index 8d5327bb7b4..225e3b44bee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.codegen.cs @@ -21,11 +21,35 @@ namespace AspNetCoreGeneratedDocument internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage #nullable disable { + #line hidden + #pragma warning disable 0649 + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext; + #pragma warning restore 0649 + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner(); + #pragma warning disable 0169 + private string __tagHelperStringValueBuffer; + #pragma warning restore 0169 + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null; + private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager + { + get + { + if (__backed__tagHelperScopeManager == null) + { + __backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope); + } + return __backed__tagHelperScopeManager; + } + } + private global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper; + private global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper; #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { - WriteLiteral("\r\n\r\n\r\n\r\n \r\n \r\n "); - Write( + WriteLiteral("\r\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n"); + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("head", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { + WriteLiteral("\r\n <meta charset=\"utf-8\" />\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\r\n <title>"); + Write( #nullable restore #line (7,13)-(7,30) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" ViewData["Title"] @@ -33,8 +57,34 @@ internal sealed class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_t #line default #line hidden #nullable disable + ); + WriteLiteral(" - Test layout component\r\n"); + } + ); + __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper = CreateTagHelper(); + __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + if (!__tagHelperExecutionContext.Output.IsContentModified) + { + await __tagHelperExecutionContext.SetOutputContentAsync(); + } + Write(__tagHelperExecutionContext.Output); + __tagHelperExecutionContext = __tagHelperScopeManager.End(); + WriteLiteral("\r\n"); + __tagHelperExecutionContext = __tagHelperScopeManager.Begin("body", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "__UniqueIdSuppressedForTesting__", async() => { + WriteLiteral("\r\n

This is a body.

\r\n"); + } ); - WriteLiteral(" - Test layout component\r\n\r\n\r\n

This is a body.

\r\n\r\n\r\n"); + __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper = CreateTagHelper(); + __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + if (!__tagHelperExecutionContext.Output.IsContentModified) + { + await __tagHelperExecutionContext.SetOutputContentAsync(); + } + Write(__tagHelperExecutionContext.Output); + __tagHelperExecutionContext = __tagHelperScopeManager.End(); + WriteLiteral("\r\n\r\n"); } #pragma warning restore 1998 #nullable restore diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt index 181bccc7705..c6620cb44af 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt @@ -12,49 +12,57 @@ RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - ClassDeclaration - - internal sealed - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_test - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - + DefaultTagHelperRuntime - + FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_HeadTagHelper + FieldDeclaration - - private - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper - __Microsoft_AspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync - HtmlContent - (0:0,0 [164] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) + HtmlContent - (0:0,0 [37] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (0:0,0 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n LazyIntermediateToken - (2:1,0 [17] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n LazyIntermediateToken - (19:2,0 [5] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - LazyIntermediateToken - (35:2,16 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n - LazyIntermediateToken - (37:3,0 [5] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - - LazyIntermediateToken - (43:3,6 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n - LazyIntermediateToken - (49:4,4 [5] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - - LazyIntermediateToken - (73:4,28 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n - LazyIntermediateToken - (79:5,4 [5] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - - LazyIntermediateToken - (151:5,76 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n - LazyIntermediateToken - (157:6,4 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - - CSharpExpression - (165:6,12 [17] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - LazyIntermediateToken - (165:6,12 [17] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - CSharp - ViewData["Title"] - HtmlContent - (182:6,29 [97] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - LazyIntermediateToken - (182:6,29 [24] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \-Test layout component - LazyIntermediateToken - (206:6,53 [8] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - - LazyIntermediateToken - (214:6,61 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n - LazyIntermediateToken - (216:7,0 [7] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - + TagHelper - (37:3,0 [186] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - head - TagMode.StartTagAndEndTag + DefaultTagHelperBody - + HtmlContent - (43:3,6 [121] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) + LazyIntermediateToken - (43:3,6 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n + LazyIntermediateToken - (49:4,4 [5] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - + LazyIntermediateToken - (73:4,28 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n + LazyIntermediateToken - (79:5,4 [5] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - + LazyIntermediateToken - (151:5,76 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n + LazyIntermediateToken - (157:6,4 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - + CSharpExpression - (165:6,12 [17] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) + LazyIntermediateToken - (165:6,12 [17] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - CSharp - ViewData["Title"] + HtmlContent - (182:6,29 [34] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) + LazyIntermediateToken - (182:6,29 [24] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \-Test layout component + LazyIntermediateToken - (206:6,53 [8] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - + LazyIntermediateToken - (214:6,61 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n + DefaultTagHelperCreate - - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper + DefaultTagHelperExecute - + HtmlContent - (223:7,7 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (223:7,7 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n - LazyIntermediateToken - (225:8,0 [5] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - - LazyIntermediateToken - (231:8,6 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n - LazyIntermediateToken - (237:9,4 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html -

- LazyIntermediateToken - (240:9,7 [15] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - This is a body. - LazyIntermediateToken - (255:9,22 [4] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html -

- LazyIntermediateToken - (259:9,26 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n - LazyIntermediateToken - (261:10,0 [7] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - + TagHelper - (225:8,0 [43] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - body - TagMode.StartTagAndEndTag + DefaultTagHelperBody - + HtmlContent - (231:8,6 [30] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) + LazyIntermediateToken - (231:8,6 [6] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n + LazyIntermediateToken - (237:9,4 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html -

+ LazyIntermediateToken - (240:9,7 [15] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - This is a body. + LazyIntermediateToken - (255:9,22 [4] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html -

+ LazyIntermediateToken - (259:9,26 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n + DefaultTagHelperCreate - - Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper + DefaultTagHelperExecute - + HtmlContent - (268:10,7 [11] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) LazyIntermediateToken - (268:10,7 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n LazyIntermediateToken - (270:11,0 [7] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - LazyIntermediateToken - (277:11,7 [2] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTagHelperDescriptorFactoryTest.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTagHelperDescriptorFactoryTest.cs index 353309d3551..44d33525422 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTagHelperDescriptorFactoryTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTagHelperDescriptorFactoryTest.cs @@ -3,11 +3,9 @@ #nullable disable -using System.Collections.Generic; -using System.Reflection; -using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; using Xunit; using static Microsoft.AspNetCore.Razor.Language.CommonMetadata; @@ -15,20 +13,20 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions; public class ViewComponentTagHelperDescriptorFactoryTest { - private static readonly Assembly _assembly = typeof(ViewComponentTagHelperDescriptorFactoryTest).GetTypeInfo().Assembly; + private static readonly Compilation _compilation = TestCompilation.Create(syntaxTrees: [CSharpSyntaxTree.ParseText(AdditionalCode)], references: []); [Fact] public void CreateDescriptor_UnderstandsStringParameters() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(StringParameterViewComponent).FullName); + var testCompilation = _compilation; + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.StringParameterViewComponent"); var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); var expectedDescriptor = TagHelperDescriptorBuilder.Create( ViewComponentTagHelperConventions.Kind, "__Generated__StringParameterViewComponentTagHelper", - typeof(StringParameterViewComponent).GetTypeInfo().Assembly.GetName().Name) + TestCompilation.AssemblyName) .Metadata( TypeName("__Generated__StringParameterViewComponentTagHelper"), new(ViewComponentTagHelperMetadata.Name, "StringParameter")) @@ -63,14 +61,14 @@ public void CreateDescriptor_UnderstandsStringParameters() public void CreateDescriptor_UnderstandsVariousParameterTypes() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(VariousParameterViewComponent).FullName); + var testCompilation = _compilation; + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.VariousParameterViewComponent"); var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); var expectedDescriptor = TagHelperDescriptorBuilder.Create( ViewComponentTagHelperConventions.Kind, "__Generated__VariousParameterViewComponentTagHelper", - typeof(VariousParameterViewComponent).GetTypeInfo().Assembly.GetName().Name) + TestCompilation.AssemblyName) .Metadata( TypeName("__Generated__VariousParameterViewComponentTagHelper"), new(ViewComponentTagHelperMetadata.Name, "VariousParameter")) @@ -84,9 +82,9 @@ public void CreateDescriptor_UnderstandsVariousParameterTypes() attribute .Name("test-enum") .Metadata(PropertyName("testEnum")) - .TypeName(typeof(VariousParameterViewComponent).FullName + "." + nameof(VariousParameterViewComponent.TestEnum)) + .TypeName("TestNamespace.VariousParameterViewComponent.TestEnum") .AsEnum() - .DisplayName(typeof(VariousParameterViewComponent).FullName + "." + nameof(VariousParameterViewComponent.TestEnum) + " VariousParameterViewComponentTagHelper.testEnum")) + .DisplayName("TestNamespace.VariousParameterViewComponent.TestEnum VariousParameterViewComponentTagHelper.testEnum")) .BoundAttributeDescriptor(attribute => attribute .Name("test-string") @@ -112,14 +110,14 @@ public void CreateDescriptor_UnderstandsVariousParameterTypes() public void CreateDescriptor_UnderstandsGenericParameters() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(GenericParameterViewComponent).FullName); + var testCompilation = _compilation; + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.GenericParameterViewComponent"); var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); var expectedDescriptor = TagHelperDescriptorBuilder.Create( ViewComponentTagHelperConventions.Kind, "__Generated__GenericParameterViewComponentTagHelper", - typeof(GenericParameterViewComponent).GetTypeInfo().Assembly.GetName().Name) + TestCompilation.AssemblyName) .Metadata( TypeName("__Generated__GenericParameterViewComponentTagHelper"), new(ViewComponentTagHelperMetadata.Name, "GenericParameter")) @@ -154,13 +152,13 @@ public void CreateDescriptor_UnderstandsGenericParameters() public void CreateDescriptor_ForSyncViewComponentWithInvokeInBaseType_Works() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); var expectedDescriptor = TagHelperDescriptorBuilder.Create( ViewComponentTagHelperConventions.Kind, "__Generated__SyncDerivedViewComponentTagHelper", - typeof(SyncDerivedViewComponent).GetTypeInfo().Assembly.GetName().Name) + TestCompilation.AssemblyName) .Metadata( TypeName("__Generated__SyncDerivedViewComponentTagHelper"), new(ViewComponentTagHelperMetadata.Name, "SyncDerived")) @@ -184,7 +182,7 @@ public void CreateDescriptor_ForSyncViewComponentWithInvokeInBaseType_Works() .DisplayName("string SyncDerivedViewComponentTagHelper.bar")) .Build(); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncDerivedViewComponent).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.SyncDerivedViewComponent"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -197,13 +195,13 @@ public void CreateDescriptor_ForSyncViewComponentWithInvokeInBaseType_Works() public void CreateDescriptor_ForAsyncViewComponentWithInvokeInBaseType_Works() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); var expectedDescriptor = TagHelperDescriptorBuilder.Create( ViewComponentTagHelperConventions.Kind, "__Generated__AsyncDerivedViewComponentTagHelper", - typeof(AsyncDerivedViewComponent).Assembly.GetName().Name) + TestCompilation.AssemblyName) .Metadata( TypeName("__Generated__AsyncDerivedViewComponentTagHelper"), new(ViewComponentTagHelperMetadata.Name, "AsyncDerived")) @@ -211,7 +209,7 @@ public void CreateDescriptor_ForAsyncViewComponentWithInvokeInBaseType_Works() .TagMatchingRuleDescriptor(rule => rule.RequireTagName("vc:async-derived")) .Build(); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncDerivedViewComponent).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.AsyncDerivedViewComponent"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -224,10 +222,10 @@ public void CreateDescriptor_ForAsyncViewComponentWithInvokeInBaseType_Works() public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInvokeMethod() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(ViewComponentWithoutInvokeMethod).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.ViewComponentWithoutInvokeMethod"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -241,10 +239,10 @@ public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInvokeMethod() public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInstanceInvokeMethod() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(StaticInvokeAsyncViewComponent).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.StaticInvokeAsyncViewComponent"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -258,10 +256,10 @@ public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInstanceInvoke public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoPublicInvokeMethod() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(NonPublicInvokeAsyncViewComponent).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.NonPublicInvokeAsyncViewComponent"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -275,10 +273,10 @@ public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoPublicInvokeMe public void CreateDescriptor_ForViewComponentWithInvokeAsync_UnderstandsGenericTask() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncViewComponentWithGenericTask).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.AsyncViewComponentWithGenericTask"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -291,10 +289,10 @@ public void CreateDescriptor_ForViewComponentWithInvokeAsync_UnderstandsGenericT public void CreateDescriptor_ForViewComponentWithInvokeAsync_UnderstandsNonGenericTask() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncViewComponentWithNonGenericTask).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.AsyncViewComponentWithNonGenericTask"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -307,10 +305,10 @@ public void CreateDescriptor_ForViewComponentWithInvokeAsync_UnderstandsNonGener public void CreateDescriptor_ForViewComponentWithInvokeAsync_DoesNotUnderstandVoid() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncViewComponentWithString).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.AsyncViewComponentWithString"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -324,10 +322,10 @@ public void CreateDescriptor_ForViewComponentWithInvokeAsync_DoesNotUnderstandVo public void CreateDescriptor_ForViewComponentWithInvokeAsync_DoesNotUnderstandString() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncViewComponentWithString).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.AsyncViewComponentWithString"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -341,10 +339,10 @@ public void CreateDescriptor_ForViewComponentWithInvokeAsync_DoesNotUnderstandSt public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandVoid() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncViewComponentWithVoid).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.SyncViewComponentWithVoid"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -358,10 +356,10 @@ public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandVoid() public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandNonGenericTask() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncViewComponentWithNonGenericTask).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.SyncViewComponentWithNonGenericTask"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -375,10 +373,10 @@ public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandNonGene public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandGenericTask() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncViewComponentWithGenericTask).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.SyncViewComponentWithGenericTask"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -392,10 +390,10 @@ public void CreateDescriptor_ForViewComponentWithInvoke_DoesNotUnderstandGeneric public void CreateDescriptor_ForViewComponent_WithAmbiguousMethods() { // Arrange - var testCompilation = TestCompilation.Create(_assembly); + var testCompilation = _compilation; var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); - var viewComponent = testCompilation.GetTypeByMetadataName(typeof(DerivedViewComponentWithAmbiguity).FullName); + var viewComponent = testCompilation.GetTypeByMetadataName("TestNamespace.DerivedViewComponentWithAmbiguity"); // Act var descriptor = factory.CreateDescriptor(viewComponent); @@ -404,88 +402,96 @@ public void CreateDescriptor_ForViewComponent_WithAmbiguousMethods() var diagnostic = Assert.Single(descriptor.GetAllDiagnostics()); Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_AmbiguousMethods.Id, diagnostic.Id); } -} - -public class StringParameterViewComponent -{ - public string Invoke(string foo, string bar) => null; -} - -public class VariousParameterViewComponent -{ - public string Invoke(TestEnum testEnum, string testString, int baz = 5) => null; - - public enum TestEnum - { - A = 1, - B = 2, - C = 3 - } -} - -public class GenericParameterViewComponent -{ - public string Invoke(List Foo, Dictionary Bar) => null; -} - -public class ViewComponentWithoutInvokeMethod -{ -} - -public class AsyncViewComponentWithGenericTask -{ - public Task InvokeAsync() => null; -} - -public class AsyncViewComponentWithNonGenericTask -{ - public Task InvokeAsync() => null; -} - -public class AsyncViewComponentWithVoid -{ - public void InvokeAsync() { } -} -public class AsyncViewComponentWithString -{ - public string InvokeAsync() => null; -} - -public class SyncViewComponentWithVoid -{ - public void Invoke() { } -} - -public class SyncViewComponentWithNonGenericTask -{ - public Task Invoke() => null; -} - -public class SyncViewComponentWithGenericTask -{ - public Task Invoke() => null; -} - -public class SyncDerivedViewComponent : StringParameterViewComponent -{ -} - -public class AsyncDerivedViewComponent : AsyncViewComponentWithNonGenericTask -{ -} - -public class DerivedViewComponentWithAmbiguity : AsyncViewComponentWithNonGenericTask -{ - public string Invoke() => null; -} - -public class StaticInvokeAsyncViewComponent -{ - public static Task InvokeAsync() => null; -} - -public class NonPublicInvokeAsyncViewComponent -{ - protected Task InvokeAsync() => null; + public const string AdditionalCode = """ + using System.Collections.Generic; + using System.Threading.Tasks; + + namespace TestNamespace + { + public class StringParameterViewComponent + { + public string Invoke(string foo, string bar) => null; + } + + public class VariousParameterViewComponent + { + public string Invoke(TestEnum testEnum, string testString, int baz = 5) => null; + + public enum TestEnum + { + A = 1, + B = 2, + C = 3 + } + } + + public class GenericParameterViewComponent + { + public string Invoke(List Foo, Dictionary Bar) => null; + } + + public class ViewComponentWithoutInvokeMethod + { + } + + public class AsyncViewComponentWithGenericTask + { + public Task InvokeAsync() => null; + } + + public class AsyncViewComponentWithNonGenericTask + { + public Task InvokeAsync() => null; + } + + public class AsyncViewComponentWithVoid + { + public void InvokeAsync() { } + } + + public class AsyncViewComponentWithString + { + public string InvokeAsync() => null; + } + + public class SyncViewComponentWithVoid + { + public void Invoke() { } + } + + public class SyncViewComponentWithNonGenericTask + { + public Task Invoke() => null; + } + + public class SyncViewComponentWithGenericTask + { + public Task Invoke() => null; + } + + public class SyncDerivedViewComponent : StringParameterViewComponent + { + } + + public class AsyncDerivedViewComponent : AsyncViewComponentWithNonGenericTask + { + } + + public class DerivedViewComponentWithAmbiguity : AsyncViewComponentWithNonGenericTask + { + public string Invoke() => null; + } + + public class StaticInvokeAsyncViewComponent + { + public static Task InvokeAsync() => null; + } + + public class NonPublicInvokeAsyncViewComponent + { + protected Task InvokeAsync() => null; + } + } + """; } diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTagHelperDescriptorProviderTest.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTagHelperDescriptorProviderTest.cs index e4712707c84..340e4e1b4e4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTagHelperDescriptorProviderTest.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTagHelperDescriptorProviderTest.cs @@ -25,7 +25,7 @@ public class StringParameterViewComponent } "; - var compilation = MvcShim.BaseCompilation.AddSyntaxTrees(CSharpSyntaxTree.ParseText(code)); + var compilation = TestCompilation.Create().AddSyntaxTrees(CSharpSyntaxTree.ParseText(code)); var context = new TagHelperDescriptorProviderContext(compilation); diff --git a/src/Compiler/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.Compiler.csproj b/src/Compiler/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.Compiler.csproj deleted file mode 100644 index acb10650c86..00000000000 --- a/src/Compiler/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.Compiler.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - - - - - - diff --git a/src/Compiler/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.Compiler.csproj b/src/Compiler/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.Compiler.csproj deleted file mode 100644 index faa0c341e56..00000000000 --- a/src/Compiler/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.Compiler.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - $(DefaultNetCoreTargetFrameworks);$(DefaultNetFxTargetFramework) - true - - - - - - - - - - diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/TestCompilation.cs b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/TestCompilation.cs index f150526bc8a..76dee4cb168 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/TestCompilation.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/TestCompilation.cs @@ -60,7 +60,7 @@ private static IEnumerable ResolvePaths(CompilationLibrary library) public static string AssemblyName => "TestAssembly"; // When we use Basic.Reference.Assemblies everywhere, this overload should be removed. - // Tracked by https://github.com/dotnet/razor/issues/10343. + // See also https://github.com/dotnet/razor/issues/10343. public static CSharpCompilation Create(Assembly assembly, SyntaxTree syntaxTree = null) { IEnumerable syntaxTrees = null; @@ -83,6 +83,8 @@ public static CSharpCompilation Create(Assembly assembly, SyntaxTree syntaxTree return compilation; } + public static CSharpCompilation Create() => Create(syntaxTrees: [], references: []); + public static CSharpCompilation Create(IEnumerable syntaxTrees, IEnumerable references) { var compilation = CSharpCompilation.Create( From dda1b20b1e53e108041762b5550ad95216d39b05 Mon Sep 17 00:00:00 2001 From: Derek Gray Date: Tue, 17 Sep 2024 08:23:24 -0500 Subject: [PATCH 357/386] Respond to PR requested changes --- .../Formatting/Passes/HtmlFormattingPassBase.cs | 6 +++--- .../Formatting_NetFx/RazorFormattingTest.cs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/HtmlFormattingPassBase.cs b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/HtmlFormattingPassBase.cs index 855ed04b4ab..9f02ade9e7e 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/HtmlFormattingPassBase.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/HtmlFormattingPassBase.cs @@ -56,16 +56,16 @@ private static ImmutableArray FilterIncomingChanges(FormattingContex using var changesToKeep = new PooledArrayBuilder(capacity: changes.Length); - for (var i = 0; i < changes.Length; i++) + foreach (var change in changes) { // Don't keep changes that start inside of a razor comment block. - var comment = syntaxTree.Root.FindInnermostNode(changes[i].Span.Start)?.FirstAncestorOrSelf(); + var comment = syntaxTree.Root.FindInnermostNode(change.Span.Start)?.FirstAncestorOrSelf(); if (comment is not null) { continue; } - changesToKeep.Add(changes[i]); + changesToKeep.Add(change); } return changesToKeep.DrainToImmutable(); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs index 04acfc57758..5f54cbef8b9 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/RazorFormattingTest.cs @@ -711,18 +711,18 @@ public async Task MultiLineComment_WithinHtml () await RunFormattingTestAsync( input: """
- @* -
- This comment's indentation will be preserved + @*
+ This comment's opening at-star will be aligned, and the + indentation of the rest of its lines will be preserved.
*@
""", expected: """
- @* -
- This comment's indentation will be preserved + @*
+ This comment's opening at-star will be aligned, and the + indentation of the rest of its lines will be preserved.
*@
From 05a0fdd281514120189559acbb449bdcd9ea1a8b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 17 Sep 2024 17:44:38 +0000 Subject: [PATCH 358/386] Update dependencies from https://github.com/dotnet/arcade build 20240916.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24463.2 -> To Version 9.0.0-beta.24466.2 --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 48af69b8681..19df9def783 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -96,14 +96,14 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 3a25a7f1cc446b60678ed25c9d829420d6321eba - + https://github.com/dotnet/arcade - bcba6939456aa552554eae9ea9538a039cc98d96 + 04b9022eba9c184a8036328af513c22e6949e8b6 - + https://github.com/dotnet/arcade - bcba6939456aa552554eae9ea9538a039cc98d96 + 04b9022eba9c184a8036328af513c22e6949e8b6 diff --git a/eng/Versions.props b/eng/Versions.props index f16a1f34e72..89a48a2fe78 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,7 +50,7 @@ 6.0.2-servicing.22064.6 6.0.1 9.0.0-alpha.1.24304.1 - 9.0.0-beta.24463.2 + 9.0.0-beta.24466.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 4.12.0-2.24419.3 diff --git a/global.json b/global.json index 572464c35ba..ee427b672b0 100644 --- a/global.json +++ b/global.json @@ -22,7 +22,7 @@ "rollForward": "latestPatch" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24463.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24466.2", "Microsoft.Build.NoTargets": "3.7.0" } } From c349de7362e5b4b1f0226edb3d1726ef917d559f Mon Sep 17 00:00:00 2001 From: David Wengier Date: Wed, 18 Sep 2024 07:20:51 +1000 Subject: [PATCH 359/386] Bump Roslyn to 4.12.0-3.24466.4 --- eng/Version.Details.xml | 76 ++++++++++++++++++++--------------------- eng/Versions.props | 38 ++++++++++----------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7ea417466f4..9937b0aea87 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -11,82 +11,82 @@ ad3c9aa85596f42c6a483233c50fab8cee8c412a - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 - + https://github.com/dotnet/roslyn - 9f86520c46f67d2a8a59af189f8fd87e35c574bb + 7b7951aa13c50ad768538e58ed3805898b058928 diff --git a/eng/Versions.props b/eng/Versions.props index 707ebbb49ad..a78ad1ba11c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,25 +53,25 @@ 9.0.0-beta.24453.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 - 4.12.0-3.24454.5 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 + 4.12.0-3.24466.4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - View component '{0}' must have exactly one public method named '{1}' or '{2}'. - - - Method '{0}' of view component '{1}' should be declared to return {2}&lt;T&gt;. - - - Could not find an '{0}' or '{1}' method for the view component '{2}'. - - - Method '{0}' of view component '{1}' cannot return a {2}. - - - Method '{0}' of view component '{1}' should be declared to return a value. - - \ No newline at end of file diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperConventions.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperConventions.cs deleted file mode 100644 index 36209ccc35b..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperConventions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X; - -public static class ViewComponentTagHelperConventions -{ - public static readonly string Kind = "MVC.ViewComponent"; -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperIntermediateNode.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperIntermediateNode.cs deleted file mode 100644 index 94bb3c5a296..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperIntermediateNode.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.CodeGeneration; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X; - -public sealed class ViewComponentTagHelperIntermediateNode : ExtensionIntermediateNode -{ - public override IntermediateNodeCollection Children { get; } = IntermediateNodeCollection.ReadOnly; - - public string ClassName { get; set; } - - public TagHelperDescriptor TagHelper { get; set; } - - public override void Accept(IntermediateNodeVisitor visitor) - { - if (visitor == null) - { - throw new ArgumentNullException(nameof(visitor)); - } - - AcceptExtensionNode(this, visitor); - } - - public override void WriteNode(CodeTarget target, CodeRenderingContext context) - { - if (target == null) - { - throw new ArgumentNullException(nameof(target)); - } - - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - var extension = target.GetExtension(); - if (extension == null) - { - ReportMissingCodeTargetExtension(context); - return; - } - - extension.WriteViewComponentTagHelper(context, this); - } - - public override void FormatNode(IntermediateNodeFormatter formatter) - { - formatter.WriteContent(ClassName); - - formatter.WriteProperty(nameof(ClassName), ClassName); - formatter.WriteProperty(nameof(TagHelper), TagHelper?.DisplayName); - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperMetadata.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperMetadata.cs deleted file mode 100644 index e3482905abe..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperMetadata.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X; - -public static class ViewComponentTagHelperMetadata -{ - /// - /// The key in a containing - /// the short name of a view component. - /// - public static readonly string Name = "MVC.ViewComponent.Name"; -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperPass.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperPass.cs deleted file mode 100644 index da44cacbf7c..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTagHelperPass.cs +++ /dev/null @@ -1,205 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System.Collections.Generic; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Extensions; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X; - -public class ViewComponentTagHelperPass : IntermediateNodePassBase, IRazorOptimizationPass -{ - // Run after the default taghelper pass - public override int Order => IntermediateNodePassBase.DefaultFeatureOrder + 2000; - - protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) - { - var @namespace = documentNode.FindPrimaryNamespace(); - var @class = documentNode.FindPrimaryClass(); - if (@namespace == null || @class == null) - { - // Nothing to do, bail. We can't function without the standard structure. - return; - } - - var context = new Context(@namespace, @class); - - // For each VCTH *usage* we need to rewrite the tag helper node to use the tag helper runtime to construct - // and set properties on the the correct field, and using the name of the type we will generate. - var nodes = documentNode.FindDescendantNodes(); - for (var i = 0; i < nodes.Count; i++) - { - var node = nodes[i]; - foreach (var tagHelper in node.TagHelpers) - { - RewriteUsage(context, node, tagHelper); - } - } - - // Then for each VCTH *definition* that we've seen we need to generate the class that implements - // ITagHelper and the field that will hold it. - foreach (var tagHelper in context.TagHelpers) - { - AddField(context, tagHelper); - AddTagHelperClass(context, tagHelper); - } - } - - private void RewriteUsage(Context context, TagHelperIntermediateNode node, TagHelperDescriptor tagHelper) - { - if (!tagHelper.IsViewComponentKind()) - { - return; - } - - context.Add(tagHelper); - - // Now we need to insert a create node using the default tag helper runtime. This is similar to - // code in DefaultTagHelperOptimizationPass. - // - // Find the body node. - var i = 0; - while (i < node.Children.Count && node.Children[i] is TagHelperBodyIntermediateNode) - { - i++; - } - while (i < node.Children.Count && node.Children[i] is DefaultTagHelperBodyIntermediateNode) - { - i++; - } - - // Now find the last create node. - while (i < node.Children.Count && node.Children[i] is DefaultTagHelperCreateIntermediateNode) - { - i++; - } - - // Now i has the right insertion point. - node.Children.Insert(i, new DefaultTagHelperCreateIntermediateNode() - { - FieldName = context.GetFieldName(tagHelper), - TagHelper = tagHelper, - TypeName = context.GetFullyQualifiedName(tagHelper), - }); - - // Now we need to rewrite any set property nodes to use the default runtime. - for (i = 0; i < node.Children.Count; i++) - { - if (node.Children[i] is TagHelperPropertyIntermediateNode propertyNode && - propertyNode.TagHelper == tagHelper) - { - // This is a set property for this VCTH - we need to replace it with a node - // that will use our field and property name. - node.Children[i] = new DefaultTagHelperPropertyIntermediateNode(propertyNode) - { - FieldName = context.GetFieldName(tagHelper), - PropertyName = propertyNode.BoundAttribute.GetPropertyName(), - }; - } - } - } - - private void AddField(Context context, TagHelperDescriptor tagHelper) - { - // We need to insert a node for the field that will hold the tag helper. We've already generated a field name - // at this time and use it for all uses of the same tag helper type. - // - // We also want to preserve the ordering of the nodes for testability. So insert at the end of any existing - // field nodes. - var i = 0; - while (i < context.Class.Children.Count && context.Class.Children[i] is DefaultTagHelperRuntimeIntermediateNode) - { - i++; - } - - while (i < context.Class.Children.Count && context.Class.Children[i] is FieldDeclarationIntermediateNode) - { - i++; - } - - context.Class.Children.Insert(i, new FieldDeclarationIntermediateNode() - { - Annotations = - { - { CommonAnnotations.DefaultTagHelperExtension.TagHelperField, bool.TrueString }, - }, - Modifiers = - { - "private", - }, - FieldName = context.GetFieldName(tagHelper), - FieldType = "global::" + context.GetFullyQualifiedName(tagHelper), - }); - } - - private void AddTagHelperClass(Context context, TagHelperDescriptor tagHelper) - { - var node = new ViewComponentTagHelperIntermediateNode() - { - ClassName = context.GetClassName(tagHelper), - TagHelper = tagHelper - }; - - context.Class.Children.Add(node); - } - - private struct Context - { - private readonly Dictionary _tagHelpers; - - public Context(NamespaceDeclarationIntermediateNode @namespace, ClassDeclarationIntermediateNode @class) - { - Namespace = @namespace; - Class = @class; - - _tagHelpers = new Dictionary(); - } - - public ClassDeclarationIntermediateNode Class { get; } - - public NamespaceDeclarationIntermediateNode Namespace { get; } - - - public IEnumerable TagHelpers => _tagHelpers.Keys; - - public bool Add(TagHelperDescriptor tagHelper) - { - if (_tagHelpers.ContainsKey(tagHelper)) - { - return false; - } - - var className = $"__Generated__{tagHelper.GetViewComponentName()}ViewComponentTagHelper"; - var namespaceSeparator = string.IsNullOrEmpty(Namespace.Content) ? string.Empty : "."; - var fullyQualifiedName = $"{Namespace.Content}{namespaceSeparator}{Class.ClassName}.{className}"; - var fieldName = GenerateFieldName(tagHelper); - - _tagHelpers.Add(tagHelper, (className, fullyQualifiedName, fieldName)); - - return true; - } - - public string GetClassName(TagHelperDescriptor taghelper) - { - return _tagHelpers[taghelper].className; - } - - public string GetFullyQualifiedName(TagHelperDescriptor taghelper) - { - return _tagHelpers[taghelper].fullyQualifiedName; - } - - public string GetFieldName(TagHelperDescriptor taghelper) - { - return _tagHelpers[taghelper].fieldName; - } - - private static string GenerateFieldName(TagHelperDescriptor tagHelper) - { - return $"__{tagHelper.GetViewComponentName()}ViewComponentTagHelper"; - } - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTypeVisitor.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTypeVisitor.cs deleted file mode 100644 index 610fa47c60b..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTypeVisitor.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using Microsoft.CodeAnalysis; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X; - -internal sealed class ViewComponentTypeVisitor : SymbolVisitor -{ - private readonly INamedTypeSymbol _viewComponentAttribute; - private readonly INamedTypeSymbol? _nonViewComponentAttribute; - private readonly List _results; - - public ViewComponentTypeVisitor( - INamedTypeSymbol viewComponentAttribute, - INamedTypeSymbol? nonViewComponentAttribute, - List results) - { - _viewComponentAttribute = viewComponentAttribute; - _nonViewComponentAttribute = nonViewComponentAttribute; - _results = results; - } - - public override void VisitNamedType(INamedTypeSymbol symbol) - { - if (IsViewComponent(symbol)) - { - _results.Add(symbol); - } - - if (symbol.DeclaredAccessibility != Accessibility.Public) - { - return; - } - - foreach (var member in symbol.GetTypeMembers()) - { - Visit(member); - } - } - - public override void VisitNamespace(INamespaceSymbol symbol) - { - foreach (var member in symbol.GetMembers()) - { - Visit(member); - } - } - - internal bool IsViewComponent(INamedTypeSymbol symbol) - { - if (symbol.DeclaredAccessibility != Accessibility.Public || - symbol.IsAbstract || - symbol.IsGenericType || - AttributeIsDefined(symbol, _nonViewComponentAttribute)) - { - return false; - } - - return symbol.Name.EndsWith(ViewComponentTypes.ViewComponentSuffix, StringComparison.Ordinal) || - AttributeIsDefined(symbol, _viewComponentAttribute); - } - - private static bool AttributeIsDefined(INamedTypeSymbol? type, INamedTypeSymbol? queryAttribute) - { - if (type == null || queryAttribute == null) - { - return false; - } - - foreach (var attribute in type.GetAttributes()) - { - if (SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, queryAttribute)) - { - return true; - } - } - - return AttributeIsDefined(type.BaseType, queryAttribute); - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTypes.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTypes.cs deleted file mode 100644 index b35773f97c3..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version1_X/ViewComponentTypes.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X; - -internal static class ViewComponentTypes -{ - public const string Assembly = "Microsoft.AspNetCore.Mvc.ViewFeatures"; - - public static readonly Version AssemblyVersion = new Version(1, 1, 0, 0); - - public const string ViewComponentSuffix = "ViewComponent"; - - public const string ViewComponentAttribute = "Microsoft.AspNetCore.Mvc.ViewComponentAttribute"; - - public const string NonViewComponentAttribute = "Microsoft.AspNetCore.Mvc.NonViewComponentAttribute"; - - public const string GenericTask = "System.Threading.Tasks.Task`1"; - - public const string Task = "System.Threading.Tasks.Task"; - - public const string IDictionary = "System.Collections.Generic.IDictionary`2"; - - public const string AsyncMethodName = "InvokeAsync"; - - public const string SyncMethodName = "Invoke"; - - public static class ViewComponent - { - public const string Name = "Name"; - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/IInjectTargetExtension.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/IInjectTargetExtension.cs deleted file mode 100644 index 2ef6196f57d..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/IInjectTargetExtension.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using Microsoft.AspNetCore.Razor.Language.CodeGeneration; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public interface IInjectTargetExtension : ICodeTargetExtension -{ - void WriteInjectProperty(CodeRenderingContext context, InjectIntermediateNode node); -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/IViewComponentTagHelperTargetExtension.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/IViewComponentTagHelperTargetExtension.cs deleted file mode 100644 index d78f7e1d91b..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/IViewComponentTagHelperTargetExtension.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using Microsoft.AspNetCore.Razor.Language.CodeGeneration; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public interface IViewComponentTagHelperTargetExtension : ICodeTargetExtension -{ - void WriteViewComponentTagHelper(CodeRenderingContext context, ViewComponentTagHelperIntermediateNode node); -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectDirective.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectDirective.cs deleted file mode 100644 index 951e955bcf2..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectDirective.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public static class InjectDirective -{ - public static readonly DirectiveDescriptor Directive = DirectiveDescriptor.CreateDirective( - "inject", - DirectiveKind.SingleLine, - builder => - { - builder - .AddTypeToken(Resources.InjectDirective_TypeToken_Name, Resources.InjectDirective_TypeToken_Description) - .AddMemberToken(Resources.InjectDirective_MemberToken_Name, Resources.InjectDirective_MemberToken_Description); - - builder.Usage = DirectiveUsage.FileScopedMultipleOccurring; - builder.Description = Resources.InjectDirective_Description; - }); - - public static RazorProjectEngineBuilder Register(RazorProjectEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - builder.AddTargetExtension(new InjectTargetExtension()); - return builder; - } - - internal class Pass : IntermediateNodePassBase, IRazorDirectiveClassifierPass - { - // Runs after the @model and @namespace directives - public override int Order => 10; - - protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) - { - var visitor = new Visitor(); - visitor.Visit(documentNode); - var modelType = ModelDirective.GetModelType(documentNode); - - var properties = new HashSet(StringComparer.Ordinal); - - for (var i = visitor.Directives.Count - 1; i >= 0; i--) - { - var directive = visitor.Directives[i]; - var tokens = directive.Children.OfType().ToArray(); - var isMalformed = directive is MalformedDirectiveIntermediateNode; - - var hasType = tokens.Length > 0 && !string.IsNullOrWhiteSpace(tokens[0].Content); - Debug.Assert(hasType || isMalformed); - var typeName = hasType ? tokens[0].Content : string.Empty; - var typeSpan = hasType ? tokens[0].Source : directive.Source?.GetZeroWidthEndSpan(); - - var hasMemberName = tokens.Length > 1 && !string.IsNullOrWhiteSpace(tokens[1].Content); - Debug.Assert(hasMemberName || isMalformed); - var memberName = hasMemberName ? tokens[1].Content : null; - var memberSpan = hasMemberName ? tokens[1].Source : null; - - if (hasMemberName && !properties.Add(memberName)) - { - continue; - } - - const string tModel = ""; - if (typeName.EndsWith(tModel, StringComparison.Ordinal)) - { - typeName = typeName[..^tModel.Length] + "<" + modelType + ">"; - if (typeSpan.HasValue) - { - typeSpan = new SourceSpan(typeSpan.Value.FilePath, typeSpan.Value.AbsoluteIndex, typeSpan.Value.LineIndex, typeSpan.Value.CharacterIndex, typeSpan.Value.Length - tModel.Length, typeSpan.Value.LineCount, typeSpan.Value.EndCharacterIndex - tModel.Length); - } - } - - var injectNode = new InjectIntermediateNode() - { - TypeName = typeName, - MemberName = memberName, - TypeSource = typeSpan, - MemberSource = memberSpan, - IsMalformed = isMalformed - }; - - visitor.Class.Children.Add(injectNode); - } - } - } - - private class Visitor : IntermediateNodeWalker - { - public ClassDeclarationIntermediateNode Class { get; private set; } - - public IList Directives { get; } = []; - - public override void VisitClassDeclaration(ClassDeclarationIntermediateNode node) - { - if (Class == null) - { - Class = node; - } - - base.VisitClassDeclaration(node); - } - - public override void VisitDirective(DirectiveIntermediateNode node) - { - if (node.Directive == Directive) - { - Directives.Add(node); - } - } - - public override void VisitMalformedDirective(MalformedDirectiveIntermediateNode node) - { - if (node.Directive == Directive) - { - Directives.Add(node); - } - } - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectIntermediateNode.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectIntermediateNode.cs deleted file mode 100644 index d9b3d960ed8..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectIntermediateNode.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.CodeGeneration; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public class InjectIntermediateNode : ExtensionIntermediateNode -{ - public string TypeName { get; set; } - - public string MemberName { get; set; } - - public SourceSpan? TypeSource { get; set; } - - public SourceSpan? MemberSource { get; set; } - - public bool IsMalformed { get; set; } - - public override IntermediateNodeCollection Children => IntermediateNodeCollection.ReadOnly; - - public override void Accept(IntermediateNodeVisitor visitor) - { - if (visitor == null) - { - throw new ArgumentNullException(nameof(visitor)); - } - - AcceptExtensionNode(this, visitor); - } - - public override void WriteNode(CodeTarget target, CodeRenderingContext context) - { - if (target == null) - { - throw new ArgumentNullException(nameof(target)); - } - - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - var extension = target.GetExtension(); - if (extension == null) - { - ReportMissingCodeTargetExtension(context); - return; - } - - extension.WriteInjectProperty(context, this); - } - - public override void FormatNode(IntermediateNodeFormatter formatter) - { - formatter.WriteContent(MemberName); - - formatter.WriteProperty(nameof(MemberName), MemberName); - formatter.WriteProperty(nameof(TypeName), TypeName); - formatter.WriteProperty(nameof(IsMalformed), IsMalformed.ToString()); - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectTargetExtension.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectTargetExtension.cs deleted file mode 100644 index 865ba972e12..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/InjectTargetExtension.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using Microsoft.AspNetCore.Razor.Language.CodeGeneration; -using Microsoft.AspNetCore.Razor.Language.Extensions; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public class InjectTargetExtension : IInjectTargetExtension -{ - private const string RazorInjectAttribute = "[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]"; - - public void WriteInjectProperty(CodeRenderingContext context, InjectIntermediateNode node) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - if (node == null) - { - throw new ArgumentNullException(nameof(node)); - } - - if (!context.Options.DesignTime && !string.IsNullOrWhiteSpace(node.TypeSource?.FilePath)) - { - if (node.TypeName == "") - { - // if we don't even have a type name, just emit an empty mapped region so that intellisense still works - context.CodeWriter.BuildEnhancedLinePragma(node.TypeSource.Value, context).Dispose(); - } - else - { - context.CodeWriter.WriteLine(RazorInjectAttribute); - var memberName = node.MemberName ?? "Member_" + DefaultTagHelperTargetExtension.GetDeterministicId(context); - context.CodeWriter.WriteAutoPropertyDeclaration(["public"], node.TypeName, memberName, node.TypeSource, node.MemberSource, context, privateSetter: true, defaultValue: true); - } - } - else if(!node.IsMalformed) - { - var property = $"public {node.TypeName} {node.MemberName} {{ get; private set; }}"; - - if (node.Source.HasValue) - { - using (context.CodeWriter.BuildLinePragma(node.Source.Value, context)) - { - context.CodeWriter - .WriteLine(RazorInjectAttribute) - .WriteLine(property); - } - } - else - { - context.CodeWriter - .WriteLine(RazorInjectAttribute) - .WriteLine(property); - } - } - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ModelDirective.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ModelDirective.cs deleted file mode 100644 index e3394de7553..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ModelDirective.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public static class ModelDirective -{ - public static readonly DirectiveDescriptor Directive = DirectiveDescriptor.CreateDirective( - "model", - DirectiveKind.SingleLine, - builder => - { - builder.AddTypeToken(Resources.ModelDirective_TypeToken_Name, Resources.ModelDirective_TypeToken_Description); - builder.Usage = DirectiveUsage.FileScopedSinglyOccurring; - builder.Description = Resources.ModelDirective_Description; - }); - - public static RazorProjectEngineBuilder Register(RazorProjectEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - builder.Features.Add(new Pass()); - return builder; - } - - public static string GetModelType(DocumentIntermediateNode document) - { - if (document == null) - { - throw new ArgumentNullException(nameof(document)); - } - - var visitor = new Visitor(); - return GetModelType(document, visitor); - } - - private static string GetModelType(DocumentIntermediateNode document, Visitor visitor) - { - visitor.Visit(document); - - for (var i = visitor.ModelDirectives.Count - 1; i >= 0; i--) - { - var directive = visitor.ModelDirectives[i]; - - var tokens = directive.Tokens.ToArray(); - if (tokens.Length >= 1) - { - return tokens[0].Content; - } - } - - if (document.DocumentKind == RazorPageDocumentClassifierPass.RazorPageDocumentKind) - { - return visitor.Class.ClassName; - } - else - { - return "dynamic"; - } - } - - internal class Pass : IntermediateNodePassBase, IRazorDirectiveClassifierPass - { - // Runs after the @inherits directive - public override int Order => 5; - - protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) - { - var visitor = new Visitor(); - var modelType = GetModelType(documentNode, visitor); - - if (documentNode.Options.DesignTime) - { - // Alias the TModel token to a known type. - // This allows design time compilation to succeed for Razor files where the token isn't replaced. - var typeName = $"global::{typeof(object).FullName}"; - var usingNode = new UsingDirectiveIntermediateNode() - { - Content = $"TModel = {typeName}" - }; - - visitor.Namespace?.Children.Insert(0, usingNode); - } - - var baseType = visitor.Class?.BaseType?.Replace("", "<" + modelType + ">"); - visitor.Class.BaseType = baseType; - } - } - - private class Visitor : IntermediateNodeWalker - { - public NamespaceDeclarationIntermediateNode Namespace { get; private set; } - - public ClassDeclarationIntermediateNode Class { get; private set; } - - public IList ModelDirectives { get; } = new List(); - - public override void VisitNamespaceDeclaration(NamespaceDeclarationIntermediateNode node) - { - if (Namespace == null) - { - Namespace = node; - } - - base.VisitNamespaceDeclaration(node); - } - - public override void VisitClassDeclaration(ClassDeclarationIntermediateNode node) - { - if (Class == null) - { - Class = node; - } - - base.VisitClassDeclaration(node); - } - - public override void VisitDirective(DirectiveIntermediateNode node) - { - if (node.Directive == Directive) - { - ModelDirectives.Add(node); - } - } - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ModelExpressionPass.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ModelExpressionPass.cs deleted file mode 100644 index 0112b0ef53e..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ModelExpressionPass.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public class ModelExpressionPass : IntermediateNodePassBase, IRazorOptimizationPass -{ - private const string ModelExpressionTypeName = "Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression"; - - protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) - { - var visitor = new Visitor(); - visitor.Visit(documentNode); - } - - private class Visitor : IntermediateNodeWalker - { - public List TagHelpers { get; } = new List(); - - public override void VisitTagHelperProperty(TagHelperPropertyIntermediateNode node) - { - if (string.Equals(node.BoundAttribute.TypeName, ModelExpressionTypeName, StringComparison.Ordinal) || - (node.IsIndexerNameMatch && - string.Equals(node.BoundAttribute.IndexerTypeName, ModelExpressionTypeName, StringComparison.Ordinal))) - { - var expression = new CSharpExpressionIntermediateNode(); - - expression.Children.Add(new IntermediateToken() - { - Kind = TokenKind.CSharp, - Content = "ModelExpressionProvider.CreateModelExpression(ViewData, __model => ", - }); - - if (node.Children.Count == 1 && node.Children[0] is IntermediateToken token && token.IsCSharp) - { - // A 'simple' expression will look like __model => __model.Foo - - expression.Children.Add(new IntermediateToken() - { - Kind = TokenKind.CSharp, - Content = "__model." - }); - - expression.Children.Add(token); - } - else - { - for (var i = 0; i < node.Children.Count; i++) - { - if (node.Children[i] is CSharpExpressionIntermediateNode nestedExpression) - { - for (var j = 0; j < nestedExpression.Children.Count; j++) - { - if (nestedExpression.Children[j] is IntermediateToken cSharpToken && - cSharpToken.IsCSharp) - { - expression.Children.Add(cSharpToken); - } - } - - continue; - } - } - } - - expression.Children.Add(new IntermediateToken() - { - Kind = TokenKind.CSharp, - Content = ")", - }); - - node.Children.Clear(); - - node.Children.Add(expression); - } - } - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/PageDirective.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/PageDirective.cs deleted file mode 100644 index ef287dfbe44..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/PageDirective.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public class PageDirective -{ - public static readonly DirectiveDescriptor Directive = DirectiveDescriptor.CreateDirective( - "page", - DirectiveKind.SingleLine, - builder => - { - builder.AddOptionalStringToken(Resources.PageDirective_RouteToken_Name, Resources.PageDirective_RouteToken_Description); - builder.Usage = DirectiveUsage.FileScopedSinglyOccurring; - builder.Description = Resources.PageDirective_Description; - }); - - private PageDirective(string routeTemplate, IntermediateNode directiveNode, SourceSpan? source) - { - RouteTemplate = routeTemplate; - DirectiveNode = directiveNode; - Source = source; - } - - public string RouteTemplate { get; } - - public IntermediateNode DirectiveNode { get; } - - public SourceSpan? Source { get; } - - public static RazorProjectEngineBuilder Register(RazorProjectEngineBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddDirective(Directive); - return builder; - } - - public static bool TryGetPageDirective(DocumentIntermediateNode documentNode, out PageDirective pageDirective) - { - var visitor = new Visitor(); - for (var i = 0; i < documentNode.Children.Count; i++) - { - visitor.Visit(documentNode.Children[i]); - } - - if (visitor.DirectiveTokens == null) - { - pageDirective = null; - return false; - } - - var tokens = visitor.DirectiveTokens.ToList(); - string routeTemplate = null; - SourceSpan? sourceSpan = null; - if (tokens.Count > 0) - { - routeTemplate = TrimQuotes(tokens[0].Content); - sourceSpan = tokens[0].Source; - } - - pageDirective = new PageDirective(routeTemplate, visitor.DirectiveNode, sourceSpan); - return true; - } - - private static string TrimQuotes(string content) - { - // Tokens aren't captured if they're malformed. Therefore, this method will - // always be called with a valid token content. - Debug.Assert(content.Length >= 2); - Debug.Assert(content.StartsWith("\"", StringComparison.Ordinal)); - Debug.Assert(content.EndsWith("\"", StringComparison.Ordinal)); - - return content.Substring(1, content.Length - 2); - } - - private class Visitor : IntermediateNodeWalker - { - public IntermediateNode DirectiveNode { get; private set; } - - public IEnumerable DirectiveTokens { get; private set; } - - public override void VisitDirective(DirectiveIntermediateNode node) - { - if (node.Directive == Directive) - { - DirectiveNode = node; - DirectiveTokens = node.Tokens; - } - } - - public override void VisitMalformedDirective(MalformedDirectiveIntermediateNode node) - { - if (DirectiveTokens == null && node.Directive == Directive) - { - DirectiveNode = node; - DirectiveTokens = node.Tokens; - } - } - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/RazorExtensions.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/RazorExtensions.cs index 0ce365df840..31d4a578270 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/RazorExtensions.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/RazorExtensions.cs @@ -21,7 +21,7 @@ public static void Register(RazorProjectEngineBuilder builder) } FunctionsDirective.Register(builder); - InjectDirective.Register(builder); + InjectDirective.Register(builder, considerNullabilityEnforcement: false); ModelDirective.Register(builder); NamespaceDirective.Register(builder); PageDirective.Register(builder); diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/RazorExtensionsDiagnosticFactory.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/RazorExtensionsDiagnosticFactory.cs deleted file mode 100644 index 35b15f870ae..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/RazorExtensionsDiagnosticFactory.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.Language; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -internal class RazorExtensionsDiagnosticFactory -{ - private const string DiagnosticPrefix = "RZ"; - - internal static readonly RazorDiagnosticDescriptor ViewComponent_CannotFindMethod = - new($"{DiagnosticPrefix}3900", - ViewComponentResources.ViewComponent_CannotFindMethod, - RazorDiagnosticSeverity.Error); - - public static RazorDiagnostic CreateViewComponent_CannotFindMethod(string tagHelperType) - => RazorDiagnostic.Create( - ViewComponent_CannotFindMethod, - new SourceSpan(SourceLocation.Undefined, contentLength: 0), - ViewComponentTypes.SyncMethodName, - ViewComponentTypes.AsyncMethodName, - tagHelperType); - - internal static readonly RazorDiagnosticDescriptor ViewComponent_AmbiguousMethods = - new($"{DiagnosticPrefix}3901", - ViewComponentResources.ViewComponent_AmbiguousMethods, - RazorDiagnosticSeverity.Error); - - public static RazorDiagnostic CreateViewComponent_AmbiguousMethods(string tagHelperType) - => RazorDiagnostic.Create( - ViewComponent_AmbiguousMethods, - new SourceSpan(SourceLocation.Undefined, contentLength: 0), - tagHelperType, - ViewComponentTypes.SyncMethodName, - ViewComponentTypes.AsyncMethodName); - - internal static readonly RazorDiagnosticDescriptor ViewComponent_AsyncMethod_ShouldReturnTask = - new($"{DiagnosticPrefix}3902", - ViewComponentResources.ViewComponent_AsyncMethod_ShouldReturnTask, - RazorDiagnosticSeverity.Error); - - public static RazorDiagnostic CreateViewComponent_AsyncMethod_ShouldReturnTask(string tagHelperType) - => RazorDiagnostic.Create( - ViewComponent_AsyncMethod_ShouldReturnTask, - new SourceSpan(SourceLocation.Undefined, contentLength: 0), - ViewComponentTypes.AsyncMethodName, - tagHelperType, - nameof(Task)); - - internal static readonly RazorDiagnosticDescriptor ViewComponent_SyncMethod_ShouldReturnValue = - new($"{DiagnosticPrefix}3903", - ViewComponentResources.ViewComponent_SyncMethod_ShouldReturnValue, - RazorDiagnosticSeverity.Error); - - public static RazorDiagnostic CreateViewComponent_SyncMethod_ShouldReturnValue(string tagHelperType) - => RazorDiagnostic.Create( - ViewComponent_SyncMethod_ShouldReturnValue, - new SourceSpan(SourceLocation.Undefined, contentLength: 0), - ViewComponentTypes.SyncMethodName, - tagHelperType); - - internal static readonly RazorDiagnosticDescriptor ViewComponent_SyncMethod_CannotReturnTask = - new($"{DiagnosticPrefix}3904", - ViewComponentResources.ViewComponent_SyncMethod_CannotReturnTask, - RazorDiagnosticSeverity.Error); - - public static RazorDiagnostic CreateViewComponent_SyncMethod_CannotReturnTask(string tagHelperType) - => RazorDiagnostic.Create( - ViewComponent_SyncMethod_CannotReturnTask, - new SourceSpan(SourceLocation.Undefined, contentLength: 0), - ViewComponentTypes.SyncMethodName, - tagHelperType, - nameof(Task)); - - internal static readonly RazorDiagnosticDescriptor PageDirective_CannotBeImported = - new($"{DiagnosticPrefix}3905", - Resources.PageDirectiveCannotBeImported, - RazorDiagnosticSeverity.Error); - - public static RazorDiagnostic CreatePageDirective_CannotBeImported(SourceSpan source) - { - var fileName = Path.GetFileName(source.FilePath); - - return RazorDiagnostic.Create(PageDirective_CannotBeImported, source, PageDirective.Directive.Directive, fileName); - } - - internal static readonly RazorDiagnosticDescriptor PageDirective_MustExistAtTheTopOfFile = - new($"{DiagnosticPrefix}3906", - Resources.PageDirectiveMustExistAtTheTopOfFile, - RazorDiagnosticSeverity.Error); - - public static RazorDiagnostic CreatePageDirective_MustExistAtTheTopOfFile(SourceSpan source) - => RazorDiagnostic.Create(PageDirective_MustExistAtTheTopOfFile, source, PageDirective.Directive.Directive); -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/Resources.resx b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/Resources.resx index 396e93a69a2..572047d77f7 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/Resources.resx +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/Resources.resx @@ -168,19 +168,4 @@ Namespace - - The '@{0}' directive specified in {1} file will not be imported. The directive must appear at the top of each Razor cshtml file. - - - The '@{0}' directive must precede all other elements defined in a Razor file. - - - Mark the page as a Razor Page. - - - An optional route template for the page. - - - RouteTemplate - \ No newline at end of file diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/TagHelperDescriptorExtensions.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/TagHelperDescriptorExtensions.cs deleted file mode 100644 index 61a73b3e228..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/TagHelperDescriptorExtensions.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using Microsoft.AspNetCore.Razor.Language; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public static class TagHelperDescriptorExtensions -{ - /// - /// Indicates whether a represents a view component. - /// - /// The to check. - /// Whether a represents a view component. - public static bool IsViewComponentKind(this TagHelperDescriptor tagHelper) - { - if (tagHelper == null) - { - throw new ArgumentNullException(nameof(tagHelper)); - } - - return string.Equals(ViewComponentTagHelperConventions.Kind, tagHelper.Kind, StringComparison.Ordinal); - } - - public static string GetViewComponentName(this TagHelperDescriptor tagHelper) - { - if (tagHelper == null) - { - throw new ArgumentNullException(nameof(tagHelper)); - } - - tagHelper.Metadata.TryGetValue(ViewComponentTagHelperMetadata.Name, out var result); - return result; - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentResources.resx b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentResources.resx deleted file mode 100644 index d6aad4ff3fc..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentResources.resx +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - View component '{0}' must have exactly one public method named '{1}' or '{2}'. - - - Method '{0}' of view component '{1}' should be declared to return {2}&lt;T&gt;. - - - Could not find an '{0}' or '{1}' method for the view component '{2}'. - - - Method '{0}' of view component '{1}' cannot return a {2}. - - - Method '{0}' of view component '{1}' should be declared to return a value. - - \ No newline at end of file diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperConventions.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperConventions.cs deleted file mode 100644 index 058c20868e3..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperConventions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public static class ViewComponentTagHelperConventions -{ - public static readonly string Kind = "MVC.ViewComponent"; -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperIntermediateNode.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperIntermediateNode.cs deleted file mode 100644 index 5f08ef6be68..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperIntermediateNode.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.CodeGeneration; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public sealed class ViewComponentTagHelperIntermediateNode : ExtensionIntermediateNode -{ - public override IntermediateNodeCollection Children { get; } = IntermediateNodeCollection.ReadOnly; - - public string ClassName { get; set; } - - public TagHelperDescriptor TagHelper { get; set; } - - public override void Accept(IntermediateNodeVisitor visitor) - { - if (visitor == null) - { - throw new ArgumentNullException(nameof(visitor)); - } - - AcceptExtensionNode(this, visitor); - } - - public override void WriteNode(CodeTarget target, CodeRenderingContext context) - { - if (target == null) - { - throw new ArgumentNullException(nameof(target)); - } - - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - var extension = target.GetExtension(); - if (extension == null) - { - ReportMissingCodeTargetExtension(context); - return; - } - - extension.WriteViewComponentTagHelper(context, this); - } - - public override void FormatNode(IntermediateNodeFormatter formatter) - { - formatter.WriteContent(ClassName); - - formatter.WriteProperty(nameof(ClassName), ClassName); - formatter.WriteProperty(nameof(TagHelper), TagHelper?.DisplayName); - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperMetadata.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperMetadata.cs deleted file mode 100644 index 88d92b8cc7b..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperMetadata.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public static class ViewComponentTagHelperMetadata -{ - /// - /// The key in a containing - /// the short name of a view component. - /// - public static readonly string Name = "MVC.ViewComponent.Name"; -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperPass.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperPass.cs deleted file mode 100644 index cbacadea315..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTagHelperPass.cs +++ /dev/null @@ -1,205 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System.Collections.Generic; -using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Extensions; -using Microsoft.AspNetCore.Razor.Language.Intermediate; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -public class ViewComponentTagHelperPass : IntermediateNodePassBase, IRazorOptimizationPass -{ - // Run after the default taghelper pass - public override int Order => IntermediateNodePassBase.DefaultFeatureOrder + 2000; - - protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentIntermediateNode documentNode) - { - var @namespace = documentNode.FindPrimaryNamespace(); - var @class = documentNode.FindPrimaryClass(); - if (@namespace == null || @class == null) - { - // Nothing to do, bail. We can't function without the standard structure. - return; - } - - var context = new Context(@namespace, @class); - - // For each VCTH *usage* we need to rewrite the tag helper node to use the tag helper runtime to construct - // and set properties on the the correct field, and using the name of the type we will generate. - var nodes = documentNode.FindDescendantNodes(); - for (var i = 0; i < nodes.Count; i++) - { - var node = nodes[i]; - foreach (var tagHelper in node.TagHelpers) - { - RewriteUsage(context, node, tagHelper); - } - } - - // Then for each VCTH *definition* that we've seen we need to generate the class that implements - // ITagHelper and the field that will hold it. - foreach (var tagHelper in context.TagHelpers) - { - AddField(context, tagHelper); - AddTagHelperClass(context, tagHelper); - } - } - - private void RewriteUsage(Context context, TagHelperIntermediateNode node, TagHelperDescriptor tagHelper) - { - if (!tagHelper.IsViewComponentKind()) - { - return; - } - - context.Add(tagHelper); - - // Now we need to insert a create node using the default tag helper runtime. This is similar to - // code in DefaultTagHelperOptimizationPass. - // - // Find the body node. - var i = 0; - while (i < node.Children.Count && node.Children[i] is TagHelperBodyIntermediateNode) - { - i++; - } - while (i < node.Children.Count && node.Children[i] is DefaultTagHelperBodyIntermediateNode) - { - i++; - } - - // Now find the last create node. - while (i < node.Children.Count && node.Children[i] is DefaultTagHelperCreateIntermediateNode) - { - i++; - } - - // Now i has the right insertion point. - node.Children.Insert(i, new DefaultTagHelperCreateIntermediateNode() - { - FieldName = context.GetFieldName(tagHelper), - TagHelper = tagHelper, - TypeName = context.GetFullyQualifiedName(tagHelper), - }); - - // Now we need to rewrite any set property nodes to use the default runtime. - for (i = 0; i < node.Children.Count; i++) - { - if (node.Children[i] is TagHelperPropertyIntermediateNode propertyNode && - propertyNode.TagHelper == tagHelper) - { - // This is a set property for this VCTH - we need to replace it with a node - // that will use our field and property name. - node.Children[i] = new DefaultTagHelperPropertyIntermediateNode(propertyNode) - { - FieldName = context.GetFieldName(tagHelper), - PropertyName = propertyNode.BoundAttribute.GetPropertyName(), - }; - } - } - } - - private void AddField(Context context, TagHelperDescriptor tagHelper) - { - // We need to insert a node for the field that will hold the tag helper. We've already generated a field name - // at this time and use it for all uses of the same tag helper type. - // - // We also want to preserve the ordering of the nodes for testability. So insert at the end of any existing - // field nodes. - var i = 0; - while (i < context.Class.Children.Count && context.Class.Children[i] is DefaultTagHelperRuntimeIntermediateNode) - { - i++; - } - - while (i < context.Class.Children.Count && context.Class.Children[i] is FieldDeclarationIntermediateNode) - { - i++; - } - - context.Class.Children.Insert(i, new FieldDeclarationIntermediateNode() - { - Annotations = - { - { CommonAnnotations.DefaultTagHelperExtension.TagHelperField, bool.TrueString }, - }, - Modifiers = - { - "private", - }, - FieldName = context.GetFieldName(tagHelper), - FieldType = "global::" + context.GetFullyQualifiedName(tagHelper), - }); - } - - private void AddTagHelperClass(Context context, TagHelperDescriptor tagHelper) - { - var node = new ViewComponentTagHelperIntermediateNode() - { - ClassName = context.GetClassName(tagHelper), - TagHelper = tagHelper - }; - - context.Class.Children.Add(node); - } - - private struct Context - { - private readonly Dictionary _tagHelpers; - - public Context(NamespaceDeclarationIntermediateNode @namespace, ClassDeclarationIntermediateNode @class) - { - Namespace = @namespace; - Class = @class; - - _tagHelpers = new Dictionary(); - } - - public ClassDeclarationIntermediateNode Class { get; } - - public NamespaceDeclarationIntermediateNode Namespace { get; } - - - public IEnumerable TagHelpers => _tagHelpers.Keys; - - public bool Add(TagHelperDescriptor tagHelper) - { - if (_tagHelpers.ContainsKey(tagHelper)) - { - return false; - } - - var className = $"__Generated__{tagHelper.GetViewComponentName()}ViewComponentTagHelper"; - var namespaceSeparator = string.IsNullOrEmpty(Namespace.Content) ? string.Empty : "."; - var fullyQualifiedName = $"{Namespace.Content}{namespaceSeparator}{Class.ClassName}.{className}"; - var fieldName = GenerateFieldName(tagHelper); - - _tagHelpers.Add(tagHelper, (className, fullyQualifiedName, fieldName)); - - return true; - } - - public string GetClassName(TagHelperDescriptor taghelper) - { - return _tagHelpers[taghelper].className; - } - - public string GetFullyQualifiedName(TagHelperDescriptor taghelper) - { - return _tagHelpers[taghelper].fullyQualifiedName; - } - - public string GetFieldName(TagHelperDescriptor taghelper) - { - return _tagHelpers[taghelper].fieldName; - } - - private static string GenerateFieldName(TagHelperDescriptor tagHelper) - { - return $"__{tagHelper.GetViewComponentName()}ViewComponentTagHelper"; - } - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTypeVisitor.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTypeVisitor.cs deleted file mode 100644 index 7e2b8240fb5..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTypeVisitor.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using Microsoft.CodeAnalysis; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -internal sealed class ViewComponentTypeVisitor : SymbolVisitor -{ - private readonly INamedTypeSymbol _viewComponentAttribute; - private readonly INamedTypeSymbol? _nonViewComponentAttribute; - private readonly List _results; - - public ViewComponentTypeVisitor( - INamedTypeSymbol viewComponentAttribute, - INamedTypeSymbol? nonViewComponentAttribute, - List results) - { - _viewComponentAttribute = viewComponentAttribute; - _nonViewComponentAttribute = nonViewComponentAttribute; - _results = results; - } - - public override void VisitNamedType(INamedTypeSymbol symbol) - { - if (IsViewComponent(symbol)) - { - _results.Add(symbol); - } - - if (symbol.DeclaredAccessibility != Accessibility.Public) - { - return; - } - - foreach (var member in symbol.GetTypeMembers()) - { - Visit(member); - } - } - - public override void VisitNamespace(INamespaceSymbol symbol) - { - foreach (var member in symbol.GetMembers()) - { - Visit(member); - } - } - - internal bool IsViewComponent(INamedTypeSymbol symbol) - { - if (_viewComponentAttribute == null) - { - return false; - } - - if (symbol.DeclaredAccessibility != Accessibility.Public || - symbol.IsAbstract || - symbol.IsGenericType || - AttributeIsDefined(symbol, _nonViewComponentAttribute)) - { - return false; - } - - return symbol.Name.EndsWith(ViewComponentTypes.ViewComponentSuffix, StringComparison.Ordinal) || - AttributeIsDefined(symbol, _viewComponentAttribute); - } - - private static bool AttributeIsDefined(INamedTypeSymbol? type, INamedTypeSymbol? queryAttribute) - { - if (type == null || queryAttribute == null) - { - return false; - } - - foreach (var attribute in type.GetAttributes()) - { - if (SymbolEqualityComparer.Default.Equals(attribute.AttributeClass, queryAttribute)) - { - return true; - } - } - - return AttributeIsDefined(type.BaseType, queryAttribute); - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTypes.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTypes.cs deleted file mode 100644 index c333ca62aee..00000000000 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc.Version2_X/ViewComponentTypes.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#nullable disable - -using System; - -namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X; - -internal static class ViewComponentTypes -{ - public const string Assembly = "Microsoft.AspNetCore.Mvc.ViewFeatures"; - - public static readonly Version AssemblyVersion = new Version(1, 1, 0, 0); - - public const string ViewComponentSuffix = "ViewComponent"; - - public const string ViewComponentAttribute = "Microsoft.AspNetCore.Mvc.ViewComponentAttribute"; - - public const string NonViewComponentAttribute = "Microsoft.AspNetCore.Mvc.NonViewComponentAttribute"; - - public const string GenericTask = "System.Threading.Tasks.Task`1"; - - public const string Task = "System.Threading.Tasks.Task"; - - public const string IDictionary = "System.Collections.Generic.IDictionary`2"; - - public const string AsyncMethodName = "InvokeAsync"; - - public const string SyncMethodName = "Invoke"; - - public static class ViewComponent - { - public const string Name = "Name"; - } -} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/InjectDirective.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/InjectDirective.cs index 15ed4fc0327..583286b24dc 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/InjectDirective.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/InjectDirective.cs @@ -27,7 +27,7 @@ public static class InjectDirective builder.Description = RazorExtensionsResources.InjectDirective_Description; }); - public static RazorProjectEngineBuilder Register(RazorProjectEngineBuilder builder) + public static RazorProjectEngineBuilder Register(RazorProjectEngineBuilder builder, bool considerNullabilityEnforcement) { if (builder == null) { @@ -36,7 +36,7 @@ public static RazorProjectEngineBuilder Register(RazorProjectEngineBuilder build builder.AddDirective(Directive); builder.Features.Add(new Pass()); - builder.AddTargetExtension(new InjectTargetExtension()); + builder.AddTargetExtension(new InjectTargetExtension(considerNullabilityEnforcement)); return builder; } diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/InjectTargetExtension.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/InjectTargetExtension.cs index 46e83e4cae9..0ea1c5ac9b0 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/InjectTargetExtension.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/InjectTargetExtension.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions; -public class InjectTargetExtension : IInjectTargetExtension +public class InjectTargetExtension(bool considerNullabilityEnforcement) : IInjectTargetExtension { private const string RazorInjectAttribute = "[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]"; @@ -42,7 +42,7 @@ public void WriteInjectProperty(CodeRenderingContext context, InjectIntermediate else if (!node.IsMalformed) { var property = $"public {node.TypeName} {node.MemberName} {{ get; private set; }}"; - if (!context.Options.SuppressNullabilityEnforcement) + if (considerNullabilityEnforcement && !context.Options.SuppressNullabilityEnforcement) { property += " = default!;"; } @@ -61,7 +61,7 @@ public void WriteInjectProperty(CodeRenderingContext context, InjectIntermediate void WriteProperty() { - if (!context.Options.SuppressNullabilityEnforcement) + if (considerNullabilityEnforcement && !context.Options.SuppressNullabilityEnforcement) { context.CodeWriter.WriteLine("#nullable restore"); } @@ -70,7 +70,7 @@ void WriteProperty() .WriteLine(RazorInjectAttribute) .WriteLine(property); - if (!context.Options.SuppressNullabilityEnforcement) + if (considerNullabilityEnforcement && !context.Options.SuppressNullabilityEnforcement) { context.CodeWriter.WriteLine("#nullable disable"); } diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/RazorExtensions.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/RazorExtensions.cs index fa19e49ba40..317a5f387b0 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/RazorExtensions.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Mvc/RazorExtensions.cs @@ -22,7 +22,7 @@ public static void Register(RazorProjectEngineBuilder builder) throw new ArgumentNullException(nameof(builder)); } - InjectDirective.Register(builder); + InjectDirective.Register(builder, considerNullabilityEnforcement: true); ModelDirective.Register(builder); PageDirective.Register(builder); diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.ProjectEngineHost.Test/ProjectEngineFactoryProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.ProjectEngineHost.Test/ProjectEngineFactoryProviderTest.cs index 4072d5b13d7..6b0c2f43966 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.ProjectEngineHost.Test/ProjectEngineFactoryProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.ProjectEngineHost.Test/ProjectEngineFactoryProviderTest.cs @@ -103,7 +103,7 @@ public void Create_CreatesDesignTimeTemplateEngine_ForVersion2_1() Assert.Single(engine.Engine.Features.OfType()); Assert.Single(engine.Engine.Features.OfType()); - Assert.Single(engine.Engine.Features.OfType()); + Assert.Single(engine.Engine.Features.OfType()); } [Fact] @@ -122,7 +122,7 @@ public void Create_CreatesDesignTimeTemplateEngine_ForVersion2_0() Assert.Single(engine.Engine.Features.OfType()); Assert.Single(engine.Engine.Features.OfType()); Assert.Single(engine.Engine.Features.OfType()); - Assert.Single(engine.Engine.Features.OfType()); + Assert.Single(engine.Engine.Features.OfType()); } [Fact] @@ -141,7 +141,7 @@ public void Create_CreatesTemplateEngine_ForVersion1_1() Assert.Single(engine.Engine.Features.OfType()); Assert.Single(engine.Engine.Features.OfType()); Assert.Single(engine.Engine.Features.OfType()); - Assert.Single(engine.Engine.Features.OfType()); + Assert.Single(engine.Engine.Features.OfType()); } [Fact] @@ -166,10 +166,10 @@ public void Create_DoesNotSupportViewComponentTagHelpers_ForVersion1_0() Assert.Empty(engine.Engine.Features.OfType()); Assert.Empty(engine.Engine.Features.OfType()); - Assert.Empty(engine.Engine.Features.OfType()); + Assert.Empty(engine.Engine.Features.OfType()); Assert.Empty(engine.Engine.Features.OfType()); - Assert.Empty(engine.Engine.Features.OfType()); + Assert.Empty(engine.Engine.Features.OfType()); } [Fact] From e23328e964b51af1c1937239b5f0f3b9abe2e929 Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Thu, 19 Sep 2024 17:31:12 -0700 Subject: [PATCH 371/386] Add telemetry for 'bad' experiences based on tag helpers --- .../DocumentPullDiagnosticsEndpoint.cs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs index eba0c7da011..7005fd9d44b 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; @@ -25,6 +27,7 @@ internal class DocumentPullDiagnosticsEndpoint : IRazorRequestHandler + /// Reports telemetry for RZ10012 "Found markup element with unexpected name" to help track down potential issues + /// with taghelpers being discovered (or lack thereof) + /// + private async ValueTask ReportRZ10012TelemetryAsync(DocumentContext documentContext, VSInternalDiagnosticReport[]? razorDiagnostics, CancellationToken cancellationToken) + { + if (razorDiagnostics is null) + { + return; + } + + if (_telemetryReporter is null) + { + return; + } + + var relaventDiagnostics = razorDiagnostics.SelectMany(r => r.Diagnostics?.Where(d => d.Code == "RZ10012") ?? []).ToImmutableArray(); + if (relaventDiagnostics.Length == 0) + { + return; + } + + var document = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); + var tagHelpers = document.GetTagHelpers(); + + if (Interlocked.Exchange(ref _lastReportedTagHelperCount, tagHelpers.Count) != tagHelpers.Count) + { + _telemetryReporter.ReportEvent( + "rz10012", + Severity.Low, + new Property("tagHelpers", tagHelpers.Count), + new Property("rz10012errors", relaventDiagnostics.Length)); + } + } } From 6aa9aee9ab1384f3ca620115704526b932da38ef Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Thu, 19 Sep 2024 17:35:35 -0700 Subject: [PATCH 372/386] Calculate SuppressAddComponentParameter in tooling (#10763) Fixes #10736 Chris did a good breakdown of what this value is used for #10736 (comment) --- .../src/CSharp/CompilationExtensions.cs | 19 +++++++ .../RazorCodeGenerationOptionsBuilder.cs | 4 ++ .../src/Language/RazorConfiguration.cs | 12 +++-- .../RazorSourceGenerator.Helpers.cs | 5 +- .../RazorSourceGenerator.RazorProviders.cs | 17 +++++-- .../SourceGenerators/RazorSourceGenerator.cs | 20 ++------ .../RazorSourceGeneratorTests.cs | 2 + .../Kendo.Mvc.Examples.project.razor.json | 2 +- .../Resources/project.razor.json | 2 +- .../RazorWorkspaceListenerBase.cs | 2 +- .../Formatters/RazorConfigurationFormatter.cs | 26 +++++----- .../MessagePack/SerializationFormat.cs | 2 +- .../Utilities}/RazorProjectInfoFactory.cs | 49 ++++++++++--------- .../ProjectSystem/RemoteDocumentSnapshot.cs | 2 +- .../ProjectSystem/RemoteProjectSnapshot.cs | 36 ++++++++++---- .../DefaultWindowsRazorProjectHost.cs | 2 +- .../RazorProjectInfoSerializerTest.cs | 1 + .../Formatting_NetFx/FormattingTestBase.cs | 2 +- .../ObjectReaders.cs | 4 +- .../ObjectWriters.cs | 3 ++ .../SerializationFormat.cs | 2 +- 21 files changed, 134 insertions(+), 80 deletions(-) create mode 100644 src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/CompilationExtensions.cs rename src/Razor/src/{Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace => Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities}/RazorProjectInfoFactory.cs (85%) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/CompilationExtensions.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/CompilationExtensions.cs new file mode 100644 index 00000000000..dc5dcd44c86 --- /dev/null +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/CompilationExtensions.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.CodeAnalysis.Razor.Compiler.CSharp; + +internal static class CompilationExtensions +{ + public static bool HasAddComponentParameter(this Compilation compilation) + { + return compilation.GetTypesByMetadataName("Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder") + .Any(static t => + t.DeclaredAccessibility == Accessibility.Public && + t.GetMembers("AddComponentParameter") + .Any(static m => m.DeclaredAccessibility == Accessibility.Public)); + } +} diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorCodeGenerationOptionsBuilder.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorCodeGenerationOptionsBuilder.cs index 4f35d92c094..0e9caed4b26 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorCodeGenerationOptionsBuilder.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorCodeGenerationOptionsBuilder.cs @@ -159,6 +159,10 @@ public RazorCodeGenerationOptionsBuilder(RazorConfiguration configuration) ArgHelper.ThrowIfNull(configuration); Configuration = configuration; + if (configuration.SuppressAddComponentParameter) + { + _flags.SetFlag(RazorCodeGenerationOptionsFlags.SuppressAddComponentParameter); + } } public RazorCodeGenerationOptionsBuilder(RazorCodeGenerationOptionsFlags flags) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorConfiguration.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorConfiguration.cs index a1b1ba4b487..83cd64698d1 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorConfiguration.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorConfiguration.cs @@ -11,20 +11,23 @@ public sealed record class RazorConfiguration( RazorLanguageVersion LanguageVersion, string ConfigurationName, ImmutableArray Extensions, - LanguageServerFlags? LanguageServerFlags = null, - bool UseConsolidatedMvcViews = true) + bool UseConsolidatedMvcViews = true, + bool SuppressAddComponentParameter = false, + LanguageServerFlags? LanguageServerFlags = null) { public static readonly RazorConfiguration Default = new( RazorLanguageVersion.Latest, ConfigurationName: "unnamed", Extensions: [], - LanguageServerFlags: null, - UseConsolidatedMvcViews: true); + UseConsolidatedMvcViews: true, + SuppressAddComponentParameter: false, + LanguageServerFlags: null); public bool Equals(RazorConfiguration? other) => other is not null && LanguageVersion == other.LanguageVersion && ConfigurationName == other.ConfigurationName && + SuppressAddComponentParameter == other.SuppressAddComponentParameter && LanguageServerFlags == other.LanguageServerFlags && UseConsolidatedMvcViews == other.UseConsolidatedMvcViews && Extensions.SequenceEqual(other.Extensions); @@ -35,6 +38,7 @@ public override int GetHashCode() hash.Add(LanguageVersion); hash.Add(ConfigurationName); hash.Add(Extensions); + hash.Add(SuppressAddComponentParameter); hash.Add(UseConsolidatedMvcViews); hash.Add(LanguageServerFlags); return hash; diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.Helpers.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.Helpers.cs index bc0e302982d..6b789f69744 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.Helpers.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.Helpers.cs @@ -87,8 +87,7 @@ private static StaticCompilationTagHelperFeature GetStaticTagHelperFeature(Compi private static SourceGeneratorProjectEngine GetGenerationProjectEngine( SourceGeneratorProjectItem item, IEnumerable imports, - RazorSourceGenerationOptions razorSourceGeneratorOptions, - bool isAddComponentParameterAvailable) + RazorSourceGenerationOptions razorSourceGeneratorOptions) { var fileSystem = new VirtualRazorProjectFileSystem(); fileSystem.Add(item); @@ -107,7 +106,7 @@ private static SourceGeneratorProjectEngine GetGenerationProjectEngine( options.SuppressMetadataSourceChecksumAttributes = !razorSourceGeneratorOptions.GenerateMetadataSourceChecksumAttributes; options.SupportLocalizedComponentNames = razorSourceGeneratorOptions.SupportLocalizedComponentNames; options.SuppressUniqueIds = razorSourceGeneratorOptions.TestSuppressUniqueIds; - options.SuppressAddComponentParameter = !isAddComponentParameterAvailable; + options.SuppressAddComponentParameter = razorSourceGeneratorOptions.Configuration.SuppressAddComponentParameter; })); CompilerFeatures.Register(b); diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.RazorProviders.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.RazorProviders.cs index 7daf0ba4abf..1cd315c9d28 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.RazorProviders.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.RazorProviders.cs @@ -2,21 +2,24 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Immutable; using System.IO; +using System.Linq; using System.Text; using System.Threading; using Microsoft.AspNetCore.Razor.Language; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Razor.Compiler.CSharp; namespace Microsoft.NET.Sdk.Razor.SourceGenerators { public partial class RazorSourceGenerator { - private (RazorSourceGenerationOptions?, Diagnostic?) ComputeRazorSourceGeneratorOptions(((AnalyzerConfigOptionsProvider, ParseOptions), bool) pair, CancellationToken ct) + private (RazorSourceGenerationOptions?, Diagnostic?) ComputeRazorSourceGeneratorOptions((((AnalyzerConfigOptionsProvider, ParseOptions), ImmutableArray), bool) pair, CancellationToken ct) { - var ((options, parseOptions), isSuppressed) = pair; + var (((options, parseOptions), references), isSuppressed) = pair; var globalOptions = options.GlobalOptions; if (isSuppressed) @@ -42,7 +45,15 @@ public partial class RazorSourceGenerator razorLanguageVersion = RazorLanguageVersion.Latest; } - var razorConfiguration = new RazorConfiguration(razorLanguageVersion, configurationName ?? "default", Extensions: [], UseConsolidatedMvcViews: true); + var minimalReferences = references + .Where(r => r.Display is { } display && display.EndsWith("Microsoft.AspNetCore.Components.dll", StringComparison.Ordinal)) + .ToImmutableArray(); + + var isComponentParameterSupported = minimalReferences.Length == 0 + ? false + : CSharpCompilation.Create("components", references: minimalReferences).HasAddComponentParameter(); + + var razorConfiguration = new RazorConfiguration(razorLanguageVersion, configurationName ?? "default", Extensions: [], UseConsolidatedMvcViews: true, SuppressAddComponentParameter: !isComponentParameterSupported); var razorSourceGenerationOptions = new RazorSourceGenerationOptions() { diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.cs index 0fe65e3eb60..9d3eff80c26 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/SourceGenerators/RazorSourceGenerator.cs @@ -6,7 +6,6 @@ using System.IO; using System.Linq; using Microsoft.AspNetCore.Razor.Language; -using Microsoft.AspNetCore.Razor.Language.Extensions; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -44,6 +43,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) var razorSourceGeneratorOptions = analyzerConfigOptions .Combine(parseOptions) + .Combine(metadataRefs.Collect()) .SuppressIfNeeded(isGeneratorSuppressed) .Select(ComputeRazorSourceGeneratorOptions) .ReportDiagnostics(context); @@ -235,30 +235,16 @@ public void Initialize(IncrementalGeneratorInitializationContext context) var razorHostOutputsEnabled = analyzerConfigOptions.CheckGlobalFlagSet("EnableRazorHostOutputs"); var withOptionsDesignTime = withOptions.EmptyOrCachedWhen(razorHostOutputsEnabled, false); - var isAddComponentParameterAvailable = metadataRefs - .Where(r => r.Display is { } display && display.EndsWith("Microsoft.AspNetCore.Components.dll", StringComparison.Ordinal)) - .Collect() - .Select((refs, _) => - { - var compilation = CSharpCompilation.Create("components", references: refs); - return compilation.GetTypesByMetadataName("Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder") - .Any(static t => - t.DeclaredAccessibility == Accessibility.Public && - t.GetMembers("AddComponentParameter") - .Any(static m => m.DeclaredAccessibility == Accessibility.Public)); - }); - IncrementalValuesProvider<(string, SourceGeneratorRazorCodeDocument)> processed(bool designTime) { return (designTime ? withOptionsDesignTime : withOptions) - .Combine(isAddComponentParameterAvailable) .Select((pair, _) => { - var (((sourceItem, imports), razorSourceGeneratorOptions), isAddComponentParameterAvailable) = pair; + var ((sourceItem, imports), razorSourceGeneratorOptions) = pair; RazorSourceGeneratorEventSource.Log.ParseRazorDocumentStart(sourceItem.RelativePhysicalPath); - var projectEngine = GetGenerationProjectEngine(sourceItem, imports, razorSourceGeneratorOptions, isAddComponentParameterAvailable); + var projectEngine = GetGenerationProjectEngine(sourceItem, imports, razorSourceGeneratorOptions); var document = projectEngine.ProcessInitialParse(sourceItem, designTime); diff --git a/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs b/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs index 9d5de9e89e6..6bcc67c34bd 100644 --- a/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs +++ b/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs @@ -1160,6 +1160,7 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. Assert.Equal(2, result.GeneratedSources.Length); Assert.Collection(eventListener.Events, + e => Assert.Equal("ComputeRazorSourceGeneratorOptions", e.EventName), e => Assert.Equal("DiscoverTagHelpersFromCompilationStart", e.EventName), e => Assert.Equal("DiscoverTagHelpersFromCompilationStop", e.EventName), e => Assert.Equal("DiscoverTagHelpersFromReferencesStart", e.EventName), @@ -3260,6 +3261,7 @@ public async Task IncrementalCompilation_OnlyCompilationRuns_When_MetadataRefere // reference causes the compilation to change so we re-run tag helper discovery there // but we didn't re-check the actual reference itself Assert.Collection(eventListener.Events, + e => Assert.Equal("ComputeRazorSourceGeneratorOptions", e.EventName), e => Assert.Equal("DiscoverTagHelpersFromCompilationStart", e.EventName), e => Assert.Equal("DiscoverTagHelpersFromCompilationStop", e.EventName)); } diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Resources/Telerik/Kendo.Mvc.Examples.project.razor.json b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Resources/Telerik/Kendo.Mvc.Examples.project.razor.json index 00ca3271787..9104b499f89 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Resources/Telerik/Kendo.Mvc.Examples.project.razor.json +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Resources/Telerik/Kendo.Mvc.Examples.project.razor.json @@ -1,5 +1,5 @@ { - "__Version": 5, + "__Version": 6, "ProjectKey": "C:\\Users\\admin\\location\\Kendo.Mvc.Examples\\obj\\Debug\\net7.0\\", "FilePath": "C:\\Users\\admin\\location\\Kendo.Mvc.Examples\\Kendo.Mvc.Examples.csproj", "Configuration": { diff --git a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Resources/project.razor.json b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Resources/project.razor.json index 2521817d3c0..d1525d22f3a 100644 --- a/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Resources/project.razor.json +++ b/src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/Resources/project.razor.json @@ -1,5 +1,5 @@ { - "__Version": 5, + "__Version": 6, "ProjectKey": "C:\\Users\\admin\\location\\blazorserver\\obj\\Debug\\net7.0\\", "FilePath": "C:\\Users\\admin\\location\\blazorserver\\blazorserver.csproj", "Configuration": { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace/RazorWorkspaceListenerBase.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace/RazorWorkspaceListenerBase.cs index 7ab3ecf2a4b..753ad07c46d 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace/RazorWorkspaceListenerBase.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace/RazorWorkspaceListenerBase.cs @@ -279,7 +279,7 @@ private static async Task ProcessWorkCoreAsync(ImmutableArray work, Stream private static async Task ReportUpdateProjectAsync(Stream stream, Project project, ILogger logger, CancellationToken cancellationToken) { logger.LogTrace("Serializing information for {projectId}", project.Id); - var projectInfo = await RazorProjectInfoFactory.ConvertAsync(project, logger, cancellationToken).ConfigureAwait(false); + var projectInfo = await RazorProjectInfoFactory.ConvertAsync(project, cancellationToken).ConfigureAwait(false); if (projectInfo is null) { logger.LogTrace("Skipped writing data for {projectId}", project.Id); diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/Formatters/RazorConfigurationFormatter.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/Formatters/RazorConfigurationFormatter.cs index 94a229eedb7..6232c1fabdb 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/Formatters/RazorConfigurationFormatter.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/Formatters/RazorConfigurationFormatter.cs @@ -22,14 +22,10 @@ public override RazorConfiguration Deserialize(ref MessagePackReader reader, Ser var configurationName = CachedStringFormatter.Instance.Deserialize(ref reader, options) ?? string.Empty; var languageVersionText = CachedStringFormatter.Instance.Deserialize(ref reader, options) ?? string.Empty; + var suppressAddComponentParameter = reader.ReadBoolean(); + var useConsolidatedMvcViews = reader.ReadBoolean(); - count -= 2; - - if (reader.NextMessagePackType is MessagePackType.Boolean) - { - reader.ReadBoolean(); // forceRuntimeCodeGeneration - count -= 1; - } + count -= 4; using var builder = new PooledArrayBuilder(); @@ -45,14 +41,19 @@ public override RazorConfiguration Deserialize(ref MessagePackReader reader, Ser ? version : RazorLanguageVersion.Version_2_1; - return new(languageVersion, configurationName, extensions); + return new( + languageVersion, + configurationName, + extensions, + UseConsolidatedMvcViews: useConsolidatedMvcViews, + SuppressAddComponentParameter: suppressAddComponentParameter); } public override void Serialize(ref MessagePackWriter writer, RazorConfiguration value, SerializerCachingOptions options) { - // Write 3 values + 1 value per extension. + // Write 4 values + 1 value per extension. var extensions = value.Extensions; - var count = extensions.Length + 2; + var count = extensions.Length + 4; writer.WriteArrayHeader(count); @@ -67,7 +68,10 @@ public override void Serialize(ref MessagePackWriter writer, RazorConfiguration CachedStringFormatter.Instance.Serialize(ref writer, value.LanguageVersion.ToString(), options); } - count -= 2; + writer.Write(value.SuppressAddComponentParameter); + writer.Write(value.UseConsolidatedMvcViews); + + count -= 4; for (var i = 0; i < count; i++) { diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/SerializationFormat.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/SerializationFormat.cs index bb550776606..0fc5c52667c 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/SerializationFormat.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/SerializationFormat.cs @@ -9,5 +9,5 @@ internal static class SerializationFormat // or any of the types that compose it changes. This includes: RazorConfiguration, // ProjectWorkspaceState, TagHelperDescriptor, and DocumentSnapshotHandle. // NOTE: If this version is changed, a coordinated insertion is required between Roslyn and Razor for the C# extension. - public const int Version = 5; + public const int Version = 6; } diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace/RazorProjectInfoFactory.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/RazorProjectInfoFactory.cs similarity index 85% rename from src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace/RazorProjectInfoFactory.cs rename to src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/RazorProjectInfoFactory.cs index c99a25ec283..37a68df1de7 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace/RazorProjectInfoFactory.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Utilities/RazorProjectInfoFactory.cs @@ -1,23 +1,26 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT license. See License.txt in the project root for license information. +using System; using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; +using System.IO; using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.PooledObjects; using Microsoft.AspNetCore.Razor.ProjectEngineHost; using Microsoft.AspNetCore.Razor.ProjectSystem; using Microsoft.AspNetCore.Razor.Serialization; using Microsoft.AspNetCore.Razor.Telemetry; -using Microsoft.AspNetCore.Razor.Utilities; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Razor; -using Microsoft.Extensions.Logging; +using Microsoft.CodeAnalysis.Razor.Compiler.CSharp; -namespace Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace; +namespace Microsoft.AspNetCore.Razor.Utilities; internal static class RazorProjectInfoFactory { @@ -30,19 +33,17 @@ static RazorProjectInfoFactory() : StringComparison.OrdinalIgnoreCase; } - public static async Task ConvertAsync(Project project, ILogger? logger, CancellationToken cancellationToken) + public static async Task ConvertAsync(Project project, CancellationToken cancellationToken) { var projectPath = Path.GetDirectoryName(project.FilePath); if (projectPath is null) { - logger?.LogInformation("projectPath is null, skip conversion for {projectId}", project.Id); return null; } var intermediateOutputPath = Path.GetDirectoryName(project.CompilationOutputInfo.AssemblyPath); if (intermediateOutputPath is null) { - logger?.LogInformation("intermediatePath is null, skip conversion for {projectId}", project.Id); return null; } @@ -52,23 +53,19 @@ static RazorProjectInfoFactory() // Not a razor project if (documents.Length == 0) { - if (project.DocumentIds.Count == 0) - { - logger?.LogInformation("No razor documents for {projectId}", project.Id); - } - else - { - logger?.LogTrace("No documents in {projectId}", project.Id); - } - return null; } var csharpLanguageVersion = (project.ParseOptions as CSharpParseOptions)?.LanguageVersion ?? LanguageVersion.Default; - var options = project.AnalyzerOptions.AnalyzerConfigOptionsProvider; - var configuration = ComputeRazorConfigurationOptions(options, logger, out var defaultNamespace); + var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); + if (compilation is null) + { + return null; + } + var options = project.AnalyzerOptions.AnalyzerConfigOptionsProvider; + var configuration = ComputeRazorConfigurationOptions(options, compilation, out var defaultNamespace); var fileSystem = RazorProjectFileSystem.Create(projectPath); var defaultConfigure = (RazorProjectEngineBuilder builder) => @@ -104,7 +101,7 @@ static RazorProjectInfoFactory() documents: documents); } - private static RazorConfiguration ComputeRazorConfigurationOptions(AnalyzerConfigOptionsProvider options, ILogger? logger, out string defaultNamespace) + private static RazorConfiguration ComputeRazorConfigurationOptions(AnalyzerConfigOptionsProvider options, Compilation compilation, out string defaultNamespace) { // See RazorSourceGenerator.RazorProviders.cs @@ -119,11 +116,17 @@ private static RazorConfiguration ComputeRazorConfigurationOptions(AnalyzerConfi if (!globalOptions.TryGetValue("build_property.RazorLangVersion", out var razorLanguageVersionString) || !RazorLanguageVersion.TryParse(razorLanguageVersionString, out var razorLanguageVersion)) { - logger?.LogTrace("Using default of latest language version"); razorLanguageVersion = RazorLanguageVersion.Latest; } - var razorConfiguration = new RazorConfiguration(razorLanguageVersion, configurationName, Extensions: [], UseConsolidatedMvcViews: true); + var suppressAddComponentParameter = !compilation.HasAddComponentParameter(); + + var razorConfiguration = new RazorConfiguration( + razorLanguageVersion, + configurationName, + Extensions: [], + UseConsolidatedMvcViews: true, + suppressAddComponentParameter); defaultNamespace = rootNamespace ?? "ASP"; // TODO: Source generator does this. Do we want it? @@ -182,7 +185,7 @@ private static string GetTargetPath(string documentFilePath, string normalizedPr private static bool TryGetFileKind(string filePath, [NotNullWhen(true)] out string? fileKind) { - var extension = Path.GetExtension(filePath.AsSpan()); + var extension = Path.GetExtension(filePath); if (extension.Equals(".cshtml", s_stringComparison)) { @@ -216,8 +219,8 @@ private static bool TryGetRazorFileName(string? filePath, [NotNullWhen(true)] ou var path = filePath.AsSpan(); // Generated files have a path like: virtualcsharp-razor:///e:/Scratch/RazorInConsole/Goo.cshtml__virtual.cs - if (path.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) && - (path.EndsWith(generatedRazorExtension, s_stringComparison) || path.EndsWith(generatedCshtmlExtension, s_stringComparison))) + if (path.StartsWith(prefix.AsSpan(), StringComparison.OrdinalIgnoreCase) && + (path.EndsWith(generatedRazorExtension.AsSpan(), s_stringComparison) || path.EndsWith(generatedCshtmlExtension.AsSpan(), s_stringComparison))) { // Go through the file path normalizer because it also does Uri decoding, and we're converting from a Uri to a path // but "new Uri(filePath).LocalPath" seems wasteful diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs index bf65778cd50..c8b9537ba4c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteDocumentSnapshot.cs @@ -64,7 +64,7 @@ public async Task GetGeneratedOutputAsync(bool _) // and simply compiles when asked, and if a new document snapshot comes in, we compile again. This is presumably worse for perf // but since we don't expect users to ever use cohosting without source generators, it's fine for now. - var projectEngine = _projectSnapshot.GetProjectEngine_CohostOnly(); + var projectEngine = await _projectSnapshot.GetProjectEngine_CohostOnlyAsync(CancellationToken.None).ConfigureAwait(false); var tagHelpers = await _projectSnapshot.GetTagHelpersAsync(CancellationToken.None).ConfigureAwait(false); var imports = await DocumentState.GetImportsAsync(this, projectEngine).ConfigureAwait(false); diff --git a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs index 6d5d2ec6040..c5d51dce06c 100644 --- a/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs +++ b/src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs @@ -18,7 +18,9 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Razor; +using Microsoft.CodeAnalysis.Razor.Compiler.CSharp; using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.VisualStudio.Threading; namespace Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem; @@ -29,8 +31,8 @@ internal class RemoteProjectSnapshot : IProjectSnapshot private readonly Project _project; private readonly DocumentSnapshotFactory _documentSnapshotFactory; private readonly ITelemetryReporter _telemetryReporter; - private readonly Lazy _lazyConfiguration; - private readonly Lazy _lazyProjectEngine; + private readonly AsyncLazy _lazyConfiguration; + private readonly AsyncLazy _lazyProjectEngine; private ImmutableArray _tagHelpers; @@ -41,11 +43,12 @@ public RemoteProjectSnapshot(Project project, DocumentSnapshotFactory documentSn _telemetryReporter = telemetryReporter; Key = _project.ToProjectKey(); - _lazyConfiguration = new Lazy(CreateRazorConfiguration); - _lazyProjectEngine = new Lazy(() => + _lazyConfiguration = new AsyncLazy(CreateRazorConfigurationAsync, joinableTaskFactory: null); + _lazyProjectEngine = new AsyncLazy(async () => { + var configuration = await _lazyConfiguration.GetValueAsync(); return ProjectEngineFactories.DefaultProvider.Create( - _lazyConfiguration.Value, + configuration, rootDirectoryPath: Path.GetDirectoryName(FilePath).AssumeNotNull(), configure: builder => { @@ -53,7 +56,8 @@ public RemoteProjectSnapshot(Project project, DocumentSnapshotFactory documentSn builder.SetCSharpLanguageVersion(CSharpLanguageVersion); builder.SetSupportLocalizedComponentNames(); }); - }); + }, + joinableTaskFactory: null); } public RazorConfiguration Configuration => throw new InvalidOperationException("Should not be called for cohosted projects."); @@ -96,7 +100,8 @@ public async ValueTask> GetTagHelpersAsync(C { if (_tagHelpers.IsDefault) { - var computedTagHelpers = await ComputeTagHelpersAsync(_project, _lazyProjectEngine.Value, _telemetryReporter, cancellationToken); + var projectEngine = await _lazyProjectEngine.GetValueAsync(cancellationToken); + var computedTagHelpers = await ComputeTagHelpersAsync(_project, projectEngine, _telemetryReporter, cancellationToken); ImmutableInterlocked.InterlockedInitialize(ref _tagHelpers, computedTagHelpers); } @@ -138,9 +143,9 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSna /// NOTE: To be called only from CohostDocumentSnapshot.GetGeneratedOutputAsync(). Will be removed when that method uses the source generator directly. /// /// - internal RazorProjectEngine GetProjectEngine_CohostOnly() => _lazyProjectEngine.Value; + internal Task GetProjectEngine_CohostOnlyAsync(CancellationToken cancellationToken) => _lazyProjectEngine.GetValueAsync(cancellationToken); - private RazorConfiguration CreateRazorConfiguration() + private async Task CreateRazorConfigurationAsync() { // See RazorSourceGenerator.RazorProviders.cs @@ -156,6 +161,17 @@ private RazorConfiguration CreateRazorConfiguration() razorLanguageVersion = RazorLanguageVersion.Latest; } - return new(razorLanguageVersion, configurationName, Extensions: [], UseConsolidatedMvcViews: true); + var compilation = await _project.GetCompilationAsync().ConfigureAwait(false); + + var suppressAddComponentParameter = compilation is null + ? false + : !compilation.HasAddComponentParameter(); + + return new( + razorLanguageVersion, + configurationName, + Extensions: [], + UseConsolidatedMvcViews: true, + suppressAddComponentParameter); } } diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/ProjectSystem/DefaultWindowsRazorProjectHost.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/ProjectSystem/DefaultWindowsRazorProjectHost.cs index d3514dc58de..5b499fb9c44 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/ProjectSystem/DefaultWindowsRazorProjectHost.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/ProjectSystem/DefaultWindowsRazorProjectHost.cs @@ -166,7 +166,7 @@ internal static bool TryGetConfiguration( languageVersion, configurationItem.Key, extensions, - languageServerFlags); + LanguageServerFlags: languageServerFlags); return true; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace.Test/RazorProjectInfoSerializerTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace.Test/RazorProjectInfoSerializerTest.cs index 465d490de1f..0b5ea2a7a73 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace.Test/RazorProjectInfoSerializerTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.ExternalAccess.RoslynWorkspace.Test/RazorProjectInfoSerializerTest.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using Microsoft.AspNetCore.Razor.Test.Common; +using Microsoft.AspNetCore.Razor.Utilities; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Text; diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs index 8e070db10f5..6a4ae7846fc 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting_NetFx/FormattingTestBase.cs @@ -290,7 +290,7 @@ @using Microsoft.AspNetCore.Components.Web ]); var projectEngine = RazorProjectEngine.Create( - new RazorConfiguration(RazorLanguageVersion.Latest, "TestConfiguration", Extensions: [], new LanguageServerFlags(forceRuntimeCodeGeneration)), + new RazorConfiguration(RazorLanguageVersion.Latest, "TestConfiguration", Extensions: [], LanguageServerFlags: new LanguageServerFlags(forceRuntimeCodeGeneration)), projectFileSystem, builder => { diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/ObjectReaders.cs b/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/ObjectReaders.cs index e1726562363..91ae5629e82 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/ObjectReaders.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/ObjectReaders.cs @@ -42,6 +42,8 @@ public static RazorConfiguration ReadConfigurationFromProperties(JsonDataReader { var configurationName = reader.ReadNonNullString(nameof(RazorConfiguration.ConfigurationName)); var languageVersionText = reader.ReadNonNullString(nameof(RazorConfiguration.LanguageVersion)); + var suppressAddComponentParameter = reader.ReadBooleanOrFalse(nameof(RazorConfiguration.SuppressAddComponentParameter)); + var useConsolidatedMvcViews = reader.ReadBooleanOrTrue(nameof(RazorConfiguration.UseConsolidatedMvcViews)); var extensions = reader.ReadImmutableArrayOrEmpty(nameof(RazorConfiguration.Extensions), static r => { @@ -53,7 +55,7 @@ public static RazorConfiguration ReadConfigurationFromProperties(JsonDataReader ? version : RazorLanguageVersion.Version_2_1; - return new(languageVersion, configurationName, extensions); + return new(languageVersion, configurationName, extensions, SuppressAddComponentParameter: suppressAddComponentParameter); } public static RazorDiagnostic ReadDiagnostic(JsonDataReader reader) diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/ObjectWriters.cs b/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/ObjectWriters.cs index c8998ca6fc9..aad91449d2b 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/ObjectWriters.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/ObjectWriters.cs @@ -35,6 +35,9 @@ public static void WriteProperties(JsonDataWriter writer, RazorConfiguration val writer.Write(nameof(value.LanguageVersion), languageVersionText); + writer.WriteIfNotFalse(nameof(value.SuppressAddComponentParameter), value.SuppressAddComponentParameter); + writer.WriteIfNotTrue(nameof(value.UseConsolidatedMvcViews), value.UseConsolidatedMvcViews); + writer.WriteArrayIfNotNullOrEmpty(nameof(value.Extensions), value.Extensions, static (w, v) => w.Write(v.ExtensionName)); } diff --git a/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/SerializationFormat.cs b/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/SerializationFormat.cs index 1be32b7f927..c6a8db23f4a 100644 --- a/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/SerializationFormat.cs +++ b/src/Shared/Microsoft.AspNetCore.Razor.Serialization.Json/SerializationFormat.cs @@ -9,5 +9,5 @@ internal static class SerializationFormat // or any of the types that compose it changes. This includes: RazorConfiguration, // ProjectWorkspaceState, TagHelperDescriptor, and DocumentSnapshotHandle. // NOTE: If this version is changed, a coordinated insertion is required between Roslyn and Razor for the C# extension. - public const int Version = 5; + public const int Version = 6; } From 80f22d1707aa13e9542a1b10579757fa2cd94172 Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Sun, 22 Sep 2024 14:52:03 -0700 Subject: [PATCH 373/386] Feedback --- .../DocumentPullDiagnosticsEndpoint.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs index 7005fd9d44b..664c9aba7c6 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.Language; +using Microsoft.AspNetCore.Razor.Language.Components; using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.PooledObjects; @@ -182,8 +183,8 @@ private async ValueTask ReportRZ10012TelemetryAsync(DocumentContext documentCont return; } - var relaventDiagnostics = razorDiagnostics.SelectMany(r => r.Diagnostics?.Where(d => d.Code == "RZ10012") ?? []).ToImmutableArray(); - if (relaventDiagnostics.Length == 0) + var relevantDiagnosticsCount = razorDiagnostics.Sum(CountDiagnostics); + if (relevantDiagnosticsCount == 0) { return; } @@ -194,10 +195,14 @@ private async ValueTask ReportRZ10012TelemetryAsync(DocumentContext documentCont if (Interlocked.Exchange(ref _lastReportedTagHelperCount, tagHelpers.Count) != tagHelpers.Count) { _telemetryReporter.ReportEvent( - "rz10012", + "RZ10012", Severity.Low, new Property("tagHelpers", tagHelpers.Count), - new Property("rz10012errors", relaventDiagnostics.Length)); + new Property("RZ10012errors", relevantDiagnosticsCount)); } - } + + static int CountDiagnostics(VSInternalDiagnosticReport report) + => report.Diagnostics?.Count(d => d.Code == ComponentDiagnosticFactory.UnexpectedMarkupElement.Id) + ?? 0; + } } From 11603e60f03653280e04e3f4679499eb25835f9f Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Sun, 22 Sep 2024 15:03:08 -0700 Subject: [PATCH 374/386] Use project instead of taghelpers from document --- .../DocumentPullDiagnosticsEndpoint.cs | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs index 664c9aba7c6..b5d1a7b1951 100644 --- a/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs +++ b/src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/DocumentPullDiagnosticsEndpoint.cs @@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts; using Microsoft.AspNetCore.Razor.LanguageServer.Hosting; using Microsoft.AspNetCore.Razor.PooledObjects; +using Microsoft.AspNetCore.Razor.ProjectSystem; using Microsoft.AspNetCore.Razor.Telemetry; using Microsoft.CodeAnalysis.Razor.ProjectSystem; using Microsoft.CodeAnalysis.Razor.Protocol; @@ -28,7 +29,7 @@ internal class DocumentPullDiagnosticsEndpoint : IRazorRequestHandler _lastReporedProjectTagHelperCount = ImmutableDictionary.Empty; public DocumentPullDiagnosticsEndpoint( LanguageServerFeatureOptions languageServerFeatureOptions, @@ -189,20 +190,36 @@ private async ValueTask ReportRZ10012TelemetryAsync(DocumentContext documentCont return; } - var document = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false); - var tagHelpers = document.GetTagHelpers(); + var tagHelpers = await documentContext.Project.GetTagHelpersAsync(cancellationToken).ConfigureAwait(false); + var tagHelperCount = tagHelpers.Count(); + var shouldReport = false; - if (Interlocked.Exchange(ref _lastReportedTagHelperCount, tagHelpers.Count) != tagHelpers.Count) + ImmutableInterlocked.AddOrUpdate( + ref _lastReporedProjectTagHelperCount, + documentContext.Project.Key, + (k) => + { + shouldReport = true; + return tagHelperCount; + }, + (k, currentValue) => + { + shouldReport = currentValue != tagHelperCount; + return tagHelperCount; + }); + + if (shouldReport) { _telemetryReporter.ReportEvent( "RZ10012", Severity.Low, - new Property("tagHelpers", tagHelpers.Count), - new Property("RZ10012errors", relevantDiagnosticsCount)); + new("tagHelpers", tagHelperCount), + new("RZ10012errors", relevantDiagnosticsCount), + new("project", documentContext.Project.Key.Id)); } static int CountDiagnostics(VSInternalDiagnosticReport report) => report.Diagnostics?.Count(d => d.Code == ComponentDiagnosticFactory.UnexpectedMarkupElement.Id) ?? 0; - } + } } From 01f860d9e70f3b6c08d61532d5bc6dc4e553fca5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 23 Sep 2024 12:43:28 +0000 Subject: [PATCH 375/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240917.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 10.0.0-alpha.1.24459.1 -> To Version 10.0.0-alpha.1.24467.1 --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bb2a14337ee..fa43a0b36b9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - 08649fed58d668737a54913f7d4c649a8da5dc6e + 38a050f3b80b4dfdd0e8f6c772a3e9835674d3b4 diff --git a/eng/Versions.props b/eng/Versions.props index 9e856c4d617..802890a70ae 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 10.0.0-alpha.1.24459.1 + 10.0.0-alpha.1.24467.1 9.0.0-beta.24453.1 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From fb7807621221702c10cfe6c2071b50c9294ae2e7 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Mon, 23 Sep 2024 10:17:58 -0700 Subject: [PATCH 376/386] Fuse incorrect page directives (#10907) * Add tests * Emit the attribute in runtime code, even if it has errors * Update test baseline --- .../ComponentCodeGenerationTestBase.cs | 65 +++++++++++++++++++ .../TestComponent.codegen.cs | 32 +++++++++ .../TestComponent.diagnostics.txt | 1 + .../TestComponent.ir.txt | 21 ++++++ .../TestComponent.mappings.txt | 5 ++ .../TestComponent.codegen.cs | 31 +++++++++ .../TestComponent.diagnostics.txt | 1 + .../TestComponent.ir.txt | 19 ++++++ .../TestComponent.codegen.cs | 42 ++++++++++++ .../TestComponent.diagnostics.txt | 1 + .../TestComponent.ir.txt | 17 +++++ .../TestComponent.mappings.txt | 5 ++ .../TestComponent.codegen.cs | 42 ++++++++++++ .../TestComponent.diagnostics.txt | 1 + .../TestComponent.ir.txt | 17 +++++ .../TestComponent.mappings.txt | 5 ++ .../TestComponent.codegen.cs | 24 +++++++ .../TestComponent.diagnostics.txt | 1 + .../TestComponent.ir.txt | 12 ++++ .../TestComponent.codegen.cs | 24 +++++++ .../TestComponent.diagnostics.txt | 1 + .../TestComponent.ir.txt | 10 +++ .../TestComponent.codegen.cs | 34 ++++++++++ .../TestComponent.diagnostics.txt | 1 + .../TestComponent.ir.txt | 10 +++ .../TestComponent.mappings.txt | 5 ++ .../TestComponent.codegen.cs | 34 ++++++++++ .../TestComponent.diagnostics.txt | 1 + .../TestComponent.ir.txt | 10 +++ .../TestComponent.mappings.txt | 5 ++ .../Components/ComponentPageDirectivePass.cs | 11 ++-- 31 files changed, 483 insertions(+), 5 deletions(-) create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.diagnostics.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.mappings.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.diagnostics.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.diagnostics.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.mappings.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.diagnostics.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.mappings.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.diagnostics.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.diagnostics.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.diagnostics.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.mappings.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.diagnostics.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.mappings.txt diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs index 02461edf28f..e44e9a3f64e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs @@ -5550,6 +5550,71 @@ @inherits BaseComponent ]); } + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/10863")] + public void PageDirective_NoForwardSlash() + { + // Act + var generated = CompileToCSharp(""" + @page "MyPage" + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/10863")] + public void PageDirective_NoForwardSlash_WithComment() + { + // Act + var generated = CompileToCSharp(""" + @page /* comment */ "MyPage" + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/10863")] + public void PageDirective_MissingRoute() + { + // Act + var generated = CompileToCSharp(""" + @page + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + + // Design time writer doesn't correctly emit pragmas for missing tokens, so don't validate them in design time + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument, verifyLinePragmas: !DesignTime); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/10863")] + public void PageDirective_MissingRoute_WithComment() + { + // Act + var generated = CompileToCSharp(""" + @page /* comment */ + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + + // Design time writer doesn't correctly emit pragmas for missing tokens, so don't validate them in design time + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument, verifyLinePragmas: !DesignTime); + CompileToAssembly(generated); + } + + #endregion #region EventCallback diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.codegen.cs new file mode 100644 index 00000000000..80e6877d1d7 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.codegen.cs @@ -0,0 +1,32 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.diagnostics.txt new file mode 100644 index 00000000000..2419e9d10d0 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.diagnostics.txt @@ -0,0 +1 @@ +x:\dir\subdir\Test\TestComponent.cshtml(1,6): Error RZ1016: The 'page' directive expects a string surrounded by double quotes. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt new file mode 100644 index 00000000000..d83e2a8a601 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt @@ -0,0 +1,21 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + MalformedDirective - (0:0,0 [5] x:\dir\subdir\Test\TestComponent.cshtml) - page + CSharpCode - (5:0,5 [0] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (5:0,5 [0] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - + HtmlContent - (5:0,5 [2] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (5:0,5 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.mappings.txt new file mode 100644 index 00000000000..a6b073f91d2 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (5:0,5 [0] x:\dir\subdir\Test\TestComponent.cshtml) +|| +Generated Location: (920:26,5 [0] ) +|| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.codegen.cs new file mode 100644 index 00000000000..02c715203ff --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.codegen.cs @@ -0,0 +1,31 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.diagnostics.txt new file mode 100644 index 00000000000..e3425fa2dbc --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.diagnostics.txt @@ -0,0 +1 @@ +x:\dir\subdir\Test\TestComponent.cshtml(1,20): Error RZ1016: The 'page' directive expects a string surrounded by double quotes. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt new file mode 100644 index 00000000000..233c25c9448 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt @@ -0,0 +1,19 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + MalformedDirective - (0:0,0 [19] x:\dir\subdir\Test\TestComponent.cshtml) - page + HtmlContent - (19:0,19 [2] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (19:0,19 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.codegen.cs new file mode 100644 index 00000000000..a2998bfb5c0 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.codegen.cs @@ -0,0 +1,42 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { +// language=Route,Component +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +global::System.Object __typeHelper = "MyPage"; + +#line default +#line hidden +#nullable disable + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.diagnostics.txt new file mode 100644 index 00000000000..15714a08e34 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.diagnostics.txt @@ -0,0 +1 @@ +x:\dir\subdir\Test\TestComponent.cshtml(1,1): Error RZ9988: The @page directive must specify a route template. The route template must be enclosed in quotes and begin with the '/' character. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt new file mode 100644 index 00000000000..2ff1dd75a2e --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt @@ -0,0 +1,17 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + DirectiveToken - (6:0,6 [8] x:\dir\subdir\Test\TestComponent.cshtml) - "MyPage" + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.mappings.txt new file mode 100644 index 00000000000..ff1fe6dcd78 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (6:0,6 [8] x:\dir\subdir\Test\TestComponent.cshtml) +|"MyPage"| +Generated Location: (749:22,37 [8] ) +|"MyPage"| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.codegen.cs new file mode 100644 index 00000000000..a2998bfb5c0 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.codegen.cs @@ -0,0 +1,42 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { +// language=Route,Component +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +global::System.Object __typeHelper = "MyPage"; + +#line default +#line hidden +#nullable disable + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.diagnostics.txt new file mode 100644 index 00000000000..15714a08e34 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.diagnostics.txt @@ -0,0 +1 @@ +x:\dir\subdir\Test\TestComponent.cshtml(1,1): Error RZ9988: The @page directive must specify a route template. The route template must be enclosed in quotes and begin with the '/' character. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt new file mode 100644 index 00000000000..9b05a0bfecd --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt @@ -0,0 +1,17 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + DirectiveToken - (20:0,20 [8] x:\dir\subdir\Test\TestComponent.cshtml) - "MyPage" + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.mappings.txt new file mode 100644 index 00000000000..b4b60abd1ea --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (20:0,20 [8] x:\dir\subdir\Test\TestComponent.cshtml) +|"MyPage"| +Generated Location: (749:22,37 [8] ) +|"MyPage"| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.codegen.cs new file mode 100644 index 00000000000..9dfa26c2a18 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.codegen.cs @@ -0,0 +1,24 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.diagnostics.txt new file mode 100644 index 00000000000..2419e9d10d0 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.diagnostics.txt @@ -0,0 +1 @@ +x:\dir\subdir\Test\TestComponent.cshtml(1,6): Error RZ1016: The 'page' directive expects a string surrounded by double quotes. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt new file mode 100644 index 00000000000..67b17c77744 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt @@ -0,0 +1,12 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [22] ) - global::System + UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [27] ) - global::System.Linq + UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree + MalformedDirective - (0:0,0 [5] x:\dir\subdir\Test\TestComponent.cshtml) - page + CSharpCode - (5:0,5 [0] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (5:0,5 [0] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.codegen.cs new file mode 100644 index 00000000000..9dfa26c2a18 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.codegen.cs @@ -0,0 +1,24 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.diagnostics.txt new file mode 100644 index 00000000000..e3425fa2dbc --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.diagnostics.txt @@ -0,0 +1 @@ +x:\dir\subdir\Test\TestComponent.cshtml(1,20): Error RZ1016: The 'page' directive expects a string surrounded by double quotes. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt new file mode 100644 index 00000000000..b6abec93a06 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt @@ -0,0 +1,10 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [22] ) - global::System + UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [27] ) - global::System.Linq + UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree + MalformedDirective - (0:0,0 [19] x:\dir\subdir\Test\TestComponent.cshtml) - page diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.codegen.cs new file mode 100644 index 00000000000..1b1772ca682 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.codegen.cs @@ -0,0 +1,34 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + [global::Microsoft.AspNetCore.Components.RouteAttribute( + // language=Route,Component +#nullable restore +#line (1,7)-(1,15) "x:\dir\subdir\Test\TestComponent.cshtml" +"MyPage" + +#line default +#line hidden +#nullable disable + )] + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.diagnostics.txt new file mode 100644 index 00000000000..15714a08e34 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.diagnostics.txt @@ -0,0 +1 @@ +x:\dir\subdir\Test\TestComponent.cshtml(1,1): Error RZ9988: The @page directive must specify a route template. The route template must be enclosed in quotes and begin with the '/' character. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt new file mode 100644 index 00000000000..c2bb7e7b978 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt @@ -0,0 +1,10 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [22] ) - global::System + UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [27] ) - global::System.Linq + UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + RouteAttributeExtensionNode - (6:0,6 [8] x:\dir\subdir\Test\TestComponent.cshtml) - "MyPage" + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.mappings.txt new file mode 100644 index 00000000000..08ea8558467 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (6:0,6 [8] x:\dir\subdir\Test\TestComponent.cshtml) +|"MyPage"| +Generated Location: (504:16,0 [8] ) +|"MyPage"| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.codegen.cs new file mode 100644 index 00000000000..b4122cfef0f --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.codegen.cs @@ -0,0 +1,34 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + [global::Microsoft.AspNetCore.Components.RouteAttribute( + // language=Route,Component +#nullable restore +#line (1,21)-(1,29) "x:\dir\subdir\Test\TestComponent.cshtml" +"MyPage" + +#line default +#line hidden +#nullable disable + )] + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.diagnostics.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.diagnostics.txt new file mode 100644 index 00000000000..15714a08e34 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.diagnostics.txt @@ -0,0 +1 @@ +x:\dir\subdir\Test\TestComponent.cshtml(1,1): Error RZ9988: The @page directive must specify a route template. The route template must be enclosed in quotes and begin with the '/' character. diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt new file mode 100644 index 00000000000..f134f1b55de --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt @@ -0,0 +1,10 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [22] ) - global::System + UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [27] ) - global::System.Linq + UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + RouteAttributeExtensionNode - (20:0,20 [8] x:\dir\subdir\Test\TestComponent.cshtml) - "MyPage" + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.mappings.txt new file mode 100644 index 00000000000..ca9912367af --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (20:0,20 [8] x:\dir\subdir\Test\TestComponent.cshtml) +|"MyPage"| +Generated Location: (505:16,0 [8] ) +|"MyPage"| + diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentPageDirectivePass.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentPageDirectivePass.cs index 44b4131cb5a..5c0a2cd5a47 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentPageDirectivePass.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentPageDirectivePass.cs @@ -59,15 +59,16 @@ protected override void ExecuteCore(RazorCodeDocument codeDocument, DocumentInte var pageDirective = (DirectiveIntermediateNode)directives[i].Node; // The parser also adds errors for invalid syntax, we just need to not crash. - var routeToken = pageDirective.Tokens.FirstOrDefault(); + var routeToken = pageDirective.Tokens.First(); - if (routeToken is { Content: ['"', '/', .., '"'] content }) + if (routeToken is not { Content: ['"', '/', .., '"'] }) { - @namespace.Children.Insert(index++, new RouteAttributeExtensionNode(content) { Source = routeToken.Source }); + pageDirective.Diagnostics.Add(ComponentDiagnosticFactory.CreatePageDirective_MustSpecifyRoute(pageDirective.Source)); } - else + + if (!codeDocument.GetCodeGenerationOptions().DesignTime || pageDirective.Diagnostics.Count == 0) { - pageDirective.Diagnostics.Add(ComponentDiagnosticFactory.CreatePageDirective_MustSpecifyRoute(pageDirective.Source)); + @namespace.Children.Insert(index++, new RouteAttributeExtensionNode(routeToken.Content) { Source = routeToken.Source }); } } } From 3e0da42f82553178744daf61795b51326084251f Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 23 Sep 2024 13:21:21 -0700 Subject: [PATCH 377/386] Fix missed DotNetBuildFromSource->DotNetBuildSourceOnly (#10915) --- src/Analyzers/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analyzers/Directory.Build.props b/src/Analyzers/Directory.Build.props index 6bcdb3f9857..d27caa04acd 100644 --- a/src/Analyzers/Directory.Build.props +++ b/src/Analyzers/Directory.Build.props @@ -14,7 +14,7 @@ LatestMajor - + From 4ccb0abb81bacced1da9be1cb7f924403a3cd58f Mon Sep 17 00:00:00 2001 From: Alex Gavrilov Date: Wed, 25 Sep 2024 16:15:11 -0700 Subject: [PATCH 378/386] More hardening of the completion test (#10904) * More hardening of the completion test We not wait for a specific item in the actual shown completion UI, and also wait for the correct text in the editor post-commit to account for actions such as OnAutoInsert * Switch the other "commit tag name" test to the new way of waiting for completion * PR feedback --- .../CompletionIntegrationTests.cs | 339 ++++++++++++++++-- .../InProcess/EditorInProcess_Completion.cs | 41 +++ 2 files changed, 344 insertions(+), 36 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CompletionIntegrationTests.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CompletionIntegrationTests.cs index 8c8c8a12945..baf48dd0985 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CompletionIntegrationTests.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CompletionIntegrationTests.cs @@ -2,8 +2,10 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; +using System.Diagnostics; using System.Linq; using System.Threading.Tasks; +using Microsoft.VisualStudio.Extensibility.Testing; using Roslyn.Test.Utilities; using Xunit; using Xunit.Abstractions; @@ -17,55 +19,270 @@ public class CompletionIntegrationTests(ITestOutputHelper testOutputHelper) : Ab [IdeFact] public async Task SnippetCompletion_Html() { - await TestServices.SolutionExplorer.AddFileAsync( - RazorProjectConstants.BlazorProjectName, - "Test.razor", - """ -@page "Test" + await VerifyTypeAndCommitCompletionAsync( + input: """ + @page "Test" -Test + Test + +

Test

+ + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + output: """ + @page "Test" -

Test

+ Test -@code { - private int currentCount = 0; +

Test

+
+
+
+
- private void IncrementCount() + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + search: "

Test

", + stringsToType: ["{ENTER}", "d", "d"]); + } + + [IdeFact, WorkItem("https://github.com/dotnet/razor/issues/10787")] + public async Task CompletionCommit_HtmlAttributeWithoutValue() { - currentCount++; + await VerifyTypeAndCommitCompletionAsync( + input: """ + @page "Test" + + Test + + + + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + output: """ + @page "Test" + + Test + + + + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + search: "Test", charsOffset: 1, ControlledHangMitigatingCancellationToken); - TestServices.Input.Send("{ENTER}"); - TestServices.Input.Send("d"); - TestServices.Input.Send("d"); + Test - await CommitCompletionAndVerifyAsync(""" -@page "Test" + + + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + output: """ + @page "Test" -Test + Test -

Test

-
-
-
-
+ -@code { - private int currentCount = 0; + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + search: "Test + + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + output: """ + @page "Test" + + Test + + ", + stringsToType: ["{ENTER}", "{ENTER}", "<", "s", "p", "a"], + commitChar: null, + expectedSelectedItemLabel: "span"); } -} -"""); + + [IdeFact] + public async Task CompletionCommit_WithAngleBracket_HtmlTag() + { + await VerifyTypeAndCommitCompletionAsync( + input: """ + @page "Test" + + Test + + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + output: """ + @page "Test" + + Test + + + + @code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } + } + """, + search: "", + stringsToType: ["{ENTER}", "{ENTER}", "<", "s", "p", "a"], + commitChar: '>', + "span"); + } + + [IdeFact] + public async Task CompletionCommit_CSharp() + { + await VerifyTypeAndCommitCompletionAsync( + input: """ + @page "Test" + + Test + + @code { + private int myCurrentCount = 0; + + private void IncrementCount() + { + myCurrentCount++; + } + } + """, + output: """ + @page "Test" + + Test + + @code { + private int myCurrentCount = 0; + + private void IncrementCount() + { + myCurrentCount++; + + myCurrentCount + } + } + """, + search: "myCurrentCount++;", + stringsToType: ["{ENTER}", "{ENTER}", "m", "y", "C", "u", "r"]); + } + + private async Task VerifyTypeAndCommitCompletionAsync(string input, string output, string search, string[] stringsToType, char? commitChar = null, string? expectedSelectedItemLabel = null) + { + await TestServices.SolutionExplorer.AddFileAsync( + RazorProjectConstants.BlazorProjectName, + "Test.razor", + input, + open: true, + ControlledHangMitigatingCancellationToken); + + await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken); + + await TestServices.Editor.PlaceCaretAsync(search, charsOffset: 1, ControlledHangMitigatingCancellationToken); + foreach (var stringToType in stringsToType) + { + TestServices.Input.Send(stringToType); + } + + if (expectedSelectedItemLabel is not null) + { + await CommitCompletionAndVerifyAsync(output, expectedSelectedItemLabel, commitChar); + } + else + { + await CommitCompletionAndVerifyAsync(output, commitChar); + } } [IdeFact] @@ -225,12 +442,25 @@ public enum MyEnum """); } - private async Task CommitCompletionAndVerifyAsync(string expected) + private async Task CommitCompletionAndVerifyAsync(string expected, char? commitChar = null) { var session = await TestServices.Editor.WaitForCompletionSessionAsync(HangMitigatingCancellationToken); Assert.NotNull(session); - Assert.True(session.CommitIfUnique(HangMitigatingCancellationToken)); + if (commitChar.HasValue) + { + // Commit using the specified commit character + session.Commit(commitChar.Value, HangMitigatingCancellationToken); + + // session.Commit call above commits as if the commit character was typed, + // but doesn't actually insert the character into the buffer. + // So we still need to insert the character into the buffer ourselves. + TestServices.Input.Send(commitChar.Value.ToString()); + } + else + { + Assert.True(session.CommitIfUnique(HangMitigatingCancellationToken)); + } var textView = await TestServices.Editor.GetActiveTextViewAsync(HangMitigatingCancellationToken); var text = textView.TextBuffer.CurrentSnapshot.GetText(); @@ -239,4 +469,41 @@ private async Task CommitCompletionAndVerifyAsync(string expected) // tests allow for it as long as the content is correct AssertEx.AssertEqualToleratingWhitespaceDifferences(expected, text); } + + private async Task CommitCompletionAndVerifyAsync(string expected, string expectedSelectedItemLabel, char? commitChar = null) + { + // Actually open completion UI and wait for it have selected item we are interested in + var session = await TestServices.Editor.OpenCompletionSessionAndWaitForItemAsync(TimeSpan.FromSeconds(10), expectedSelectedItemLabel, HangMitigatingCancellationToken); + + Assert.NotNull(session); + if (commitChar is char commitCharValue) + { + // Commit using the specified commit character + session.Commit(commitCharValue, HangMitigatingCancellationToken); + + // session.Commit call above commits as if the commit character was typed, + // but doesn't actually insert the character into the buffer. + // So we still need to insert the character into the buffer ourselves. + TestServices.Input.Send(commitCharValue.ToString()); + } + else + { + Assert.True(session.CommitIfUnique(HangMitigatingCancellationToken)); + } + + var textView = await TestServices.Editor.GetActiveTextViewAsync(HangMitigatingCancellationToken); + + var stopwatch = new Stopwatch(); + string text; + while ((text = textView.TextBuffer.CurrentSnapshot.GetText()) != expected && stopwatch.ElapsedMilliseconds < EditorInProcess.DefaultCompletionWaitTimeMilliseconds) + { + // Text might get updated *after* completion by something like auto-insert, so wait for the desired text + await Task.Delay(100, HangMitigatingCancellationToken); + } + + // Snippets may have slight whitespace differences due to line endings. These + // tests allow for it as long as the content is correct + Assert.Equal(expected, text); + } + } diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/EditorInProcess_Completion.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/EditorInProcess_Completion.cs index 838e2eb79e8..caf687e31ee 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/EditorInProcess_Completion.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/InProcess/EditorInProcess_Completion.cs @@ -12,6 +12,8 @@ namespace Microsoft.VisualStudio.Extensibility.Testing; internal partial class EditorInProcess { + public const int DefaultCompletionWaitTimeMilliseconds = 10000; + public async Task DismissCompletionSessionsAsync(CancellationToken cancellationToken) { await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); @@ -55,4 +57,43 @@ public async Task DismissCompletionSessionsAsync(CancellationToken cancellationT return session; } + + /// + /// Open completion pop-up window UI and wait for the specified item to be present selected + /// + /// + /// + /// + /// Completion session that has matching selected item, or null otherwise + public async Task OpenCompletionSessionAndWaitForItemAsync(TimeSpan timeOut, string selectedItemLabel, CancellationToken cancellationToken) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + + // Returns completion session that might or might not be visible in the IDE + var session = await WaitForCompletionSessionAsync(timeOut, cancellationToken); + + if (session is null) + { + return null; + } + + var textView = await GetActiveTextViewAsync(cancellationToken); + var stopWatch = Stopwatch.StartNew(); + + // Actually open the completion pop-up window and force visible items to be computed or re-computed + session.OpenOrUpdate(new CompletionTrigger(CompletionTriggerReason.Insertion, textView.TextSnapshot), textView.Caret.Position.BufferPosition, cancellationToken); + while (session.GetComputedItems(cancellationToken).SelectedItem?.DisplayText != selectedItemLabel) + { + if (stopWatch.ElapsedMilliseconds >= timeOut.TotalMilliseconds) + { + return null; + } + + await Task.Delay(100, cancellationToken); + + session.OpenOrUpdate(new CompletionTrigger(CompletionTriggerReason.Insertion, textView.TextSnapshot), textView.Caret.Position.BufferPosition, cancellationToken); + } + + return session; + } } From eb2b7d418d5cd7328d704e071efa7b3b255230fe Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Wed, 25 Sep 2024 17:04:09 -0700 Subject: [PATCH 379/386] Add a filter for faults to avoid bucketing (#10921) Helps remove AssumeNotNull from the fault parameters and blame something in our code stack instead --- .../Telemetry/TelemetryReporter.cs | 187 +++++++++++++----- .../Telemetry/TelemetryReporterTests.cs | 31 +++ 2 files changed, 169 insertions(+), 49 deletions(-) diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Telemetry/TelemetryReporter.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Telemetry/TelemetryReporter.cs index f6de565c009..8b268f4b9ec 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Telemetry/TelemetryReporter.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Telemetry/TelemetryReporter.cs @@ -2,11 +2,15 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; +using System.Collections.Frozen; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; using Microsoft.VisualStudio.Telemetry; using Microsoft.AspNetCore.Razor.Telemetry; +using Microsoft.AspNetCore.Razor; +using System.IO; + #if DEBUG using System.Linq; @@ -16,6 +20,16 @@ namespace Microsoft.VisualStudio.Razor.Telemetry; internal abstract class TelemetryReporter : ITelemetryReporter { + private const string CodeAnalysisNamespace = nameof(Microsoft) + "." + nameof(CodeAnalysis); + private const string AspNetCoreNamespace = nameof(Microsoft) + "." + nameof(AspNetCore); + private const string MicrosoftVSRazorNamespace = $"{nameof(Microsoft)}.{nameof(VisualStudio)}.{nameof(Razor)}"; + + // Types that will not contribute to fault bucketing. Fully qualified name is + // required in order to match correctly. + private static readonly FrozenSet s_faultIgnoredTypeNames = new string[] { + "Microsoft.AspNetCore.Razor.NullableExtensions" + }.ToFrozenSet(); + protected ImmutableArray TelemetrySessions { get; set; } protected TelemetryReporter(ImmutableArray telemetrySessions = default) @@ -163,6 +177,11 @@ public void ReportFault(Exception exception, string? message, params object?[] @ return 0; }); + var (moduleName, methodName) = GetModifiedFaultParameters(exception); + faultEvent.SetFailureParameters( + failureParameter1: moduleName, + failureParameter2: methodName); + Report(faultEvent); } catch (Exception) @@ -170,55 +189,6 @@ public void ReportFault(Exception exception, string? message, params object?[] @ } } - private static string GetExceptionDetails(Exception exception) - { - const string CodeAnalysisNamespace = nameof(Microsoft) + "." + nameof(CodeAnalysis); - const string AspNetCoreNamespace = nameof(Microsoft) + "." + nameof(AspNetCore); - - // Be resilient to failing here. If we can't get a suitable name, just fall back to the standard name we - // used to report. - try - { - // walk up the stack looking for the first call from a type that isn't in the ErrorReporting namespace. - var frames = new StackTrace(exception).GetFrames(); - - // On the .NET Framework, GetFrames() can return null even though it's not documented as such. - // At least one case here is if the exception's stack trace itself is null. - if (frames != null) - { - foreach (var frame in frames) - { - var method = frame?.GetMethod(); - var methodName = method?.Name; - if (methodName is null) - { - continue; - } - - var declaringTypeName = method?.DeclaringType?.FullName; - if (declaringTypeName == null) - { - continue; - } - - if (!declaringTypeName.StartsWith(CodeAnalysisNamespace) && - !declaringTypeName.StartsWith(AspNetCoreNamespace)) - { - continue; - } - - return declaringTypeName + "." + methodName; - } - } - } - catch - { - } - - // If we couldn't get a stack, do this - return exception.Message; - } - protected virtual void Report(TelemetryEvent telemetryEvent) { try @@ -297,4 +267,123 @@ public TelemetryScope TrackLspRequest(string lspMethodName, string languageServe new("eventscope.languageservername", languageServerName), new("eventscope.correlationid", correlationId)); } + + + /// + /// Returns values that should be set to (failureParameter1, failureParameter2) when reporting a fault. + /// Those values represent the blamed stackframe module and method name. + /// + internal static (string?, string?) GetModifiedFaultParameters(Exception exception) + { + var frame = FindFirstRazorStackFrame(exception, static (declaringTypeName, _) => + { + if (s_faultIgnoredTypeNames.Contains(declaringTypeName)) + { + return false; + } + + return true; + }); + + var method = frame?.GetMethod(); + if (method is null) + { + return (null, null); + } + + var moduleName = Path.GetFileNameWithoutExtension(method.Module.Name); + return (moduleName, method.Name); + } + + private static string GetExceptionDetails(Exception exception) + { + var frame = FindFirstRazorStackFrame(exception); + + if (frame is null) + { + return exception.Message; + } + + var method = frame.GetMethod(); + + // These are checked in FindFirstRazorStackFrame + method.AssumeNotNull(); + method.DeclaringType.AssumeNotNull(); + + var declaringTypeName = method.DeclaringType.FullName; + var methodName = method.Name; + + return declaringTypeName + "." + methodName; + } + + /// + /// Finds the first stack frame in exception stack that originates from razor code based on namespace + /// + /// The exception to get the stack from + /// Optional predicate to filter by declaringTypeName and methodName + /// + private static StackFrame? FindFirstRazorStackFrame( + Exception exception, + Func? predicate = null) + { + // Be resilient to failing here. If we can't get a suitable name, just fall back to the standard name we + // used to report. + try + { + // walk up the stack looking for the first call from a type that isn't in the ErrorReporting namespace. + var frames = new StackTrace(exception).GetFrames(); + + // On the .NET Framework, GetFrames() can return null even though it's not documented as such. + // At least one case here is if the exception's stack trace itself is null. + if (frames != null) + { + foreach (var frame in frames) + { + if (frame is null) + { + continue; + } + + var method = frame.GetMethod(); + var methodName = method?.Name; + if (methodName is null) + { + continue; + } + + var declaringTypeName = method?.DeclaringType?.FullName; + if (declaringTypeName == null) + { + continue; + } + + if (!IsInOwnedNamespace(declaringTypeName)) + { + continue; + } + + if (predicate is null) + { + return frame; + } + + if (predicate(declaringTypeName, methodName)) + { + return frame; + } + } + } + + return null; + } + catch + { + return null; + } + } + + private static bool IsInOwnedNamespace(string declaringTypeName) + => declaringTypeName.StartsWith(CodeAnalysisNamespace) || + declaringTypeName.StartsWith(AspNetCoreNamespace) || + declaringTypeName.StartsWith(MicrosoftVSRazorNamespace); } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs index 50fa4623eba..0f269a51b9a 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Telemetry/TelemetryReporterTests.cs @@ -2,7 +2,9 @@ // Licensed under the MIT license. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Razor; using Microsoft.AspNetCore.Razor.Telemetry; using Microsoft.AspNetCore.Razor.Test.Common; using Microsoft.VisualStudio.Editor.Razor.Test.Shared; @@ -392,4 +394,33 @@ public void ReportFault_InnerMostExceptionIsOperationCanceledException_SkipsFaul // Assert Assert.Empty(reporter.Events); } + + [Theory, MemberData(nameof(s_throwFunctions))] + public void GetModifiedFaultParameters_FiltersCorrectly(Func throwAction) + { + try + { + throwAction(); + } + catch (Exception ex) + { + var (param1, param2) = TestTelemetryReporter.GetModifiedFaultParameters(ex); + + Assert.Equal("Microsoft.VisualStudio.LanguageServices.Razor.Test", param1); + Assert.NotNull(param2); + + // Depending on debug/release the stack can contain a constructor or + // a call to this method. We expect one or the other and both + // are valid +#if DEBUG + Assert.StartsWith("<.cctor>", param2); +#else + Assert.Equal("GetModifiedFaultParameters_FiltersCorrectly", param2); +#endif + } + } + + public static readonly IEnumerable s_throwFunctions = [ + [() => ((object?)null).AssumeNotNull()] + ]; } From 3bf3548f442f7eb4ef17852311f711cc7ce47309 Mon Sep 17 00:00:00 2001 From: Ankita Khera Date: Thu, 26 Sep 2024 13:57:02 -0700 Subject: [PATCH 380/386] update configs for snap --- eng/Versions.props | 4 ++-- eng/config/PublishData.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 802890a70ae..d24fd0e281e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -30,8 +30,8 @@ imported. This OK because we want to just have an obvious salt for a local build. --> - 17.12.3 - 17.12 + 17.13.1 + 17.13 $(AddinMajorVersion) $(AddinVersion).$(OfficialBuildId) $(AddinVersion).42424242.42 diff --git a/eng/config/PublishData.json b/eng/config/PublishData.json index 60ddaded238..a6e0ca56f8e 100644 --- a/eng/config/PublishData.json +++ b/eng/config/PublishData.json @@ -28,8 +28,8 @@ ], "vsBranch": "main", "vsMajorVersion": 17, - "insertionCreateDraftPR": false, - "insertionTitlePrefix": "[d17.12 P3]" + "insertionCreateDraftPR": true, + "insertionTitlePrefix": "[d17.13 P1]" }, "release/dev17.6": { "nugetKind": [ @@ -92,10 +92,10 @@ "Shipping", "NonShipping" ], - "vsBranch": "rel/d17.12", + "vsBranch": "main", "vsMajorVersion": 17, "insertionCreateDraftPR": false, - "insertionTitlePrefix": "[d17.12 P2]" + "insertionTitlePrefix": "[d17.12 P3]" } } } From 8ae2804ea63052076a67bbb44348c567e2b6c5a8 Mon Sep 17 00:00:00 2001 From: Phil Allen Date: Thu, 26 Sep 2024 16:19:57 -0700 Subject: [PATCH 381/386] Update merge --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index c596731dffa..031f7fe4fdd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 9.0.0-alpha.1.24304.1 + 10.0.0-alpha.1.24467.1 9.0.0-beta.24466.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From 4b1b541ed34e34b4b91202871f661879dabb4f55 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Thu, 26 Sep 2024 17:36:12 -0700 Subject: [PATCH 382/386] Fuse fix usings (#10925) * Add test * Change how we parse runtime whitespace for using directives * Update added test * Update baselines * Update parsing doc --- docs/Parsing.md | 4 +- .../IncompleteDirectives_Runtime.ir.txt | 14 +++---- .../InjectWithModel_Runtime.ir.txt | 14 +++---- .../InjectWithSemicolon_Runtime.ir.txt | 14 +++---- .../Inject_Runtime.ir.txt | 14 +++---- .../Basic_Runtime.ir.txt | 14 +++---- .../IncompleteDirectives_Runtime.ir.txt | 14 +++---- .../InheritsViewModel_Runtime.ir.txt | 14 +++---- .../InheritsWithViewImports_Runtime.ir.txt | 14 +++---- .../InjectWithModel_Runtime.ir.txt | 14 +++---- .../InjectWithSemicolon_Runtime.ir.txt | 14 +++---- .../Inject_Runtime.ir.txt | 14 +++---- .../InvalidNamespaceAtEOF_Runtime.ir.txt | 14 +++---- .../MalformedPageDirective_Runtime.ir.txt | 14 +++---- .../ModelExpressionTagHelper_Runtime.ir.txt | 14 +++---- .../Model_Runtime.ir.txt | 14 +++---- .../PageWithNamespace_Runtime.ir.txt | 14 +++---- ...eWithNoLeadingPageDirective_Runtime.ir.txt | 14 +++---- ...rPagesWithRouteTemplate_Runtime.codegen.cs | 2 +- ...RazorPagesWithRouteTemplate_Runtime.ir.txt | 16 ++++---- .../RazorPagesWithoutModel_Runtime.codegen.cs | 2 +- .../RazorPagesWithoutModel_Runtime.ir.txt | 16 ++++---- .../RazorPages_Runtime.codegen.cs | 2 +- .../RazorPages_Runtime.ir.txt | 16 ++++---- .../Sections_Runtime.ir.txt | 14 +++---- .../UsingDirectives_Runtime.codegen.cs | 6 +-- .../UsingDirectives_Runtime.ir.txt | 18 ++++----- .../ViewComponentTagHelper_Runtime.ir.txt | 14 +++---- .../ViewWithNamespace_Runtime.ir.txt | 14 +++---- .../_ViewImports_Runtime.ir.txt | 14 +++---- .../BasicTest.ir.txt | 14 +++---- ...irectiveWithViewImports_Runtime.codegen.cs | 2 +- ...uteDirectiveWithViewImports_Runtime.ir.txt | 14 +++---- .../BasicComponent_Runtime.ir.txt | 8 ++-- .../Basic_Runtime.ir.txt | 14 +++---- .../IncompleteDirectives_Runtime.ir.txt | 14 +++---- .../InheritsViewModel_Runtime.ir.txt | 14 +++---- .../InheritsWithViewImports_Runtime.ir.txt | 14 +++---- .../InjectWithModel_Runtime.ir.txt | 14 +++---- .../InjectWithSemicolon_Runtime.ir.txt | 14 +++---- .../Inject_Runtime.ir.txt | 14 +++---- .../InvalidNamespaceAtEOF_Runtime.ir.txt | 14 +++---- .../MalformedPageDirective_Runtime.ir.txt | 14 +++---- .../ModelExpressionTagHelper_Runtime.ir.txt | 14 +++---- .../Model_Runtime.ir.txt | 14 +++---- .../PageWithNamespace_Runtime.ir.txt | 14 +++---- ...eWithNoLeadingPageDirective_Runtime.ir.txt | 14 +++---- .../RazorPage_WithCssScope.ir.txt | 14 +++---- ...onNullableModel_LangNew_Runtime.codegen.cs | 2 +- ...ithNonNullableModel_LangNew_Runtime.ir.txt | 16 ++++---- ...NullableModel_LangNew_Runtime.mappings.txt | 14 +++---- ...onNullableModel_LangOld_Runtime.codegen.cs | 2 +- ...ithNonNullableModel_LangOld_Runtime.ir.txt | 16 ++++---- ...NullableModel_LangOld_Runtime.mappings.txt | 14 +++---- ...thNullableModel_LangNew_Runtime.codegen.cs | 2 +- ...e_WithNullableModel_LangNew_Runtime.ir.txt | 16 ++++---- ...NullableModel_LangNew_Runtime.mappings.txt | 14 +++---- ...thNullableModel_LangOld_Runtime.codegen.cs | 2 +- ...e_WithNullableModel_LangOld_Runtime.ir.txt | 16 ++++---- ...NullableModel_LangOld_Runtime.mappings.txt | 14 +++---- ...rPagesWithRouteTemplate_Runtime.codegen.cs | 2 +- ...RazorPagesWithRouteTemplate_Runtime.ir.txt | 16 ++++---- .../RazorPagesWithoutModel_Runtime.codegen.cs | 2 +- .../RazorPagesWithoutModel_Runtime.ir.txt | 16 ++++---- .../RazorPages_Runtime.codegen.cs | 2 +- .../RazorPages_Runtime.ir.txt | 16 ++++---- .../RazorView_Layout_WithCssScope.ir.txt | 14 +++---- .../RazorView_WithCssScope.ir.txt | 14 +++---- ...bleModel_NullableContextEnabled.codegen.cs | 2 +- ...ullableModel_NullableContextEnabled.ir.txt | 16 ++++---- ...eBaseType_NullableContexEnabled.codegen.cs | 2 +- ...lableBaseType_NullableContexEnabled.ir.txt | 16 ++++---- ...bleModel_NullableContextEnabled.codegen.cs | 2 +- ...ullableModel_NullableContextEnabled.ir.txt | 16 ++++---- ...Model_NullableContextNotEnabled.codegen.cs | 2 +- ...ableModel_NullableContextNotEnabled.ir.txt | 16 ++++---- .../Sections_Runtime.ir.txt | 14 +++---- .../UsingDirectives_Runtime.codegen.cs | 6 +-- .../UsingDirectives_Runtime.ir.txt | 18 ++++----- ...onentTagHelperOptionalParam_Runtime.ir.txt | 14 +++---- .../ViewComponentTagHelper_Runtime.ir.txt | 14 +++---- .../ViewWithNamespace_Runtime.ir.txt | 14 +++---- .../_ViewImports_Runtime.ir.txt | 14 +++---- .../CapturesNewlineAfterUsing.cspans.txt | 6 +-- .../CapturesNewlineAfterUsing.stree.txt | 11 +++-- .../ComponentCodeGenerationTestBase.cs | 16 ++++++++ .../AddTagHelperDirective_Runtime.ir.txt | 14 +++---- .../AttributeDirective_Runtime.ir.txt | 14 +++---- ...ttributeTargetingTagHelpers_Runtime.ir.txt | 14 +++---- .../Await_Runtime.ir.txt | 14 +++---- .../BasicTagHelpers_Prefixed_Runtime.ir.txt | 14 +++---- ...cTagHelpers_RemoveTagHelper_Runtime.ir.txt | 14 +++---- .../BasicTagHelpers_Runtime.ir.txt | 14 +++---- .../Blocks_Runtime.ir.txt | 14 +++---- .../CSharp7_Runtime.ir.txt | 14 +++---- .../CSharp8_Runtime.codegen.cs | 2 +- .../CSharp8_Runtime.ir.txt | 14 +++---- .../CodeBlockAtEOF_Runtime.ir.txt | 14 +++---- .../CodeBlockWithTextElement_Runtime.ir.txt | 14 +++---- .../CodeBlock_Runtime.ir.txt | 14 +++---- .../ComplexTagHelpers_Runtime.ir.txt | 14 +++---- .../ConditionalAttributes2_Runtime.ir.txt | 14 +++---- .../ConditionalAttributes_Runtime.ir.txt | 14 +++---- ...SelectorTagHelperAttributes_Runtime.ir.txt | 14 +++---- .../DesignTime_Runtime.ir.txt | 14 +++---- ...uplicateAttributeTagHelpers_Runtime.ir.txt | 14 +++---- .../DuplicateTargetTagHelper_Runtime.ir.txt | 14 +++---- .../DynamicAttributeTagHelpers_Runtime.ir.txt | 14 +++---- .../EmptyAttributeTagHelpers_Runtime.ir.txt | 14 +++---- .../EmptyCodeBlock_Runtime.ir.txt | 14 +++---- .../EmptyExplicitExpression_Runtime.ir.txt | 14 +++---- ...ptyImplicitExpressionInCode_Runtime.ir.txt | 14 +++---- .../EmptyImplicitExpression_Runtime.ir.txt | 14 +++---- .../EnumTagHelpers_Runtime.ir.txt | 14 +++---- .../EscapedExpression_Runtime.ir.txt | 14 +++---- .../EscapedIdentifier_Runtime.ir.txt | 14 +++---- .../EscapedTagHelpers_Runtime.ir.txt | 14 +++---- .../ExplicitExpressionAtEOF_Runtime.ir.txt | 14 +++---- ...xplicitExpressionWithMarkup_Runtime.ir.txt | 14 +++---- .../ExplicitExpression_Runtime.ir.txt | 14 +++---- .../ExpressionsInCode_Runtime.ir.txt | 14 +++---- .../FunctionsBlockMinimal_Runtime.ir.txt | 14 +++---- .../FunctionsBlock_Runtime.ir.txt | 14 +++---- .../HiddenSpansInCode_Runtime.ir.txt | 14 +++---- ...HtmlCommentWithQuote_Double_Runtime.ir.txt | 14 +++---- ...HtmlCommentWithQuote_Single_Runtime.ir.txt | 14 +++---- .../Implements_Runtime.ir.txt | 14 +++---- .../ImplicitExpressionAtEOF_Runtime.ir.txt | 14 +++---- .../ImplicitExpression_Runtime.ir.txt | 14 +++---- .../IncompleteDirectives_Runtime.ir.txt | 14 +++---- .../IncompleteTagHelper_Runtime.ir.txt | 14 +++---- .../Inherits_Runtime.ir.txt | 14 +++---- .../InlineBlocks_Runtime.ir.txt | 14 +++---- .../Instrumented_Runtime.ir.txt | 14 +++---- .../MarkupInCodeBlock_Runtime.ir.txt | 14 +++---- ...p_InCodeBlocksWithTagHelper_Runtime.ir.txt | 14 +++---- .../Markup_InCodeBlocks_Runtime.ir.txt | 14 +++---- .../MinimizedTagHelpers_Runtime.ir.txt | 14 +++---- .../NestedCSharp_Runtime.ir.txt | 14 +++---- .../NestedCodeBlocks_Runtime.ir.txt | 14 +++---- .../NestedScriptTagTagHelpers_Runtime.ir.txt | 14 +++---- .../NestedTagHelpers_Runtime.ir.txt | 14 +++---- .../NoLinePragmas_Runtime.ir.txt | 14 +++---- .../NullConditionalExpressions_Runtime.ir.txt | 14 +++---- .../OpenedIf_Runtime.ir.txt | 14 +++---- .../ParserError_Runtime.ir.txt | 14 +++---- ...PrefixedAttributeTagHelpers_Runtime.ir.txt | 14 +++---- .../RazorComments_Runtime.ir.txt | 14 +++---- .../RemoveTagHelperDirective_Runtime.ir.txt | 14 +++---- .../Sections_Runtime.ir.txt | 14 +++---- .../SimpleTagHelpers_Runtime.ir.txt | 14 +++---- .../SimpleUnspacedIf_Runtime.ir.txt | 14 +++---- ...leLineControlFlowStatements_Runtime.ir.txt | 14 +++---- ...WithNewlineBeforeAttributes_Runtime.ir.txt | 14 +++---- .../SingleTagHelper_Runtime.ir.txt | 14 +++---- .../StringLiterals_Runtime.ir.txt | 14 +++---- ...Expression_RecursivePattern_Runtime.ir.txt | 14 +++---- .../SymbolBoundAttributes_Runtime.ir.txt | 14 +++---- .../TagHelpersInSection_Runtime.ir.txt | 14 +++---- ...gHelpersWithBoundAttributes_Runtime.ir.txt | 14 +++---- ...lpersWithDataDashAttributes_Runtime.ir.txt | 14 +++---- .../TagHelpersWithPrefix_Runtime.ir.txt | 14 +++---- .../TagHelpersWithTemplate_Runtime.ir.txt | 14 +++---- ...WithWeirdlySpacedAttributes_Runtime.ir.txt | 14 +++---- .../Tags_Runtime.ir.txt | 14 +++---- .../Templates_Runtime.ir.txt | 14 +++---- ...itionsInTagHelperAttributes_Runtime.ir.txt | 14 +++---- .../UnfinishedExpressionInCode_Runtime.ir.txt | 14 +++---- .../Usings_OutOfOrder_Runtime.codegen.cs | 14 +++---- .../Usings_OutOfOrder_Runtime.ir.txt | 26 ++++++------ .../Usings_Runtime.codegen.cs | 12 +++--- .../Usings_Runtime.ir.txt | 24 +++++------ .../UsingDirective/TestComponent.codegen.cs | 36 +++++++++++++++++ .../UsingDirective/TestComponent.ir.txt | 19 +++++++++ .../UsingDirective/TestComponent.mappings.txt | 5 +++ .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 22 +++++----- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 24 +++++------ .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 22 +++++----- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 24 +++++------ .../AtAtHandled/TestComponent.ir.txt | 10 ++--- .../AtTransitions/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../ComponentImports/_Imports.codegen.cs | 4 +- .../ComponentImports/_Imports.ir.txt | 14 +++---- .../ComponentImports/_Imports.mappings.txt | 22 +++++----- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 30 +++++++------- .../UseTestComponent.codegen.cs | 2 +- .../UseTestComponent.ir.txt | 12 +++--- .../UseTestComponent.mappings.txt | 26 ++++++------ .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 30 +++++++------- .../UseTestComponent.codegen.cs | 2 +- .../UseTestComponent.ir.txt | 12 +++--- .../UseTestComponent.mappings.txt | 26 ++++++------ .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 24 +++++------ .../UseTestComponent.codegen.cs | 2 +- .../UseTestComponent.ir.txt | 12 +++--- .../UseTestComponent.mappings.txt | 26 ++++++------ .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 24 +++++------ .../UseTestComponent.codegen.cs | 2 +- .../UseTestComponent.ir.txt | 12 +++--- .../UseTestComponent.mappings.txt | 22 +++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 22 +++++----- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 22 +++++----- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 14 +++---- .../TestComponent.mappings.txt | 20 ++++------ .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 14 +++---- .../Counter.codegen.cs | 4 +- .../Counter.ir.txt | 14 +++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 14 +++---- .../TestComponent.mappings.txt | 40 +++++++++---------- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 14 +++---- .../TestComponent.ir.txt | 10 ++--- .../Component_WithKey/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../Component_WithRef/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../Component_WithSplat/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 14 +++---- .../TestComponent.mappings.txt | 20 ++++------ .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.ir.txt | 10 ++--- .../Duplicate_RenderMode/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../Element_WithKey/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../Element_WithRef/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../Element_WithSplat/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../EmptyRootNamespace/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 20 +++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../FormName_CSharpError/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../FormName_CSharpValue/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../FormName_Component/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 28 ++++++------- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 28 ++++++------- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 18 ++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../FormName_FakeSubmit/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../FormName_HtmlValue/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../FormName_MixedValue/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 18 ++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 20 +++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../FormName_Nested/TestComponent.codegen.cs | 2 +- .../FormName_Nested/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 20 +++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../FormName_NotAForm/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../FormName_Nullability/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../FormName_RazorError/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 12 +++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 22 +++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 18 ++++----- .../TestComponent.codegen.cs | 4 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 28 ++++++------- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 18 ++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 18 ++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 18 ++++----- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 20 +++++----- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../GenericTypeCheck/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../InjectDirective/TestComponent.codegen.cs | 2 +- .../InjectDirective/TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 30 +++++++------- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.mappings.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 20 +++++----- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../LinePragma_Multiline/TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../Regression_597/TestComponent.ir.txt | 10 ++--- .../Regression_609/TestComponent.ir.txt | 10 ++--- .../Regression_772/TestComponent.ir.txt | 10 ++--- .../Regression_773/TestComponent.ir.txt | 10 ++--- .../Regression_784/TestComponent.codegen.cs | 2 +- .../Regression_784/TestComponent.ir.txt | 12 +++--- .../Regression_784/TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../ScriptTag_Razor7/TestComponent.ir.txt | 10 ++--- .../ScriptTag_Razor8/TestComponent.ir.txt | 10 ++--- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 14 +++---- .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 16 ++++---- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../UsingDirective/TestComponent.codegen.cs | 30 ++++++++++++++ .../UsingDirective/TestComponent.ir.txt | 10 +++++ .../UsingDirective/TestComponent.mappings.txt | 5 +++ .../TestComponent.codegen.cs | 2 +- .../TestComponent.ir.txt | 12 +++--- .../TestComponent.mappings.txt | 20 +++++----- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../TestComponent.ir.txt | 10 ++--- .../CapturesNewlineAfterUsing.cspans.txt | 6 +-- .../CapturesNewlineAfterUsing.stree.txt | 11 +++-- .../src/Language/Legacy/CSharpCodeParser.cs | 7 +++- .../RazorSourceGeneratorTests.cs | 4 +- .../FindNodeTests.cs | 5 ++- 780 files changed, 4183 insertions(+), 4274 deletions(-) create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.mappings.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.codegen.cs create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.ir.txt create mode 100644 src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.mappings.txt diff --git a/docs/Parsing.md b/docs/Parsing.md index a5208c9e525..ead3c502d21 100644 --- a/docs/Parsing.md +++ b/docs/Parsing.md @@ -58,4 +58,6 @@ CSharpCode Literal: ^^^\r\n ``` -In this way we keep the whitespace as belonging to the overall CSharpCode node, but don't make it part of the directive itself, ensuring the editor sees the correct length for the directive. \ No newline at end of file +In this way we keep the whitespace as belonging to the overall CSharpCode node, but don't make it part of the directive itself, ensuring the editor sees the correct length for the directive. + +We apply a very similar fix to `@using` directives, to ensure that the newline is treated as metacode of the overall block, rather than being a part of the `using` itself. \ No newline at end of file diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt index 88b3a491c57..b7aa37e1698 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt index d5b4619212a..5e900403c4c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt index 95f1b3114ee..615ba7cccaf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt index ebc3d5ac1a4..023c02254e6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt index a6d32e3df08..6a6d15050ed 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Basic - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt index 6216dbe0d33..d545eb7abd8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives), null)] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_IncompleteDirectives - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt index 9ad5ce18472..e40f593eea4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsViewModel - MyBasePageForViews - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt index e8de5419468..895b487c4ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports), null)] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InheritsWithViewImports - MyPageModel - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt index 20f170ad27e..0c8279e61fb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithModel - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt index 1ff05218558..07b5f5631f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InjectWithSemicolon - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt index 510d1b3f9bd..802e3724b7f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Inject - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt index 46048ea0442..91c685e14a9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_InvalidNamespaceAtEOF - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt index b4023f0b6d3..4bd837546da 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective), null)] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_MalformedPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt index 41aa60b9d18..483624f29d5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ModelExpressionTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt index 80688598805..c060edad9c3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Model - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt index 026e6ab7e32..82fd3a2d299 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace.cshtml", typeof(Test.Namespace.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace), null)] NamespaceDeclaration - - Test.Namespace - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_PageWithNamespace - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt index 17420a85865..c40b55ec971 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective), null)] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPageWithNoLeadingPageDirective - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs index 766dbb8c493..fe6f956bd90 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCore using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; -#line (4,2)-(5,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml" +#line (4,2)-(4,43) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml" using Microsoft.AspNetCore.Mvc.RazorPages #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt index ff0716d0aca..369288d914a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt @@ -3,14 +3,14 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate), @"/About")] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures - UsingDirective - (36:3,1 [43] RazorPagesWithRouteTemplate.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (36:3,1 [41] RazorPagesWithRouteTemplate.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages RazorCompiledItemMetadataAttribute - (6:0,6 [8] RazorPagesWithRouteTemplate.cshtml) RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithRouteTemplate - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs index 85100fe90d8..01dda34441a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCore using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; -#line (4,2)-(5,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml" +#line (4,2)-(4,43) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml" using Microsoft.AspNetCore.Mvc.RazorPages #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt index bd3781c03dc..a3af5743af6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt @@ -3,14 +3,14 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel), null)] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures - UsingDirective - (38:3,1 [43] RazorPagesWithoutModel.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (38:3,1 [41] RazorPagesWithoutModel.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPagesWithoutModel - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - text-danger - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs index bd1654c914b..688b61d131b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCore using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; -#line (5,2)-(6,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml" +#line (5,2)-(5,43) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml" using Microsoft.AspNetCore.Mvc.RazorPages #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt index 59eb0ecd802..2cf46b20ae8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt @@ -3,14 +3,14 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.RazorPageAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages), null)] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures - UsingDirective - (55:4,1 [43] RazorPages.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (55:4,1 [41] RazorPages.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_RazorPages - global::Microsoft.AspNetCore.Mvc.RazorPages.Page - PreallocatedTagHelperHtmlAttributeValue - - __tagHelperAttribute_0 - class - text-danger - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt index d366a5f7893..b6730ae5c52 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Sections - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - DefaultTagHelperRuntime - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs index 78b1e284f6f..00396700c81 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs @@ -12,15 +12,15 @@ namespace AspNetCore using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; -#line (1,2)-(2,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" +#line (1,2)-(1,29) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" using System.ComponentModel ; -#line (2,2)-(3,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" +#line (2,2)-(2,26) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" using System.Collections ; -#line (3,2)-(4,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" +#line (3,2)-(3,14) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" using System ; diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt index 4df34b01323..7449f1e8780 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt @@ -3,15 +3,15 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives))] NamespaceDeclaration - - AspNetCore - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures - UsingDirective - (1:0,1 [29] UsingDirectives.cshtml) - System.ComponentModel - UsingDirective - (31:1,1 [26] UsingDirectives.cshtml) - System.Collections - UsingDirective - (58:2,1 [14] UsingDirectives.cshtml) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [27] UsingDirectives.cshtml) - System.ComponentModel + UsingDirective - (31:1,1 [24] UsingDirectives.cshtml) - System.Collections + UsingDirective - (58:2,1 [12] UsingDirectives.cshtml) - System UsingDirective - (73:3,1 [12] UsingDirectives.cshtml) - System RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_UsingDirectives - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt index 770b7ed3709..0f04b4efca3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - FieldDeclaration - - private - global::AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewComponentTagHelper.__Generated__TestViewComponentTagHelper - __TestViewComponentTagHelper diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt index 200920f2f55..7dbac6ae2cd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace.cshtml", typeof(Test.Namespace.TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace))] NamespaceDeclaration - - Test.Namespace - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ViewWithNamespace - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt index 74029bf6ff0..ec050e07875 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest__ViewImports - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.ir.txt index 3b6caff3fce..56e4c130be3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.ir.txt @@ -3,13 +3,13 @@ CSharpCode - IntermediateToken - - CSharp - [assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/TestFiles/IntegrationTests/InstrumentationPassIntegrationTest/BasicTest.cshtml", typeof(AspNetCore.TestFiles_IntegrationTests_InstrumentationPassIntegrationTest_BasicTest))] NamespaceDeclaration - - AspNetCore - UsingDirective - (1:0,1 [14] ) - System - UsingDirective - (16:1,1 [34] ) - System.Collections.Generic - UsingDirective - (51:2,1 [19] ) - System.Linq - UsingDirective - (71:3,1 [30] ) - System.Threading.Tasks - UsingDirective - (102:4,1 [32] ) - Microsoft.AspNetCore.Mvc - UsingDirective - (135:5,1 [42] ) - Microsoft.AspNetCore.Mvc.Rendering - UsingDirective - (178:6,1 [45] ) - Microsoft.AspNetCore.Mvc.ViewFeatures + UsingDirective - (1:0,1 [12] ) - System + UsingDirective - (16:1,1 [32] ) - System.Collections.Generic + UsingDirective - (51:2,1 [17] ) - System.Linq + UsingDirective - (71:3,1 [28] ) - System.Threading.Tasks + UsingDirective - (102:4,1 [30] ) - Microsoft.AspNetCore.Mvc + UsingDirective - (135:5,1 [40] ) - Microsoft.AspNetCore.Mvc.Rendering + UsingDirective - (178:6,1 [43] ) - Microsoft.AspNetCore.Mvc.ViewFeatures RazorSourceChecksumAttribute - ClassDeclaration - - public - TestFiles_IntegrationTests_InstrumentationPassIntegrationTest_BasicTest - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage - PreallocatedTagHelperPropertyValue - - __tagHelperAttribute_0 - value - Hello - HtmlAttributeValueStyle.DoubleQuotes diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.codegen.cs index e8c12c22554..8f85c2ade57 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.codegen.cs @@ -12,7 +12,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (1,2)-(2,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\_ViewImports.cshtml" +#line (1,2)-(1,14) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\_ViewImports.cshtml" using System #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.ir.txt index f6ea905d7be..9ec9d499d38 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AttributeDirectiveWithViewImports_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (1:0,1 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\_ViewImports.cshtml) - 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 + UsingDirective - (1:0,1 [12] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\_ViewImports.cshtml) - System CSharpCode - (26:1,11 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\_ViewImports.cshtml) IntermediateToken - (26:1,11 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\_ViewImports.cshtml) - CSharp - [Serializable] CSharpCode - (11:0,11 [14] AttributeDirectiveWithViewImports.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_Runtime.ir.txt index 970d4c4e3c6..b1196e1363c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_Runtime.ir.txt @@ -1,9 +1,9 @@ Document - NamespaceDeclaration - - TestFiles.IntegrationTests.CodeGenerationIntegrationTest - 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 - (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 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - BasicComponent - global::Microsoft.AspNetCore.Components.ComponentBase - IDisposable MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt index bb2dfe4d57f..ac9187d63b2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Basic_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt index 6af247f7569..41a10f5292e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt index a87252108ee..e7cf6a81f9a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsViewModel_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt index 78ebbebbdb6..e7cc91dcb2c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InheritsWithViewImports_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt index f3c7bb47cc6..79e29c00989 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithModel_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt index a22e7329218..4aa107d8d2d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InjectWithSemicolon_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt index cdcb7fbec97..53af91db89c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inject_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt index d01e12f9994..bf3ef34295f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InvalidNamespaceAtEOF_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt index 2ca6219b5d3..6c6d17fcac8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MalformedPageDirective_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt index 184efec4d89..1bcffac69cd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ModelExpressionTagHelper_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt index 2edaa113a45..68af78c1203 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Model_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt index 31ab344447d..ddd4d92f4a1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PageWithNamespace_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - Test.Namespace - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt index 346b2f28937..23b1c3cd03c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPageWithNoLeadingPageDirective_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.ir.txt index 661ce844d18..3f31496efc8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithCssScope.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.cs index 3343a1a9015..837e9efb8c7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (2,2)-(3,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" +#line (2,2)-(2,21) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" using TestNamespace #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.ir.txt index 8efd1b0b509..994c560a814 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace + 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 + UsingDirective - (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.mappings.txt index 193db25f87d..52ff1c93a63 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangNew_Runtime.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) -|using TestNamespace -| -Generated Location: (1005:16,0 [21] ) -|using TestNamespace -| +Source Location: (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) +|using TestNamespace| +Generated Location: (1006:16,0 [19] ) +|using TestNamespace| Source Location: (54:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (2063:36,0 [10] ) +Generated Location: (2064:36,0 [10] ) |Model.Name| Source Location: (78:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (2319:46,0 [14] ) +Generated Location: (2320:46,0 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.cs index 5660607b01a..b67bacef721 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (2,2)-(3,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" +#line (2,2)-(2,21) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" using TestNamespace #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.ir.txt index f937ddd5ef3..46a777cd2d6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace + 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 + UsingDirective - (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.mappings.txt index 193db25f87d..52ff1c93a63 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNonNullableModel_LangOld_Runtime.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) -|using TestNamespace -| -Generated Location: (1005:16,0 [21] ) -|using TestNamespace -| +Source Location: (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) +|using TestNamespace| +Generated Location: (1006:16,0 [19] ) +|using TestNamespace| Source Location: (54:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (2063:36,0 [10] ) +Generated Location: (2064:36,0 [10] ) |Model.Name| Source Location: (78:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (2319:46,0 [14] ) +Generated Location: (2320:46,0 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.cs index 68a1f75cf5f..10fd07393ce 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (2,2)-(3,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" +#line (2,2)-(2,21) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" using TestNamespace #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.ir.txt index 1c026c0aef5..67090281469 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace + 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 + UsingDirective - (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.mappings.txt index 544865bd281..b51e5531cba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangNew_Runtime.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) -|using TestNamespace -| -Generated Location: (1005:16,0 [21] ) -|using TestNamespace -| +Source Location: (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) +|using TestNamespace| +Generated Location: (1006:16,0 [19] ) +|using TestNamespace| Source Location: (55:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (2063:36,0 [10] ) +Generated Location: (2064:36,0 [10] ) |Model.Name| Source Location: (79:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (2319:46,0 [14] ) +Generated Location: (2320:46,0 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.cs index cc5ef0e825e..b405118a3ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (2,2)-(3,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" +#line (2,2)-(2,21) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" using TestNamespace #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.ir.txt index 7a00e428f85..08da2eb191f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace + 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 + UsingDirective - (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.mappings.txt index 544865bd281..b51e5531cba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPage_WithNullableModel_LangOld_Runtime.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (8:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) -|using TestNamespace -| -Generated Location: (1005:16,0 [21] ) -|using TestNamespace -| +Source Location: (8:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) +|using TestNamespace| +Generated Location: (1006:16,0 [19] ) +|using TestNamespace| Source Location: (55:4,5 [10] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model.Name| -Generated Location: (2063:36,0 [10] ) +Generated Location: (2064:36,0 [10] ) |Model.Name| Source Location: (79:6,5 [14] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) |Model?.Address| -Generated Location: (2319:46,0 [14] ) +Generated Location: (2320:46,0 [14] ) |Model?.Address| diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs index a0be33e7420..635057a1f50 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (4,2)-(5,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml" +#line (4,2)-(4,43) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate.cshtml" using Microsoft.AspNetCore.Mvc.RazorPages #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt index 1ffae76587e..fa61c8a7cb2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithRouteTemplate_Runtime.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (36:3,1 [43] RazorPagesWithRouteTemplate.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages + 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 + UsingDirective - (36:3,1 [41] RazorPagesWithRouteTemplate.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages RazorCompiledItemMetadataAttribute - (6:0,6 [8] RazorPagesWithRouteTemplate.cshtml) RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs index 6f769d05311..cdbb3dcea6d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (4,2)-(5,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml" +#line (4,2)-(4,43) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel.cshtml" using Microsoft.AspNetCore.Mvc.RazorPages #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt index 8b1129000fc..03efb641386 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_Runtime.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (38:3,1 [43] RazorPagesWithoutModel.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages + 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 + UsingDirective - (38:3,1 [41] RazorPagesWithoutModel.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs index 84eb1dae727..970ed0b25cc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (5,2)-(6,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml" +#line (5,2)-(5,43) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages.cshtml" using Microsoft.AspNetCore.Mvc.RazorPages #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt index 983fbd7f38b..c1b6a5175e1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_Runtime.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (55:4,1 [43] RazorPages.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages + 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 + UsingDirective - (55:4,1 [41] RazorPages.cshtml) - Microsoft.AspNetCore.Mvc.RazorPages RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt index c6620cb44af..792145b6ea2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_Layout_WithCssScope.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.ir.txt index e9a136bd4b2..7a19c739bda 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithCssScope.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.codegen.cs index a83bb4b85aa..3528aafa6ab 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (2,2)-(3,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" +#line (2,2)-(2,21) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" using TestNamespace #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.ir.txt index 36bc7b80611..66ab2b49cbc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNonNullableModel_NullableContextEnabled.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (3:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace + 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 + UsingDirective - (3:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.codegen.cs index a043bb2314a..a65b1147d4e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (2,2)-(3,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" +#line (2,2)-(2,21) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" using TestNamespace #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.ir.txt index 6a1136c45a7..8ce1cc8864c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableBaseType_NullableContexEnabled.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (3:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace + 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 + UsingDirective - (3:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.codegen.cs index 8ff9736d1a7..a59acf74f5a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (2,2)-(3,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" +#line (2,2)-(2,21) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" using TestNamespace #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.ir.txt index 676d1e370ea..4ac841da705 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextEnabled.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (3:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace + 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 + UsingDirective - (3:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.codegen.cs index 8ff9736d1a7..a59acf74f5a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.codegen.cs @@ -13,7 +13,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (2,2)-(3,1) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" +#line (2,2)-(2,21) "TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml" using TestNamespace #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.ir.txt index 676d1e370ea..4ac841da705 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorView_WithNullableModel_NullableContextNotEnabled.ir.txt @@ -1,14 +1,14 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (3:1,1 [21] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace + 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 + UsingDirective - (3:1,1 [19] TestFiles\IntegrationTests\CodeGenerationIntegrationTest\test.cshtml) - TestNamespace RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt index 8f0184c644c..60b1d92c046 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs index 44a2a7ae909..446661ec6ce 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.codegen.cs @@ -12,19 +12,19 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (1,2)-(2,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" +#line (1,2)-(1,29) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" using System.ComponentModel #nullable disable ; #nullable restore -#line (2,2)-(3,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" +#line (2,2)-(2,26) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" using System.Collections #nullable disable ; #nullable restore -#line (3,2)-(4,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" +#line (3,2)-(3,14) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives.cshtml" using System #nullable disable diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt index 882893e7b82..0c334a6af39 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UsingDirectives_Runtime.ir.txt @@ -1,15 +1,15 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (1:0,1 [29] UsingDirectives.cshtml) - System.ComponentModel - UsingDirective - (31:1,1 [26] UsingDirectives.cshtml) - System.Collections - UsingDirective - (58:2,1 [14] UsingDirectives.cshtml) - 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 + UsingDirective - (1:0,1 [27] UsingDirectives.cshtml) - System.ComponentModel + UsingDirective - (31:1,1 [24] UsingDirectives.cshtml) - System.Collections + UsingDirective - (58:2,1 [12] UsingDirectives.cshtml) - System UsingDirective - (73:3,1 [12] UsingDirectives.cshtml) - System RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.ir.txt index 45573d87c08..d6a1104947b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelperOptionalParam_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt index dbd7497bf4e..6b8ac1dd7b8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewComponentTagHelper_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt index 0084d515daa..6dffca77d36 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ViewWithNamespace_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - Test.Namespace - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt index d617143dc64..9f7b1838608 100644 --- a/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/_ViewImports_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.cspans.txt index 9862748b6a1..7bb1eed998e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.cspans.txt @@ -1,4 +1,4 @@ Markup span at (0:0,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [12] ) -Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [12] ) -Code span at (1:0,1 [11] ) (Accepts:AnyExceptNewline) - Parent: Directive block at (0:0,0 [12] ) -Markup span at (12:1,0 [0] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [12] ) +Transition span at (0:0,0 [1] ) (Accepts:None) - Parent: Directive block at (0:0,0 [10] ) +Code span at (1:0,1 [9] ) (Accepts:AnyExceptNewline) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (10:0,10 [2] ) (Accepts:Any) - Parent: Statement block at (0:0,0 [12] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt index 86dcaea4807..d2bea112cb4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/legacyTest/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt @@ -3,15 +3,14 @@ MarkupTextLiteral - [0..0)::0 - [] - Gen - SpanEditHandler;Accepts:Any Marker;[]; CSharpCodeBlock - [0..12)::12 - RazorDirective - [0..12)::12 + RazorDirective - [0..10)::10 CSharpTransition - [0..1)::1 - Gen - SpanEditHandler;Accepts:None Transition;[@]; - RazorDirectiveBody - [1..12)::11 - CSharpStatementLiteral - [1..12)::11 - [using FooLF] - Gen - SpanEditHandler;Accepts:AnyExceptNewline + RazorDirectiveBody - [1..10)::9 + CSharpStatementLiteral - [1..10)::9 - [using Foo] - Gen - SpanEditHandler;Accepts:AnyExceptNewline Keyword;[using]; Whitespace;[ ]; Identifier;[Foo]; - NewLine;[LF]; - MarkupTextLiteral - [12..12)::0 - [] - Gen - SpanEditHandler;Accepts:Any - Marker;[]; + RazorMetaCode - [10..12)::2 - Gen - SpanEditHandler;Accepts:Any + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs index e44e9a3f64e..b7c4984ce27 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs @@ -5614,6 +5614,22 @@ public void PageDirective_MissingRoute_WithComment() CompileToAssembly(generated); } + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/10863")] + public void UsingDirective() + { + // Act + var generated = CompileToCSharp(""" + @using System.Collections + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + #endregion 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 42a48cc7afb..ea9aa764b03 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 35d72f241bb..e07d2661f37 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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) 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 1b143bcc8ec..f42d3410087 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 0ec037d4b56..974acc13a18 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 52f73ff911e..779f8bfd67d 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 9225bc581ae..a0fd8ab6788 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 4914fe4eb63..e46dca883cf 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 c8d18bd5e40..9245271c800 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 94404ac098b..421089a7f43 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 7e11f565e73..772e19c2e75 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 @@ -12,7 +12,7 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (1,2)-(2,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml" +#line (1,2)-(1,34) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CSharp8.cshtml" using System.Collections.Generic #line default 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 bb528f13498..81c7c77d5eb 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 b59b9bac1d8..9f8753dc101 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 b3d714dc1dd..870367e5162 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 5fb10616cde..30c5a468373 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 dffaa409027..058f36affc3 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.ir.txt index 3d7276f2fd7..b913a39e9d6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes2_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 5537c044784..fcc544820c1 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 3800a207ac7..ac5094f3727 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 d9c96bec741..eadaa8728b6 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 19d2527db62..2f4aff040c7 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 f65e29ebcdd..c2bdfd5285a 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,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 267b78e1983..93c73bff7c0 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 703dc6dde0b..d7d4e6ece66 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 e427287c554..0a7e699a421 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 b6249f71638..4f98be73b69 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 11f58107e2c..d667609d267 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 ee8555695bf..6eace06f0a5 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 f5017c5096b..b4cafd4b16d 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.ir.txt index fd56752764d..6f7816a341a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EscapedExpression_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 83388c3f1b1..9c82737feb9 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 c8aef1bcb8e..81a9e89c902 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 527966f5c29..f7b7ac59152 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 ccb93547bd8..0206aef1614 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 3efb69e7414..ad32b2e0ca4 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 52e6fac4718..fc5e2f7292b 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 b2091f476a1..deee0e85d86 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 4fa36b8f439..f49ba49e18e 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 929394c228e..dcf3272a106 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 e4654c94a1f..9b39e382345 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - 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 134680c52ef..852366b746b 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,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.ir.txt index 4b58651fc9b..4027bd1b1d5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Implements_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.ir.txt index 539ac7bb2c4..cd9f949fc78 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.ir.txt index 6735e6751cc..7693cf998ab 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt index 382efa77cf1..7274c0398a5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteDirectives_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.ir.txt index 6697abe38fa..b8f46001e5a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/IncompleteTagHelper_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.ir.txt index 2e6bf46ae2c..8f7bcf659b4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Inherits_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.ir.txt index cfc241aa1ba..5fb43452b2c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/InlineBlocks_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.ir.txt index 0b8cbc6282e..472ccdcbb4b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Instrumented_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.ir.txt index 4184ab65086..466ca6777a1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MarkupInCodeBlock_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.ir.txt index bf538d697e7..33a1786321a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocksWithTagHelper_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.ir.txt index 0c2f37c479e..9ff2c5ed532 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Markup_InCodeBlocks_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.ir.txt index f312c1235f2..d75d976d8ed 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/MinimizedTagHelpers_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.ir.txt index 96ff78d1d44..d13c53adb97 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCSharp_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.ir.txt index 391ddbd747b..b6ce6f55630 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedCodeBlocks_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.ir.txt index 45b4d2c478f..a145e5ef70f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedScriptTagTagHelpers_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.ir.txt index 5b54da81c19..a3a1af62bd2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NestedTagHelpers_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.ir.txt index 30142d2dd68..a275c88ecea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NoLinePragmas_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.ir.txt index 1c153641b76..de3a32afa0f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/NullConditionalExpressions_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.ir.txt index 473b9648415..82bafac8f51 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/OpenedIf_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.ir.txt index 9c0f61420b5..e908e7ae971 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ParserError_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.ir.txt index fe7c85c4681..1ab10213611 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/PrefixedAttributeTagHelpers_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.ir.txt index 160886a6763..813b987c2d0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorComments_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.ir.txt index 82c6e13c4b9..cb821d0bafb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RemoveTagHelperDirective_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt index 8541321a79b..9a9d5c0dd53 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Sections_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.ir.txt index 43d6897a07f..1d5504d456a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleTagHelpers_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.ir.txt index 2811d9aca1f..c4fee0a9e6f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SimpleUnspacedIf_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.ir.txt index 91f0e1309b0..2e28b1a4e76 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleLineControlFlowStatements_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.ir.txt index 5b09edff084..6c64e447db0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelperWithNewlineBeforeAttributes_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.ir.txt index 21781c9f6d4..fe121db8d34 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SingleTagHelper_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.ir.txt index d722c24d0b4..5dc72d5043d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/StringLiterals_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.ir.txt index 6df0b582b3a..336b461dc8e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SwitchExpression_RecursivePattern_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.ir.txt index ebb3fe58432..97dfde5b5c8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/SymbolBoundAttributes_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt index e46cbc8a484..9815929c13d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersInSection_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.ir.txt index 301a41abc2d..5e863fcb892 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithBoundAttributes_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.ir.txt index 9d9a92f7113..2c28f0f4d1a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithDataDashAttributes_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.ir.txt index d4e6fec2952..84ad899da96 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithPrefix_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt index b8f63b7a76f..4f517afed99 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithTemplate_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.ir.txt index be570989777..129e3c7dcef 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TagHelpersWithWeirdlySpacedAttributes_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.ir.txt index 2fff147dd8e..5650c400009 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Tags_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.ir.txt index 0f21f41483a..5cb49ab4a43 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Templates_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.ir.txt index 205ae49b0ff..e24397ad27f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/TransitionsInTagHelperAttributes_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.ir.txt index c4fd3bfd7ac..fd6f5cfb32d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/UnfinishedExpressionInCode_Runtime.ir.txt @@ -1,13 +1,13 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 + 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 RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.codegen.cs index 582e12e504c..e83170d0004 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.codegen.cs @@ -12,43 +12,43 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (1,2)-(2,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" +#line (1,2)-(1,17) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" using System.IO #nullable disable ; #nullable restore -#line (7,2)-(8,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" +#line (7,2)-(7,34) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" using Foo = System.Text.Encoding #nullable disable ; #nullable restore -#line (13,2)-(14,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" +#line (13,2)-(13,14) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" using System #nullable disable ; #nullable restore -#line (15,2)-(16,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" +#line (15,2)-(15,21) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" using static System #nullable disable ; #nullable restore -#line (16,2)-(17,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" +#line (16,2)-(16,29) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" using static System.Console #nullable disable ; #nullable restore -#line (22,2)-(23,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" +#line (22,2)-(22,43) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" using static global::System.Text.Encoding #nullable disable ; #nullable restore -#line (32,2)-(33,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" +#line (32,2)-(32,19) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder.cshtml" using System.Text #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.ir.txt index 3d5b44cc8d4..0b5422c5767 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_OutOfOrder_Runtime.ir.txt @@ -1,19 +1,19 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (1:0,1 [17] Usings_OutOfOrder.cshtml) - System.IO - UsingDirective - (60:6,1 [34] Usings_OutOfOrder.cshtml) - Foo = System.Text.Encoding - UsingDirective - (136:12,1 [14] Usings_OutOfOrder.cshtml) - System - UsingDirective - (153:14,1 [21] Usings_OutOfOrder.cshtml) - static System - UsingDirective - (175:15,1 [29] Usings_OutOfOrder.cshtml) - static System.Console - UsingDirective - (246:21,1 [43] Usings_OutOfOrder.cshtml) - static global::System.Text.Encoding - UsingDirective - (576:31,1 [19] Usings_OutOfOrder.cshtml) - System.Text + 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 + UsingDirective - (1:0,1 [15] Usings_OutOfOrder.cshtml) - System.IO + UsingDirective - (60:6,1 [32] Usings_OutOfOrder.cshtml) - Foo = System.Text.Encoding + UsingDirective - (136:12,1 [12] Usings_OutOfOrder.cshtml) - System + UsingDirective - (153:14,1 [19] Usings_OutOfOrder.cshtml) - static System + UsingDirective - (175:15,1 [27] Usings_OutOfOrder.cshtml) - static System.Console + UsingDirective - (246:21,1 [41] Usings_OutOfOrder.cshtml) - static global::System.Text.Encoding + UsingDirective - (576:31,1 [17] Usings_OutOfOrder.cshtml) - System.Text RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.codegen.cs index 11aba447b73..a3aadbe2792 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.codegen.cs @@ -12,37 +12,37 @@ namespace AspNetCoreGeneratedDocument using global::Microsoft.AspNetCore.Mvc.Rendering; using global::Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore -#line (1,2)-(2,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" +#line (1,2)-(1,17) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" using System.IO #nullable disable ; #nullable restore -#line (2,2)-(3,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" +#line (2,2)-(2,34) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" using Foo = System.Text.Encoding #nullable disable ; #nullable restore -#line (3,2)-(4,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" +#line (3,2)-(3,14) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" using System #nullable disable ; #nullable restore -#line (5,2)-(6,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" +#line (5,2)-(5,21) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" using static System #nullable disable ; #nullable restore -#line (6,2)-(7,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" +#line (6,2)-(6,29) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" using static System.Console #nullable disable ; #nullable restore -#line (7,2)-(8,1) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" +#line (7,2)-(7,43) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings.cshtml" using static global::System.Text.Encoding #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.ir.txt index 26b0208ef5b..0b27dd517b0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Usings_Runtime.ir.txt @@ -1,18 +1,18 @@ Document - RazorCompiledItemAttribute - NamespaceDeclaration - - AspNetCoreGeneratedDocument - 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 - UsingDirective - (1:0,1 [17] Usings.cshtml) - System.IO - UsingDirective - (19:1,1 [34] Usings.cshtml) - Foo = System.Text.Encoding - UsingDirective - (54:2,1 [14] Usings.cshtml) - System - UsingDirective - (71:4,1 [21] Usings.cshtml) - static System - UsingDirective - (93:5,1 [29] Usings.cshtml) - static System.Console - UsingDirective - (123:6,1 [43] Usings.cshtml) - static global::System.Text.Encoding + 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 + UsingDirective - (1:0,1 [15] Usings.cshtml) - System.IO + UsingDirective - (19:1,1 [32] Usings.cshtml) - Foo = System.Text.Encoding + UsingDirective - (54:2,1 [12] Usings.cshtml) - System + UsingDirective - (71:4,1 [19] Usings.cshtml) - static System + UsingDirective - (93:5,1 [27] Usings.cshtml) - static System.Console + UsingDirective - (123:6,1 [41] Usings.cshtml) - static global::System.Text.Encoding RazorSourceChecksumAttribute - RazorCompiledItemMetadataAttribute - CreateNewOnMetadataUpdateAttribute - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.codegen.cs new file mode 100644 index 00000000000..9f3ba30c8cb --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.codegen.cs @@ -0,0 +1,36 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +using System.Collections; + +#line default +#line hidden +#nullable disable + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.ir.txt new file mode 100644 index 00000000000..1c2ea49d0ac --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.ir.txt @@ -0,0 +1,19 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [24] x:\dir\subdir\Test\TestComponent.cshtml) - System.Collections + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + DesignTimeDirective - + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (25:0,25 [2] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (25:0,25 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.mappings.txt new file mode 100644 index 00000000000..413ed467a5a --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/UsingDirective/TestComponent.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (1:0,1 [24] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Collections| +Generated Location: (361:12,0 [24] ) +|using System.Collections| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitBooleanConversion/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitBooleanConversion/TestComponent.ir.txt index b20e12a4393..511b0de1c39 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitBooleanConversion/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitBooleanConversion/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [49] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_Bind/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_Bind/TestComponent.ir.txt index b6d92ff3047..542067a875a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_Bind/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_Bind/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [150] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown/TestComponent.ir.txt index ce37d4288dd..1fb58801220 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [31] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown_Assignment/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown_Assignment/TestComponent.ir.txt index 944f9e16716..7f49d84176f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown_Assignment/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_BindUnknown_Assignment/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [37] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_CustomEvent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_CustomEvent/TestComponent.ir.txt index 4a79ab5e22c..4c878243b37 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_CustomEvent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_CustomEvent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [169] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_TypeInference/TestComponent.ir.txt index 11e58780fbd..4ffb3299cee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddAttribute_ImplicitStringConversion_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [144] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_DynamicComponentName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_DynamicComponentName/TestComponent.ir.txt index 719f326d9a1..8714b40dda0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_DynamicComponentName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_DynamicComponentName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [25] x:\dir\subdir\Test\TestComponent.cshtml) - dynamic diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_EscapedComponentName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_EscapedComponentName/TestComponent.ir.txt index 296377e97da..d5833c18af9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_EscapedComponentName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_EscapedComponentName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [21] x:\dir\subdir\Test\TestComponent.cshtml) - int diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_GlobalNamespace/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_GlobalNamespace/TestComponent.ir.txt index ff610dabd93..a55080a70df 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_GlobalNamespace/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_GlobalNamespace/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_WithNameof/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_WithNameof/TestComponent.ir.txt index 34f78e4f708..a4fd9b76685 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_WithNameof/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AddComponentParameter_WithNameof/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.codegen.cs index fd947c02e6a..52e92fe690d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.codegen.cs @@ -8,13 +8,13 @@ namespace Test using global::System.Linq; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,30) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Threading.Tasks #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.ir.txt index 334d5a3068e..85bdba578a3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [30] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks - UsingDirective - (32:1,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks + UsingDirective - (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (75:2,0 [57] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.mappings.txt index 93f3e7f3853..7bfac6f42a9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_Lambda/TestComponent.mappings.txt @@ -1,19 +1,15 @@ -Source Location: (1:0,1 [30] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Threading.Tasks -| -Generated Location: (328:11,0 [30] ) -|using System.Threading.Tasks -| +Source Location: (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Threading.Tasks| +Generated Location: (329:11,0 [28] ) +|using System.Threading.Tasks| -Source Location: (32:1,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (466:17,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (468:17,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (94:2,19 [33] x:\dir\subdir\Test\TestComponent.cshtml) |async (e) => await Task.Delay(10)| -Generated Location: (1208:34,0 [33] ) +Generated Location: (1210:34,0 [33] ) |async (e) => await Task.Delay(10)| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.codegen.cs index 5161fcac0f5..b55c10fac80 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.codegen.cs @@ -8,13 +8,13 @@ namespace Test using global::System.Linq; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,30) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Threading.Tasks #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.ir.txt index 6b773b1bff0..2b33ee38785 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [30] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks - UsingDirective - (32:1,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks + UsingDirective - (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (75:2,0 [28] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.mappings.txt index 111ed5c48bd..969a30d5bd3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_ActionEventArgs_MethodGroup/TestComponent.mappings.txt @@ -1,20 +1,16 @@ -Source Location: (1:0,1 [30] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Threading.Tasks -| -Generated Location: (328:11,0 [30] ) -|using System.Threading.Tasks -| +Source Location: (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Threading.Tasks| +Generated Location: (329:11,0 [28] ) +|using System.Threading.Tasks| -Source Location: (32:1,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (466:17,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (468:17,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (92:2,17 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1208:34,0 [7] ) +Generated Location: (1210:34,0 [7] ) |OnClick| Source Location: (112:3,7 [88] x:\dir\subdir\Test\TestComponent.cshtml) @@ -24,7 +20,7 @@ Source Location: (112:3,7 [88] x:\dir\subdir\Test\TestComponent.cshtml) return Task.CompletedTask; } | -Generated Location: (1452:45,0 [88] ) +Generated Location: (1454:45,0 [88] ) | Task OnClick(MouseEventArgs e) { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.codegen.cs index cd0430291d3..d8153b336d2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.codegen.cs @@ -8,13 +8,13 @@ namespace Test using global::System.Linq; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,30) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Threading.Tasks #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.ir.txt index 034ccb0ff80..3f3f618e803 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [30] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks - UsingDirective - (32:1,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks + UsingDirective - (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (75:2,0 [56] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.mappings.txt index eb87bcd12bc..1a2d0d2e942 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_Lambda/TestComponent.mappings.txt @@ -1,19 +1,15 @@ -Source Location: (1:0,1 [30] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Threading.Tasks -| -Generated Location: (328:11,0 [30] ) -|using System.Threading.Tasks -| +Source Location: (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Threading.Tasks| +Generated Location: (329:11,0 [28] ) +|using System.Threading.Tasks| -Source Location: (32:1,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (466:17,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (468:17,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (94:2,19 [32] x:\dir\subdir\Test\TestComponent.cshtml) |async () => await Task.Delay(10)| -Generated Location: (1208:34,0 [32] ) +Generated Location: (1210:34,0 [32] ) |async () => await Task.Delay(10)| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.codegen.cs index 5081e0a9076..2e4d6278607 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.codegen.cs @@ -8,13 +8,13 @@ namespace Test using global::System.Linq; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,30) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Threading.Tasks #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.ir.txt index f705c552ec9..2101486e565 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [30] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks - UsingDirective - (32:1,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Threading.Tasks + UsingDirective - (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (75:2,0 [28] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.mappings.txt index 3638337dbfc..829f1b89fd5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AsyncEventHandler_OnElement_Action_MethodGroup/TestComponent.mappings.txt @@ -1,20 +1,16 @@ -Source Location: (1:0,1 [30] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Threading.Tasks -| -Generated Location: (328:11,0 [30] ) -|using System.Threading.Tasks -| +Source Location: (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Threading.Tasks| +Generated Location: (329:11,0 [28] ) +|using System.Threading.Tasks| -Source Location: (32:1,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (466:17,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (32:1,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (468:17,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (92:2,17 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1208:34,0 [7] ) +Generated Location: (1210:34,0 [7] ) |OnClick| Source Location: (112:3,7 [72] x:\dir\subdir\Test\TestComponent.cshtml) @@ -24,7 +20,7 @@ Source Location: (112:3,7 [72] x:\dir\subdir\Test\TestComponent.cshtml) return Task.CompletedTask; } | -Generated Location: (1452:45,0 [72] ) +Generated Location: (1454:45,0 [72] ) | Task OnClick() { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtAtHandled/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtAtHandled/TestComponent.ir.txt index d62cb6bcb2f..34338f53efa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtAtHandled/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtAtHandled/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [67] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtTransitions/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtTransitions/TestComponent.ir.txt index 71b0967be87..d9a70dd63f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtTransitions/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/AtTransitions/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [32] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.ir.txt index d68f154df99..18f780ef411 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression_Generic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression_Generic/TestComponent.ir.txt index eefc323d21e..a1e21343be0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression_Generic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression_Generic/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression_NestedGeneric/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression_NestedGeneric/TestComponent.ir.txt index 205aa611e38..6f2145b3a27 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression_NestedGeneric/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValueAndExpression_NestedGeneric/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt index 2f60683b248..189b1035bf2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_TypeChecked_WithMatchingProperties/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_TypeChecked_WithMatchingProperties/TestComponent.ir.txt index fbbaa9189d7..b435fbe35ef 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_TypeChecked_WithMatchingProperties/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_EventCallback_TypeChecked_WithMatchingProperties/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.ir.txt index ab047d4462b..bc3ffa3316b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [71] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.ir.txt index 17d21414bcc..25a8ff5583e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithoutMatchingProperties/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [71] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.ir.txt index 1607978de1b..6295ffb917c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression_Generic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression_Generic/TestComponent.ir.txt index 3ae443ab4cb..460bca486fc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression_Generic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndExpression_Generic/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt index f52f54e66eb..4b5f0a1b297 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.ir.txt index 1439dd67f21..24d5d7c9e31 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_DynamicComponentName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [37] x:\dir\subdir\Test\TestComponent.cshtml) - dynamic diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.ir.txt index 851174b1718..77c79d23c7a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_EscapedComponentName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [33] x:\dir\subdir\Test\TestComponent.cshtml) - int diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt index f52f54e66eb..4b5f0a1b297 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_GlobalNamespaceComponent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.ir.txt index 8f477332011..76ee65136ab 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithMatchingProperties_WithNameof/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.ir.txt index fbab60d6fcc..f5c764baf7e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValue_WithoutMatchingProperties/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.ir.txt index f6b65af01e1..18900ed9fd3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_TypeChecked_WithMatchingProperties/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.ir.txt index ec4122d5dd8..b8b0b17d60b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [72] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.ir.txt index 3b55e44395d..1f48b031e83 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.ir.txt index a440fcb9c7f..494cf46c4f2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [126] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.ir.txt index a9256eac191..387ebfa6230 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.ir.txt index 565d39163a2..4377917bb37 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.ir.txt index 395cde8e54a..180fbee9c87 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.ir.txt index 8025a011b25..696de88e401 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [72] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.ir.txt index a06af6449ad..9ac2b9f6d92 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [102] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.ir.txt index 66efe675558..57d80171f54 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.ir.txt index 0b390ce3e48..a3536b42404 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [92] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.ir.txt index 2e1a2d77ebf..f7926d9adab 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.ir.txt index a6b5f60e222..1e0522eaf8c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [92] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.ir.txt index bc3b8d99533..d4d9073af73 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.ir.txt index 66efe675558..57d80171f54 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.ir.txt index a7253f9157d..03b6193235c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.ir.txt index d3ccd75154c..b87dfa3ba35 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [124] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.ir.txt index 12b597ae217..4dd159a72a6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithStringAttribute_DoesNotUseStringSyntax/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [39] x:\dir\subdir\Test\TestComponent.cshtml) - InputText diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.codegen.cs index 9ff1b3cc643..17967c6a213 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,28) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Globalization #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.ir.txt index b1c9172aecc..153864d3428 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (29:1,0 [114] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.mappings.txt index 437f2c0613f..a3464fd6e09 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithCulture/TestComponent.mappings.txt @@ -1,25 +1,23 @@ -Source Location: (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Globalization -| -Generated Location: (371:12,0 [28] ) -|using System.Globalization -| +Source Location: (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Globalization| +Generated Location: (372:12,0 [26] ) +|using System.Globalization| Source Location: (48:1,19 [11] x:\dir\subdir\Test\TestComponent.cshtml) |ParentValue| -Generated Location: (1025:29,0 [11] ) +Generated Location: (1026:29,0 [11] ) |ParentValue| Source Location: (111:1,82 [28] x:\dir\subdir\Test\TestComponent.cshtml) |CultureInfo.InvariantCulture| -Generated Location: (1196:37,0 [28] ) +Generated Location: (1197:37,0 [28] ) |CultureInfo.InvariantCulture| Source Location: (152:2,7 [55] x:\dir\subdir\Test\TestComponent.cshtml) | public string ParentValue { get; set; } = "hi"; | -Generated Location: (1738:50,0 [55] ) +Generated Location: (1739:50,0 [55] ) | public string ParentValue { get; set; } = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.ir.txt index bd96ebed528..e762e632b67 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WithFormat_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [104] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.ir.txt index 41c06967978..ee8823fd3eb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementFallback_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.codegen.cs index 417277595d3..19dacac2551 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,28) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Globalization #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.ir.txt index 6aac31a9b08..1e35ab62bd5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (29:1,0 [118] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.mappings.txt index d61eb01989e..7124aca567d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithCulture/TestComponent.mappings.txt @@ -1,25 +1,23 @@ -Source Location: (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Globalization -| -Generated Location: (371:12,0 [28] ) -|using System.Globalization -| +Source Location: (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Globalization| +Generated Location: (372:12,0 [26] ) +|using System.Globalization| Source Location: (48:1,19 [11] x:\dir\subdir\Test\TestComponent.cshtml) |ParentValue| -Generated Location: (1027:29,0 [11] ) +Generated Location: (1028:29,0 [11] ) |ParentValue| Source Location: (115:1,86 [28] x:\dir\subdir\Test\TestComponent.cshtml) |CultureInfo.InvariantCulture| -Generated Location: (1198:37,0 [28] ) +Generated Location: (1199:37,0 [28] ) |CultureInfo.InvariantCulture| Source Location: (156:2,7 [55] x:\dir\subdir\Test\TestComponent.cshtml) | public string ParentValue { get; set; } = "hi"; | -Generated Location: (1746:50,0 [55] ) +Generated Location: (1747:50,0 [55] ) | public string ParentValue { get; set; } = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithSuffix_OverridesEvent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithSuffix_OverridesEvent/TestComponent.ir.txt index f47c20f3dfb..44bc51b1049 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithSuffix_OverridesEvent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithSuffix_OverridesEvent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [67] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.ir.txt index c0b4191370a..ff95669a5b6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElementWithSuffix_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [34] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindAndParamBindSet/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindAndParamBindSet/TestComponent.ir.txt index a03710e3ec5..218b277f0b2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindAndParamBindSet/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindAndParamBindSet/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindValueWithGetSet/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindValueWithGetSet/TestComponent.ir.txt index e03262c8610..a940c1a545d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindValueWithGetSet/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindValueWithGetSet/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindWithoutSuffixAndParamBindSetWithSuffix/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindWithoutSuffixAndParamBindSetWithSuffix/TestComponent.ir.txt index 41c22795dac..34e17154c24 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindWithoutSuffixAndParamBindSetWithSuffix/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingBindWithoutSuffixAndParamBindSetWithSuffix/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [58] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingSetWithAfter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingSetWithAfter/TestComponent.ir.txt index 84836de8013..d4dce1aa935 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingSetWithAfter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_MixingSetWithAfter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [82] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithBindAfterAndSuffix/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithBindAfterAndSuffix/TestComponent.ir.txt index fdff791ceb1..c7fb8ebaef1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithBindAfterAndSuffix/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithBindAfterAndSuffix/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [76] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithEventAsExplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithEventAsExplicitExpression/TestComponent.ir.txt index ed0fb811702..7061c0edec3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithEventAsExplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithEventAsExplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [25] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithEventAsExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithEventAsExpression/TestComponent.ir.txt index 0b5ef3c2c8a..bb65aa07be2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithEventAsExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithEventAsExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [25] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithGetSetAndSuffix/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithGetSetAndSuffix/TestComponent.ir.txt index 4d62940b389..ca4c7ee5a3a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithGetSetAndSuffix/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithGetSetAndSuffix/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [79] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithStringAttribute_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithStringAttribute_WritesAttributes/TestComponent.ir.txt index 1a9f75f9b0e..b4a89844308 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithStringAttribute_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithStringAttribute_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [33] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithoutCloseTag/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithoutCloseTag/TestComponent.ir.txt index d22ce2bdd63..38322e88588 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithoutCloseTag/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WithoutCloseTag/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.ir.txt index 07cd261659d..5afdb7ce414 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToElement_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [28] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.ir.txt index f91d95894c8..a86370459a1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [85] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.ir.txt index ff7374cd2b3..dcf57ac073a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [96] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.ir.txt index 1dadf10c9ac..0e7c8799764 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [96] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.ir.txt index 589598de715..303592a765f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [96] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithAfter_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithAfter_Action/TestComponent.ir.txt index d01c959f2c2..255dd97ae21 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithAfter_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithAfter_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [72] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_Action/TestComponent.ir.txt index 406d5d8e9a4..44418eb1064 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_EventCallback/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_EventCallback/TestComponent.ir.txt index 0338ad14fd6..6def14fde62 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_EventCallback/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_EventCallback/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_Function/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_Function/TestComponent.ir.txt index ad5e3847c17..34e7febb72d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_Function/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_InferredType_WithGetSet_Function/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.codegen.cs index 4134ecb99a8..e025bc7eb74 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,28) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Globalization #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.ir.txt index 085c341c3b8..284c38668fc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (29:1,0 [83] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.mappings.txt index 3b958bac893..6109615cda9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture/TestComponent.mappings.txt @@ -1,20 +1,18 @@ -Source Location: (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Globalization -| -Generated Location: (371:12,0 [28] ) -|using System.Globalization -| +Source Location: (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Globalization| +Generated Location: (372:12,0 [26] ) +|using System.Globalization| Source Location: (64:1,35 [11] x:\dir\subdir\Test\TestComponent.cshtml) |ParentValue| -Generated Location: (1085:30,0 [11] ) +Generated Location: (1086:30,0 [11] ) |ParentValue| Source Location: (121:2,7 [44] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } | -Generated Location: (1575:43,0 [44] ) +Generated Location: (1576:43,0 [44] ) | public int ParentValue { get; set; } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.codegen.cs index cc21beddcf8..03aed57c00a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,28) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Globalization #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.ir.txt index 6afdc32802d..d930137bfa2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) - System.Globalization ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (29:1,0 [132] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.mappings.txt index ff564b64cac..20f17a3527b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToInputElementWithDefaultCulture_Override/TestComponent.mappings.txt @@ -1,25 +1,23 @@ -Source Location: (1:0,1 [28] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Globalization -| -Generated Location: (371:12,0 [28] ) -|using System.Globalization -| +Source Location: (1:0,1 [26] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Globalization| +Generated Location: (372:12,0 [26] ) +|using System.Globalization| Source Location: (64:1,35 [11] x:\dir\subdir\Test\TestComponent.cshtml) |ParentValue| -Generated Location: (1085:30,0 [11] ) +Generated Location: (1086:30,0 [11] ) |ParentValue| Source Location: (131:1,102 [26] x:\dir\subdir\Test\TestComponent.cshtml) |CultureInfo.CurrentCulture| -Generated Location: (1257:38,0 [26] ) +Generated Location: (1258:38,0 [26] ) |CultureInfo.CurrentCulture| Source Location: (170:2,7 [44] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } | -Generated Location: (1799:51,0 [44] ) +Generated Location: (1800:51,0 [44] ) | public int ParentValue { get; set; } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.ir.txt index e312fae099e..dd9d1f45b77 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndAttributeChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [46] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.ir.txt index c9ea3733ff8..eee59e46a37 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BodyAndExplicitChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [46] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.ir.txt index d60563b70f3..584e326095e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputCheckbox_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [42] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.codegen.cs index f9619f3b602..737d2eff464 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.ir.txt index 2c89dfbeec9..4fa160ca51e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.mappings.txt index 0147a7f52a0..c157fb0a16a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_CanOverrideEvent/TestComponent.mappings.txt @@ -1,20 +1,18 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (59:1,15 [11] x:\dir\subdir\Test\TestComponent.cshtml) |CurrentDate| -Generated Location: (1042:29,0 [11] ) +Generated Location: (1043:29,0 [11] ) |CurrentDate| Source Location: (126:2,7 [77] x:\dir\subdir\Test\TestComponent.cshtml) | public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1); | -Generated Location: (1561:42,0 [77] ) +Generated Location: (1562:42,0 [77] ) | public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1); | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.ir.txt index b1bc8b6c025..c86a18d759c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.ir.txt index fe965de5737..002e7761555 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormat_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [67] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.ir.txt index d04888f2ee6..413ef6fd5e8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [42] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultCultureAndDefaultFormat_Override/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultCultureAndDefaultFormat_Override/TestComponent.ir.txt index d9e0c685f66..3c63e4e511c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultCultureAndDefaultFormat_Override/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultCultureAndDefaultFormat_Override/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [69] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat/TestComponent.ir.txt index 213788eba61..e547962fcc2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [44] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat_Override/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat_Override/TestComponent.ir.txt index 98ca2d0063f..2ebbaa9496e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat_Override/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithDefaultFormat_Override/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [69] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.codegen.cs index 5c450e28c98..f07d812a71e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.ir.txt index 1c783429e3e..362d5ff68e8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [63] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.mappings.txt index 13edc4acd04..e98510c4d07 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix/TestComponent.mappings.txt @@ -1,20 +1,18 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (65:1,21 [11] x:\dir\subdir\Test\TestComponent.cshtml) |CurrentDate| -Generated Location: (1042:29,0 [11] ) +Generated Location: (1043:29,0 [11] ) |CurrentDate| Source Location: (116:2,7 [77] x:\dir\subdir\Test\TestComponent.cshtml) | public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1); | -Generated Location: (1562:42,0 [77] ) +Generated Location: (1563:42,0 [77] ) | public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1); | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix_CanOverrideEvent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix_CanOverrideEvent/TestComponent.ir.txt index 454539a97a5..d56b87c4101 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix_CanOverrideEvent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithSuffix_CanOverrideEvent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [91] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_IsCaseSensitive/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_IsCaseSensitive/TestComponent.ir.txt index 84c15fe81da..1bfbb83e525 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_IsCaseSensitive/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_IsCaseSensitive/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [30] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.ir.txt index 07e81a9d721..9ab6d50d40e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputWithoutType_WritesAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [30] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_01/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_01/TestComponent.ir.txt index bcc6ed68d67..36a1059b9e0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_01/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_01/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [191] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_02/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_02/TestComponent.ir.txt index b531edb382f..4a183a3de1e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_02/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CanProduceLinePragmasForComponentWithRenderFragment_02/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [191] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_CombiningMultipleAncestors/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_CombiningMultipleAncestors/TestComponent.ir.txt index d5923f90672..6fc5cd860cb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_CombiningMultipleAncestors/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_CombiningMultipleAncestors/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [120] x:\dir\subdir\Test\TestComponent.cshtml) - ParentOne diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Explicit/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Explicit/TestComponent.ir.txt index e3c63c89121..b22489befcc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Explicit/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Explicit/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [85] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ExplicitOverride/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ExplicitOverride/TestComponent.ir.txt index 7a1fd2ff7a7..b414db7c0b1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ExplicitOverride/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ExplicitOverride/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [103] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested/TestComponent.ir.txt index afcac6b237a..598bfdcc4ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [70] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary/TestComponent.ir.txt index 693de8692b9..f3cb43cd605 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [79] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_02/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_02/TestComponent.ir.txt index 693de8692b9..f3cb43cd605 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_02/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_02/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [79] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_03/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_03/TestComponent.ir.txt index 419b6cd4529..d9ba19e7902 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_03/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_03/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_Dynamic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_Dynamic/TestComponent.ir.txt index a998ec3cf96..21e32a12c88 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_Dynamic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericArgumentNested_Dictionary_Dynamic/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [79] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.ir.txt index 9eb3645384f..3b9f959109a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [78] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.ir.txt index 07c0a8b848f..069ff7f9189 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_GenericLambda/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [86] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints/TestComponent.ir.txt index c7af7c06fc2..8a151afb63e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [203] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.codegen.cs index 9ab4d99531d..cbe78938552 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,15) "x:\dir\subdir\Test\TestComponent.cshtml" using Models; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.ir.txt index 696c3a97291..a7755bcf1c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [15] x:\dir\subdir\Test\TestComponent.cshtml) - Models + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) - Models ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (18:2,0 [203] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.mappings.txt index 9a055201ede..3c77ca98a96 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_ClassesAndInterfaces/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (1:0,1 [15] x:\dir\subdir\Test\TestComponent.cshtml) -|using Models; -| -Generated Location: (371:12,0 [15] ) -|using Models; -| +Source Location: (1:0,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) +|using Models;| +Generated Location: (372:12,0 [13] ) +|using Models;| Source Location: (57:2,39 [30] x:\dir\subdir\Test\TestComponent.cshtml) |Array.Empty()| -Generated Location: (979:28,0 [30] ) +Generated Location: (980:28,0 [30] ) |Array.Empty()| Source Location: (144:4,29 [9] x:\dir\subdir\Test\TestComponent.cshtml) |FieldName| -Generated Location: (2322:56,0 [9] ) +Generated Location: (2323:56,0 [9] ) |FieldName| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.codegen.cs index 47ab73941ea..57b1d874238 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,15) "x:\dir\subdir\Test\TestComponent.cshtml" using Models; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.ir.txt index 247d06c4bb8..17e10e104c6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [15] x:\dir\subdir\Test\TestComponent.cshtml) - Models + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) - Models ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (16:1,0 [203] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.mappings.txt index 33ba752f4ab..94706cf9c3d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_MultipleConstraints_GenericClassConstraints/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (1:0,1 [15] x:\dir\subdir\Test\TestComponent.cshtml) -|using Models; -| -Generated Location: (371:12,0 [15] ) -|using Models; -| +Source Location: (1:0,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) +|using Models;| +Generated Location: (372:12,0 [13] ) +|using Models;| Source Location: (55:1,39 [30] x:\dir\subdir\Test\TestComponent.cshtml) |Array.Empty()| -Generated Location: (979:28,0 [30] ) +Generated Location: (980:28,0 [30] ) |Array.Empty()| Source Location: (142:3,29 [9] x:\dir\subdir\Test\TestComponent.cshtml) |FieldName| -Generated Location: (2338:56,0 [9] ) +Generated Location: (2339:56,0 [9] ) |FieldName| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_WithConstraints/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_WithConstraints/TestComponent.ir.txt index c7af7c06fc2..8a151afb63e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_WithConstraints/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Inferred_WithConstraints/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [203] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.ir.txt index bf347b53afb..5fd67c04e65 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Multilayer/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [92] x:\dir\subdir\Test\TestComponent.cshtml) - Ancestor diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.ir.txt index f702789824a..64b9e52c0c2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_MultipleTypes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [172] x:\dir\subdir\Test\TestComponent.cshtml) - Parent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_CreatesError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_CreatesError/TestComponent.ir.txt index 2a9a436edf0..c3ee7252b14 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_CreatesError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_CreatesError/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [58] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Explicit/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Explicit/TestComponent.ir.txt index 586d99a9419..578760bc9f7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Explicit/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Explicit/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.ir.txt index 0f6e7e3704b..5c42a5a0a4c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_NotCascaded_Inferred/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [68] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Override/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Override/TestComponent.ir.txt index a1507b48b14..ffa2ac99fde 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Override/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Override/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [91] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Override_Multilayer/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Override_Multilayer/TestComponent.ir.txt index 0caf69d4d83..3e0c9212b1c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Override_Multilayer/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Override_Multilayer/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [208] x:\dir\subdir\Test\TestComponent.cshtml) - TreeNode diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt index 70f04b8df81..1a7c6df68b7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_ParameterInNamespace/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - (11:0,11 [16] x:\dir\subdir\Test\TestComponent.cshtml) - MyApp.Components - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (31:2,0 [95] x:\dir\subdir\Test\TestComponent.cshtml) - ParentComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Partial_CreatesError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Partial_CreatesError/TestComponent.ir.txt index 0e7b0b01686..1c0b58ec46a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Partial_CreatesError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Partial_CreatesError/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt index 7aff555aa1e..fca19ded8ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_Tuple/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - ParentComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.ir.txt index 659a6029211..324e9708c96 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithSplatAndKey/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [60] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithUnrelatedType_CreatesError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithUnrelatedType_CreatesError/TestComponent.ir.txt index 1854b690715..687645d475c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithUnrelatedType_CreatesError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/CascadingGenericInference_WithUnrelatedType_CreatesError/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - Grid diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.ir.txt index 1081715f38f..eb3ec6ec659 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [26] x:\dir\subdir\Test\TestComponent.cshtml) - C diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic/TestComponent.ir.txt index ae6b371de31..131e6772a33 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [42] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBind/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBind/TestComponent.ir.txt index f2a95824b54..84d50321278 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBind/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBind/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [44] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped/TestComponent.ir.txt index 7252f193855..7865dbbf805 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [44] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped_TypeInference/TestComponent.ir.txt index f55668285aa..87f86ae0ae4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBindWeaklyTyped_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [43] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBind_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBind_TypeInference/TestComponent.ir.txt index be6fd58af70..7f42e93c2dc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBind_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericBind_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [31] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericChildContent/TestComponent.ir.txt index bf9da894449..f3cf6589e56 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [90] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericChildContent_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericChildContent_TypeInference/TestComponent.ir.txt index 194d806690a..e7dd21bb0f0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericChildContent_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericChildContent_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute/TestComponent.ir.txt index fa527a61fbe..3598eee2880 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [56] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute_TypeInference/TestComponent.ir.txt index 3afbd4bcd10..62e5213cc14 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_GenericWeaklyTypedAttribute_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [43] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic_TypeInference/TestComponent.ir.txt index bc9c142aa71..7e1ba33a99c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic_TypeInference_Multiple/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic_TypeInference_Multiple/TestComponent.ir.txt index e16b72b74f6..ff3227dd880 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic_TypeInference_Multiple/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Generic_TypeInference_Multiple/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.codegen.cs index f035cfc2d9c..5f71b00a1a0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,50) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Rendering; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.ir.txt index aef8fc48b33..15e90412385 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [50] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [48] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (55:2,2 [34] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.mappings.txt index b570ae8874c..4063f3c8f7d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InFunctionsDirective/TestComponent.mappings.txt @@ -1,13 +1,11 @@ -Source Location: (1:0,1 [50] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Rendering; -| -Generated Location: (371:12,0 [50] ) -|using Microsoft.AspNetCore.Components.Rendering; -| +Source Location: (1:0,1 [48] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Rendering;| +Generated Location: (372:12,0 [48] ) +|using Microsoft.AspNetCore.Components.Rendering;| Source Location: (55:2,2 [34] x:\dir\subdir\Test\TestComponent.cshtml) | RenderChildComponent(__builder); | -Generated Location: (878:26,0 [34] ) +Generated Location: (879:26,0 [34] ) | RenderChildComponent(__builder); | Source Location: (101:4,7 [69] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +13,7 @@ Source Location: (101:4,7 [69] x:\dir\subdir\Test\TestComponent.cshtml) void RenderChildComponent(RenderTreeBuilder __builder) { | -Generated Location: (1095:36,0 [69] ) +Generated Location: (1096:36,0 [69] ) | void RenderChildComponent(RenderTreeBuilder __builder) { @@ -24,7 +22,7 @@ Generated Location: (1095:36,0 [69] ) Source Location: (195:8,0 [7] x:\dir\subdir\Test\TestComponent.cshtml) | } | -Generated Location: (1397:48,0 [7] ) +Generated Location: (1398:48,0 [7] ) | } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.codegen.cs index fe5d14463cb..64114fb1a0c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,51) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.RenderTree; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.ir.txt index 486ec9b44b9..2bf3acdf4ac 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [51] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.RenderTree + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.RenderTree ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (54:1,2 [42] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.mappings.txt index 804f18ba74f..2608c1ae056 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_InLocalFunction/TestComponent.mappings.txt @@ -1,16 +1,14 @@ -Source Location: (1:0,1 [51] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.RenderTree; -| -Generated Location: (371:12,0 [51] ) -|using Microsoft.AspNetCore.Components.RenderTree; -| +Source Location: (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.RenderTree;| +Generated Location: (372:12,0 [49] ) +|using Microsoft.AspNetCore.Components.RenderTree;| Source Location: (54:1,2 [42] x:\dir\subdir\Test\TestComponent.cshtml) | void RenderChildComponent() { | -Generated Location: (878:26,0 [42] ) +Generated Location: (879:26,0 [42] ) | void RenderChildComponent() { @@ -19,12 +17,12 @@ Generated Location: (878:26,0 [42] ) Source Location: (121:5,0 [7] x:\dir\subdir\Test\TestComponent.cshtml) | } | -Generated Location: (1160:38,0 [7] ) +Generated Location: (1161:38,0 [7] ) | } | Source Location: (135:8,2 [25] x:\dir\subdir\Test\TestComponent.cshtml) | RenderChildComponent(); | -Generated Location: (1300:46,0 [25] ) +Generated Location: (1301:46,0 [25] ) | RenderChildComponent(); | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_MultipleGenerics/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_MultipleGenerics/TestComponent.ir.txt index c6252ff61e9..4ca1f83a4e5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_MultipleGenerics/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_MultipleGenerics/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [228] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_MultipleGenerics_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_MultipleGenerics_TypeInference/TestComponent.ir.txt index 996545a7e55..304aef3b8dc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_MultipleGenerics_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_MultipleGenerics_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [229] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.ir.txt index 9f850352bf0..b66d1e67683 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_NonGenericParameterizedChildContent_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [140] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Simple/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Simple/TestComponent.ir.txt index 8e0d2bda571..bfab51a8e11 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Simple/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_Simple/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [15] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithChildContent/TestComponent.ir.txt index 41f32fa25b5..9516f9c411f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [91] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithElementOnlyChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithElementOnlyChildContent/TestComponent.ir.txt index 953273d1d9c..904d3301f36 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithElementOnlyChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithElementOnlyChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [47] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitChildContent/TestComponent.ir.txt index f3cdda0970f..39a1820138a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [61] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.ir.txt index 86ebc2ad3e7..cc0a65932ca 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitEventHandler/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.ir.txt index 8b2f0b0c9ee..ded45690976 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitGenericChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitStringParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitStringParameter/TestComponent.ir.txt index 7e5b49c6f42..f4b222aa1f5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitStringParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithExplicitStringParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [49] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.ir.txt index fc7be7a02f7..ab0ccb8c3a6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [107] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.ir.txt index 9be009cf380..24160f4876b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [164] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.ir.txt index 69e79036dac..83ed0b97afc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithGenericChildContent_SetsParameterNameOnComponent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [164] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.ir.txt index faf816a7641..c2092d73590 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithLambdaEventHandler/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [49] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithNonPropertyAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithNonPropertyAttributes/TestComponent.ir.txt index 07e74b56ef9..1c09553b064 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithNonPropertyAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithNonPropertyAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [72] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithPageDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithPageDirective/TestComponent.ir.txt index d6ce27e8383..d172d377af0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithPageDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithPageDirective/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components RouteAttributeExtensionNode - (6:0,6 [9] x:\dir\subdir\Test\TestComponent.cshtml) - "/MyPage" RouteAttributeExtensionNode - (23:1,6 [20] x:\dir\subdir\Test\TestComponent.cshtml) - "/AnotherRoute/{id}" ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithParameters/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithParameters/TestComponent.ir.txt index 61e82409d00..2512245b144 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithParameters/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithParameters/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [131] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.codegen.cs index 38b26fc654e..257c697cde8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.ir.txt index dab910d725f..80c074437ec 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (44:1,0 [37] x:\dir\subdir\Test\TestComponent.cshtml) - DynamicElement diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.mappings.txt index 4d77dc68399..8a26f78bd48 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildComponent_WithWeaklyTypeEventHandler/TestComponent.mappings.txt @@ -1,20 +1,18 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (70:1,26 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1144:29,0 [7] ) +Generated Location: (1145:29,0 [7] ) |OnClick| Source Location: (92:3,7 [60] x:\dir\subdir\Test\TestComponent.cshtml) | private Action OnClick { get; set; } | -Generated Location: (1390:40,0 [60] ) +Generated Location: (1391:40,0 [60] ) | private Action OnClick { get; set; } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs index 0fa8152e78e..3ad720927d7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,19) "x:\dir\subdir\Test\TestComponent.cshtml" using AnotherTest #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.ir.txt index 7413bf33bea..efaf7aadfc5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [19] x:\dir\subdir\Test\TestComponent.cshtml) - AnotherTest + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [17] x:\dir\subdir\Test\TestComponent.cshtml) - AnotherTest ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (22:2,0 [63] x:\dir\subdir\Test\TestComponent.cshtml) - HeaderComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt index 9ce8d189e21..d1f38da2d50 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ChildContent_FromAnotherNamespace/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (1:0,1 [19] x:\dir\subdir\Test\TestComponent.cshtml) -|using AnotherTest -| -Generated Location: (371:12,0 [19] ) -|using AnotherTest -| +Source Location: (1:0,1 [17] x:\dir\subdir\Test\TestComponent.cshtml) +|using AnotherTest| +Generated Location: (372:12,0 [17] ) +|using AnotherTest| Source Location: (119:6,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |context| -Generated Location: (1508:37,0 [7] ) +Generated Location: (1509:37,0 [7] ) |context| Source Location: (276:12,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |context| -Generated Location: (2454:59,0 [7] ) +Generated Location: (2455:59,0 [7] ) |context| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.codegen.cs index 8b309ba88ce..38ea2ed985e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.codegen.cs @@ -9,13 +9,13 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\_Imports.razor" +#line (1,2)-(1,19) "x:\dir\subdir\Test\_Imports.razor" using System.Text #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\_Imports.razor" +#line (2,2)-(2,25) "x:\dir\subdir\Test\_Imports.razor" using System.Reflection #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.ir.txt index 1f665393e7c..1020e1849b9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.ir.txt @@ -1,12 +1,12 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [19] x:\dir\subdir\Test\_Imports.razor) - System.Text - UsingDirective - (21:1,1 [25] x:\dir\subdir\Test\_Imports.razor) - System.Reflection + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [17] x:\dir\subdir\Test\_Imports.razor) - System.Text + UsingDirective - (21:1,1 [23] x:\dir\subdir\Test\_Imports.razor) - System.Reflection CSharpCode - IntermediateToken - - CSharp - [global::Microsoft.AspNetCore.Components.LayoutAttribute(typeof(MainLayout))] ClassDeclaration - - public partial - _Imports - System.Object - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.mappings.txt index d8d4b520855..348da246480 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentImports/_Imports.mappings.txt @@ -1,19 +1,15 @@ -Source Location: (1:0,1 [19] x:\dir\subdir\Test\_Imports.razor) -|using System.Text -| -Generated Location: (365:12,0 [19] ) -|using System.Text -| +Source Location: (1:0,1 [17] x:\dir\subdir\Test\_Imports.razor) +|using System.Text| +Generated Location: (366:12,0 [17] ) +|using System.Text| -Source Location: (21:1,1 [25] x:\dir\subdir\Test\_Imports.razor) -|using System.Reflection -| -Generated Location: (486:18,0 [25] ) -|using System.Reflection -| +Source Location: (21:1,1 [23] x:\dir\subdir\Test\_Imports.razor) +|using System.Reflection| +Generated Location: (488:18,0 [23] ) +|using System.Reflection| Source Location: (69:4,1 [3] x:\dir\subdir\Test\_Imports.razor) |Foo| -Generated Location: (950:35,0 [3] ) +Generated Location: (952:35,0 [3] ) |Foo| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentParameter_TypeMismatch_ReportsDiagnostic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentParameter_TypeMismatch_ReportsDiagnostic/TestComponent.ir.txt index a022f13095e..1730ad1680a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentParameter_TypeMismatch_ReportsDiagnostic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentParameter_TypeMismatch_ReportsDiagnostic/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [43] x:\dir\subdir\Test\TestComponent.cshtml) - CoolnessMeter diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithBooleanParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithBooleanParameter/TestComponent.ir.txt index 85065d22641..00606aeb0c3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithBooleanParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithBooleanParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [26] x:\dir\subdir\Test\TestComponent.cshtml) - strong diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithBooleanParameter_Minimized/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithBooleanParameter_Minimized/TestComponent.ir.txt index 5244b02b866..9fb31f23375 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithBooleanParameter_Minimized/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithBooleanParameter_Minimized/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [26] x:\dir\subdir\Test\TestComponent.cshtml) - strong diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.codegen.cs index 053a2747109..dd30149e455 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.codegen.cs @@ -8,7 +8,7 @@ namespace Test using global::System.Linq; using global::System.Threading.Tasks; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,40) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.ir.txt index 34f37668b8f..5d63deeebed 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem1, TItem2, TItem3 MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Item1

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.mappings.txt index adcb25c08d3..375777746c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/TestComponent.mappings.txt @@ -1,58 +1,56 @@ -Source Location: (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components; -| -Generated Location: (319:11,0 [40] ) -|using Microsoft.AspNetCore.Components; -| +Source Location: (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components;| +Generated Location: (320:11,0 [38] ) +|using Microsoft.AspNetCore.Components;| Source Location: (52:1,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem1| -Generated Location: (555:20,0 [6] ) +Generated Location: (556:20,0 [6] ) |TItem1| Source Location: (92:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem2| -Generated Location: (702:28,0 [6] ) +Generated Location: (703:28,0 [6] ) |TItem2| Source Location: (131:3,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem3| -Generated Location: (849:36,0 [6] ) +Generated Location: (850:36,0 [6] ) |TItem3| Source Location: (59:1,18 [20] x:\dir\subdir\Test\TestComponent.cshtml) |where TItem1 : Image| -Generated Location: (1052:44,0 [20] ) +Generated Location: (1053:44,0 [20] ) |where TItem1 : Image| Source Location: (99:2,18 [19] x:\dir\subdir\Test\TestComponent.cshtml) |where TItem2 : ITag| -Generated Location: (1206:51,0 [19] ) +Generated Location: (1207:51,0 [19] ) |where TItem2 : ITag| Source Location: (138:3,18 [27] x:\dir\subdir\Test\TestComponent.cshtml) |where TItem3 : Image, new()| -Generated Location: (1359:58,0 [27] ) +Generated Location: (1360:58,0 [27] ) |where TItem3 : Image, new()| Source Location: (186:6,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) |foreach (var item2 in Items2) { | -Generated Location: (1787:71,0 [34] ) +Generated Location: (1788:71,0 [34] ) |foreach (var item2 in Items2) { | Source Location: (234:9,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(item2)| -Generated Location: (2038:82,0 [19] ) +Generated Location: (2039:82,0 [19] ) |ChildContent(item2)| Source Location: (266:11,0 [3] x:\dir\subdir\Test\TestComponent.cshtml) |} | -Generated Location: (2303:92,0 [3] ) +Generated Location: (2304:92,0 [3] ) |} | @@ -63,7 +61,7 @@ Source Location: (294:15,7 [236] x:\dir\subdir\Test\TestComponent.cshtml) [Parameter] public TItem3 Item3 { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } | -Generated Location: (2549:103,0 [236] ) +Generated Location: (2550:103,0 [236] ) | [Parameter] public TItem1 Item1 { get; set; } [Parameter] public List Items2 { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.codegen.cs index 5c20d7e723c..59eb0f730e6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\UseTestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\UseTestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.ir.txt index 7d2a148052b..78666fca04a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\UseTestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\UseTestComponent.cshtml) - Test ClassDeclaration - - public partial - UseTestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [94] x:\dir\subdir\Test\UseTestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.mappings.txt index 9c6d72447c4..1016f505fdf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters/UseTestComponent.mappings.txt @@ -1,28 +1,26 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\UseTestComponent.cshtml) -|using Test -| -Generated Location: (374:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\UseTestComponent.cshtml) +|using Test| +Generated Location: (375:12,0 [10] ) +|using Test| Source Location: (35:1,22 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |item1| -Generated Location: (963:28,0 [5] ) +Generated Location: (964:28,0 [5] ) |item1| Source Location: (49:1,36 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |items| -Generated Location: (1124:36,0 [5] ) +Generated Location: (1125:36,0 [5] ) |items| Source Location: (62:1,49 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |item1| -Generated Location: (1285:44,0 [5] ) +Generated Location: (1286:44,0 [5] ) |item1| Source Location: (78:2,8 [7] x:\dir\subdir\Test\UseTestComponent.cshtml) |context| -Generated Location: (1567:54,0 [7] ) +Generated Location: (1568:54,0 [7] ) |context| Source Location: (118:5,7 [268] x:\dir\subdir\Test\UseTestComponent.cshtml) @@ -32,7 +30,7 @@ Source Location: (118:5,7 [268] x:\dir\subdir\Test\UseTestComponent.cshtml) static Tag tag2 = new Tag() { description = "Another description."}; List items = new List() { tag1, tag2 }; | -Generated Location: (1854:67,0 [268] ) +Generated Location: (1855:67,0 [268] ) | Image item1 = new Image() { id = 1, url="https://example.com"}; static Tag tag1 = new Tag() { description = "A description."}; @@ -42,16 +40,16 @@ Generated Location: (1854:67,0 [268] ) Source Location: (28:1,15 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |Item1| -Generated Location: (3089:93,0 [5] ) +Generated Location: (3090:93,0 [5] ) |Item1| Source Location: (41:1,28 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |Items2| -Generated Location: (3360:102,0 [6] ) +Generated Location: (3361:102,0 [6] ) |Items2| Source Location: (55:1,42 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |Item3| -Generated Location: (3632:111,0 [5] ) +Generated Location: (3633:111,0 [5] ) |Item3| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.codegen.cs index 053a2747109..dd30149e455 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.codegen.cs @@ -8,7 +8,7 @@ namespace Test using global::System.Linq; using global::System.Threading.Tasks; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,40) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.ir.txt index 52b1e3d7d11..2b5e6381006 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem1, TItem2, TItem3 MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Item1

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.mappings.txt index 31224a36bab..be183220ffd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.mappings.txt @@ -1,58 +1,56 @@ -Source Location: (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components; -| -Generated Location: (319:11,0 [40] ) -|using Microsoft.AspNetCore.Components; -| +Source Location: (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components;| +Generated Location: (320:11,0 [38] ) +|using Microsoft.AspNetCore.Components;| Source Location: (52:1,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem1| -Generated Location: (555:20,0 [6] ) +Generated Location: (556:20,0 [6] ) |TItem1| Source Location: (93:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem2| -Generated Location: (702:28,0 [6] ) +Generated Location: (703:28,0 [6] ) |TItem2| Source Location: (133:3,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem3| -Generated Location: (849:36,0 [6] ) +Generated Location: (850:36,0 [6] ) |TItem3| Source Location: (59:1,18 [20] x:\dir\subdir\Test\TestComponent.cshtml) |where TItem1 : Image| -Generated Location: (1052:44,0 [20] ) +Generated Location: (1053:44,0 [20] ) |where TItem1 : Image| Source Location: (100:2,18 [19] x:\dir\subdir\Test\TestComponent.cshtml) |where TItem2 : ITag| -Generated Location: (1206:51,0 [19] ) +Generated Location: (1207:51,0 [19] ) |where TItem2 : ITag| Source Location: (140:3,18 [27] x:\dir\subdir\Test\TestComponent.cshtml) |where TItem3 : Image, new()| -Generated Location: (1359:58,0 [27] ) +Generated Location: (1360:58,0 [27] ) |where TItem3 : Image, new()| Source Location: (189:6,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) |foreach (var item2 in Items2) { | -Generated Location: (1787:71,0 [34] ) +Generated Location: (1788:71,0 [34] ) |foreach (var item2 in Items2) { | Source Location: (237:9,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(item2)| -Generated Location: (2038:82,0 [19] ) +Generated Location: (2039:82,0 [19] ) |ChildContent(item2)| Source Location: (269:11,0 [3] x:\dir\subdir\Test\TestComponent.cshtml) |} | -Generated Location: (2303:92,0 [3] ) +Generated Location: (2304:92,0 [3] ) |} | @@ -63,7 +61,7 @@ Source Location: (297:15,7 [236] x:\dir\subdir\Test\TestComponent.cshtml) [Parameter] public TItem3 Item3 { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } | -Generated Location: (2549:103,0 [236] ) +Generated Location: (2550:103,0 [236] ) | [Parameter] public TItem1 Item1 { get; set; } [Parameter] public List Items2 { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.codegen.cs index 5c20d7e723c..59eb0f730e6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\UseTestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\UseTestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.ir.txt index 7d2a148052b..78666fca04a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\UseTestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\UseTestComponent.cshtml) - Test ClassDeclaration - - public partial - UseTestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [94] x:\dir\subdir\Test\UseTestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.mappings.txt index 9c6d72447c4..1016f505fdf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithConstrainedTypeParameters_WithSemicolon/UseTestComponent.mappings.txt @@ -1,28 +1,26 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\UseTestComponent.cshtml) -|using Test -| -Generated Location: (374:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\UseTestComponent.cshtml) +|using Test| +Generated Location: (375:12,0 [10] ) +|using Test| Source Location: (35:1,22 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |item1| -Generated Location: (963:28,0 [5] ) +Generated Location: (964:28,0 [5] ) |item1| Source Location: (49:1,36 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |items| -Generated Location: (1124:36,0 [5] ) +Generated Location: (1125:36,0 [5] ) |items| Source Location: (62:1,49 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |item1| -Generated Location: (1285:44,0 [5] ) +Generated Location: (1286:44,0 [5] ) |item1| Source Location: (78:2,8 [7] x:\dir\subdir\Test\UseTestComponent.cshtml) |context| -Generated Location: (1567:54,0 [7] ) +Generated Location: (1568:54,0 [7] ) |context| Source Location: (118:5,7 [268] x:\dir\subdir\Test\UseTestComponent.cshtml) @@ -32,7 +30,7 @@ Source Location: (118:5,7 [268] x:\dir\subdir\Test\UseTestComponent.cshtml) static Tag tag2 = new Tag() { description = "Another description."}; List items = new List() { tag1, tag2 }; | -Generated Location: (1854:67,0 [268] ) +Generated Location: (1855:67,0 [268] ) | Image item1 = new Image() { id = 1, url="https://example.com"}; static Tag tag1 = new Tag() { description = "A description."}; @@ -42,16 +40,16 @@ Generated Location: (1854:67,0 [268] ) Source Location: (28:1,15 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |Item1| -Generated Location: (3089:93,0 [5] ) +Generated Location: (3090:93,0 [5] ) |Item1| Source Location: (41:1,28 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |Items2| -Generated Location: (3360:102,0 [6] ) +Generated Location: (3361:102,0 [6] ) |Items2| Source Location: (55:1,42 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |Item3| -Generated Location: (3632:111,0 [5] ) +Generated Location: (3633:111,0 [5] ) |Item3| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithDecimalParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithDecimalParameter/TestComponent.ir.txt index 2781a6091c5..8eee8c379c2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithDecimalParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithDecimalParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - strong diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithDynamicParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithDynamicParameter/TestComponent.ir.txt index e65fda3b468..c26fd26fd30 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithDynamicParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithDynamicParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - strong diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.ir.txt index 9fce58ad9e7..aec56b0050f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTupleParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (90:4,0 [51] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.codegen.cs index 2280b142bed..42b383d35f9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.codegen.cs @@ -8,7 +8,7 @@ namespace Test using global::System.Linq; using global::System.Threading.Tasks; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,40) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.ir.txt index 87268c63ae9..0ed3fca1224 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Item

\n\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.mappings.txt index 902f3698101..18ca190ec37 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/TestComponent.mappings.txt @@ -1,44 +1,42 @@ -Source Location: (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components; -| -Generated Location: (319:11,0 [40] ) -|using Microsoft.AspNetCore.Components; -| +Source Location: (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components;| +Generated Location: (320:11,0 [38] ) +|using Microsoft.AspNetCore.Components;| Source Location: (52:1,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) |TItem| -Generated Location: (555:20,0 [5] ) +Generated Location: (556:20,0 [5] ) |TItem| Source Location: (82:5,4 [20] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(Items1)| -Generated Location: (1114:36,0 [20] ) +Generated Location: (1115:36,0 [20] ) |ChildContent(Items1)| Source Location: (111:7,1 [33] x:\dir\subdir\Test\TestComponent.cshtml) |foreach (var item in Items2) { | -Generated Location: (1322:45,0 [33] ) +Generated Location: (1323:45,0 [33] ) |foreach (var item in Items2) { | Source Location: (152:9,8 [18] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(item)| -Generated Location: (1572:56,0 [18] ) +Generated Location: (1573:56,0 [18] ) |ChildContent(item)| Source Location: (176:10,0 [3] x:\dir\subdir\Test\TestComponent.cshtml) |} | -Generated Location: (1779:65,0 [3] ) +Generated Location: (1780:65,0 [3] ) |} | Source Location: (185:12,4 [22] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(Items3())| -Generated Location: (1999:75,0 [22] ) +Generated Location: (2000:75,0 [22] ) |ChildContent(Items3())| Source Location: (222:14,7 [248] x:\dir\subdir\Test\TestComponent.cshtml) @@ -48,7 +46,7 @@ Source Location: (222:14,7 [248] x:\dir\subdir\Test\TestComponent.cshtml) [Parameter] public Func Items3 { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } | -Generated Location: (2259:86,0 [248] ) +Generated Location: (2260:86,0 [248] ) | [Parameter] public TItem[] Items1 { get; set; } [Parameter] public List Items2 { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.codegen.cs index 0b85907d5e4..7aff1e759b3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\UseTestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\UseTestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.ir.txt index c3a477ae9c5..1598a6138db 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\UseTestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\UseTestComponent.cshtml) - Test ClassDeclaration - - public partial - UseTestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [111] x:\dir\subdir\Test\UseTestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.mappings.txt index f2558e314bd..ca1a4303660 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterArray/UseTestComponent.mappings.txt @@ -1,28 +1,26 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\UseTestComponent.cshtml) -|using Test -| -Generated Location: (374:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\UseTestComponent.cshtml) +|using Test| +Generated Location: (375:12,0 [10] ) +|using Test| Source Location: (35:1,22 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |items1| -Generated Location: (963:28,0 [6] ) +Generated Location: (964:28,0 [6] ) |items1| Source Location: (49:1,36 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |items2| -Generated Location: (1125:36,0 [6] ) +Generated Location: (1126:36,0 [6] ) |items2| Source Location: (63:1,50 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |items3| -Generated Location: (1287:44,0 [6] ) +Generated Location: (1288:44,0 [6] ) |items3| Source Location: (80:2,8 [22] x:\dir\subdir\Test\UseTestComponent.cshtml) |context[0].description| -Generated Location: (1570:54,0 [22] ) +Generated Location: (1571:54,0 [22] ) |context[0].description| Source Location: (135:5,7 [208] x:\dir\subdir\Test\UseTestComponent.cshtml) @@ -32,7 +30,7 @@ Source Location: (135:5,7 [208] x:\dir\subdir\Test\UseTestComponent.cshtml) List items2 = new List() { new [] { tag } }; Tag[] items3() => new [] { tag }; | -Generated Location: (1872:67,0 [208] ) +Generated Location: (1873:67,0 [208] ) | static Tag tag = new Tag() { description = "A description."}; Tag[] items1 = new [] { tag }; @@ -42,16 +40,16 @@ Generated Location: (1872:67,0 [208] ) Source Location: (28:1,15 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |Items1| -Generated Location: (2889:90,0 [6] ) +Generated Location: (2890:90,0 [6] ) |Items1| Source Location: (42:1,29 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |Items2| -Generated Location: (3144:99,0 [6] ) +Generated Location: (3145:99,0 [6] ) |Items2| Source Location: (56:1,43 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |Items3| -Generated Location: (3399:108,0 [6] ) +Generated Location: (3400:108,0 [6] ) |Items3| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.codegen.cs index a2efcb05c75..0917e78a100 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.codegen.cs @@ -8,7 +8,7 @@ namespace Test using global::System.Linq; using global::System.Threading.Tasks; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,40) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.ir.txt index 440c0964529..a9e065ef616 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem1, TItem2 MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Item

\n\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.mappings.txt index 794863e9744..4378eb79b55 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/TestComponent.mappings.txt @@ -1,43 +1,41 @@ -Source Location: (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components; -| -Generated Location: (319:11,0 [40] ) -|using Microsoft.AspNetCore.Components; -| +Source Location: (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components;| +Generated Location: (320:11,0 [38] ) +|using Microsoft.AspNetCore.Components;| Source Location: (52:1,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem1| -Generated Location: (555:20,0 [6] ) +Generated Location: (556:20,0 [6] ) |TItem1| Source Location: (71:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem2| -Generated Location: (702:28,0 [6] ) +Generated Location: (703:28,0 [6] ) |TItem2| Source Location: (102:6,4 [19] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(Item1)| -Generated Location: (1262:44,0 [19] ) +Generated Location: (1263:44,0 [19] ) |ChildContent(Item1)| Source Location: (130:8,1 [33] x:\dir\subdir\Test\TestComponent.cshtml) |foreach (var item in Items2) { | -Generated Location: (1469:53,0 [33] ) +Generated Location: (1470:53,0 [33] ) |foreach (var item in Items2) { | Source Location: (171:10,8 [18] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(item)| -Generated Location: (1719:64,0 [18] ) +Generated Location: (1720:64,0 [18] ) |ChildContent(item)| Source Location: (195:11,0 [3] x:\dir\subdir\Test\TestComponent.cshtml) |} | -Generated Location: (1926:73,0 [3] ) +Generated Location: (1927:73,0 [3] ) |} | @@ -47,7 +45,7 @@ Source Location: (207:13,7 [215] x:\dir\subdir\Test\TestComponent.cshtml) [Parameter] public List<(TItem1, TItem2)> Items2 { get; set; } [Parameter] public RenderFragment<(TItem1, TItem2)> ChildContent { get; set; } | -Generated Location: (2112:83,0 [215] ) +Generated Location: (2113:83,0 [215] ) | [Parameter] public (TItem1, TItem2) Item1 { get; set; } [Parameter] public List<(TItem1, TItem2)> Items2 { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.codegen.cs index 3e310282284..8ab4de41f40 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\UseTestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\UseTestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.ir.txt index 9e9d50b1a09..623a87fa609 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\UseTestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\UseTestComponent.cshtml) - Test ClassDeclaration - - public partial - UseTestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [80] x:\dir\subdir\Test\UseTestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.mappings.txt index 7d3da0247d0..95ce432b66e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple/UseTestComponent.mappings.txt @@ -1,23 +1,21 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\UseTestComponent.cshtml) -|using Test -| -Generated Location: (374:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\UseTestComponent.cshtml) +|using Test| +Generated Location: (375:12,0 [10] ) +|using Test| Source Location: (34:1,21 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |item1| -Generated Location: (963:28,0 [5] ) +Generated Location: (964:28,0 [5] ) |item1| Source Location: (47:1,34 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |items2| -Generated Location: (1124:36,0 [6] ) +Generated Location: (1125:36,0 [6] ) |items2| Source Location: (64:2,8 [7] x:\dir\subdir\Test\UseTestComponent.cshtml) |context| -Generated Location: (1407:46,0 [7] ) +Generated Location: (1408:46,0 [7] ) |context| Source Location: (104:5,7 [176] x:\dir\subdir\Test\UseTestComponent.cshtml) @@ -26,7 +24,7 @@ Source Location: (104:5,7 [176] x:\dir\subdir\Test\UseTestComponent.cshtml) static (string, int) item2 = ("Another string", 42); List<(string, int)> items2 = new List<(string, int)>() { item2 }; | -Generated Location: (1694:59,0 [176] ) +Generated Location: (1695:59,0 [176] ) | (string, int) item1 = ("A string", 42); static (string, int) item2 = ("Another string", 42); @@ -35,11 +33,11 @@ Generated Location: (1694:59,0 [176] ) Source Location: (28:1,15 [5] x:\dir\subdir\Test\UseTestComponent.cshtml) |Item1| -Generated Location: (2684:81,0 [5] ) +Generated Location: (2685:81,0 [5] ) |Item1| Source Location: (40:1,27 [6] x:\dir\subdir\Test\UseTestComponent.cshtml) |Items2| -Generated Location: (2947:90,0 [6] ) +Generated Location: (2948:90,0 [6] ) |Items2| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.codegen.cs index 6853da41fae..dbbb6b02917 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,9) "x:\dir\subdir\Test\TestComponent.cshtml" using N #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.ir.txt index e1f37cb3f78..047df476e7f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [9] x:\dir\subdir\Test\TestComponent.cshtml) - N + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [7] x:\dir\subdir\Test\TestComponent.cshtml) - N ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (212:11,0 [137] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.mappings.txt index d5f139dc12e..7d75119464f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTupleGloballyQualifiedTypes/TestComponent.mappings.txt @@ -1,9 +1,7 @@ -Source Location: (1:0,1 [9] x:\dir\subdir\Test\TestComponent.cshtml) -|using N -| -Generated Location: (371:12,0 [9] ) -|using N -| +Source Location: (1:0,1 [7] x:\dir\subdir\Test\TestComponent.cshtml) +|using N| +Generated Location: (371:12,0 [7] ) +|using N| Source Location: (21:1,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TParam| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple_ExplicitGenericArguments/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple_ExplicitGenericArguments/TestComponent.ir.txt index 5128ce1731d..4b0a3a89350 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple_ExplicitGenericArguments/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameterValueTuple_ExplicitGenericArguments/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TDomain, TValue MethodDeclaration - - protected override - void - BuildRenderTree Component - (86:3,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.codegen.cs index 566b4b5bceb..f1016f2628b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.codegen.cs @@ -8,7 +8,7 @@ namespace Test using global::System.Linq; using global::System.Threading.Tasks; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,40) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.ir.txt index 7a381ab7acc..2e3415c7f20 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem1, TItem2 MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Item1

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.mappings.txt index 71d5e8d5435..b9cf85912b5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters/TestComponent.mappings.txt @@ -1,38 +1,36 @@ -Source Location: (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components; -| -Generated Location: (319:11,0 [40] ) -|using Microsoft.AspNetCore.Components; -| +Source Location: (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components;| +Generated Location: (320:11,0 [38] ) +|using Microsoft.AspNetCore.Components;| Source Location: (52:1,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem1| -Generated Location: (555:20,0 [6] ) +Generated Location: (556:20,0 [6] ) |TItem1| Source Location: (71:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem2| -Generated Location: (702:28,0 [6] ) +Generated Location: (703:28,0 [6] ) |TItem2| Source Location: (98:5,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) |foreach (var item2 in Items2) { | -Generated Location: (1172:42,0 [34] ) +Generated Location: (1173:42,0 [34] ) |foreach (var item2 in Items2) { | Source Location: (146:8,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(item2)| -Generated Location: (1421:53,0 [19] ) +Generated Location: (1422:53,0 [19] ) |ChildContent(item2)| Source Location: (178:10,0 [3] x:\dir\subdir\Test\TestComponent.cshtml) |} | -Generated Location: (1686:63,0 [3] ) +Generated Location: (1687:63,0 [3] ) |} | @@ -42,7 +40,7 @@ Source Location: (188:11,7 [185] x:\dir\subdir\Test\TestComponent.cshtml) [Parameter] public List Items2 { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } | -Generated Location: (1872:73,0 [185] ) +Generated Location: (1873:73,0 [185] ) | [Parameter] public TItem1 Item1 { get; set; } [Parameter] public List Items2 { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_Interconnected/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_Interconnected/TestComponent.ir.txt index 7ff215b76a3..7d5fe3465cd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_Interconnected/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_Interconnected/TestComponent.ir.txt @@ -1,9 +1,9 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - T1, T2 MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.codegen.cs index 566b4b5bceb..f1016f2628b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.codegen.cs @@ -8,7 +8,7 @@ namespace Test using global::System.Linq; using global::System.Threading.Tasks; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,40) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.ir.txt index 37b31b187ee..e7cae26d9a0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem1, TItem2 MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Item1

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.mappings.txt index dd06a509e99..bc2e4cd8c73 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ComponentWithTypeParameters_WithSemicolon/TestComponent.mappings.txt @@ -1,38 +1,36 @@ -Source Location: (1:0,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components; -| -Generated Location: (319:11,0 [40] ) -|using Microsoft.AspNetCore.Components; -| +Source Location: (1:0,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components;| +Generated Location: (320:11,0 [38] ) +|using Microsoft.AspNetCore.Components;| Source Location: (52:1,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem1| -Generated Location: (555:20,0 [6] ) +Generated Location: (556:20,0 [6] ) |TItem1| Source Location: (72:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TItem2| -Generated Location: (702:28,0 [6] ) +Generated Location: (703:28,0 [6] ) |TItem2| Source Location: (100:5,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) |foreach (var item2 in Items2) { | -Generated Location: (1172:42,0 [34] ) +Generated Location: (1173:42,0 [34] ) |foreach (var item2 in Items2) { | Source Location: (148:8,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) |ChildContent(item2)| -Generated Location: (1421:53,0 [19] ) +Generated Location: (1422:53,0 [19] ) |ChildContent(item2)| Source Location: (180:10,0 [3] x:\dir\subdir\Test\TestComponent.cshtml) |} | -Generated Location: (1686:63,0 [3] ) +Generated Location: (1687:63,0 [3] ) |} | @@ -42,7 +40,7 @@ Source Location: (190:11,7 [185] x:\dir\subdir\Test\TestComponent.cshtml) [Parameter] public List Items2 { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } | -Generated Location: (1872:73,0 [185] ) +Generated Location: (1873:73,0 [185] ) | [Parameter] public TItem1 Item1 { get; set; } [Parameter] public List Items2 { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute/TestComponent.ir.txt index b972a27e789..403d4a6638b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute_02/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute_02/TestComponent.ir.txt index 43c9695f760..46a26808200 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute_02/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute_02/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute_03/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute_03/TestComponent.ir.txt index 0d5db5a2d27..dbfdbc51f5c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute_03/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_ComplexContentInAttribute_03/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [52] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.codegen.cs index 2f1232a566d..1a6c58fca7d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.codegen.cs @@ -9,13 +9,13 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,34) "x:\dir\subdir\Test\TestComponent.cshtml" using static Test2.SomeComponent #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,19) "x:\dir\subdir\Test\TestComponent.cshtml" using Foo = Test3 #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.ir.txt index 43257821698..e8beb5c46cc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.ir.txt @@ -1,12 +1,12 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) - static Test2.SomeComponent - UsingDirective - (36:1,1 [19] x:\dir\subdir\Test\TestComponent.cshtml) - Foo = Test3 + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [32] x:\dir\subdir\Test\TestComponent.cshtml) - static Test2.SomeComponent + UsingDirective - (36:1,1 [17] x:\dir\subdir\Test\TestComponent.cshtml) - Foo = Test3 ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (55:2,0 [15] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.mappings.txt index 604e891f1b9..bba3a009bea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_IgnoresStaticAndAliasUsings/TestComponent.mappings.txt @@ -1,14 +1,10 @@ -Source Location: (1:0,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) -|using static Test2.SomeComponent -| -Generated Location: (371:12,0 [34] ) -|using static Test2.SomeComponent -| +Source Location: (1:0,1 [32] x:\dir\subdir\Test\TestComponent.cshtml) +|using static Test2.SomeComponent| +Generated Location: (372:12,0 [32] ) +|using static Test2.SomeComponent| -Source Location: (36:1,1 [19] x:\dir\subdir\Test\TestComponent.cshtml) -|using Foo = Test3 -| -Generated Location: (513:18,0 [19] ) -|using Foo = Test3 -| +Source Location: (36:1,1 [17] x:\dir\subdir\Test\TestComponent.cshtml) +|using Foo = Test3| +Generated Location: (515:18,0 [17] ) +|using Foo = Test3| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_MatchingIsCaseSensitive/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_MatchingIsCaseSensitive/TestComponent.ir.txt index 0ae2e9d028c..0629300f8a7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_MatchingIsCaseSensitive/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_MatchingIsCaseSensitive/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [15] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_MultipleComponentsDifferByCase/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_MultipleComponentsDifferByCase/TestComponent.ir.txt index 1bbde2ac13c..064566fc4d4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_MultipleComponentsDifferByCase/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_MultipleComponentsDifferByCase/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [31] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.codegen.cs index 692f69d8650..6958ea6d1c5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.codegen.cs @@ -16,13 +16,13 @@ namespace using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\_Imports.razor" +#line (1,2)-(1,19) "x:\dir\subdir\Test\_Imports.razor" using System.Text #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\_Imports.razor" +#line (2,2)-(2,25) "x:\dir\subdir\Test\_Imports.razor" using System.Reflection #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.ir.txt index 516baa7f9f0..b50167b1023 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_InImports/TestComponent.ir.txt @@ -1,12 +1,12 @@ Document - NamespaceDeclaration - (57:2,11 [8] x:\dir\subdir\Test\_Imports.razor) - New.Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [19] x:\dir\subdir\Test\_Imports.razor) - System.Text - UsingDirective - (21:1,1 [25] x:\dir\subdir\Test\_Imports.razor) - System.Reflection + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [17] x:\dir\subdir\Test\_Imports.razor) - System.Text + UsingDirective - (21:1,1 [23] x:\dir\subdir\Test\_Imports.razor) - System.Reflection ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Counter diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.codegen.cs index a098f5f5152..07756e9e18b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.codegen.cs @@ -16,13 +16,13 @@ namespace using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\_Imports.razor" +#line (1,2)-(1,19) "x:\dir\subdir\Test\_Imports.razor" using System.Text #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\_Imports.razor" +#line (2,2)-(2,25) "x:\dir\subdir\Test\_Imports.razor" using System.Reflection #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.ir.txt index 5b373f2cea7..0900cc54f33 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_NamespaceDirective_OverrideImports/Counter.ir.txt @@ -1,12 +1,12 @@ Document - NamespaceDeclaration - (11:0,11 [8] Counter.razor) - New.Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [19] x:\dir\subdir\Test\_Imports.razor) - System.Text - UsingDirective - (21:1,1 [25] x:\dir\subdir\Test\_Imports.razor) - System.Reflection + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [17] x:\dir\subdir\Test\_Imports.razor) - System.Text + UsingDirective - (21:1,1 [23] x:\dir\subdir\Test\_Imports.razor) - System.Reflection ClassDeclaration - - public partial - Counter - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (21:1,0 [12] Counter.razor) - Counter2 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_PreserveWhitespaceDirective_InImports/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_PreserveWhitespaceDirective_InImports/TestComponent.ir.txt index c1436a44472..cc8b87037de 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_PreserveWhitespaceDirective_InImports/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_PreserveWhitespaceDirective_InImports/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [55] x:\dir\subdir\Test\TestComponent.cshtml) - parent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_PreserveWhitespaceDirective_OverrideImports/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_PreserveWhitespaceDirective_OverrideImports/TestComponent.ir.txt index ae86d3faa70..61a9ecd5d14 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_PreserveWhitespaceDirective_OverrideImports/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_PreserveWhitespaceDirective_OverrideImports/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (29:2,0 [55] x:\dir\subdir\Test\TestComponent.cshtml) - parent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_TextTagsAreNotRendered/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_TextTagsAreNotRendered/TestComponent.ir.txt index 92c684c4f64..40196f03a91 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_TextTagsAreNotRendered/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_TextTagsAreNotRendered/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Counter diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.codegen.cs index 6dc54cc1331..b462455fe70 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.codegen.cs @@ -9,13 +9,13 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,49) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Rendering #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.ir.txt index cae3d0d1afb..5544a553766 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.ir.txt @@ -1,12 +1,12 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web - UsingDirective - (45:1,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (45:1,1 [47] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Element with no attributes

\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.mappings.txt index d0c9797d597..b418307aa0f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithCssScope/TestComponent.mappings.txt @@ -1,50 +1,46 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| -Source Location: (45:1,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Rendering -| -Generated Location: (522:18,0 [49] ) -|using Microsoft.AspNetCore.Components.Rendering -| +Source Location: (45:1,1 [47] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Rendering| +Generated Location: (524:18,0 [47] ) +|using Microsoft.AspNetCore.Components.Rendering| Source Location: (192:3,61 [3] x:\dir\subdir\Test\TestComponent.cshtml) |123| -Generated Location: (1322:37,0 [3] ) +Generated Location: (1324:37,0 [3] ) |123| Source Location: (318:6,30 [20] x:\dir\subdir\Test\TestComponent.cshtml) |myComponentReference| -Generated Location: (2176:54,0 [20] ) +Generated Location: (2178:54,0 [20] ) |myComponentReference| Source Location: (439:10,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) |if (DateTime.Now.Year > 1950) { | -Generated Location: (2495:66,0 [34] ) +Generated Location: (2497:66,0 [34] ) |if (DateTime.Now.Year > 1950) { | Source Location: (511:12,38 [18] x:\dir\subdir\Test\TestComponent.cshtml) |myElementReference| -Generated Location: (2905:79,0 [18] ) +Generated Location: (2907:79,0 [18] ) |myElementReference| Source Location: (589:13,30 [10] x:\dir\subdir\Test\TestComponent.cshtml) |myVariable| -Generated Location: (3566:96,0 [10] ) +Generated Location: (3568:96,0 [10] ) |myVariable| Source Location: (639:14,0 [3] x:\dir\subdir\Test\TestComponent.cshtml) |} | -Generated Location: (4060:108,0 [3] ) +Generated Location: (4062:108,0 [3] ) |} | @@ -59,7 +55,7 @@ Source Location: (651:16,7 [233] x:\dir\subdir\Test\TestComponent.cshtml) for (var i = 0; i < 10; i++) { | -Generated Location: (4246:118,0 [233] ) +Generated Location: (4248:118,0 [233] ) | ElementReference myElementReference; TemplatedComponent myComponentReference; @@ -73,12 +69,12 @@ Generated Location: (4246:118,0 [233] ) Source Location: (912:25,28 [1] x:\dir\subdir\Test\TestComponent.cshtml) |i| -Generated Location: (4708:136,0 [1] ) +Generated Location: (4710:136,0 [1] ) |i| Source Location: (925:25,41 [1] x:\dir\subdir\Test\TestComponent.cshtml) |i| -Generated Location: (4994:147,0 [1] ) +Generated Location: (4996:147,0 [1] ) |i| Source Location: (933:26,0 [164] x:\dir\subdir\Test\TestComponent.cshtml) @@ -89,7 +85,7 @@ Source Location: (933:26,0 [164] x:\dir\subdir\Test\TestComponent.cshtml) System.GC.KeepAlive(myVariable); } | -Generated Location: (5176:156,0 [164] ) +Generated Location: (5178:156,0 [164] ) | } System.GC.KeepAlive(myElementReference); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithDocType/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithDocType/TestComponent.ir.txt index a0dcd35937a..5c5e3590a96 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithDocType/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithDocType/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - \n
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_NoValueSpecified/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_NoValueSpecified/TestComponent.ir.txt index 5c8fb5003c3..adc5e3e3fcb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_NoValueSpecified/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_NoValueSpecified/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [43] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredChildContent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified/TestComponent.ir.txt index 9321b8be3f0..fb6061b9400 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [156] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredChildContent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecifiedAsText_WithoutName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecifiedAsText_WithoutName/TestComponent.ir.txt index 7d1728cd8a8..6e51ad253ec 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecifiedAsText_WithoutName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecifiedAsText_WithoutName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [100] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredChildContent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified_WithoutName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified_WithoutName/TestComponent.ir.txt index 822e4501a85..5e330564745 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified_WithoutName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredChildContent_ValueSpecified_WithoutName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [111] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredChildContent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_NoValueSpecified/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_NoValueSpecified/TestComponent.ir.txt index 04326e53bb7..09ee96fed1a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_NoValueSpecified/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_NoValueSpecified/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [85] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredChildContent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_ValueSpecified/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_ValueSpecified/TestComponent.ir.txt index ded9b375dcd..c945b7ee984 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_ValueSpecified/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredNamedChildContent_ValueSpecified/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [129] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredChildContent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_NoValueSpecified/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_NoValueSpecified/TestComponent.ir.txt index 98fea963fc8..0a52bca8ee2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_NoValueSpecified/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_NoValueSpecified/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [41] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredParameters diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecified/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecified/TestComponent.ir.txt index eaff3dbe38e..8df52a3987e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecified/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecified/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredParameters diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind/TestComponent.ir.txt index a389b36bcd2..9473415f6c6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValueSpecifiedUsingBind/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [67] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredParameters diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValuesSpecifiedUsingSplatting/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValuesSpecifiedUsingSplatting/TestComponent.ir.txt index 9a8c46c6cc5..e1829ccc737 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValuesSpecifiedUsingSplatting/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEditorRequiredParameter_ValuesSpecifiedUsingSplatting/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [91] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithEditorRequiredParameters diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEscapedParameterName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEscapedParameterName/TestComponent.ir.txt index 0fd548b6d62..d4964314a3b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEscapedParameterName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithEscapedParameterName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [49] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithFullyQualifiedTagNames/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithFullyQualifiedTagNames/TestComponent.ir.txt index efc15d0eb4a..bbc474ff069 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithFullyQualifiedTagNames/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithFullyQualifiedTagNames/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [15] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImplicitLambdaEventHandler/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImplicitLambdaEventHandler/TestComponent.ir.txt index a2358e7bbfa..f6f81ced3e7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImplicitLambdaEventHandler/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImplicitLambdaEventHandler/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [43] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImportsFile/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImportsFile/TestComponent.codegen.cs index 7d75b8d4c5c..0827f16f76c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImportsFile/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImportsFile/TestComponent.codegen.cs @@ -9,13 +9,13 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\_Imports.razor" +#line (1,2)-(1,19) "x:\dir\subdir\Test\_Imports.razor" using System.Text #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\_Imports.razor" +#line (2,2)-(2,25) "x:\dir\subdir\Test\_Imports.razor" using System.Reflection #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImportsFile/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImportsFile/TestComponent.ir.txt index 5cfec6ba483..26b4f3be6ed 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImportsFile/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithImportsFile/TestComponent.ir.txt @@ -1,12 +1,12 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [19] x:\dir\subdir\Test\_Imports.razor) - System.Text - UsingDirective - (21:1,1 [25] x:\dir\subdir\Test\_Imports.razor) - System.Reflection + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [17] x:\dir\subdir\Test\_Imports.razor) - System.Text + UsingDirective - (21:1,1 [23] x:\dir\subdir\Test\_Imports.razor) - System.Reflection CSharpCode - (57:2,11 [14] x:\dir\subdir\Test\_Imports.razor) IntermediateToken - (57:2,11 [14] x:\dir\subdir\Test\_Imports.razor) - CSharp - [Serializable] ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithInitOnlyParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithInitOnlyParameter/TestComponent.ir.txt index 314889191c9..c5b4f7a8c86 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithInitOnlyParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithInitOnlyParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [38] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithKey/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithKey/TestComponent.ir.txt index b4d385f3356..c9d63a2dc4a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithKey/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithKey/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithKey_WithChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithKey_WithChildContent/TestComponent.ir.txt index 0ce1f5db707..c55aec3497d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithKey_WithChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithKey_WithChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [96] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.codegen.cs index 7ee70ae99ea..fcde6b49d7b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.codegen.cs @@ -14,7 +14,7 @@ namespace Test #nullable disable ; #nullable restore -#line (1,20)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,20)-(1,57) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components #nullable disable diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.ir.txt index 6f4e30bbb69..97440c057ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks UsingDirective - (1:0,1 [15] x:\dir\subdir\Test\TestComponent.cshtml) - System.IO - UsingDirective - (19:0,19 [39] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components + UsingDirective - (19:0,19 [37] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components UsingDirective - (61:1,3 [24] x:\dir\subdir\Test\TestComponent.cshtml) - System.Reflection ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.mappings.txt index b3d2cd7cab0..fcb4c8fedb9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithMultipleUsingDirectives/TestComponent.mappings.txt @@ -3,15 +3,13 @@ Generated Location: (320:11,0 [15] ) |using System.IO| -Source Location: (19:0,19 [39] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components -| -Generated Location: (446:17,0 [39] ) -|using Microsoft.AspNetCore.Components -| +Source Location: (19:0,19 [37] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components| +Generated Location: (447:17,0 [37] ) +|using Microsoft.AspNetCore.Components| Source Location: (61:1,3 [24] x:\dir\subdir\Test\TestComponent.cshtml) |using System.Reflection;| -Generated Location: (594:23,0 [24] ) +Generated Location: (595:23,0 [24] ) |using System.Reflection;| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.codegen.cs index 87d6f3e0ef5..68a7e858937 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.codegen.cs @@ -16,7 +16,7 @@ namespace using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.ir.txt index 05d4873c230..d86298700e2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - (24:1,11 [11] x:\dir\subdir\Test\TestComponent.cshtml) - AnotherTest - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (39:3,0 [51] x:\dir\subdir\Test\TestComponent.cshtml) - HeaderComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.mappings.txt index 5b73f7ee9a2..b0f4f1ae836 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective/TestComponent.mappings.txt @@ -3,20 +3,18 @@ Generated Location: (146:5,0 [11] ) |AnotherTest| -Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (512:19,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (513:19,0 [10] ) +|using Test| Source Location: (56:3,17 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Header| -Generated Location: (1145:36,0 [6] ) +Generated Location: (1146:36,0 [6] ) |Header| Source Location: (109:5,17 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Footer| -Generated Location: (1573:48,0 [6] ) +Generated Location: (1574:48,0 [6] ) |Footer| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective_WithWhitespace/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective_WithWhitespace/TestComponent.ir.txt index be8b0ec3b52..1fe4c551e55 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective_WithWhitespace/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNamespaceDirective_WithWhitespace/TestComponent.ir.txt @@ -1,9 +1,9 @@ Document - NamespaceDeclaration - (24:0,24 [19] x:\dir\subdir\Test\TestComponent.cshtml) - My.Custom.Namespace - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNullableActionParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNullableActionParameter/TestComponent.ir.txt index 0d13f57696c..62089295d7d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNullableActionParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNullableActionParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithNullableAction diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNullableRenderFragmentParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNullableRenderFragmentParameter/TestComponent.ir.txt index f6a5bc8c736..eb7c2628701 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNullableRenderFragmentParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithNullableRenderFragmentParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [56] x:\dir\subdir\Test\TestComponent.cshtml) - ComponentWithNullableRenderFragment diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithPreserveWhitespaceDirective_False/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithPreserveWhitespaceDirective_False/TestComponent.ir.txt index 5d5f3997cf4..64e09680edf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithPreserveWhitespaceDirective_False/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithPreserveWhitespaceDirective_False/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (29:2,0 [126] x:\dir\subdir\Test\TestComponent.cshtml) - ul diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithPreserveWhitespaceDirective_True/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithPreserveWhitespaceDirective_True/TestComponent.ir.txt index a00102536db..635c1f4bd34 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithPreserveWhitespaceDirective_True/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithPreserveWhitespaceDirective_True/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree HtmlContent - (26:1,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef/TestComponent.ir.txt index cc74c8b1249..859a1e53484 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_Nullable/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_Nullable/TestComponent.ir.txt index c6b64dc104d..7a9931025ab 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_Nullable/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_Nullable/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [36] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_Nullable_Generic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_Nullable_Generic/TestComponent.ir.txt index 7a2f832fe5a..723cfa5ab90 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_Nullable_Generic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_Nullable_Generic/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [50] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_WithChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_WithChildContent/TestComponent.ir.txt index 7cf113bb37c..3b0a1fe1680 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_WithChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithRef_WithChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [97] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat/TestComponent.ir.txt index e1d66fe12b7..826ca39df64 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [92] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_ExplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_ExplicitExpression/TestComponent.ir.txt index 24bd570263e..9db80c0848f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_ExplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_ExplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [95] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_GenericTypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_GenericTypeInference/TestComponent.ir.txt index 8a93dd8131d..2731b61039b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_GenericTypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_GenericTypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [58] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_ImplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_ImplicitExpression/TestComponent.ir.txt index b3cd24ddfc3..c58b061b78f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_ImplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithSplat_ImplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [93] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.codegen.cs index 4bf3deaa117..f413a2dccaa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (3,2)-(4,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (3,2)-(3,13) "x:\dir\subdir\Test\TestComponent.cshtml" using Test2 #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.ir.txt index 68556f0020c..03de83a21dc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (46:2,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) - Test2 + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (46:2,1 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Test2 RouteAttributeExtensionNode - (6:0,6 [9] x:\dir\subdir\Test\TestComponent.cshtml) - "/MyPage" RouteAttributeExtensionNode - (23:1,6 [20] x:\dir\subdir\Test\TestComponent.cshtml) - "/AnotherRoute/{id}" ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.mappings.txt index b66499ac48f..5aa1d95f890 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (46:2,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test2 -| -Generated Location: (371:12,0 [13] ) -|using Test2 -| +Source Location: (46:2,1 [11] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test2| +Generated Location: (372:12,0 [11] ) +|using Test2| Source Location: (6:0,6 [9] x:\dir\subdir\Test\TestComponent.cshtml) |"/MyPage"| -Generated Location: (617:22,0 [9] ) +Generated Location: (618:22,0 [9] ) |"/MyPage"| Source Location: (23:1,6 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"/AnotherRoute/{id}"| -Generated Location: (862:32,0 [20] ) +Generated Location: (863:32,0 [20] ) |"/AnotherRoute/{id}"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.codegen.cs index 443d7d07f20..ff98e010122 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.codegen.cs @@ -9,13 +9,13 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,13) "x:\dir\subdir\Test\TestComponent.cshtml" using Test2 #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,13) "x:\dir\subdir\Test\TestComponent.cshtml" using Test3 #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.ir.txt index 6fd8e1f4de4..3ebd9ea78ca 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.ir.txt @@ -1,12 +1,12 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) - Test2 - UsingDirective - (15:1,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) - Test3 + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Test2 + UsingDirective - (15:1,1 [11] x:\dir\subdir\Test\TestComponent.cshtml) - Test3 ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (28:2,0 [15] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.mappings.txt index c2c2d50c22b..ef93efe911a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithUsingDirectives_AmbiguousImport/TestComponent.mappings.txt @@ -1,14 +1,10 @@ -Source Location: (1:0,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test2 -| -Generated Location: (371:12,0 [13] ) -|using Test2 -| +Source Location: (1:0,1 [11] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test2| +Generated Location: (372:12,0 [11] ) +|using Test2| -Source Location: (15:1,1 [13] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test3 -| -Generated Location: (492:18,0 [13] ) -|using Test3 -| +Source Location: (15:1,1 [11] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test3| +Generated Location: (494:18,0 [11] ) +|using Test3| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithWriteOnlyParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithWriteOnlyParameter/TestComponent.ir.txt index 314889191c9..c5b4f7a8c86 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithWriteOnlyParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Component_WithWriteOnlyParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [38] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DataDashAttribute_ExplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DataDashAttribute_ExplicitExpression/TestComponent.ir.txt index 223d26f5cd9..81ead1578b1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DataDashAttribute_ExplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DataDashAttribute_ExplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [39] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DataDashAttribute_ImplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DataDashAttribute_ImplicitExpression/TestComponent.ir.txt index 1e18a5a1196..e2d9c35f196 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DataDashAttribute_ImplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DataDashAttribute_ImplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [39] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError/TestComponent.ir.txt index 26c4dc7b5ea..8865d50255f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.ir.txt index 8da757d8c42..2fe273f302e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessage/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [59] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.ir.txt index 6cc82be3ae4..82b131cae0e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageChanged/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [70] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.ir.txt index 4bdc0896324..59f250fe1cc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_BindMessageExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_Multiple/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_Multiple/TestComponent.ir.txt index e7edb81fb4f..d082c58cfa9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_Multiple/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_Multiple/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [66] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_WeaklyTyped/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_WeaklyTyped/TestComponent.ir.txt index 2e4d07ffff3..2642fe04f9a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_WeaklyTyped/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateComponentParameters_IsAnError_WeaklyTyped/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [37] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.codegen.cs index b626c9fc58b..a8b1a964ae9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.ir.txt index f82ec5d8a5c..08b9529901b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [69] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.mappings.txt index b2498674710..fb6b7b83ae8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_DifferentCasing_IsAnError_BindValue/TestComponent.mappings.txt @@ -1,20 +1,18 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (91:2,40 [4] x:\dir\subdir\Test\TestComponent.cshtml) |text| -Generated Location: (1199:32,0 [4] ) +Generated Location: (1200:32,0 [4] ) |text| Source Location: (127:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) | private string text = "hi"; | -Generated Location: (1704:46,0 [35] ) +Generated Location: (1705:46,0 [35] ) | private string text = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError/TestComponent.ir.txt index 32184e64440..f9746095644 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [140] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.codegen.cs index ebf67b929ec..44599c30b5f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.ir.txt index 5e64109e192..dd36e9a40c5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [112] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.mappings.txt index c51b9172f3f..e601e9b778d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindOnInput/TestComponent.mappings.txt @@ -1,25 +1,23 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (130:2,79 [8] x:\dir\subdir\Test\TestComponent.cshtml) |() => {}| -Generated Location: (1212:31,0 [8] ) +Generated Location: (1213:31,0 [8] ) |() => {}| Source Location: (86:2,35 [4] x:\dir\subdir\Test\TestComponent.cshtml) |text| -Generated Location: (1486:40,0 [4] ) +Generated Location: (1487:40,0 [4] ) |text| Source Location: (170:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) | private string text = "hi"; | -Generated Location: (1990:54,0 [35] ) +Generated Location: (1991:54,0 [35] ) | private string text = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.codegen.cs index 065997ccd9e..d678a022927 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.ir.txt index 43f5594856b..be8f8842cfc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [69] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.mappings.txt index b2498674710..fb6b7b83ae8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_BindValue/TestComponent.mappings.txt @@ -1,20 +1,18 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (91:2,40 [4] x:\dir\subdir\Test\TestComponent.cshtml) |text| -Generated Location: (1199:32,0 [4] ) +Generated Location: (1200:32,0 [4] ) |text| Source Location: (127:4,12 [35] x:\dir\subdir\Test\TestComponent.cshtml) | private string text = "hi"; | -Generated Location: (1704:46,0 [35] ) +Generated Location: (1705:46,0 [35] ) | private string text = "hi"; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.codegen.cs index 2ec75991a99..c3022adb3cb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.ir.txt index 4d814e6e76f..2cf245c732f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [118] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.mappings.txt index b07711bdf21..7bd2917e27f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_IsAnError_EventHandler/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (83:2,32 [8] x:\dir\subdir\Test\TestComponent.cshtml) |() => {}| -Generated Location: (1216:31,0 [8] ) +Generated Location: (1217:31,0 [8] ) |() => {}| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_Multiple_IsAnError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_Multiple_IsAnError/TestComponent.ir.txt index 6b3ce187171..945536d310b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_Multiple_IsAnError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/DuplicateMarkupAttributes_Multiple_IsAnError/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [145] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Duplicate_RenderMode/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Duplicate_RenderMode/TestComponent.ir.txt index 51091e903a9..10cf2bf19ef 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Duplicate_RenderMode/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Duplicate_RenderMode/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [137] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ElementWithUppercaseTagName_CanHideWarningWithBang/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ElementWithUppercaseTagName_CanHideWarningWithBang/TestComponent.ir.txt index 93939073fe1..e3eeb181e1e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ElementWithUppercaseTagName_CanHideWarningWithBang/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ElementWithUppercaseTagName_CanHideWarningWithBang/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - \n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey/TestComponent.ir.txt index 930e4013f80..96baf0f404d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [84] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey_AndOtherAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey_AndOtherAttributes/TestComponent.ir.txt index 88811516c3f..e38d2551569 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey_AndOtherAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey_AndOtherAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [63] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey_AttributeNameIsCaseSensitive/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey_AttributeNameIsCaseSensitive/TestComponent.ir.txt index 1d6aebc7f90..de6ecdebb67 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey_AttributeNameIsCaseSensitive/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithKey_AttributeNameIsCaseSensitive/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - Hello diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt index d838acff842..dc15719f6e9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt index 54bf4f9e400..bce57bfb9e9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AndOtherAttributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [61] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AttributeNameIsCaseSensitive/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AttributeNameIsCaseSensitive/TestComponent.ir.txt index f3fe1eed1da..ee90d359da1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AttributeNameIsCaseSensitive/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithRef_AttributeNameIsCaseSensitive/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - Hello diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat/TestComponent.ir.txt index e1c211736ff..6d0771b3f40 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [95] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_AttributeNameIsCaseSensitive/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_AttributeNameIsCaseSensitive/TestComponent.ir.txt index 988b7844b51..a490847fe89 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_AttributeNameIsCaseSensitive/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_AttributeNameIsCaseSensitive/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - Hello diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_ExplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_ExplicitExpression/TestComponent.ir.txt index de816f4b527..d959ea9e8a3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_ExplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_ExplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [98] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_ImplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_ImplicitExpression/TestComponent.ir.txt index 2902cebbe38..6b0390c99ef 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_ImplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Element_WithSplat_ImplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [96] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EmptyRootNamespace/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EmptyRootNamespace/TestComponent.ir.txt index 4a3605d3f4d..cc53ebca607 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EmptyRootNamespace/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EmptyRootNamespace/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Generated

\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_Array/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_Array/TestComponent.ir.txt index bbff333197d..744127d1957 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_Array/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_Array/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [38] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_ExplicitType/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_ExplicitType/TestComponent.ir.txt index a12863c8886..cf0a9602275 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_ExplicitType/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_ExplicitType/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_ExplicitType_MethodGroup/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_ExplicitType_MethodGroup/TestComponent.ir.txt index c3c65e67f84..112e3fa713b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_ExplicitType_MethodGroup/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_ExplicitType_MethodGroup/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_MissingTypeParameterBinding_01/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_MissingTypeParameterBinding_01/TestComponent.ir.txt index c6ed1e70ff4..eef4a91f8f9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_MissingTypeParameterBinding_01/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_MissingTypeParameterBinding_01/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [53] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_MissingTypeParameterBinding_02/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_MissingTypeParameterBinding_02/TestComponent.ir.txt index 7edfd038b41..5a699e0ba8f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_MissingTypeParameterBinding_02/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallbackOfT_GenericComponent_MissingTypeParameterBinding_02/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [53] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.codegen.cs index 63b42197108..289a09d4560 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.ir.txt index 04e96e0157e..84267f8a447 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (44:1,0 [89] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.mappings.txt index 3efdbb64800..7d1910dbaa4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Explicitly/TestComponent.mappings.txt @@ -1,18 +1,16 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (57:1,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1027:29,0 [7] ) +Generated Location: (1028:29,0 [7] ) |OnClick| Source Location: (68:1,24 [61] x:\dir\subdir\Test\TestComponent.cshtml) |EventCallback.Factory.Create(this, Increment)| -Generated Location: (1517:37,0 [61] ) +Generated Location: (1518:37,0 [61] ) |EventCallback.Factory.Create(this, Increment)| Source Location: (144:3,7 [87] x:\dir\subdir\Test\TestComponent.cshtml) @@ -22,7 +20,7 @@ Source Location: (144:3,7 [87] x:\dir\subdir\Test\TestComponent.cshtml) counter++; } | -Generated Location: (1818:48,0 [87] ) +Generated Location: (1819:48,0 [87] ) | private int counter; private void Increment() { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_Action/TestComponent.ir.txt index 5bbd5ce54d2..6028a39d895 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.codegen.cs index f50965277d2..575ab3254eb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.ir.txt index 1987da12389..84fb4ad1997 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (44:1,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.mappings.txt index 991030dc414..19271ac76a5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_ActionOfT/TestComponent.mappings.txt @@ -1,18 +1,16 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (57:1,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1027:29,0 [7] ) +Generated Location: (1028:29,0 [7] ) |OnClick| Source Location: (67:1,23 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Increment| -Generated Location: (1517:37,0 [9] ) +Generated Location: (1518:37,0 [9] ) |Increment| Source Location: (90:3,7 [103] x:\dir\subdir\Test\TestComponent.cshtml) @@ -22,7 +20,7 @@ Source Location: (90:3,7 [103] x:\dir\subdir\Test\TestComponent.cshtml) counter++; } | -Generated Location: (1766:48,0 [103] ) +Generated Location: (1767:48,0 [103] ) | private int counter; private void Increment(MouseEventArgs e) { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.codegen.cs index 9c57a1e5ad0..dc8ff6d28fa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.ir.txt index 5df393e5dd2..333a9fe39e5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (44:1,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.mappings.txt index 62195499f65..72e4396017a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTTask/TestComponent.mappings.txt @@ -1,18 +1,16 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (57:1,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1027:29,0 [7] ) +Generated Location: (1028:29,0 [7] ) |OnClick| Source Location: (67:1,23 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Increment| -Generated Location: (1517:37,0 [9] ) +Generated Location: (1518:37,0 [9] ) |Increment| Source Location: (90:3,7 [139] x:\dir\subdir\Test\TestComponent.cshtml) @@ -23,7 +21,7 @@ Source Location: (90:3,7 [139] x:\dir\subdir\Test\TestComponent.cshtml) return Task.CompletedTask; } | -Generated Location: (1767:48,0 [139] ) +Generated Location: (1768:48,0 [139] ) | private int counter; private Task Increment(MouseEventArgs e) { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTask/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTask/TestComponent.ir.txt index 5e31df58a36..282cbe0fa03 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTask/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_FuncOfTask/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.codegen.cs index 1415523be11..098f4fb2fa4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.ir.txt index f694e5a3708..07713d18c8e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (44:1,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.mappings.txt index c7d14769ef2..6df01aa2d11 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallbackOfT_Implicitly_TypeMismatch/TestComponent.mappings.txt @@ -1,18 +1,16 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (57:1,13 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1027:29,0 [7] ) +Generated Location: (1028:29,0 [7] ) |OnClick| Source Location: (67:1,23 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Increment| -Generated Location: (1517:37,0 [9] ) +Generated Location: (1518:37,0 [9] ) |Increment| Source Location: (90:3,7 [104] x:\dir\subdir\Test\TestComponent.cshtml) @@ -22,7 +20,7 @@ Source Location: (90:3,7 [104] x:\dir\subdir\Test\TestComponent.cshtml) counter++; } | -Generated Location: (1766:48,0 [104] ) +Generated Location: (1767:48,0 [104] ) | private int counter; private void Increment(ChangeEventArgs e) { diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Explicitly/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Explicitly/TestComponent.ir.txt index 999bab7ae50..d1f01b99bde 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Explicitly/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Explicitly/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_Action/TestComponent.ir.txt index 5bbd5ce54d2..6028a39d895 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_ActionOfObject/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_ActionOfObject/TestComponent.ir.txt index 2c9bd2e5f4b..d3fcb6e9c87 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_ActionOfObject/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_ActionOfObject/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_FuncOfTask/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_FuncOfTask/TestComponent.ir.txt index 5e31df58a36..282cbe0fa03 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_FuncOfTask/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_FuncOfTask/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_FuncOfobjectTask/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_FuncOfobjectTask/TestComponent.ir.txt index fb12229d91c..a7bc8bd66c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_FuncOfobjectTask/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventCallback_CanPassEventCallback_Implicitly_FuncOfobjectTask/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandlerTagHelper_EscapeQuotes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandlerTagHelper_EscapeQuotes/TestComponent.ir.txt index d7af3a86202..2225131a156 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandlerTagHelper_EscapeQuotes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandlerTagHelper_EscapeQuotes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - \n\n\n

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.codegen.cs index 55b1ce3b3c2..9374aa88682 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.ir.txt index 4f1adc4ea71..a6eb9486270 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.mappings.txt index deb73290f50..4cdc3ac6461 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_AttributeNameIsCaseSensitive/TestComponent.mappings.txt @@ -1,16 +1,14 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (81:2,7 [47] x:\dir\subdir\Test\TestComponent.cshtml) | void OnClick(MouseEventArgs e) { } | -Generated Location: (1002:30,0 [47] ) +Generated Location: (1003:30,0 [47] ) | void OnClick(MouseEventArgs e) { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.codegen.cs index 2de0c52b09d..60a4e1a6951 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.ir.txt index ae9a60e4b8c..e0d13d63e66 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [28] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.mappings.txt index 26aef619f07..f6d55d19f72 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_ArbitraryEventName_WithEventArgsMethodGroup/TestComponent.mappings.txt @@ -1,13 +1,11 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1113:29,0 [7] ) +Generated Location: (1114:29,0 [7] ) |OnClick| Source Location: (81:2,7 [42] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +13,7 @@ Source Location: (81:2,7 [42] x:\dir\subdir\Test\TestComponent.cshtml) void OnClick(EventArgs e) { } | -Generated Location: (1357:40,0 [42] ) +Generated Location: (1358:40,0 [42] ) | void OnClick(EventArgs e) { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.codegen.cs index f52726fac02..63d64f1a660 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.ir.txt index 8b8ff8d49e5..63f507f2e1a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [28] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.mappings.txt index 409fdeb7e72..f5e35456294 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithDelegate/TestComponent.mappings.txt @@ -1,13 +1,11 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1113:29,0 [7] ) +Generated Location: (1114:29,0 [7] ) |OnClick| Source Location: (81:2,7 [47] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +13,7 @@ Source Location: (81:2,7 [47] x:\dir\subdir\Test\TestComponent.cshtml) void OnClick(MouseEventArgs e) { } | -Generated Location: (1357:40,0 [47] ) +Generated Location: (1358:40,0 [47] ) | void OnClick(MouseEventArgs e) { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.codegen.cs index cbb6465dcaf..ca5bf2b9ad8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.ir.txt index 0bc13182a0d..d71fe03871a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.mappings.txt index 4238ba06c59..8e4ca066ad9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsLambdaDelegate/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [8] x:\dir\subdir\Test\TestComponent.cshtml) |x => { }| -Generated Location: (1113:29,0 [8] ) +Generated Location: (1114:29,0 [8] ) |x => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.codegen.cs index f52726fac02..63d64f1a660 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.ir.txt index 8b8ff8d49e5..63f507f2e1a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [28] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.mappings.txt index 409fdeb7e72..f5e35456294 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithEventArgsMethodGroup/TestComponent.mappings.txt @@ -1,13 +1,11 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1113:29,0 [7] ) +Generated Location: (1114:29,0 [7] ) |OnClick| Source Location: (81:2,7 [47] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +13,7 @@ Source Location: (81:2,7 [47] x:\dir\subdir\Test\TestComponent.cshtml) void OnClick(MouseEventArgs e) { } | -Generated Location: (1357:40,0 [47] ) +Generated Location: (1358:40,0 [47] ) | void OnClick(MouseEventArgs e) { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.codegen.cs index cbb6465dcaf..ca5bf2b9ad8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.ir.txt index 0bc13182a0d..d71fe03871a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.mappings.txt index 4238ba06c59..8e4ca066ad9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithLambdaDelegate/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [8] x:\dir\subdir\Test\TestComponent.cshtml) |x => { }| -Generated Location: (1113:29,0 [8] ) +Generated Location: (1114:29,0 [8] ) |x => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.codegen.cs index 973c270fb08..805e7c6aa2c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.ir.txt index 04b61fabd6d..ed3c9a11508 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [28] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.mappings.txt index c451c89ed5a..70ad8ba0712 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgMethodGroup/TestComponent.mappings.txt @@ -1,13 +1,11 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1113:29,0 [7] ) +Generated Location: (1114:29,0 [7] ) |OnClick| Source Location: (81:2,7 [31] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +13,7 @@ Source Location: (81:2,7 [31] x:\dir\subdir\Test\TestComponent.cshtml) void OnClick() { } | -Generated Location: (1357:40,0 [31] ) +Generated Location: (1358:40,0 [31] ) | void OnClick() { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.codegen.cs index d1facaba325..2654c0b9754 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.ir.txt index 077c52f4feb..06f5e24033a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [30] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.mappings.txt index fa54baecabf..1e21b2fef9b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithNoArgsLambdaDelegate/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1113:29,0 [9] ) +Generated Location: (1114:29,0 [9] ) |() => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.codegen.cs index 3ab26b2ca43..17e15904060 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.ir.txt index 27585636bc1..527d197b76c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.mappings.txt index e6ab1ebd8ce..13564ccf2a7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithString/TestComponent.mappings.txt @@ -1,7 +1,5 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.codegen.cs index b2eb4af0927..03e681bf49d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.ir.txt index 6b1e33e064e..7829f3c86ea 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [43] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.mappings.txt index 16c8881db72..bd073b02141 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_OnElement_WithoutCloseTag/TestComponent.mappings.txt @@ -1,13 +1,11 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (70:2,19 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnClick| -Generated Location: (1159:30,0 [7] ) +Generated Location: (1160:30,0 [7] ) |OnClick| Source Location: (96:4,7 [31] x:\dir\subdir\Test\TestComponent.cshtml) @@ -15,7 +13,7 @@ Source Location: (96:4,7 [31] x:\dir\subdir\Test\TestComponent.cshtml) void OnClick() { } | -Generated Location: (1442:42,0 [31] ) +Generated Location: (1443:42,0 [31] ) | void OnClick() { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.codegen.cs index 28188a3ae9c..e460bfe1fbf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.ir.txt index eb7be0415f6..6da274eb0b0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.mappings.txt index 282e60247a1..7818d058575 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_Duplicates/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (76:1,32 [4] x:\dir\subdir\Test\TestComponent.cshtml) |true| -Generated Location: (997:29,0 [4] ) +Generated Location: (998:29,0 [4] ) |true| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.codegen.cs index f054eab9b57..31a8444a77b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.ir.txt index a0365c18913..924ed3f76b7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [149] x:\dir\subdir\Test\TestComponent.cshtml) - button diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.mappings.txt index 09204452d34..4442bbd5751 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation/TestComponent.mappings.txt @@ -1,35 +1,33 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (62:1,18 [17] x:\dir\subdir\Test\TestComponent.cshtml) |() => Foo = false| -Generated Location: (1114:29,0 [17] ) +Generated Location: (1115:29,0 [17] ) |() => Foo = false| Source Location: (106:1,62 [4] x:\dir\subdir\Test\TestComponent.cshtml) |true| -Generated Location: (1352:38,0 [4] ) +Generated Location: (1353:38,0 [4] ) |true| Source Location: (138:1,94 [3] x:\dir\subdir\Test\TestComponent.cshtml) |Foo| -Generated Location: (1577:47,0 [3] ) +Generated Location: (1578:47,0 [3] ) |Foo| Source Location: (169:1,125 [5] x:\dir\subdir\Test\TestComponent.cshtml) |false| -Generated Location: (1803:56,0 [5] ) +Generated Location: (1804:56,0 [5] ) |false| Source Location: (202:2,7 [30] x:\dir\subdir\Test\TestComponent.cshtml) | bool Foo { get; set; } | -Generated Location: (2094:68,0 [30] ) +Generated Location: (2095:68,0 [30] ) | bool Foo { get; set; } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.codegen.cs index 0130f584e43..eab0bba670b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.ir.txt index 90d1db4a229..f73c97443da 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [74] x:\dir\subdir\Test\TestComponent.cshtml) - button diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.mappings.txt index e6ab1ebd8ce..13564ccf2a7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_PreventDefault_StopPropagation_Minimized/TestComponent.mappings.txt @@ -1,7 +1,5 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.codegen.cs index 3cc51b61f48..8f2d01154e4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.ir.txt index d7c402f71dc..de173e649f3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - input diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.mappings.txt index 031e54d325d..8e7f0449798 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/EventHandler_WithDelegate_PreventDefault/TestComponent.mappings.txt @@ -1,18 +1,16 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [7] x:\dir\subdir\Test\TestComponent.cshtml) |OnFocus| -Generated Location: (1113:29,0 [7] ) +Generated Location: (1114:29,0 [7] ) |OnFocus| Source Location: (95:1,51 [22] x:\dir\subdir\Test\TestComponent.cshtml) |ShouldPreventDefault()| -Generated Location: (1341:38,0 [22] ) +Generated Location: (1342:38,0 [22] ) |ShouldPreventDefault()| Source Location: (130:2,7 [95] x:\dir\subdir\Test\TestComponent.cshtml) @@ -21,7 +19,7 @@ Source Location: (130:2,7 [95] x:\dir\subdir\Test\TestComponent.cshtml) bool ShouldPreventDefault() { return false; } | -Generated Location: (1599:49,0 [95] ) +Generated Location: (1600:49,0 [95] ) | void OnFocus(FocusEventArgs e) { } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.codegen.cs index b9dbdc996f6..9b8aab360a7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.ir.txt index 85af5453fcb..6ddcc41fb64 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.mappings.txt index b7a47ebe32f..46356451c32 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpError/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (98:1,54 [1] x:\dir\subdir\Test\TestComponent.cshtml) |x| -Generated Location: (1421:39,0 [1] ) +Generated Location: (1422:39,0 [1] ) |x| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.codegen.cs index b6937d98a48..15387a0fe31 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.ir.txt index 6e2bad691aa..1f7dff620e8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [85] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.mappings.txt index dc9d902f687..113aeb5f93d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (99:1,55 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (1421:39,0 [20] ) +Generated Location: (1422:39,0 [20] ) |"named-form-handler"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.codegen.cs index 7e0938546bf..54e590f0c49 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.ir.txt index b7ed00faa72..24c9a8637be 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.mappings.txt index 4824bd261ea..f924c4dd928 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_CSharpValue_Integer/TestComponent.mappings.txt @@ -1,25 +1,23 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (98:1,54 [1] x:\dir\subdir\Test\TestComponent.cshtml) |x| -Generated Location: (1421:39,0 [1] ) +Generated Location: (1422:39,0 [1] ) |x| Source Location: (117:2,7 [18] x:\dir\subdir\Test\TestComponent.cshtml) | int x = 1; | -Generated Location: (1720:51,0 [18] ) +Generated Location: (1721:51,0 [18] ) | int x = 1; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.codegen.cs index d846ed35626..350bdebc173 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.ir.txt index 2843af86f18..22aac6a753a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.mappings.txt index 20613b9c3ca..73e24e43601 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_ChildContent/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (92:2,8 [12] x:\dir\subdir\Test\TestComponent.cshtml) |DateTime.Now| -Generated Location: (1260:33,0 [12] ) +Generated Location: (1261:33,0 [12] ) |DateTime.Now| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.codegen.cs index 0c21ccd2cf8..bfe244cc8e1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.ir.txt index 55a6a781e84..343e3ec78d3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (44:1,0 [84] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.mappings.txt index c8e27f7f553..3c790d8a06b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component/TestComponent.mappings.txt @@ -1,22 +1,20 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (84:1,40 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1177:30,0 [9] ) +Generated Location: (1178:30,0 [9] ) |() => { }| Source Location: (170:2,40 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1812:44,0 [9] ) +Generated Location: (1813:44,0 [9] ) |() => { }| Source Location: (194:2,64 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (2034:53,0 [20] ) +Generated Location: (2035:53,0 [20] ) |"named-form-handler"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.codegen.cs index f5de853a13c..a9436c2a2f2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.ir.txt index ff6a36bf307..6211c90e630 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - T MethodDeclaration - - protected override - void - BuildRenderTree Component - (58:2,0 [98] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.mappings.txt index 5497447eab9..6d5586c9148 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic/TestComponent.mappings.txt @@ -1,56 +1,54 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (55:1,11 [1] x:\dir\subdir\Test\TestComponent.cshtml) |T| -Generated Location: (617:22,0 [1] ) +Generated Location: (618:22,0 [1] ) |T| Source Location: (98:2,40 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1237:36,0 [9] ) +Generated Location: (1238:36,0 [9] ) |() => { }| Source Location: (151:2,93 [1] x:\dir\subdir\Test\TestComponent.cshtml) |1| -Generated Location: (1425:44,0 [1] ) +Generated Location: (1426:44,0 [1] ) |1| Source Location: (198:3,40 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1843:54,0 [9] ) +Generated Location: (1844:54,0 [9] ) |() => { }| Source Location: (222:3,64 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (2006:62,0 [20] ) +Generated Location: (2007:62,0 [20] ) |"named-form-handler"| Source Location: (256:3,98 [1] x:\dir\subdir\Test\TestComponent.cshtml) |2| -Generated Location: (2181:70,0 [1] ) +Generated Location: (2182:70,0 [1] ) |2| Source Location: (270:4,7 [52] x:\dir\subdir\Test\TestComponent.cshtml) | [Parameter] public T Parameter { get; set; } | -Generated Location: (2379:80,0 [52] ) +Generated Location: (2380:80,0 [52] ) | [Parameter] public T Parameter { get; set; } | Source Location: (140:2,82 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Parameter| -Generated Location: (3349:103,0 [9] ) +Generated Location: (3350:103,0 [9] ) |Parameter| Source Location: (245:3,87 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Parameter| -Generated Location: (4227:120,0 [9] ) +Generated Location: (4228:120,0 [9] ) |Parameter| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.codegen.cs index 09fba466270..7942b809db4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.ir.txt index 3534b354796..aa36314d1a0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - T MethodDeclaration - - protected override - void - BuildRenderTree Component - (58:2,0 [98] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.mappings.txt index 86d9ee1083d..a38f5e10744 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_Generic_RazorLangVersion7/TestComponent.mappings.txt @@ -1,56 +1,54 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (55:1,11 [1] x:\dir\subdir\Test\TestComponent.cshtml) |T| -Generated Location: (617:22,0 [1] ) +Generated Location: (618:22,0 [1] ) |T| Source Location: (98:2,40 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1237:36,0 [9] ) +Generated Location: (1238:36,0 [9] ) |() => { }| Source Location: (151:2,93 [1] x:\dir\subdir\Test\TestComponent.cshtml) |1| -Generated Location: (1425:44,0 [1] ) +Generated Location: (1426:44,0 [1] ) |1| Source Location: (198:3,40 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1843:54,0 [9] ) +Generated Location: (1844:54,0 [9] ) |() => { }| Source Location: (222:3,64 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (2006:62,0 [20] ) +Generated Location: (2007:62,0 [20] ) |"named-form-handler"| Source Location: (256:3,98 [1] x:\dir\subdir\Test\TestComponent.cshtml) |2| -Generated Location: (2181:70,0 [1] ) +Generated Location: (2182:70,0 [1] ) |2| Source Location: (270:4,7 [52] x:\dir\subdir\Test\TestComponent.cshtml) | [Parameter] public T Parameter { get; set; } | -Generated Location: (2379:80,0 [52] ) +Generated Location: (2380:80,0 [52] ) | [Parameter] public T Parameter { get; set; } | Source Location: (140:2,82 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Parameter| -Generated Location: (3337:103,0 [9] ) +Generated Location: (3338:103,0 [9] ) |Parameter| Source Location: (245:3,87 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Parameter| -Generated Location: (4211:120,0 [9] ) +Generated Location: (4212:120,0 [9] ) |Parameter| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.codegen.cs index a04ee0ee35c..6ef3965ff99 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.ir.txt index b7438da1355..800e0351800 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (44:1,0 [84] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.mappings.txt index c9d1447fb9e..d2c7d6ed4ff 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Component_RazorLangVersion7/TestComponent.mappings.txt @@ -1,22 +1,20 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (84:1,40 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1178:30,0 [9] ) +Generated Location: (1179:30,0 [9] ) |() => { }| Source Location: (170:2,40 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1816:44,0 [9] ) +Generated Location: (1817:44,0 [9] ) |() => { }| Source Location: (194:2,64 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (2039:53,0 [20] ) +Generated Location: (2040:53,0 [20] ) |"named-form-handler"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.codegen.cs index 1394d1337bf..21cbbbb3b74 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.ir.txt index 16b89138864..f5f755c437c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [79] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.mappings.txt index b9b7227f467..18801c26d93 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_CSharpValue/TestComponent.mappings.txt @@ -1,23 +1,21 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (98:1,54 [1] x:\dir\subdir\Test\TestComponent.cshtml) |x| -Generated Location: (1421:39,0 [1] ) +Generated Location: (1422:39,0 [1] ) |x| Source Location: (113:1,69 [1] x:\dir\subdir\Test\TestComponent.cshtml) |y| -Generated Location: (1610:48,0 [1] ) +Generated Location: (1611:48,0 [1] ) |y| Source Location: (132:2,7 [44] x:\dir\subdir\Test\TestComponent.cshtml) @@ -25,7 +23,7 @@ Source Location: (132:2,7 [44] x:\dir\subdir\Test\TestComponent.cshtml) string x = "a"; string y = "b"; | -Generated Location: (1962:61,0 [44] ) +Generated Location: (1963:61,0 [44] ) | string x = "a"; string y = "b"; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.codegen.cs index c23e32955f0..a6d12d5e6c2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.ir.txt index ca5bd516cbf..d0ae9efb4b4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [77] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.mappings.txt index f38a26e5f4a..c1444e4040c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Duplicate_HtmlValue/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.codegen.cs index e04689f1002..30586d03849 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.ir.txt index df5313cee0e..e00331050e2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [70] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.mappings.txt index c78cd79cba6..22f94a2c94d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_FakeSubmit/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (161:2,45 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (1627:38,0 [20] ) +Generated Location: (1628:38,0 [20] ) |"named-form-handler"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.codegen.cs index c8e303fbcf8..9cace2b985d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.ir.txt index 38b3831605c..563005d2a0e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.mappings.txt index f38a26e5f4a..c1444e4040c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_HtmlValue/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.codegen.cs index ff292d60eec..dd358638148 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.ir.txt index e3af0c539a6..c3fc55cf612 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [58] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.mappings.txt index 7c7faa7642a..0e4637829b0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingSubmit/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (137:2,33 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (1515:36,0 [20] ) +Generated Location: (1516:36,0 [20] ) |"named-form-handler"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingUsing/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingUsing/TestComponent.ir.txt index 8883bb27c7a..89285835c29 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingUsing/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MissingUsing/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.codegen.cs index c59d55ae90b..50ead83a682 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.ir.txt index a6471699533..3dca59b5ef2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [87] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.mappings.txt index 2067785597c..926948493eb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MixedValue/TestComponent.mappings.txt @@ -1,30 +1,28 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (105:1,61 [9] x:\dir\subdir\Test\TestComponent.cshtml) |"literal"| -Generated Location: (1438:39,0 [9] ) +Generated Location: (1439:39,0 [9] ) |"literal"| Source Location: (117:1,73 [1] x:\dir\subdir\Test\TestComponent.cshtml) |x| -Generated Location: (1606:47,0 [1] ) +Generated Location: (1607:47,0 [1] ) |x| Source Location: (140:2,7 [18] x:\dir\subdir\Test\TestComponent.cshtml) | int x = 1; | -Generated Location: (1915:59,0 [18] ) +Generated Location: (1916:59,0 [18] ) | int x = 1; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.codegen.cs index 3eb8a649040..4fa757d0ba4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.ir.txt index bd7c6b53b9c..d3c044995d5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [64] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.mappings.txt index 6094737c395..9fbccb4b9eb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_CSharpValue/TestComponent.mappings.txt @@ -1,28 +1,26 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (98:1,54 [1] x:\dir\subdir\Test\TestComponent.cshtml) |x| -Generated Location: (1421:39,0 [1] ) +Generated Location: (1422:39,0 [1] ) |x| Source Location: (141:2,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1983:53,0 [9] ) +Generated Location: (1984:53,0 [9] ) |() => { }| Source Location: (164:2,54 [1] x:\dir\subdir\Test\TestComponent.cshtml) |y| -Generated Location: (2270:62,0 [1] ) +Generated Location: (2271:62,0 [1] ) |y| Source Location: (183:3,7 [44] x:\dir\subdir\Test\TestComponent.cshtml) @@ -30,7 +28,7 @@ Source Location: (183:3,7 [44] x:\dir\subdir\Test\TestComponent.cshtml) string x = "a"; string y = "b"; | -Generated Location: (2572:74,0 [44] ) +Generated Location: (2573:74,0 [44] ) | string x = "a"; string y = "b"; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.codegen.cs index 6d32c156979..e5a2f0966fe 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.ir.txt index dc4986f5335..4b8d406b3df 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [63] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.mappings.txt index dedbfb69bac..c57abf29d64 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_MoreElements_HtmlValue/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (140:2,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1837:45,0 [9] ) +Generated Location: (1838:45,0 [9] ) |() => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.codegen.cs index 32f9d08292f..afc73dccaf5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.ir.txt index b93d59d4ff5..347ce7db068 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [63] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.mappings.txt index 084e8985ff3..5e60bf20018 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nested/TestComponent.mappings.txt @@ -1,35 +1,33 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (161:3,35 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (2051:47,0 [9] ) +Generated Location: (2052:47,0 [9] ) |() => { }| Source Location: (255:5,39 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (3025:64,0 [9] ) +Generated Location: (3026:64,0 [9] ) |() => { }| Source Location: (346:7,35 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (3879:82,0 [9] ) +Generated Location: (3880:82,0 [9] ) |() => { }| Source Location: (405:9,7 [68] x:\dir\subdir\Test\TestComponent.cshtml) | [Parameter] public RenderFragment ChildContent { get; set; } | -Generated Location: (4415:98,0 [68] ) +Generated Location: (4416:98,0 [68] ) | [Parameter] public RenderFragment ChildContent { get; set; } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.codegen.cs index 056e185a82c..5c63f518cd7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.ir.txt index c2c3c057330..0f9e37732ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.mappings.txt index f38a26e5f4a..c1444e4040c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NoAddNamedEventMethod/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.codegen.cs index 410b63e7221..0da70487c7d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.ir.txt index c35da36ae59..e397e41f6e1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [78] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.mappings.txt index 0a35e9bbcda..5aeae473958 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm/TestComponent.mappings.txt @@ -1,22 +1,20 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (74:1,30 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1136:30,0 [9] ) +Generated Location: (1137:30,0 [9] ) |() => { }| Source Location: (154:2,30 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1719:44,0 [9] ) +Generated Location: (1720:44,0 [9] ) |() => { }| Source Location: (178:2,54 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (1932:53,0 [20] ) +Generated Location: (1933:53,0 [20] ) |"named-form-handler"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.codegen.cs index 410b63e7221..0da70487c7d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.ir.txt index d5fbb68dc52..0e249fdf4b3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [78] x:\dir\subdir\Test\TestComponent.cshtml) - div diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.mappings.txt index 0a35e9bbcda..5aeae473958 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_NotAForm_RazorLangVersion7/TestComponent.mappings.txt @@ -1,22 +1,20 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (74:1,30 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1136:30,0 [9] ) +Generated Location: (1137:30,0 [9] ) |() => { }| Source Location: (154:2,30 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1719:44,0 [9] ) +Generated Location: (1720:44,0 [9] ) |() => { }| Source Location: (178:2,54 [20] x:\dir\subdir\Test\TestComponent.cshtml) |"named-form-handler"| -Generated Location: (1932:53,0 [20] ) +Generated Location: (1933:53,0 [20] ) |"named-form-handler"| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.codegen.cs index fe40d681711..fb3bf0e9b7d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.ir.txt index d37435c9f67..41eaf5c892f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [67] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.mappings.txt index a3e84b3ca1d..d803d5eda6a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_Nullability/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| Source Location: (98:1,54 [4] x:\dir\subdir\Test\TestComponent.cshtml) |null| -Generated Location: (1421:39,0 [4] ) +Generated Location: (1422:39,0 [4] ) |null| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.codegen.cs index a6645bd5c9b..2c0e3cd64db 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.ir.txt index e29eb45ed7d..72e1ba9b26f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [66] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.mappings.txt index f38a26e5f4a..c1444e4040c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorError/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.codegen.cs index 056e185a82c..5c63f518cd7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.ir.txt index c2c3c057330..0f9e37732ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [80] x:\dir\subdir\Test\TestComponent.cshtml) - form diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.mappings.txt index f38a26e5f4a..c1444e4040c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/FormName_RazorLangVersion7/TestComponent.mappings.txt @@ -1,12 +1,10 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (75:1,31 [9] x:\dir\subdir\Test\TestComponent.cshtml) |() => { }| -Generated Location: (1137:30,0 [9] ) +Generated Location: (1138:30,0 [9] ) |() => { }| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.ir.txt index cad22057c40..c4eac3c3314 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (19:1,0 [91] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.ir.txt index e40170ab938..a624d16b25e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (19:1,0 [91] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.ir.txt index 1cf7c37f911..cde4a635bcb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (19:1,0 [91] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.ir.txt index b4243af5984..281d9b55049 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (19:1,0 [88] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithAfter_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithAfter_Action/TestComponent.ir.txt index 916f2987f27..4791eff3e8a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithAfter_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithAfter_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (19:1,0 [72] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_Action/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_Action/TestComponent.ir.txt index 36d70733980..57bc10f75c9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_Action/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_Action/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (19:1,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_EventCallback/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_EventCallback/TestComponent.ir.txt index 16ee8f34b79..3ff1f67544c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_EventCallback/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_EventCallback/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (19:1,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_Function/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_Function/TestComponent.ir.txt index c88f474f6d4..a9df6d46a72 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_Function/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_InferredType_WithGetSet_Function/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TParam MethodDeclaration - - protected override - void - BuildRenderTree Component - (19:1,0 [75] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.codegen.cs index 03218524b7c..742b6921f7f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.ir.txt index da89a3f4ebf..38f248a7a9c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (20:1,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (20:1,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TChild MethodDeclaration - - protected override - void - BuildRenderTree Component - (32:2,0 [57] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.mappings.txt index a286fd67250..79831b701e7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeExplicit/TestComponent.mappings.txt @@ -1,22 +1,20 @@ -Source Location: (20:1,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (371:12,0 [12] ) -|using Test -| +Source Location: (20:1,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (372:12,0 [10] ) +|using Test| Source Location: (11:0,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TChild| -Generated Location: (586:22,0 [6] ) +Generated Location: (587:22,0 [6] ) |TChild| Source Location: (60:2,28 [7] x:\dir\subdir\Test\TestComponent.cshtml) |MyEvent| -Generated Location: (1160:37,0 [7] ) +Generated Location: (1161:37,0 [7] ) |MyEvent| Source Location: (69:2,37 [16] x:\dir\subdir\Test\TestComponent.cshtml) |(TChild x) => {}| -Generated Location: (1546:45,0 [16] ) +Generated Location: (1547:45,0 [16] ) |(TChild x) => {}| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.codegen.cs index c205d82ae7c..6e09653962b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.ir.txt index c597f521f4e..954cdf63b6b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (20:1,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (20:1,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TChild MethodDeclaration - - protected override - void - BuildRenderTree Component - (32:2,0 [55] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.mappings.txt index a1f08fac985..ab3b9631767 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_NestedTypeInference/TestComponent.mappings.txt @@ -1,23 +1,21 @@ -Source Location: (20:1,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (371:12,0 [12] ) -|using Test -| +Source Location: (20:1,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (372:12,0 [10] ) +|using Test| Source Location: (11:0,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) |TChild| -Generated Location: (586:22,0 [6] ) +Generated Location: (587:22,0 [6] ) |TChild| Source Location: (51:2,19 [9] x:\dir\subdir\Test\TestComponent.cshtml) |ChildItem| -Generated Location: (1097:36,0 [9] ) +Generated Location: (1098:36,0 [9] ) |ChildItem| Source Location: (71:2,39 [12] x:\dir\subdir\Test\TestComponent.cshtml) |MyChildEvent| -Generated Location: (1334:44,0 [12] ) +Generated Location: (1335:44,0 [12] ) |MyChildEvent| Source Location: (97:4,1 [138] x:\dir\subdir\Test\TestComponent.cshtml) @@ -25,7 +23,7 @@ Source Location: (97:4,1 [138] x:\dir\subdir\Test\TestComponent.cshtml) [Parameter] public TChild ChildItem { get; set; } [Parameter] public EventCallback MyChildEvent { get; set; } | -Generated Location: (1544:54,0 [138] ) +Generated Location: (1545:54,0 [138] ) | [Parameter] public TChild ChildItem { get; set; } [Parameter] public EventCallback MyChildEvent { get; set; } @@ -33,11 +31,11 @@ Generated Location: (1544:54,0 [138] ) Source Location: (45:2,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) |Item| -Generated Location: (2356:75,0 [4] ) +Generated Location: (2357:75,0 [4] ) |Item| Source Location: (62:2,30 [7] x:\dir\subdir\Test\TestComponent.cshtml) |MyEvent| -Generated Location: (2604:84,0 [7] ) +Generated Location: (2605:84,0 [7] ) |MyEvent| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.codegen.cs index 7ff8a891f84..0ab58f5a3ff 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.ir.txt index a921ea751d8..d4e06476b82 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [48] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.mappings.txt index 3b1a27e4619..437f54bf89d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithGenericTypeParameter_TypeInference/TestComponent.mappings.txt @@ -1,27 +1,25 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (371:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (372:12,0 [10] ) +|using Test| Source Location: (32:1,19 [1] x:\dir\subdir\Test\TestComponent.cshtml) |3| -Generated Location: (949:28,0 [1] ) +Generated Location: (950:28,0 [1] ) |3| Source Location: (44:1,31 [13] x:\dir\subdir\Test\TestComponent.cshtml) |(int x) => {}| -Generated Location: (1178:36,0 [13] ) +Generated Location: (1179:36,0 [13] ) |(int x) => {}| Source Location: (26:1,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) |Item| -Generated Location: (1931:57,0 [4] ) +Generated Location: (1932:57,0 [4] ) |Item| Source Location: (35:1,22 [7] x:\dir\subdir\Test\TestComponent.cshtml) |MyEvent| -Generated Location: (2179:66,0 [7] ) +Generated Location: (2180:66,0 [7] ) |MyEvent| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.codegen.cs index 8884b3c8df2..dbba6acc103 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.codegen.cs @@ -8,13 +8,13 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #nullable disable ; #nullable restore -#line (2,2)-(3,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (2,2)-(2,34) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Collections.Generic #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.ir.txt index d36e6eae583..b93c07b6c16 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test - UsingDirective - (14:1,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) - System.Collections.Generic + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (14:1,1 [32] x:\dir\subdir\Test\TestComponent.cshtml) - System.Collections.Generic ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (48:2,0 [61] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.mappings.txt index 71a8ada88f0..dfa77e68b18 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallbackWithNestedGenericTypeParameter_TypeInference/TestComponent.mappings.txt @@ -1,34 +1,30 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (324:11,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (325:11,0 [10] ) +|using Test| -Source Location: (14:1,1 [34] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Collections.Generic -| -Generated Location: (444:17,0 [34] ) -|using System.Collections.Generic -| +Source Location: (14:1,1 [32] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Collections.Generic| +Generated Location: (446:17,0 [32] ) +|using System.Collections.Generic| Source Location: (67:2,19 [1] x:\dir\subdir\Test\TestComponent.cshtml) |3| -Generated Location: (1044:33,0 [1] ) +Generated Location: (1046:33,0 [1] ) |3| Source Location: (79:2,31 [26] x:\dir\subdir\Test\TestComponent.cshtml) |(IEnumerable x) => {}| -Generated Location: (1273:41,0 [26] ) +Generated Location: (1275:41,0 [26] ) |(IEnumerable x) => {}| Source Location: (61:2,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) |Item| -Generated Location: (2087:62,0 [4] ) +Generated Location: (2089:62,0 [4] ) |Item| Source Location: (70:2,22 [7] x:\dir\subdir\Test\TestComponent.cshtml) |MyEvent| -Generated Location: (2335:71,0 [7] ) +Generated Location: (2337:71,0 [7] ) |MyEvent| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.codegen.cs index 10f4b66976e..099ce735013 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.ir.txt index a888ef315c2..0860486a80a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [42] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.mappings.txt index fd318b297ef..8f0d1ccb635 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_GenericEventCallback_TypeInference/TestComponent.mappings.txt @@ -1,27 +1,25 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (371:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (372:12,0 [10] ) +|using Test| Source Location: (32:1,19 [1] x:\dir\subdir\Test\TestComponent.cshtml) |3| -Generated Location: (949:28,0 [1] ) +Generated Location: (950:28,0 [1] ) |3| Source Location: (44:1,31 [7] x:\dir\subdir\Test\TestComponent.cshtml) |x => {}| -Generated Location: (1204:36,0 [7] ) +Generated Location: (1205:36,0 [7] ) |x => {}| Source Location: (26:1,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) |Item| -Generated Location: (1970:57,0 [4] ) +Generated Location: (1971:57,0 [4] ) |Item| Source Location: (35:1,22 [7] x:\dir\subdir\Test\TestComponent.cshtml) |MyEvent| -Generated Location: (2218:66,0 [7] ) +Generated Location: (2219:66,0 [7] ) |MyEvent| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.codegen.cs index 4bfb77509b9..b38150d1712 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.ir.txt index a888ef315c2..0860486a80a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [42] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.mappings.txt index 26a914cccab..6ba6fde0b89 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NestedGenericEventCallback_TypeInference/TestComponent.mappings.txt @@ -1,27 +1,25 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (371:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (372:12,0 [10] ) +|using Test| Source Location: (32:1,19 [1] x:\dir\subdir\Test\TestComponent.cshtml) |3| -Generated Location: (949:28,0 [1] ) +Generated Location: (950:28,0 [1] ) |3| Source Location: (44:1,31 [7] x:\dir\subdir\Test\TestComponent.cshtml) |x => {}| -Generated Location: (1293:36,0 [7] ) +Generated Location: (1294:36,0 [7] ) |x => {}| Source Location: (26:1,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) |Item| -Generated Location: (2172:57,0 [4] ) +Generated Location: (2173:57,0 [4] ) |Item| Source Location: (35:1,22 [7] x:\dir\subdir\Test\TestComponent.cshtml) |MyEvent| -Generated Location: (2420:66,0 [7] ) +Generated Location: (2421:66,0 [7] ) |MyEvent| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.codegen.cs index 9d0c8c4330a..a5f05ffdd7e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.ir.txt index a888ef315c2..0860486a80a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [42] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.mappings.txt index 3f366b510a5..8ad25ccaec9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericEventCallback_TypeInference/TestComponent.mappings.txt @@ -1,27 +1,25 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (371:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (372:12,0 [10] ) +|using Test| Source Location: (32:1,19 [1] x:\dir\subdir\Test\TestComponent.cshtml) |3| -Generated Location: (949:28,0 [1] ) +Generated Location: (950:28,0 [1] ) |3| Source Location: (44:1,31 [7] x:\dir\subdir\Test\TestComponent.cshtml) |x => {}| -Generated Location: (1178:36,0 [7] ) +Generated Location: (1179:36,0 [7] ) |x => {}| Source Location: (26:1,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) |Item| -Generated Location: (1918:57,0 [4] ) +Generated Location: (1919:57,0 [4] ) |Item| Source Location: (35:1,22 [7] x:\dir\subdir\Test\TestComponent.cshtml) |MyEvent| -Generated Location: (2166:66,0 [7] ) +Generated Location: (2167:66,0 [7] ) |MyEvent| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.codegen.cs index cfb21834379..411dd9c6502 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,19) "x:\dir\subdir\Test\TestComponent.cshtml" using Test.Shared #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.ir.txt index ec5db752105..b60fd84557d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [19] x:\dir\subdir\Test\TestComponent.cshtml) - Test.Shared + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [17] x:\dir\subdir\Test\TestComponent.cshtml) - Test.Shared ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (20:1,0 [37] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.mappings.txt index 198fb7aa76b..f7a4a7509e2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonGenericParameter_TypeInference/TestComponent.mappings.txt @@ -1,36 +1,34 @@ -Source Location: (1:0,1 [19] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test.Shared -| -Generated Location: (371:12,0 [19] ) -|using Test.Shared -| +Source Location: (1:0,1 [17] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test.Shared| +Generated Location: (372:12,0 [17] ) +|using Test.Shared| Source Location: (39:1,19 [1] x:\dir\subdir\Test\TestComponent.cshtml) |3| -Generated Location: (956:28,0 [1] ) +Generated Location: (957:28,0 [1] ) |3| Source Location: (48:1,28 [5] x:\dir\subdir\Test\TestComponent.cshtml) |Hello| -Generated Location: (1110:36,0 [5] ) +Generated Location: (1111:36,0 [5] ) |Hello| Source Location: (68:3,7 [38] x:\dir\subdir\Test\TestComponent.cshtml) | MyClass Hello = new MyClass(); | -Generated Location: (1312:46,0 [38] ) +Generated Location: (1313:46,0 [38] ) | MyClass Hello = new MyClass(); | Source Location: (33:1,13 [4] x:\dir\subdir\Test\TestComponent.cshtml) |Item| -Generated Location: (1991:66,0 [4] ) +Generated Location: (1992:66,0 [4] ) |Item| Source Location: (42:1,22 [3] x:\dir\subdir\Test\TestComponent.cshtml) |Foo| -Generated Location: (2239:75,0 [3] ) +Generated Location: (2240:75,0 [3] ) |Foo| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonPrimitiveType/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonPrimitiveType/TestComponent.ir.txt index 2fb72527da8..5052900e952 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonPrimitiveType/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonPrimitiveType/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [57] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonPrimitiveTypeRenderFragment/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonPrimitiveTypeRenderFragment/TestComponent.ir.txt index 762e1d73c59..e0d0f272f9c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonPrimitiveTypeRenderFragment/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_NonPrimitiveTypeRenderFragment/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [70] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_TypeParameterOrdering/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_TypeParameterOrdering/TestComponent.ir.txt index f0856c917f3..0eadb7cc352 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_TypeParameterOrdering/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_TypeParameterOrdering/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [89] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.codegen.cs index 679657cbbd5..cb397d7632e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,12) "x:\dir\subdir\Test\TestComponent.cshtml" using Test #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.ir.txt index fd07903c47e..56597ccba0e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) - Test ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (13:1,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.mappings.txt index 59f05ea2ea0..981419865f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_UnmanagedConstraint/TestComponent.mappings.txt @@ -1,17 +1,15 @@ -Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) -|using Test -| -Generated Location: (371:12,0 [12] ) -|using Test -| +Source Location: (1:0,1 [10] x:\dir\subdir\Test\TestComponent.cshtml) +|using Test| +Generated Location: (372:12,0 [10] ) +|using Test| Source Location: (37:1,24 [1] x:\dir\subdir\Test\TestComponent.cshtml) |1| -Generated Location: (949:28,0 [1] ) +Generated Location: (950:28,0 [1] ) |1| Source Location: (26:1,13 [9] x:\dir\subdir\Test\TestComponent.cshtml) |Parameter| -Generated Location: (1625:50,0 [9] ) +Generated Location: (1626:50,0 [9] ) |Parameter| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithComponentRef_CreatesDiagnostic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithComponentRef_CreatesDiagnostic/TestComponent.ir.txt index 98956571bf7..86b34818cd6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithComponentRef_CreatesDiagnostic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithComponentRef_CreatesDiagnostic/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithComponentRef_TypeInference_CreatesDiagnostic/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithComponentRef_TypeInference_CreatesDiagnostic/TestComponent.ir.txt index b13cf676059..823bd35760d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithComponentRef_TypeInference_CreatesDiagnostic/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithComponentRef_TypeInference_CreatesDiagnostic/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithFullyQualifiedTagName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithFullyQualifiedTagName/TestComponent.ir.txt index 695f36261f9..690baaeee00 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithFullyQualifiedTagName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithFullyQualifiedTagName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [87] x:\dir\subdir\Test\TestComponent.cshtml) - Test.MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithKey/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithKey/TestComponent.ir.txt index f920615e90c..93b81667749 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithKey/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithKey/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [50] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithKey_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithKey_TypeInference/TestComponent.ir.txt index 4f6f437c7cb..dc7c0f2e21d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithKey_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponent_WithKey_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [40] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt index e3d0d35fdb7..27fddc878ec 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericTypeCheck/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [29] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_AddAttribute/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_AddAttribute/TestComponent.ir.txt index 0a447d92579..8ba4a173d85 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_AddAttribute/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_AddAttribute/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [46] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_AddComponentParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_AddComponentParameter/TestComponent.ir.txt index 0a447d92579..8ba4a173d85 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_AddComponentParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_AddComponentParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [46] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind/TestComponent.ir.txt index ff6ad5db165..300741de623 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [37] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind_02/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind_02/TestComponent.ir.txt index d28e317d119..0f589356552 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind_02/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind_02/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [38] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind_03/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind_03/TestComponent.ir.txt index d06ffd425a3..873ec6c28aa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind_03/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Bind_03/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Multiple/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Multiple/TestComponent.ir.txt index 0a447d92579..8ba4a173d85 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Multiple/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ImplicitStringConversion_ParameterCasing_Multiple/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [46] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/IncludesMinimizedAttributeValueParameterBeforeLanguageVersion5/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/IncludesMinimizedAttributeValueParameterBeforeLanguageVersion5/TestComponent.ir.txt index 5cfedbcff7e..0a828a968ec 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/IncludesMinimizedAttributeValueParameterBeforeLanguageVersion5/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/IncludesMinimizedAttributeValueParameterBeforeLanguageVersion5/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InheritsDirective_NullableReferenceType/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InheritsDirective_NullableReferenceType/TestComponent.ir.txt index 20316195d6b..485780f36b0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InheritsDirective_NullableReferenceType/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InheritsDirective_NullableReferenceType/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - BaseComponent - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

My component

\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InheritsDirective_NullableReferenceType_NullableDisabled/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InheritsDirective_NullableReferenceType_NullableDisabled/TestComponent.ir.txt index 20316195d6b..485780f36b0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InheritsDirective_NullableReferenceType_NullableDisabled/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InheritsDirective_NullableReferenceType_NullableDisabled/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - BaseComponent - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

My component

\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.codegen.cs index 030d22f6cac..aa9f1091e9f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,19) "x:\dir\subdir\Test\TestComponent.cshtml" using System.Text #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.ir.txt index cc49e1ab9fa..e2855d490a7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [19] x:\dir\subdir\Test\TestComponent.cshtml) - System.Text + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [17] x:\dir\subdir\Test\TestComponent.cshtml) - System.Text ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -
\n Content\n
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.mappings.txt index 6b980da96d7..9527698326f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/InjectDirective/TestComponent.mappings.txt @@ -1,57 +1,55 @@ -Source Location: (1:0,1 [19] x:\dir\subdir\Test\TestComponent.cshtml) -|using System.Text -| -Generated Location: (371:12,0 [19] ) -|using System.Text -| +Source Location: (1:0,1 [17] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Text| +Generated Location: (372:12,0 [17] ) +|using System.Text| Source Location: (172:10,8 [5] x:\dir\subdir\Test\TestComponent.cshtml) |float| -Generated Location: (1059:31,0 [5] ) +Generated Location: (1060:31,0 [5] ) |float| Source Location: (178:10,14 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Value5| -Generated Location: (1211:39,0 [6] ) +Generated Location: (1212:39,0 [6] ) |Value5| Source Location: (117:4,8 [6] x:\dir\subdir\Test\TestComponent.cshtml) |double| -Generated Location: (1472:49,0 [6] ) +Generated Location: (1473:49,0 [6] ) |double| Source Location: (124:4,15 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Value4| -Generated Location: (1623:57,0 [6] ) +Generated Location: (1624:57,0 [6] ) |Value4| Source Location: (96:3,8 [3] x:\dir\subdir\Test\TestComponent.cshtml) |int| -Generated Location: (1884:67,0 [3] ) +Generated Location: (1885:67,0 [3] ) |int| Source Location: (100:3,12 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Value3| -Generated Location: (2032:75,0 [6] ) +Generated Location: (2033:75,0 [6] ) |Value3| Source Location: (57:2,14 [13] x:\dir\subdir\Test\TestComponent.cshtml) |StringBuilder| -Generated Location: (2294:85,0 [13] ) +Generated Location: (2295:85,0 [13] ) |StringBuilder| Source Location: (80:2,37 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Value2| -Generated Location: (2452:93,0 [6] ) +Generated Location: (2453:93,0 [6] ) |Value2| Source Location: (28:1,8 [6] x:\dir\subdir\Test\TestComponent.cshtml) |string| -Generated Location: (2713:103,0 [6] ) +Generated Location: (2714:103,0 [6] ) |string| Source Location: (35:1,15 [6] x:\dir\subdir\Test\TestComponent.cshtml) |Value1| -Generated Location: (2864:111,0 [6] ) +Generated Location: (2865:111,0 [6] ) |Value1| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt index 009552a96f7..b4893bf4502 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpExpression - (2:0,2 [10] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.ir.txt index b0d040dad55..88066dccdfd 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithComponent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [115] x:\dir\subdir\Test\TestComponent.cshtml) - SomeOtherComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs index 316c4ef5347..7647a547697 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs @@ -8,7 +8,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,14) "x:\dir\subdir\Test\TestComponent.cshtml" using System #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.ir.txt index 5f59325e4c3..667a5768765 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [14] x:\dir\subdir\Test\TestComponent.cshtml) - System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - System ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Hello

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.mappings.txt index 7f6e92af515..f07808b06ac 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LeadingWhiteSpace_WithDirective/TestComponent.mappings.txt @@ -1,7 +1,5 @@ -Source Location: (1:0,1 [14] x:\dir\subdir\Test\TestComponent.cshtml) -|using System -| -Generated Location: (344:11,0 [14] ) -|using System -| +Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) +|using System| +Generated Location: (345:11,0 [12] ) +|using System| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt index 009552a96f7..b4893bf4502 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpExpression - (2:0,2 [10] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithComponent/TestComponent.ir.txt index 8fc23b7f176..8dd408f5a72 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithComponent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithComponent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [115] x:\dir\subdir\Test\TestComponent.cshtml) - SomeOtherComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs index 316c4ef5347..7647a547697 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.codegen.cs @@ -8,7 +8,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,14) "x:\dir\subdir\Test\TestComponent.cshtml" using System #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.ir.txt index 5f59325e4c3..667a5768765 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [14] x:\dir\subdir\Test\TestComponent.cshtml) - System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) - System ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Hello

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.mappings.txt index 7f6e92af515..f07808b06ac 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_LeadingWhiteSpace_WithDirective/TestComponent.mappings.txt @@ -1,7 +1,5 @@ -Source Location: (1:0,1 [14] x:\dir\subdir\Test\TestComponent.cshtml) -|using System -| -Generated Location: (344:11,0 [14] ) -|using System -| +Source Location: (1:0,1 [12] x:\dir\subdir\Test\TestComponent.cshtml) +|using System| +Generated Location: (345:11,0 [12] ) +|using System| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt index 8189bb5c36d..e8fb6a07984 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Hello

\n\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithComponent/TestComponent.ir.txt index 951c25ead13..b46e0e229ad 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithComponent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithComponent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Hello

\n\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithDirective/TestComponent.ir.txt index 64df818cdf9..56dfcad72bc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_TrailingWhiteSpace_WithDirective/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components RouteAttributeExtensionNode - (24:2,6 [9] x:\dir\subdir\Test\TestComponent.cshtml) - "/my/url" ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.codegen.cs index f9f5bd8b5ad..02a44330dc9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,49) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Rendering #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.ir.txt index e86c733924e..7201fa91a31 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [47] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (57:1,7 [57] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.mappings.txt index 8fb5ff65c10..241861108f3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InMarkupInFunctionsBlock/TestComponent.mappings.txt @@ -1,16 +1,14 @@ -Source Location: (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Rendering -| -Generated Location: (371:12,0 [49] ) -|using Microsoft.AspNetCore.Components.Rendering -| +Source Location: (1:0,1 [47] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Rendering| +Generated Location: (372:12,0 [47] ) +|using Microsoft.AspNetCore.Components.Rendering| Source Location: (57:1,7 [57] x:\dir\subdir\Test\TestComponent.cshtml) | void MyMethod(RenderTreeBuilder __builder) { | -Generated Location: (932:29,0 [57] ) +Generated Location: (933:29,0 [57] ) | void MyMethod(RenderTreeBuilder __builder) { @@ -20,27 +18,27 @@ Source Location: (141:5,13 [46] x:\dir\subdir\Test\TestComponent.cshtml) |for (var i = 0; i < 100; i++) { | -Generated Location: (1257:42,0 [46] ) +Generated Location: (1258:42,0 [46] ) |for (var i = 0; i < 100; i++) { | Source Location: (230:8,21 [1] x:\dir\subdir\Test\TestComponent.cshtml) |i| -Generated Location: (1634:55,0 [1] ) +Generated Location: (1635:55,0 [1] ) |i| Source Location: (256:10,0 [15] x:\dir\subdir\Test\TestComponent.cshtml) | } | -Generated Location: (1928:66,0 [15] ) +Generated Location: (1929:66,0 [15] ) | } | Source Location: (286:12,0 [7] x:\dir\subdir\Test\TestComponent.cshtml) | } | -Generated Location: (2207:77,0 [7] ) +Generated Location: (2208:77,0 [7] ) | } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InsideAttribute_InMarkupBlock/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InsideAttribute_InMarkupBlock/TestComponent.ir.txt index b1ca68f46e7..be5a67155f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InsideAttribute_InMarkupBlock/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_WhiteSpace_InsideAttribute_InMarkupBlock/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -
Hello
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_Whitespace_BetweenElementAndFunctions/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_Whitespace_BetweenElementAndFunctions/TestComponent.ir.txt index c0f63215ea7..d83045213d0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_Whitespace_BetweenElementAndFunctions/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Legacy_3_1_Whitespace_BetweenElementAndFunctions/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [18] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LinePragma_Multiline/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LinePragma_Multiline/TestComponent.ir.txt index b595a152b7e..8c0aef31a2f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LinePragma_Multiline/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/LinePragma_Multiline/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpExpression - (2:0,2 [8] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MarkupComment_IsNotIncluded/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MarkupComment_IsNotIncluded/TestComponent.ir.txt index 867694e690f..17285330bc8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MarkupComment_IsNotIncluded/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MarkupComment_IsNotIncluded/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [39] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MultipleChildContentMatchingComponentName/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MultipleChildContentMatchingComponentName/TestComponent.ir.txt index ca45d132d67..3e679334c29 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MultipleChildContentMatchingComponentName/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MultipleChildContentMatchingComponentName/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [78] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MultipleExplictChildContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MultipleExplictChildContent/TestComponent.ir.txt index 76060a8b605..0053fb24b93 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MultipleExplictChildContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/MultipleExplictChildContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [87] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/NonGenericComponent_WithGenericEventHandler/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/NonGenericComponent_WithGenericEventHandler/TestComponent.ir.txt index 0a247eec10d..02d373924da 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/NonGenericComponent_WithGenericEventHandler/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/NonGenericComponent_WithGenericEventHandler/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [53] x:\dir\subdir\Test\TestComponent.cshtml) - MyComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/OmitsMinimizedAttributeValueParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/OmitsMinimizedAttributeValueParameter/TestComponent.ir.txt index 5cfedbcff7e..0a828a968ec 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/OmitsMinimizedAttributeValueParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/OmitsMinimizedAttributeValueParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt index 67b17c77744..41b434a7c11 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MalformedDirective - (0:0,0 [5] x:\dir\subdir\Test\TestComponent.cshtml) - page diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt index b6abec93a06..e32209b4225 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_MissingRoute_WithComment/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MalformedDirective - (0:0,0 [19] x:\dir\subdir\Test\TestComponent.cshtml) - page diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt index c2bb7e7b978..c2e39a05fc0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components RouteAttributeExtensionNode - (6:0,6 [8] x:\dir\subdir\Test\TestComponent.cshtml) - "MyPage" ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt index f134f1b55de..c23d22847e8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/PageDirective_NoForwardSlash_WithComment/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components RouteAttributeExtensionNode - (20:0,20 [8] x:\dir\subdir\Test\TestComponent.cshtml) - "MyPage" ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ProducesEnhancedLinePragmaWhenNecessary/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ProducesEnhancedLinePragmaWhenNecessary/TestComponent.ir.txt index e4a626acd90..832d3021adf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ProducesEnhancedLinePragmaWhenNecessary/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ProducesEnhancedLinePragmaWhenNecessary/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Single line statement

\n\nTime: diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ProducesStandardLinePragmaForCSharpCode/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ProducesStandardLinePragmaForCSharpCode/TestComponent.ir.txt index 9f322199fed..abfe50894b0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ProducesStandardLinePragmaForCSharpCode/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ProducesStandardLinePragmaForCSharpCode/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Conditional statement

diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.ir.txt index 752cf1193c5..57dfe9541c4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_AsComponentParameter_MixedContent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [54] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_ContainsComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_ContainsComponent/TestComponent.ir.txt index 7d84d394e72..290f5e3ebb4 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_ContainsComponent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_ContainsComponent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [45] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_FollowedByComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_FollowedByComponent/TestComponent.ir.txt index 119c1085919..dd6e0808232 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_FollowedByComponent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_FollowedByComponent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [45] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.ir.txt index 8774a937ad5..d8f4bbc7dff 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_AsComponentParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [47] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_InImplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_InImplicitExpression/TestComponent.ir.txt index ef1e956634a..7e660bf93d7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_InImplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_Generic_InImplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpExpression - (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_InCodeBlock/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_InCodeBlock/TestComponent.ir.txt index 8e753ae43d2..83621359b75 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_InCodeBlock/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_InCodeBlock/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [45] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_InExplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_InExplicitExpression/TestComponent.ir.txt index bee80f0d3c9..e6690326666 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_InExplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_InExplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpExpression - (2:0,2 [49] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_NonGeneric_AsComponentParameter/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_NonGeneric_AsComponentParameter/TestComponent.ir.txt index 860f8a1cf54..dd95ee6f4f9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_NonGeneric_AsComponentParameter/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_NonGeneric_AsComponentParameter/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (2:0,2 [27] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_NonGeneric_InImplicitExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_NonGeneric_InImplicitExpression/TestComponent.ir.txt index d72e5b857d7..c35c9086cc8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_NonGeneric_InImplicitExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RazorTemplate_NonGeneric_InImplicitExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpExpression - (1:0,1 [27] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_597/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_597/TestComponent.ir.txt index c3402f0e9ed..992d22e7044 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_597/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_597/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [23] x:\dir\subdir\Test\TestComponent.cshtml) - Counter diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_609/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_609/TestComponent.ir.txt index b785bb04ba7..e88619dd06d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_609/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_609/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [62] x:\dir\subdir\Test\TestComponent.cshtml) - User diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_772/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_772/TestComponent.ir.txt index 9cf55117890..7c16b84a966 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_772/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_772/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components RouteAttributeExtensionNode - (6:0,6 [3] x:\dir\subdir\Test\TestComponent.cshtml) - "/" ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_773/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_773/TestComponent.ir.txt index 3a7aa764101..5a567129def 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_773/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_773/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components RouteAttributeExtensionNode - (6:0,6 [3] x:\dir\subdir\Test\TestComponent.cshtml) - "/" ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.codegen.cs index 4f1416c45a9..32dcd6e0819 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,43) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Web #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.ir.txt index 41b79d91083..c01e6d29c41 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Web ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (44:1,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - p diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.mappings.txt index aad24d12c5b..d551442182b 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Regression_784/TestComponent.mappings.txt @@ -1,18 +1,16 @@ -Source Location: (1:0,1 [43] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Web -| -Generated Location: (371:12,0 [43] ) -|using Microsoft.AspNetCore.Components.Web -| +Source Location: (1:0,1 [41] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Web| +Generated Location: (372:12,0 [41] ) +|using Microsoft.AspNetCore.Components.Web| Source Location: (61:1,17 [16] x:\dir\subdir\Test\TestComponent.cshtml) |OnComponentHover| -Generated Location: (1113:29,0 [16] ) +Generated Location: (1114:29,0 [16] ) |OnComponentHover| Source Location: (99:1,55 [13] x:\dir\subdir\Test\TestComponent.cshtml) |ParentBgColor| -Generated Location: (1352:38,0 [13] ) +Generated Location: (1353:38,0 [13] ) |ParentBgColor| Source Location: (126:2,7 [130] x:\dir\subdir\Test\TestComponent.cshtml) @@ -23,7 +21,7 @@ Source Location: (126:2,7 [130] x:\dir\subdir\Test\TestComponent.cshtml) { } | -Generated Location: (1608:49,0 [130] ) +Generated Location: (1609:49,0 [130] ) | public string ParentBgColor { get; set; } = "#FFFFFF"; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_Existing_Attributes/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_Existing_Attributes/TestComponent.ir.txt index 572de977403..9967df95aca 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_Existing_Attributes/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_Existing_Attributes/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [114] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_Expression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_Expression/TestComponent.ir.txt index c7722084c2c..41531d228af 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_Expression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_Expression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [73] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_SimpleIdentifier/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_SimpleIdentifier/TestComponent.ir.txt index d97c2e9050e..82ca9c97d71 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_SimpleIdentifier/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Attribute_With_SimpleIdentifier/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [96] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Child_Components/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Child_Components/TestComponent.ir.txt index 2f78f82639e..0728fa626b5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Child_Components/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Child_Components/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [671] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_FullyQualified/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_FullyQualified/TestComponent.ir.txt index 037fe7f9266..09fb15ec983 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_FullyQualified/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_FullyQualified/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components CSharpCode - IntermediateToken - - CSharp - [global::Test.TestComponent.__PrivateComponentRenderModeAttribute] ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_NewExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_NewExpression/TestComponent.ir.txt index ebd5c140bb5..5c72ba5c860 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_NewExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_NewExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components CSharpCode - IntermediateToken - - CSharp - [global::Test.TestComponent.__PrivateComponentRenderModeAttribute] ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression/TestComponent.ir.txt index 173f6738cb0..68e90c36c8d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components CSharpCode - IntermediateToken - - CSharp - [global::Test.TestComponent.__PrivateComponentRenderModeAttribute] ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression_NotFirst/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression_NotFirst/TestComponent.ir.txt index debf9744075..62aa40d9fee 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression_NotFirst/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression_NotFirst/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components CSharpCode - IntermediateToken - - CSharp - [global::Test.TestComponent.__PrivateComponentRenderModeAttribute] ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression_With_Code/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression_With_Code/TestComponent.ir.txt index 0044d530d7b..d83ef6e62c3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression_With_Code/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_SimpleExpression_With_Code/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components CSharpCode - IntermediateToken - - CSharp - [global::Test.TestComponent.__PrivateComponentRenderModeAttribute] ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_WithNamespaces/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_WithNamespaces/TestComponent.ir.txt index db514554574..05166e87312 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_WithNamespaces/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Directive_WithNamespaces/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - (11:0,11 [16] x:\dir\subdir\Test\TestComponent.cshtml) - Custom.Namespace - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components CSharpCode - IntermediateToken - - CSharp - [global::Custom.Namespace.TestComponent.__PrivateComponentRenderModeAttribute] ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Multiple_Components/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Multiple_Components/TestComponent.ir.txt index bae37a8c56d..d1c968def5a 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Multiple_Components/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_Multiple_Components/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [96] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Null_Nullable_Disabled/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Null_Nullable_Disabled/TestComponent.ir.txt index f6706c301f8..3969b8737c5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Null_Nullable_Disabled/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Null_Nullable_Disabled/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [36] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Null_Nullable_Enabled/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Null_Nullable_Enabled/TestComponent.ir.txt index f6706c301f8..3969b8737c5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Null_Nullable_Enabled/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Null_Nullable_Enabled/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [36] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Nullable_Receiver/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Nullable_Receiver/TestComponent.ir.txt index feb1220d0be..a6f36291446 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Nullable_Receiver/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Nullable_Receiver/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (261:9,0 [55] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Ternary/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Ternary/TestComponent.ir.txt index 3a796854404..29412e63dfa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Ternary/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_Ternary/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [113] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_TypeInference/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_TypeInference/TestComponent.ir.txt index 4353486fc55..233387c5cd5 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_TypeInference/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/RenderMode_With_TypeInference/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TRenderMode MethodDeclaration - - protected override - void - BuildRenderTree Component - (99:2,0 [130] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ScriptTag_Razor7/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ScriptTag_Razor7/TestComponent.ir.txt index aa3353d5b9f..deb308507cf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ScriptTag_Razor7/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ScriptTag_Razor7/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [32] x:\dir\subdir\Test\TestComponent.cshtml) - script diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ScriptTag_Razor8/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ScriptTag_Razor8/TestComponent.ir.txt index d15dddbbd23..0eacf913bfe 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ScriptTag_Razor8/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/ScriptTag_Razor8/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - - diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.codegen.cs index fe2b829e67a..355f3ed0f79 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,51) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.RenderTree; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.ir.txt index ebfa7e6853c..3837f185560 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [51] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.RenderTree + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.RenderTree ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (56:2,2 [134] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.mappings.txt index dcfa3a6c1fd..61a58d6a776 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeBlock/TestComponent.mappings.txt @@ -1,9 +1,7 @@ -Source Location: (1:0,1 [51] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.RenderTree; -| -Generated Location: (371:12,0 [51] ) -|using Microsoft.AspNetCore.Components.RenderTree; -| +Source Location: (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.RenderTree;| +Generated Location: (372:12,0 [49] ) +|using Microsoft.AspNetCore.Components.RenderTree;| Source Location: (56:2,2 [134] x:\dir\subdir\Test\TestComponent.cshtml) | @@ -11,7 +9,7 @@ Source Location: (56:2,2 [134] x:\dir\subdir\Test\TestComponent.cshtml) if (__builder == null) output = "Builder is null!"; else output = "Builder is not null!"; | -Generated Location: (878:26,0 [134] ) +Generated Location: (879:26,0 [134] ) | var output = string.Empty; if (__builder == null) output = "Builder is null!"; @@ -20,6 +18,6 @@ Generated Location: (878:26,0 [134] ) Source Location: (206:6,16 [6] x:\dir\subdir\Test\TestComponent.cshtml) |output| -Generated Location: (1278:40,0 [6] ) +Generated Location: (1279:40,0 [6] ) |output| diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.codegen.cs index b528dbb920d..1def7e27bb0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,50) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Rendering; #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.ir.txt index bedac9ed24a..7ab293e5e14 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [50] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [48] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (60:2,7 [213] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.mappings.txt index da108d9bf35..7db48c0a2e9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/SingleLineControlFlowStatements_InCodeDirective/TestComponent.mappings.txt @@ -1,9 +1,7 @@ -Source Location: (1:0,1 [50] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Rendering; -| -Generated Location: (371:12,0 [50] ) -|using Microsoft.AspNetCore.Components.Rendering; -| +Source Location: (1:0,1 [48] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Rendering;| +Generated Location: (372:12,0 [48] ) +|using Microsoft.AspNetCore.Components.Rendering;| Source Location: (60:2,7 [213] x:\dir\subdir\Test\TestComponent.cshtml) | @@ -13,7 +11,7 @@ Source Location: (60:2,7 [213] x:\dir\subdir\Test\TestComponent.cshtml) if (__builder == null) output = "Builder is null!"; else output = "Builder is not null!"; | -Generated Location: (926:28,0 [213] ) +Generated Location: (927:28,0 [213] ) | void RenderChildComponent(RenderTreeBuilder __builder) { @@ -24,13 +22,13 @@ Generated Location: (926:28,0 [213] ) Source Location: (293:8,20 [6] x:\dir\subdir\Test\TestComponent.cshtml) |output| -Generated Location: (1393:44,0 [6] ) +Generated Location: (1394:44,0 [6] ) |output| Source Location: (305:9,0 [7] x:\dir\subdir\Test\TestComponent.cshtml) | } | -Generated Location: (1580:53,0 [7] ) +Generated Location: (1581:53,0 [7] ) | } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt index 8189bb5c36d..e8fb6a07984 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithCSharpExpression/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Hello

\n\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.ir.txt index 951c25ead13..b46e0e229ad 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithComponent/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -

Hello

\n\n diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.ir.txt index 64df818cdf9..56dfcad72bc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/TrailingWhiteSpace_WithDirective/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components RouteAttributeExtensionNode - (24:2,6 [9] x:\dir\subdir\Test\TestComponent.cshtml) - "/my/url" ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.codegen.cs new file mode 100644 index 00000000000..d290615815c --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.codegen.cs @@ -0,0 +1,30 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; +#nullable restore +#line (1,2)-(1,26) "x:\dir\subdir\Test\TestComponent.cshtml" +using System.Collections + +#line default +#line hidden +#nullable disable + ; + #nullable restore + public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + } + #pragma warning restore 1998 + } +} +#pragma warning restore 1591 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.ir.txt new file mode 100644 index 00000000000..82936a37369 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.ir.txt @@ -0,0 +1,10 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [24] x:\dir\subdir\Test\TestComponent.cshtml) - System.Collections + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - + MethodDeclaration - - protected override - void - BuildRenderTree diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.mappings.txt new file mode 100644 index 00000000000..e6df1c46964 --- /dev/null +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/UsingDirective/TestComponent.mappings.txt @@ -0,0 +1,5 @@ +Source Location: (1:0,1 [24] x:\dir\subdir\Test\TestComponent.cshtml) +|using System.Collections| +Generated Location: (372:12,0 [24] ) +|using System.Collections| + diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.codegen.cs index de81c1af865..bded15e4243 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.codegen.cs @@ -9,7 +9,7 @@ namespace Test using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (1,2)-(2,1) "x:\dir\subdir\Test\TestComponent.cshtml" +#line (1,2)-(1,49) "x:\dir\subdir\Test\TestComponent.cshtml" using Microsoft.AspNetCore.Components.Rendering #line default diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.ir.txt index c3f32137afc..fecfc392280 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.ir.txt @@ -1,11 +1,11 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components - UsingDirective - (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (1:0,1 [47] x:\dir\subdir\Test\TestComponent.cshtml) - Microsoft.AspNetCore.Components.Rendering ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree CSharpCode - (57:1,7 [57] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.mappings.txt index dceca48858a..0e98d84d087 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InMarkupInFunctionsBlock/TestComponent.mappings.txt @@ -1,16 +1,14 @@ -Source Location: (1:0,1 [49] x:\dir\subdir\Test\TestComponent.cshtml) -|using Microsoft.AspNetCore.Components.Rendering -| -Generated Location: (371:12,0 [49] ) -|using Microsoft.AspNetCore.Components.Rendering -| +Source Location: (1:0,1 [47] x:\dir\subdir\Test\TestComponent.cshtml) +|using Microsoft.AspNetCore.Components.Rendering| +Generated Location: (372:12,0 [47] ) +|using Microsoft.AspNetCore.Components.Rendering| Source Location: (57:1,7 [57] x:\dir\subdir\Test\TestComponent.cshtml) | void MyMethod(RenderTreeBuilder __builder) { | -Generated Location: (932:29,0 [57] ) +Generated Location: (933:29,0 [57] ) | void MyMethod(RenderTreeBuilder __builder) { @@ -20,27 +18,27 @@ Source Location: (141:5,13 [46] x:\dir\subdir\Test\TestComponent.cshtml) |for (var i = 0; i < 100; i++) { | -Generated Location: (1163:40,0 [46] ) +Generated Location: (1164:40,0 [46] ) |for (var i = 0; i < 100; i++) { | Source Location: (230:8,21 [1] x:\dir\subdir\Test\TestComponent.cshtml) |i| -Generated Location: (1418:51,0 [1] ) +Generated Location: (1419:51,0 [1] ) |i| Source Location: (256:10,0 [15] x:\dir\subdir\Test\TestComponent.cshtml) | } | -Generated Location: (1600:60,0 [15] ) +Generated Location: (1601:60,0 [15] ) | } | Source Location: (286:12,0 [7] x:\dir\subdir\Test\TestComponent.cshtml) | } | -Generated Location: (1784:69,0 [7] ) +Generated Location: (1785:69,0 [7] ) | } | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InsideAttribute_InMarkupBlock/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InsideAttribute_InMarkupBlock/TestComponent.ir.txt index b1ca68f46e7..be5a67155f6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InsideAttribute_InMarkupBlock/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_InsideAttribute_InMarkupBlock/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupBlock - -
Hello
diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_WithPreserveWhitespace/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_WithPreserveWhitespace/TestComponent.ir.txt index 9243ead7636..3cea6758d01 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_WithPreserveWhitespace/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/WhiteSpace_WithPreserveWhitespace/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree HtmlContent - (26:1,0 [6] x:\dir\subdir\Test\TestComponent.cshtml) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Whitespace_BetweenElementAndFunctions/TestComponent.ir.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Whitespace_BetweenElementAndFunctions/TestComponent.ir.txt index c0f63215ea7..d83045213d0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Whitespace_BetweenElementAndFunctions/TestComponent.ir.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/Whitespace_BetweenElementAndFunctions/TestComponent.ir.txt @@ -1,10 +1,10 @@ Document - NamespaceDeclaration - - Test - UsingDirective - (3:1,1 [22] ) - global::System - UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic - UsingDirective - (69:3,1 [27] ) - global::System.Linq - UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks - UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - MethodDeclaration - - protected override - void - BuildRenderTree MarkupElement - (0:0,0 [18] x:\dir\subdir\Test\TestComponent.cshtml) - elem diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.cspans.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.cspans.txt index 7165fe9a595..5440310b2ae 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.cspans.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.cspans.txt @@ -1,4 +1,4 @@ Markup span at (0:0,0 [0] ) - Parent: Markup block at (0:0,0 [12] ) -Transition span at (0:0,0 [1] ) - Parent: Directive block at (0:0,0 [12] ) -Code span at (1:0,1 [11] ) - Parent: Directive block at (0:0,0 [12] ) -Markup span at (12:1,0 [0] ) - Parent: Markup block at (0:0,0 [12] ) +Transition span at (0:0,0 [1] ) - Parent: Directive block at (0:0,0 [10] ) +Code span at (1:0,1 [9] ) - Parent: Directive block at (0:0,0 [10] ) +MetaCode span at (10:0,10 [2] ) - Parent: Statement block at (0:0,0 [12] ) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt index 98fb7aebce3..ef3ce4005fa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/ParserTests/CSharpBlockTest/CapturesNewlineAfterUsing.stree.txt @@ -3,15 +3,14 @@ MarkupTextLiteral - [0..0)::0 - [] - Gen Marker;[]; CSharpCodeBlock - [0..12)::12 - RazorDirective - [0..12)::12 + RazorDirective - [0..10)::10 CSharpTransition - [0..1)::1 - Gen Transition;[@]; - RazorDirectiveBody - [1..12)::11 - CSharpStatementLiteral - [1..12)::11 - [using FooLF] - Gen + RazorDirectiveBody - [1..10)::9 + CSharpStatementLiteral - [1..10)::9 - [using Foo] - Gen Keyword;[using]; Whitespace;[ ]; Identifier;[Foo]; - NewLine;[LF]; - MarkupTextLiteral - [12..12)::0 - [] - Gen - Marker;[]; + RazorMetaCode - [10..12)::2 - Gen + NewLine;[LF]; EndOfFile;[]; diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs index 800c121f1c2..3a08b15118b 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs @@ -2515,11 +2515,16 @@ private void ParseUsingDeclaration(in SyntaxListBuilder builder isStatic, hasExplicitSemicolon); - CompleteBlock(); Debug.Assert(directiveBuilder.Count == 0, "We should not have built any blocks so far."); var keywordTokens = OutputTokensAsStatementLiteral(); var directiveBody = SyntaxFactory.RazorDirectiveBody(keywordTokens, null); builder.Add(SyntaxFactory.RazorDirective(transition, directiveBody)); + + if (!Context.DesignTimeMode) + { + CaptureWhitespaceToEndOfLine(); + builder.Add(OutputAsMetaCode(Output(), Context.CurrentAcceptedCharacters)); + } } } diff --git a/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs b/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs index 6bcc67c34bd..b6d76601363 100644 --- a/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs +++ b/src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests/RazorSourceGeneratorTests.cs @@ -1059,7 +1059,7 @@ namespace MyApp.Pages using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (2,2)-(3,1) ""Pages/Index.razor"" +#line (2,2)-(2,33) ""Pages/Index.razor"" using SurveyPromptRootNamspace; #line default @@ -1132,7 +1132,7 @@ namespace MyApp.Pages using global::System.Threading.Tasks; using global::Microsoft.AspNetCore.Components; #nullable restore -#line (2,2)-(3,1) ""Pages/Index.razor"" +#line (2,2)-(2,33) ""Pages/Index.razor"" using SurveyPromptRootNamspace; #line default diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindNodeTests.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindNodeTests.cs index 4b55819c919..5adc6703356 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindNodeTests.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/FindNodeTests.cs @@ -75,8 +75,9 @@ protected override async Task OnInitializedAsync() [InlineData(5, 20, SyntaxKind.MarkupTextLiteral, true)] [InlineData(20, 21, SyntaxKind.CSharpTransition, false)] [InlineData(20, 21, SyntaxKind.CSharpTransition, true)] - [InlineData(21, 43, SyntaxKind.CSharpStatementLiteral, false)] - [InlineData(21, 43, SyntaxKind.CSharpStatementLiteral, true)] + [InlineData(21, 41, SyntaxKind.CSharpStatementLiteral, false)] + [InlineData(21, 41, SyntaxKind.CSharpStatementLiteral, true)] + [InlineData(41, 43, SyntaxKind.RazorMetaCode, true)] [InlineData(43, 44, SyntaxKind.CSharpTransition, false)] [InlineData(43, 44, SyntaxKind.CSharpTransition, true)] [InlineData(44, 50, SyntaxKind.CSharpExpressionLiteral, false)] From cab5217c9fdee5e1973ea04fde6497e4aeacb8e7 Mon Sep 17 00:00:00 2001 From: Phil Allen Date: Mon, 30 Sep 2024 09:52:42 -0700 Subject: [PATCH 383/386] Add policheck to official pipeline (#10938) --- azure-pipelines-official.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 17079041941..a9a7d5fd76a 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -66,6 +66,8 @@ extends: name: NetCore1ESPool-Svc-Internal image: 1es-windows-2022 os: windows + policheck: + enabled: true tsa: enabled: true configFile: '$(Build.SourcesDirectory)/eng/TSAConfig.gdntsa' From fc1e1828f7815bed865d0d5dd40e5fd3138e7ac8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:01:26 +0000 Subject: [PATCH 384/386] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240923.1 (#10942) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 10.0.0-alpha.1.24467.1 -> To Version 10.0.0-alpha.1.24473.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5439d4fcc58..233097c5be7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,9 +6,9 @@ 839cdfb0ecca5e0be3dbccd926e7651ef50fdf10 - + https://github.com/dotnet/source-build-reference-packages - 38a050f3b80b4dfdd0e8f6c772a3e9835674d3b4 + 0b091fc31f5379aa6f70be1436c17fc24d4416fe diff --git a/eng/Versions.props b/eng/Versions.props index b9743fc1620..35cef04b537 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -49,7 +49,7 @@ 6.0.2-servicing.22064.6 6.0.1 - 10.0.0-alpha.1.24467.1 + 10.0.0-alpha.1.24473.1 9.0.0-beta.24466.2 1.0.0-beta.23475.1 1.0.0-beta.23475.1 From ea556b90f97b0462eb3314f78db2abf3284bb500 Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Tue, 1 Oct 2024 14:55:20 -0700 Subject: [PATCH 385/386] Fix merge --- .../CodeActions/CodeActionEndToEndTest.NetFx.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs index e4f26d6b7ee..df0443e5705 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/CodeActionEndToEndTest.NetFx.cs @@ -1300,7 +1300,7 @@ private async Task ValidateExtractComponentCodeActionAsync( Assert.NotNull(codeActionToRun); - var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, documentContext.Snapshot, optionsMonitor?.CurrentValue); + var formattingService = await TestRazorFormattingService.CreateWithFullSupportAsync(LoggerFactory, codeDocument, optionsMonitor?.CurrentValue); var changes = await GetEditsAsync( codeActionToRun, requestContext, @@ -1477,9 +1477,8 @@ private class ExtractToComponentResolverDocumentContextFactory : TestDocumentCon public ExtractToComponentResolverDocumentContextFactory (string filePath, RazorCodeDocument codeDocument, - TagHelperDescriptor[]? tagHelpers = null, - int? version = null) - : base(filePath, codeDocument, version) + TagHelperDescriptor[]? tagHelpers = null) + : base(filePath, codeDocument) { _tagHelperDescriptors = CreateTagHelperDescriptors(); if (tagHelpers is not null) @@ -1491,7 +1490,6 @@ public ExtractToComponentResolverDocumentContextFactory public override bool TryCreate( Uri documentUri, VSProjectContext? projectContext, - bool versioned, [NotNullWhen(true)] out DocumentContext? context) { if (FilePath is null || CodeDocument is null) From b776c6040768b15a5a2f3383fd226a2d4651f39e Mon Sep 17 00:00:00 2001 From: Andrew Hall Date: Fri, 4 Oct 2024 15:54:56 -0700 Subject: [PATCH 386/386] Fix moq in tests --- .../Razor/ExtractToComponentCodeActionProviderTest.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToComponentCodeActionProviderTest.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToComponentCodeActionProviderTest.cs index d884dc9c0b9..7a8463b3626 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToComponentCodeActionProviderTest.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/CodeActions/Razor/ExtractToComponentCodeActionProviderTest.cs @@ -299,7 +299,6 @@ private static RazorCodeActionContext CreateRazorCodeActionContext(VSCodeActionP codeDocument.SetSyntaxTree(syntaxTree); var documentSnapshot = Mock.Of(document => - document.GetGeneratedOutputAsync() == Task.FromResult(codeDocument) && document.GetTextAsync() == Task.FromResult(codeDocument.Source.Text), MockBehavior.Strict); var sourceText = SourceText.From(text);