Skip to content
代码片段 群组 项目
未验证 提交 876c7850 编辑于 作者: Joey Robichaud's avatar Joey Robichaud 提交者: GitHub
浏览文件

Merge branch 'release/dev17.1' into merges/release/dev17.0-vs-deps-to-release/dev17.1

No related branches found
No related tags found
无相关合并请求
显示
608 个添加74 个删除
# Dotnet-format -w Roslyn.sln
# dotnet-format -w Roslyn.sln on June 18, 2021
abce41d282ac631be5217140f1bd46d0e250ad02
fbdb56063e761643707f6bc1e1ba469f6fb9a31a
57278e7dcbf7bffb310e8b14105f657f0fdbab78
\ No newline at end of file
......@@ -8,6 +8,10 @@ scripts/ @dotnet/roslyn-infrastructure
src/CodeStyle/ @dotnet/roslyn-ide
src/Compilers/ @dotnet/roslyn-compiler
# Both IDE and Compiler traits are in this file, so we don't want to ping each other for changes to just this file.
# Technically this means that if someone changes _just_ this file no reviewers will be tagged, but this isn't likely
# to happen.
src/Compilers/Test/Core/Traits/Traits.cs
src/EditorFeatures/ @dotnet/roslyn-ide
# If we touch the WPF layer or Cocoa layers, the VS for Mac team also should take a look. We do this even if it's
......
{
"files.associations": {
"**/eng/pipelines/*.yml": "azure-pipelines"
},
"omnisharp.defaultLaunchSolution": "Compilers.sln",
}
\ No newline at end of file
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29519.87
MinimumVisualStudioVersion = 10.0.40219.1
......@@ -152,6 +152,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Rebu
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Rebuild.UnitTests", "src\Compilers\Core\RebuildTest\Microsoft.CodeAnalysis.Rebuild.UnitTests.csproj", "{FDBFBB64-5980-41C2-9E3E-FB8E2F700A5C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests", "src\Compilers\CSharp\Test\Emit2\Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests.csproj", "{AAEDD19A-9D73-42C4-A2BB-ACDE36F170D5}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 5
......@@ -421,6 +423,10 @@ Global
{FDBFBB64-5980-41C2-9E3E-FB8E2F700A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDBFBB64-5980-41C2-9E3E-FB8E2F700A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDBFBB64-5980-41C2-9E3E-FB8E2F700A5C}.Release|Any CPU.Build.0 = Release|Any CPU
{AAEDD19A-9D73-42C4-A2BB-ACDE36F170D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AAEDD19A-9D73-42C4-A2BB-ACDE36F170D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAEDD19A-9D73-42C4-A2BB-ACDE36F170D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAEDD19A-9D73-42C4-A2BB-ACDE36F170D5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -491,6 +497,7 @@ Global
{E919DD77-34F8-4F57-8058-4D3FF4C2B241} = {3CDEA9FB-CD44-4AB4-98A8-5537AAA2169B}
{321F9FED-AACC-42CB-93E5-541D79E099E8} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9}
{FDBFBB64-5980-41C2-9E3E-FB8E2F700A5C} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9}
{AAEDD19A-9D73-42C4-A2BB-ACDE36F170D5} = {32A48625-F0AD-419D-828B-A50BDABA38EA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6F599E08-A9EA-4FAA-897F-5D824B0210E6}
......
......@@ -6,6 +6,7 @@
"src\\Compilers\\CSharp\\Portable\\Microsoft.CodeAnalysis.CSharp.csproj",
"src\\Compilers\\CSharp\\Test\\CommandLine\\Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests.csproj",
"src\\Compilers\\CSharp\\Test\\Emit\\Microsoft.CodeAnalysis.CSharp.Emit.UnitTests.csproj",
"src\\Compilers\\CSharp\\Test\\Emit2\\Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests.csproj",
"src\\Compilers\\CSharp\\Test\\IOperation\\Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests.csproj",
"src\\Compilers\\CSharp\\Test\\Semantic\\Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests.csproj",
"src\\Compilers\\CSharp\\Test\\Symbol\\Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests.csproj",
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31319.15
......@@ -495,6 +496,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Exte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Remote.ServiceHub.CoreComponents", "src\Workspaces\Remote\ServiceHub.CoreComponents\Microsoft.CodeAnalysis.Remote.ServiceHub.CoreComponents.csproj", "{8FCD1B85-BE63-4A2F-8E19-37244F19BE0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests", "src\Compilers\CSharp\Test\Emit2\Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests.csproj", "{2B7DC612-1B37-41F7-BE31-4D600930EAC9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests", "src\Workspaces\Remote\ServiceHubTest\Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests.csproj", "{8D830CBB-CA6E-47D8-9FB8-9230AAD272F3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.LanguageServices.New.IntegrationTests", "src\VisualStudio\IntegrationTest\New.IntegrationTests\Microsoft.VisualStudio.LanguageServices.New.IntegrationTests.csproj", "{6272739B-31E4-483E-A3A5-2ABB5040ABF0}"
ProjectSection(ProjectDependencies) = postProject
{201EC5B7-F91E-45E5-B9F2-67A266CCE6FC} = {201EC5B7-F91E-45E5-B9F2-67A266CCE6FC}
EndProjectSection
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Analyzers\VisualBasic\CodeFixes\VisualBasicCodeFixes.projitems*{0141285d-8f6c-42c7-baf3-3c0ccd61c716}*SharedItemsImports = 5
......@@ -1230,10 +1240,10 @@ Global
{8D22FC91-BDFE-4342-999B-D695E1C57E85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D22FC91-BDFE-4342-999B-D695E1C57E85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D22FC91-BDFE-4342-999B-D695E1C57E85}.Release|Any CPU.Build.0 = Release|Any CPU
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Debug|Any CPU.ActiveCfg = Debug|x86
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Debug|Any CPU.Build.0 = Debug|x86
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Release|Any CPU.ActiveCfg = Release|x86
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Release|Any CPU.Build.0 = Release|x86
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Release|Any CPU.Build.0 = Release|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
......@@ -1290,6 +1300,18 @@ Global
{8FCD1B85-BE63-4A2F-8E19-37244F19BE0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FCD1B85-BE63-4A2F-8E19-37244F19BE0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FCD1B85-BE63-4A2F-8E19-37244F19BE0F}.Release|Any CPU.Build.0 = Release|Any CPU
{2B7DC612-1B37-41F7-BE31-4D600930EAC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B7DC612-1B37-41F7-BE31-4D600930EAC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B7DC612-1B37-41F7-BE31-4D600930EAC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B7DC612-1B37-41F7-BE31-4D600930EAC9}.Release|Any CPU.Build.0 = Release|Any CPU
{8D830CBB-CA6E-47D8-9FB8-9230AAD272F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D830CBB-CA6E-47D8-9FB8-9230AAD272F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D830CBB-CA6E-47D8-9FB8-9230AAD272F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D830CBB-CA6E-47D8-9FB8-9230AAD272F3}.Release|Any CPU.Build.0 = Release|Any CPU
{6272739B-31E4-483E-A3A5-2ABB5040ABF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6272739B-31E4-483E-A3A5-2ABB5040ABF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6272739B-31E4-483E-A3A5-2ABB5040ABF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6272739B-31E4-483E-A3A5-2ABB5040ABF0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -1516,6 +1538,9 @@ Global
{AE976DE9-811D-4C86-AEBB-DCDC1226D754} = {8977A560-45C2-4EC2-A849-97335B382C74}
{3829F774-33F2-41E9-B568-AE555004FC62} = {8977A560-45C2-4EC2-A849-97335B382C74}
{8FCD1B85-BE63-4A2F-8E19-37244F19BE0F} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5}
{2B7DC612-1B37-41F7-BE31-4D600930EAC9} = {32A48625-F0AD-419D-828B-A50BDABA38EA}
{8D830CBB-CA6E-47D8-9FB8-9230AAD272F3} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5}
{6272739B-31E4-483E-A3A5-2ABB5040ABF0} = {CC126D03-7EAC-493F-B187-DCDEE1EF6A70}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29}
......
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore -rebuild -pack -test -runAnalyzers -warnAsError %*"
# Separate pipeline from normal integration CI to allow branches to change legs
# Branches that trigger a build on commit
trigger:
- main
- main-vs-deps
- release/*
- features/*
- demos/*
# Branches that are allowed to trigger a build via /azp run.
# Automatic building of all PRs is disabled in the pipeline's trigger page.
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#comment-triggers
pr:
- main
- main-vs-deps
- release/*
- features/*
- demos/*
jobs:
- job: VS_Integration_CoreHost_Debug
pool:
name: NetCore1ESPool-Public
demands: ImageOverride -equals $(queueName)
timeoutInMinutes: 135
variables:
- name: XUNIT_LOGS
value: $(Build.SourcesDirectory)\artifacts\log\Debug
steps:
- template: eng/pipelines/test-integration-job.yml
parameters:
configuration: Debug
oop64bit: true
oopCoreClr: true
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- job: VS_Integration_CoreHost_Release
pool:
name: NetCore1ESPool-Public
demands: ImageOverride -equals $(queueName)
timeoutInMinutes: 135
variables:
- name: XUNIT_LOGS
value: $(Build.SourcesDirectory)\artifacts\log\Debug
steps:
- template: eng/pipelines/test-integration-job.yml
parameters:
configuration: Release
oop64bit: true
oopCoreClr: true
# Roslyn integration test pipeline for validating against branch builds of VS.
trigger: none # Manual trigger for now
resources:
pipelines:
- pipeline: VisualStudioBuildUnderTest
source: DD-CB-ReleaseVS
branch: main
- pipeline: DartLab
source: DartLab
branch: main
repositories:
- repository: DartLabTemplates
type: git
name: DartLab.Templates
ref: refs/heads/dev/bradwhit/RemoveCheckoutNone
variables:
- name: XUNIT_LOGS
value: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)
stages:
- template: \stages\visual-studio\base.yml@DartLabTemplates
parameters:
displayName: VS Integration
testLabPoolName: VS-Platform2
visualStudioBootstrapperURI: https://vsdrop.corp.microsoft.com/file/v1/$(VisualStudio.BuildUnderTest.ProductsDropName);bootstrappers/Enterprise/vs_enterprise.exe
visualStudioInstallationParameters: --add Microsoft.VisualStudio.Component.NuGet --add Microsoft.VisualStudio.Component.Roslyn.Compiler --add Microsoft.Component.MSBuild --add Microsoft.NetCore.Component.Runtime.6.0 --add Microsoft.NetCore.Component.SDK --add Microsoft.Net.Component.4.7.2.TargetingPack --add Microsoft.VisualStudio.Component.Roslyn.LanguageServices --add Microsoft.VisualStudio.Component.FSharp --add Microsoft.ComponentGroup.ClickOnce.Publish --add Microsoft.NetCore.Component.DevelopmentTools --add Microsoft.VisualStudio.Component.MSODBC.SQL --add Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils --add Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime --add Microsoft.VisualStudio.Component.SQL.CLR --add Microsoft.VisualStudio.Component.CoreEditor --add Microsoft.VisualStudio.Workload.CoreEditor --add Microsoft.Net.Component.4.8.SDK --add Microsoft.Net.ComponentGroup.DevelopmentPrerequisites --add Microsoft.VisualStudio.Component.TypeScript.TSServer --add Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions --add Microsoft.VisualStudio.Component.JavaScript.TypeScript --add Microsoft.VisualStudio.Component.JavaScript.Diagnostics --add Microsoft.VisualStudio.Component.TextTemplating --add Component.Microsoft.VisualStudio.RazorExtension --add Microsoft.VisualStudio.Component.IISExpress --add Microsoft.VisualStudio.Component.Common.Azure.Tools --add Microsoft.Component.ClickOnce --add Microsoft.VisualStudio.Component.ManagedDesktop.Core --add Microsoft.VisualStudio.Component.SQL.SSDT --add Microsoft.VisualStudio.Component.SQL.DataSources --add Component.Microsoft.Web.LibraryManager --add Component.Microsoft.WebTools.BrowserLink.WebLivePreview --add Microsoft.VisualStudio.ComponentGroup.Web --add Microsoft.VisualStudio.Component.FSharp.WebTemplates --add Microsoft.VisualStudio.Component.DockerTools --add Microsoft.NetCore.Component.Web --add Microsoft.VisualStudio.Component.WebDeploy --add Microsoft.VisualStudio.Component.AppInsights.Tools --add Microsoft.VisualStudio.Component.Web --add Microsoft.Net.Component.4.8.TargetingPack --add Microsoft.Net.ComponentGroup.4.8.DeveloperTools --add Microsoft.VisualStudio.Component.AspNet45 --add Microsoft.VisualStudio.Component.AspNet --add Component.Microsoft.VisualStudio.Web.AzureFunctions --add Microsoft.VisualStudio.ComponentGroup.AzureFunctions --add Microsoft.VisualStudio.Component.Debugger.Snapshot --add Microsoft.VisualStudio.ComponentGroup.Web.CloudTools --add Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.Component.EntityFramework --add Microsoft.VisualStudio.Component.LiveUnitTesting --add Microsoft.VisualStudio.Component.Debugger.JustInTime --add Component.Microsoft.VisualStudio.LiveShare.2022 --add Microsoft.VisualStudio.Component.WslDebugging --add Microsoft.VisualStudio.Component.IntelliCode --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites --add Microsoft.ComponentGroup.Blend --add Microsoft.VisualStudio.Component.DotNetModelBuilder --add Microsoft.VisualStudio.Component.FSharp.Desktop --add Microsoft.VisualStudio.Component.PortableLibrary --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.Net.Component.4.6.TargetingPack --add Microsoft.VisualStudio.Component.VSSDK --add Microsoft.VisualStudio.ComponentGroup.VisualStudioExtension.Prerequisites --add Microsoft.Component.CodeAnalysis.SDK --add Microsoft.VisualStudio.Workload.VisualStudioExtension --installPath "C:\Test\VisualStudio" --quiet --norestart --wait
testExecutionJobStrategy:
maxParallel: 4
matrix:
debug_32:
_configuration: Debug
_oop64bit: false
debug_64:
_configuration: Debug
_oop64bit: true
release_32:
_configuration: Release
_oop64bit: false
release_64:
_configuration: Release
_oop64bit: true
testMachineTotalCount: 4
testAgentElevated: true
preTestMachineConfigurationStepList:
- checkout: none
- download: VisualStudioBuildUnderTest
- task: PowerShell@2
name: SetProductsDropName
displayName: Set 'VisualStudio.BuildUnderTest.ProductsDropName'
inputs:
filePath: $(DartLab.Path)\Scripts\VisualStudio\Build\Get-VisualStudioDropName.ps1
arguments: -DropNamePrefix 'Products' -VstsDropUrlsJson '$(Pipeline.Workspace)\VisualStudioBuildUnderTest\BuildArtifacts\VstsDropUrls.json' -OutVariableName 'VisualStudio.BuildUnderTest.ProductsDropName'
deployAndRunTestsStepList:
- template: eng/pipelines/test-integration-job.yml
parameters:
configuration: $(_configuration)
oop64bit: $(_oop64bit)
lspEditor: false
shallowCheckout: false
......@@ -18,11 +18,15 @@ pr:
- features/*
- demos/*
variables:
- name: XUNIT_LOGS
value: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)
jobs:
- job: VS_Integration_LSP
pool:
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open
name: NetCore1ESPool-Public
demands: ImageOverride -equals $(queueName)
timeoutInMinutes: 135
steps:
......
......@@ -15,30 +15,64 @@ pr:
- demos/*
jobs:
- job: VS_Integration
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- job: VS_Integration_Debug_32
pool:
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Open
timeoutInMinutes: 135
variables:
- name: XUNIT_LOGS
value: $(Build.SourcesDirectory)\artifacts\log\Debug
steps:
- template: eng/pipelines/test-integration-job.yml
parameters:
configuration: Debug
oop64bit: false
lspEditor: false
- job: VS_Integration_Debug_64
pool:
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Open
strategy:
maxParallel: 4
matrix:
debug_32:
_configuration: Debug
_oop64bit: false
debug_64:
_configuration: Debug
_oop64bit: true
release_32:
_configuration: Release
_oop64bit: false
release_64:
_configuration: Release
_oop64bit: true
timeoutInMinutes: 135
variables:
- name: XUNIT_LOGS
value: $(Build.SourcesDirectory)\artifacts\log\Debug
steps:
- template: eng/pipelines/test-integration-job.yml
parameters:
configuration: Debug
oop64bit: true
lspEditor: false
- job: VS_Integration_Release_32
pool:
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Open
timeoutInMinutes: 135
variables:
- name: XUNIT_LOGS
value: $(Build.SourcesDirectory)\artifacts\log\Release
steps:
- template: eng/pipelines/test-integration-job.yml
parameters:
configuration: $(_configuration)
oop64bit: $(_oop64bit)
configuration: Release
oop64bit: false
lspEditor: false
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- job: VS_Integration_Release_64
pool:
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Open
timeoutInMinutes: 135
variables:
- name: XUNIT_LOGS
value: $(Build.SourcesDirectory)\artifacts\log\Release
steps:
- template: eng/pipelines/test-integration-job.yml
parameters:
configuration: Release
oop64bit: true
lspEditor: false
......@@ -82,11 +82,11 @@ stages:
demands: ImageOverride -equals Build.Windows.Amd64.VS2022
jobs:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.1-vs-deps') }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.2') }}:
- template: /eng/common/templates/job/onelocbuild.yml
parameters:
MirrorRepo: roslyn
MirrorBranch: release/dev17.1-vs-deps
MirrorBranch: release/dev17.2
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-ROSLYN'
......
......@@ -50,7 +50,7 @@ stages:
timeoutInMinutes: 360
# Conditionally set build pool so we can share this YAML when building with different pipeline
pool:
name: VSEngSS-MicroBuild2022-1ES
name: VSEngSS-MicroBuild2019-1ES
demands:
- msbuild
- visualstudio
......@@ -90,6 +90,14 @@ stages:
inputs:
nuGetServiceConnections: azure-public/vs-impl, azure-public/vssdk
# Needed because the build fails the NuGet Tools restore without it
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
useGlobalJson: true
workingDirectory: '$(Build.SourcesDirectory)'
# Needed to restore the Microsoft.DevDiv.Optimization.Data.PowerShell package
- task: NuGetCommand@2
displayName: Restore internal tools
......
......@@ -19,7 +19,7 @@ pr: none
jobs:
- job: RichCodeNav_Indexing
pool:
name: NetCore1ESPool-Svc-Public
name: NetCore1ESPool-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open
variables:
EnableRichCodeNavigation: true
......
......@@ -30,14 +30,15 @@ jobs:
configuration: Release
queueName: Build.Windows.Amd64.VS2022.Open
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Debug 32'
jobName: Test_Windows_Desktop_Debug_32
buildJobName: Build_Windows_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testDesktop -test32
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Debug 32'
jobName: Test_Windows_Desktop_Debug_32
buildJobName: Build_Windows_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testDesktop -test32
- template: eng/pipelines/test-windows-job.yml
parameters:
......@@ -57,14 +58,15 @@ jobs:
configuration: Debug
testArguments: -testCoreClr
- template: eng/pipelines/test-windows-job-single-machine.yml
parameters:
testRunName: 'Test Windows CoreClr Debug Single Machine'
jobName: Test_Windows_CoreClr_Debug_Single_Machine
buildJobName: Build_Windows_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testCoreClr
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-windows-job-single-machine.yml
parameters:
testRunName: 'Test Windows CoreClr Debug Single Machine'
jobName: Test_Windows_CoreClr_Debug_Single_Machine
buildJobName: Build_Windows_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testCoreClr
- template: eng/pipelines/test-windows-job.yml
parameters:
......@@ -77,21 +79,22 @@ jobs:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Spanish Release 32'
jobName: Test_Windows_Desktop_Spanish_Release_32
testRunName: 'Test Windows Desktop Spanish Release 64'
jobName: Test_Windows_Desktop_Spanish_Release_64
buildJobName: Build_Windows_Release
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -test32 -helixQueueName Windows.10.Amd64.Server2022.ES.Open
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Release 64'
jobName: Test_Windows_Desktop_Release_64
buildJobName: Build_Windows_Release
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -test64
testArguments: -testDesktop -test64 -helixQueueName Windows.10.Amd64.Server2022.ES.Open
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-windows-job.yml
parameters:
testRunName: 'Test Windows Desktop Release 64'
jobName: Test_Windows_Desktop_Release_64
buildJobName: Build_Windows_Release
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -test64
- template: eng/pipelines/test-windows-job.yml
parameters:
......@@ -128,15 +131,16 @@ jobs:
configuration: Debug
testArguments: --testCoreClr --helixQueueName Ubuntu.1804.Amd64.Open
- template: eng/pipelines/test-unix-job-single-machine.yml
parameters:
testRunName: 'Test Linux Debug Single Machine'
jobName: Test_Linux_Debug_Single_Machine
buildJobName: Build_Unix_Debug
testArtifactName: Transport_Artifacts_Unix_Debug
configuration: Debug
testArguments: --testCoreClr
queueName: Build.Ubuntu.1804.Amd64.Open
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-unix-job-single-machine.yml
parameters:
testRunName: 'Test Linux Debug Single Machine'
jobName: Test_Linux_Debug_Single_Machine
buildJobName: Build_Unix_Debug
testArtifactName: Transport_Artifacts_Unix_Debug
configuration: Debug
testArguments: --testCoreClr
queueName: Build.Ubuntu.1804.Amd64.Open
- template: eng/pipelines/test-unix-job.yml
parameters:
......@@ -153,7 +157,7 @@ jobs:
- job: Correctness_Determinism
pool:
name: NetCore1ESPool-Svc-Public
name: NetCore1ESPool-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Open
timeoutInMinutes: 90
steps:
......@@ -169,7 +173,7 @@ jobs:
- job: Correctness_Build
pool:
name: NetCore1ESPool-Svc-Public
name: NetCore1ESPool-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Open
timeoutInMinutes: 90
steps:
......@@ -201,7 +205,7 @@ jobs:
- job: Correctness_Rebuild
pool:
name: NetCore1ESPool-Svc-Public
name: NetCore1ESPool-Public
demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Open
timeoutInMinutes: 90
steps:
......
......@@ -46,3 +46,10 @@ The change affects compatibility in two ways:
- DateTimeConstant(-1) will still count when we check that you don’t specify two default values. The compiler will produce an error, instead of succeeding (and producing IL with two attributes).
PR: https://github.com/dotnet/roslyn/pull/11536
# Version 4.1.0
### Can no longer inherit from CompletionService and CompletionServiceWithProviders
The constructors of Microsoft.CodeAnalysis.Completion and Microsoft.CodeAnalysis.Completion.CompletionServiceWithProviders are now internal.
Roslyn does not support implementing completion for arbitrary languages.
\ No newline at end of file
......@@ -10,14 +10,20 @@ efforts behind them.
| Feature | Branch | State | Developer | Reviewer | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- |
| [Newlines in interpolations](https://github.com/dotnet/csharplang/issues/4935) | main | [Merged in 17.1p1](https://github.com/dotnet/roslyn/issues/57154) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv), [chsienki](https://github.com/chsienki) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [List patterns](https://github.com/dotnet/csharplang/issues/3435) | [list-patterns](https://github.com/dotnet/roslyn/tree/features/list-patterns) | [Merged in 17.1p2](https://github.com/dotnet/roslyn/issues/51289) | [alrz](https://github.com/alrz) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |
| [Parameter null-checking](https://github.com/dotnet/csharplang/issues/2145) | [param-nullchecking](https://github.com/dotnet/roslyn/tree/features/param-nullchecking) | [In Progress](https://github.com/dotnet/roslyn/issues/36024) | [RikkiGibson](https://github.com/RikkiGibson), [fayrose](https://github.com/fayrose) | [cston](https://github.com/cston), [chsienki](https://github.com/chsienki) | [jaredpar](https://github.com/jaredpar) |
| [Raw string literals](https://github.com/dotnet/csharplang/issues/4304) | [RawStringLiterals](https://github.com/dotnet/roslyn/tree/features/RawStringLiterals) | [In Progress](https://github.com/dotnet/roslyn/issues/55306) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [nameof(parameter)](https://github.com/dotnet/csharplang/issues/373) | main | [In Progress](https://github.com/dotnet/roslyn/issues/40524) | [jcouv](https://github.com/jcouv) | TBD | [jcouv](https://github.com/jcouv) |
| [Relax ordering of `ref` and `partial` modifiers](https://github.com/dotnet/csharplang/issues/946) | [ref-partial](https://github.com/dotnet/roslyn/tree/features/ref-partial) | In Progress | [alrz](https://github.com/alrz) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [Parameter null-checking](https://github.com/dotnet/csharplang/issues/2145) | [param-nullchecking](https://github.com/dotnet/roslyn/tree/features/param-nullchecking) | [In Progress](https://github.com/dotnet/roslyn/issues/36024) | [fayrose](https://github.com/fayrose) | [agocke](https://github.com/agocke) | [jaredpar](https://github.com/jaredpar) |
| [Generic attributes](https://github.com/dotnet/csharplang/issues/124) | [generic-attributes](https://github.com/dotnet/roslyn/tree/features/generic-attributes) | [Merged into 17.0p4 (preview langver)](https://github.com/dotnet/roslyn/issues/36285) | [AviAvni](https://github.com/AviAvni) | [RikkiGibson](https://github.com/RikkiGibson), [jcouv](https://github.com/jcouv) | [mattwar](https://github.com/mattwar) |
| [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [Implemented](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [List patterns](https://github.com/dotnet/csharplang/issues/3435) | [list-patterns](https://github.com/dotnet/roslyn/tree/features/list-patterns) | [In Progress](https://github.com/dotnet/roslyn/issues/51289) | [alrz](https://github.com/alrz) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |
| [Raw string literals](https://github.com/dotnet/csharplang/issues/4304) | [RawStringLiterals](https://github.com/dotnet/roslyn/tree/features/features/RawStringLiterals) | [In Progress](https://github.com/dotnet/roslyn/issues/55306) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Semi-auto-properties](https://github.com/dotnet/csharplang/issues/140) | [semi-auto-props](https://github.com/dotnet/roslyn/tree/features/semi-auto-props) | [In Progress](https://github.com/dotnet/roslyn/issues/57012) | [Youssef1313](https://github.com/Youssef1313) | [333fred](https://github.com/333fred), [RikkiGibson](https://github.com/RikkiGibson) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Required members](https://github.com/dotnet/csharplang/issues/3630) | [required-members](https://github.com/dotnet/roslyn/tree/features/required-members) | [In Progress](https://github.com/dotnet/roslyn/issues/57046) | [333fred](https://github.com/333fred) | [jcouv](https://github.com/jcouv), [RikkiGibson](https://github.com/RikkiGibson) | [333fred](https://github.com/333fred) |
| [Top Level statement attribute specifiers](https://github.com/dotnet/csharplang/issues/5045) | [main-attributes](https://github.com/dotnet/roslyn/tree/features/main-attributes) | [In Progress](https://github.com/dotnet/roslyn/issues/57047) | [chsienki](https://github.com/chsienki) | TBD | [jaredpar](https://github.com/jaredpar) |
| [Primary Constructors](https://github.com/dotnet/csharplang/issues/2691) | [primary-constructors](https://github.com/dotnet/roslyn/tree/features/primary-constructors) | [In Progress](https://github.com/dotnet/roslyn/issues/57048) | TBD | TBD | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Params Span\<T> + Stackalloc any array type](https://github.com/dotnet/csharplang/issues/1757) | [params-span](https://github.com/dotnet/roslyn/tree/features/params-span) | [In Progress](https://github.com/dotnet/roslyn/issues/57049) | [cston](https://github.com/cston) | TBD | [jaredpar](https://github.com/jaredpar) |
# C# 10.0
| Feature | Branch | State | Developer | Reviewer | LDM Champ |
......@@ -39,6 +45,12 @@ efforts behind them.
| [Parameterless struct constructors](https://github.com/dotnet/csharplang/issues/99) | [struct-ctors](https://github.com/dotnet/roslyn/tree/features/struct-ctors) | [Merged into 17.0p3](https://github.com/dotnet/roslyn/issues/51698) | [cston](https://github.com/cston) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [jcouv](https://github.com/jouv) |
| [Caller expression attribute](https://github.com/dotnet/csharplang/issues/287) | main | [Merged into 17.0p3](https://github.com/dotnet/roslyn/issues/52745) | [Youssef1313](https://github.com/Youssef1313) | [333fred](https://github.com/333fred),[AlekseyTs](https://github.com/AlekseyTs) | [jcouv](https://github.com/jcouv) |
# VB 17.0
| Feature | Branch | State | Developer | Reviewer | LDM Champ |
|-------------------------------------------------------------------------------------------|--------|------------------------------------------------------------------|-------------------------------------------|-----------------------------------|-----------|
| [Caller expression attribute](https://github.com/dotnet/csharplang/issues/287) | main | [Merged into 17.0p3](https://github.com/dotnet/roslyn/issues/52745) | [Youssef1313](https://github.com/Youssef1313) | [333fred](https://github.com/333fred),[AlekseyTs](https://github.com/AlekseyTs) | [jcouv](https://github.com/jcouv) |
# VB 16.9
| Feature | Branch | State | Developer | Reviewer | LDM Champ |
......
# Feature Request
https://github.com/dotnet/roslyn/issues/30172: _Programmatic suppression of warnings_
Provide an ability for platform/library authors to author simple, context-aware compiler extensions to programmatically suppress specific instances of reported analyzer and/or compiler diagnostics, which are always known to be false positives in the context of the platform/library.
# Programmatically Suppressible Diagnostic
An analyzer/compiler diagnostic would be considered a candidate for programmatic suppression if **all** of the following conditions hold:
1. _Not an error by default_: Diagnostic's [DefaultSeverity](http://source.roslyn.io/#Microsoft.CodeAnalysis/Diagnostic/Diagnostic.cs,8e27a878b4d6e40c) is *not* [DiagnosticSeverity.Error](http://source.roslyn.io/#Microsoft.CodeAnalysis/Diagnostic/DiagnosticSeverity.cs,f771032fb5a00c1c).
2. _Must be configurable_: Diagnostic is *not* tagged with [WellKnownDiagnosticTags.NotConfigurable](http://source.roslyn.io/#Microsoft.CodeAnalysis/Diagnostic/WellKnownDiagnosticTags.cs,207e57dd0b96bd4b) custom tag, indicating that its severity is configurable.
3. _No existing source suppression_: Diagnostic is *not* already suppressed in source via pragma/suppress message attribute.
# Core Design
1. _For platform/library authors:_ Expose a new "DiagnosticSuppressor" public API for authoring such compiler extensions. API contract for the suppressors (detailed API with doc comments in the [last section](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#detailed-api-proposal-with-documentation-comments-from-the-draft-pr)):
1. Declaratively provide all the analyzer and/or compiler diagnostic IDs that can be suppressed by it.
2. For each such suppressible diagnostic ID, provide a unique suppression ID and justification. These are required to enable proper diagnosis and configuration of each suppression (covered in detail [later](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#example-experience-with-screenshots)).
3. Register callbacks for reported analyzer and/or compiler diagnostics with these suppressible diagnostic IDs. The callback can analyze the syntax and/or semantics of the diagnostic location and report a suppression for it.
4. DiagnosticSuppressors would *not* be able to register any another analysis callbacks, and hence cannot report any new diagnostics.
2. _For end users:_
1. Seamless development experience when targeting such a platform/library, whereby the users do not see false positives from analyzers/compiler in their development context.
2. End users do not need to manually add and/or maintain source suppressions through pragmas/SuppressMessageAttributes for such context-specific false positives.
3. End users still have the ultimate control over suppressors (specifics covered in [later section](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#example-experience-with-screenshots)):
1. Audit: Diagnostic suppressions are logged as "Info" diagnostics on the command line, so the end users can audit each suppression in the verbose build log or msbuild binlog. Additionally, they are also logged in the [/errorlog SARIF file](https://github.com/dotnet/roslyn/blob/master/docs/compilers/Error%20Log%20Format.md) as suppressed diagnostics.
2. Configuration: Each diagnostic suppression has an associated suppression ID. This is clearly indicated in the logged "Info" diagnostics for suppressions, and the end users can disable the bucket of suppressions under any specific suppression ID with simple command line argument or ruleset entries.
3. _For analyzer driver:_
1. Order of execution between analyzers/compiler and suppressors: For command line builds, all diagnostic suppressors will run **after** all the analyzer and compiler diagnostics have been computed. For live analysis in Visual Studio, diagnostic suppressors may be invoked with a subset of the full set of reported diagnostics, as an optimization for supporting incremental and partial analysis scenarios.
2. Order of execution between individual suppressors: Execution of diagnostic suppressors would be independent of other suppressors. Diagnostic suppressions reported by one suppressor would not affect the input set of reported diagnostics passed to any other suppressor. Each diagnostic might be programmatically suppressed by more then one suppressor, so the analyzer driver will union all the reported suppressions for each diagnostic. Command line compiler will log one suppression diagnostic per-suppression for each programmatically suppressed diagnostic.
# Development Experience Example
Let us consider the core example for UnityEngine covered in https://github.com/dotnet/roslyn/issues/30172:
```csharp
using UnityEngine;
class BulletMovement : MonoBehaviour
{
[SerializeField] private float speed;
private void Update()
{
this.transform.position *= speed;
}
}
```
Serialization frameworks and tools embedding .NET Core or Mono often set the value of fields or call methods outside of user code. Such code is not available for analysis to the compiler and analyzers, leading to false reports such as following:
1. [CS0649](https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0649): `Field 'speed' is never assigned to, and will always have its default value 0`
2. [IDE0044 dotnet_style_readonly_field](https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2019): Make field 'speed' readonly
## New experience with screenshots:
1. _For platform/library authors:_ UnityEngine can selectively suppress instances of such diagnostics by writing a simple [SerializedFieldDiagnosticSuppressor](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#file-serializedfielddiagnosticsuppressor-cs) extension based on the DiagnosticSuppressor API and packaging it along with the Unity framework SDK/library.
2. _For end users:_
1. Users do not see above false positives in the IDE live analysis or command line build. For example, see the below screenshots with and without the SerializedFieldDiagnosticSuppressor:
1. Without the suppressor: See image [here](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#file-without_suppressor-png)
2. With the suppressor: See image [here](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#file-with_suppressor-png)
2. Audit suppressions:
1. Command line build: End users will see "Info" severity suppression diagnostics in command line builds, see image [here](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#file-suppression_info_diagnostic-png)
`info SPR0001: Diagnostic 'CS0649' was programmatically suppressed by a DiagnosticSuppressor with suppresion ID 'SPR1001' and justification 'Field symbols marked with SerializedFieldAttribute are implicitly assigned by UnityEngine at runtime and hence do not have its default value'`
These diagnostics will *always* be logged in the [msbuild binlog](https://github.com/Microsoft/msbuild/blob/master/documentation/wiki/Binary-Log.md). They would not be visible in the console output for regular msbuild invocations, but increasing the msbuild verbosity to detailed or diagnostic will emit these diagnostics.
2. Visual Studio IDE: Users can see the original suppressed diagnostic in the Visual Studio Error List when they change the default filter for the "Suppression State" column in the error list to include "Suppressed" diagnostics, see image [here](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#file-view_suppressed_diagnostic_errorlist-png). In future, we also plan to add a new error list column, possibly named "Suppression Source", which will display the suppression ID and justification associated with each programmatic suppression.
3. Disable suppressors: End users can disable specific suppression IDs from an analyzer package using the following two mechanisms:
1. `/nowarn:<%suppression_id%>`: See image [here](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#file-disable_suppressor_nowarn-png) for disabling the suppression ID from the project property page, which in turn generates the nowarn command line argument.
2. Ruleset entry: See image [here](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#file-disable_suppressor_rulesetentry-png) for disabling the suppression ID using a [CodeAnalysis ruleset](https://docs.microsoft.com/en-us/visualstudio/code-quality/using-rule-sets-to-group-code-analysis-rules?view=vs-2019)
# Open Questions:
1. _Should the DiagnsoticSuppressor feature be Opt-in OR on-by-default:_ This was brought up few times in the past, especially with the concern with _on-by-default_ behavior being that an end user would not see any indication in the command line that diagnostic suppressors were executed as part of their build. I think we have following options:
1. Opt-in:
1. Keep the feature behind a new, _permanent_ feature flag: This way the command line arguments will always indicate if diagnostic suppressors were involved in the build.
2. Add a new command line switch to enable suppressors
2. On-By-default: No command line argument indicating suppressors are involved in a build, but users can look at binlogs and/or verbose msbuild output logs to determine the same.
The [draft PR](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#draft-pr-implementing-the-above-proposal) for this feature currently puts the feature being a feature flag. If we decide to take the _on-by-default_ route, I can revert the changes adding the feature flag. Otherwise, if we decide that we should make it opt-in with a new command line compiler switch, I would like to propose that we keep the feature flag for the initial PR, and then have a follow-up PR to add the command line switch.
**Update:** We have decided to keep the feature being a temporary feature flag for initial release, which will be removed once we are confident about the feature's performance, user experience, etc.
2. _Message for the "Info" suppression diagnostic_: I have chosen the below message format (with 3 format arguments), but any suggested changes are welcome:
`Diagnostic 'CS0649' was programmatically suppressed by a DiagnosticSuppressor with suppresion ID 'SPR1001' and justification 'Field symbols marked with SerializedFieldAttribute are implicitly assigned by UnityEngine at runtime and hence do not have its default value'`
3. _What should be the diagnostic ID for the "Info" suppression diagnostic?_: We have following options:
1. Use a CSxxxx/BCxxxx diagnostic ID for the suppression diagnostic so it is evident that the diagnostic is coming from the core compiler.
2. Use a distinct diagnostic prefix, such as 'SPR0001', similar to the way we report 'AD0001' diagnostics for analyzer exceptions. This provides a separate bucketing/categorization for these special suppression diagnostics.
The [draft PR](https://gist.github.com/mavasani/fcac17a9581b5c54cef8a689eeec954a#draft-pr-implementing-the-above-proposal) chooses the second approach with 'SPR0001' as the diagnostic ID.
**Update:** We have decided the diagnostic ID would be `SP0001`.
# Draft PR implementing the above proposal:
https://github.com/dotnet/roslyn/pull/36067
# Detailed API proposal with documentation comments from the Draft PR
```csharp
namespace Microsoft.CodeAnalysis.Diagnostics
{
/// <summary>
/// The base type for diagnostic suppressors that can programmatically suppress analyzer and/or compiler non-error diagnostics.
/// </summary>
public abstract class DiagnosticSuppressor : DiagnosticAnalyzer
{
// Disallow suppressors from reporting diagnostics or registering analysis actions.
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray<DiagnosticDescriptor>.Empty;
public sealed override void Initialize(AnalysisContext context) { }
/// <summary>
/// Returns a set of descriptors for the suppressions that this suppressor is capable of producing.
/// </summary>
public abstract ImmutableArray<SuppressionDescriptor> SupportedSuppressions { get; }
/// <summary>
/// Suppress analyzer and/or compiler non-error diagnostics reported for the compilation.
/// This may be a subset of the full set of reported diagnostics, as an optimization for
/// supporting incremental and partial analysis scenarios.
/// A diagnostic is considered suppressible by a DiagnosticSuppressor if *all* of the following conditions are met:
/// 1. Diagnostic is not already suppressed in source via pragma/suppress message attribute.
/// 2. Diagnostic's <see cref="Diagnostic.DefaultSeverity"/> is not <see cref="DiagnosticSeverity.Error"/>.
/// 3. Diagnostic is not tagged with <see cref="WellKnownDiagnosticTags.NotConfigurable"/> custom tag.
/// </summary>
public abstract void ReportSuppressions(SuppressionAnalysisContext context);
}
/// <summary>
/// Provides a description about a programmatic suppression of a <see cref="Diagnostic"/> by a <see cref="DiagnosticSuppressor"/>.
/// </summary>
public sealed class SuppressionDescriptor : IEquatable<SuppressionDescriptor>
{
/// <summary>
/// An unique identifier for the suppression.
/// </summary>
public string Id { get; }
/// <summary>
/// Identifier of the suppressed diagnostic, i.e. <see cref="Diagnostic.Id"/>.
/// </summary>
public string SuppressedDiagnosticId { get; }
/// <summary>
/// A localizable description about the suppression.
/// </summary>
public LocalizableString Description { get; }
}
/// <summary>
/// Context for suppressing analyzer and/or compiler non-error diagnostics reported for the compilation.
/// </summary>
public struct SuppressionAnalysisContext
{
/// <summary>
/// Suppressible analyzer and/or compiler non-error diagnostics reported for the compilation.
/// This may be a subset of the full set of reported diagnostics, as an optimization for
/// supporting incremental and partial analysis scenarios.
/// A diagnostic is considered suppressible by a DiagnosticSuppressor if *all* of the following conditions are met:
/// 1. Diagnostic is not already suppressed in source via pragma/suppress message attribute.
/// 2. Diagnostic's <see cref="Diagnostic.DefaultSeverity"/> is not <see cref="DiagnosticSeverity.Error"/>.
/// 3. Diagnostic is not tagged with <see cref="WellKnownDiagnosticTags.NotConfigurable"/> custom tag.
/// </summary>
public ImmutableArray<Diagnostic> ReportedDiagnostics { get; }
/// <summary>
/// Report a <see cref="Suppression"/> for a reported diagnostic.
/// </summary>
public void ReportSuppression(Suppression suppression);
/// <summary>
/// Gets a <see cref="SemanticModel"/> for the given <see cref="SyntaxTree"/>, which is shared across all analyzers.
/// </summary>
public SemanticModel GetSemanticModel(SyntaxTree syntaxTree);
/// <summary>
/// <see cref="CodeAnalysis.Compilation"/> for the context.
/// </summary>
public Compilation Compilation { get; }
/// <summary>
/// Options specified for the analysis.
/// </summary>
public AnalyzerOptions Options { get; }
/// <summary>
/// Token to check for requested cancellation of the analysis.
/// </summary>
public CancellationToken CancellationToken { get; }
}
/// <summary>
/// Programmatic suppression of a <see cref="Diagnostic"/> by a <see cref="DiagnosticSuppressor"/>.
/// </summary>
public struct Suppression
{
/// <summary>
/// Creates a suppression of a <see cref="Diagnostic"/> with the given <see cref="SuppressionDescriptor"/>.
/// </summary>
/// <param name="descriptor">
/// Descriptor for the suppression, which must be from <see cref="DiagnosticSuppressor.SupportedSuppressions"/>
/// for the <see cref="DiagnosticSuppressor"/> creating this suppression.
/// </param>
/// <param name="suppressedDiagnostic">
/// <see cref="Diagnostic"/> to be suppressed, which must be from <see cref="SuppressionAnalysisContext.ReportedDiagnostics"/>
/// for the suppression context in which this suppression is being created.</param>
public static Suppression Create(SuppressionDescriptor descriptor, Diagnostic suppressedDiagnostic);
/// <summary>
/// Descriptor for this suppression.
/// </summary>
public SuppressionDescriptor Descriptor { get; }
/// <summary>
/// Diagnostic suppressed by this suppression.
/// </summary>
public Diagnostic SuppressedDiagnostic { get; }
}
}
```
## This document lists known breaking changes in Roslyn after .NET 6 all the way to .NET 7.
1. In Visual Studio 17.1, the contextual keyword `var` cannot be used as an explicit lambda return type.
```csharp
using System;
F(var () => default); // error: 'var' cannot be used as an explicit lambda return type
F(@var () => default); // ok
static void F(Func<var> f) { }
class var { }
```
2. In Visual Studio 17.1, indexers that take an interpolated string handler and require the receiver as an input for the constructor cannot be used in an object initializer.
```cs
using System.Runtime.CompilerServices;
_ = new C { [$""] = 1 }; // error: Interpolated string handler conversions that reference the instance being indexed cannot be used in indexer member initializers.
class C
{
public int this[[InterpolatedStringHandlerArgument("")] CustomHandler c]
{
get => throw null;
set => throw null;
}
}
[InterpolatedStringHandler]
class CustomHandler
{
public CustomHandler(int literalLength, int formattedCount, C c) {}
}
```
3. In Visual Studio 17.1, `ref`/`ref readonly`/`in`/`out` are not allowed to be used on return/parameters of a method attributed with `UnmanagedCallersOnly`.
https://github.com/dotnet/roslyn/issues/57025
```cs
using System.Runtime.InteropServices;
[UnmanagedCallersOnly]
static ref int M1() => throw null; // error CS8977: Cannot use 'ref', 'in', or 'out' in a method attributed with 'UnmanagedCallersOnly'.
[UnmanagedCallersOnly]
static ref readonly int M2() => throw null; // error CS8977: Cannot use 'ref', 'in', or 'out' in a method attributed with 'UnmanagedCallersOnly'.
[UnmanagedCallersOnly]
static void M3(ref int o) => throw null; // error CS8977: Cannot use 'ref', 'in', or 'out' in a method attributed with 'UnmanagedCallersOnly'.
[UnmanagedCallersOnly]
static void M4(in int o) => throw null; // error CS8977: Cannot use 'ref', 'in', or 'out' in a method attributed with 'UnmanagedCallersOnly'.
[UnmanagedCallersOnly]
static void M5(out int o) => throw null; // error CS8977: Cannot use 'ref', 'in', or 'out' in a method attributed with 'UnmanagedCallersOnly'.
```
4. Beginning with C# 11.0, `Length` and `Count` properties on countable and indexable types
are assumed to be non-negative for purpose of subsumption and exhaustiveness analysis of patterns and switches.
Those types can be used with implicit Index indexer and list patterns.
```csharp
void M(int[] i)
{
if (i is { Length: -1 }) {} // error: impossible under assumption of non-negative length
}
```
5. Starting with Visual Studio 17.1, format specifiers in interpolated strings can not contain curly braces (either `{` or `}`). In previous versions `{{` was interpreted as an escaped `{` and `}}` was interpreted as an escaped `}` char in the format specifier. Now the first `}` char in a format specifier ends the interpolation, and any `{` char is an error.
https://github.com/dotnet/roslyn/issues/5775
```csharp
using System;
Console.WriteLine($"{{{12:X}}}");
//prints now: "{C}" - not "{X}}"
```
6. Starting with Visual Studio 17.1, `struct` type declarations with field initializers must include an explicitly declared constructor.
```csharp
struct S
{
int X = 1; // error: struct with field initializers must include an explicitly declared constructor
}
```
......@@ -33,3 +33,4 @@ The table below describes all of the warnings controlled by warning levels `5` o
| CS8892 | 5 | [Multiple entry points](https://github.com/dotnet/roslyn/issues/46831) |
| CS8897 | 5 | [Static class used as the parameter type of a method in an interface type](https://github.com/dotnet/roslyn/issues/38256) |
| CS8898 | 5 | [Static class used as the return type of a method in an interface type](https://github.com/dotnet/roslyn/issues/38256) |
| CS8981 | 7 | [Type names only containing lower-cased ascii characters may become reserved for the language](https://github.com/dotnet/roslyn/issues/56653) |
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册