Skip to content

Commit 96698d9

Browse files
committed
Merge remote-tracking branch 'upstream/main' into merges/main-to-features/param-nullchecking
2 parents ed3de52 + 506fc4d commit 96698d9

File tree

857 files changed

+118850
-9325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

857 files changed

+118850
-9325
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"**/eng/pipelines/*.yml": "azure-pipelines"
4+
}
5+
}

Roslyn.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,9 @@ EndProject
501501
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}"
502502
EndProject
503503
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}"
504+
ProjectSection(ProjectDependencies) = postProject
505+
{201EC5B7-F91E-45E5-B9F2-67A266CCE6FC} = {201EC5B7-F91E-45E5-B9F2-67A266CCE6FC}
506+
EndProjectSection
504507
EndProject
505508
Global
506509
GlobalSection(SharedMSBuildProjectFiles) = preSolution

Verify.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -build -restore -rebuild -pack -test -runAnalyzers -warnAsError %*"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Roslyn integration test pipeline for validating against branch builds of VS.
2+
3+
trigger: none # Manual trigger for now
4+
5+
resources:
6+
pipelines:
7+
- pipeline: VisualStudioBuildUnderTest
8+
source: DD-CB-ReleaseVS
9+
branch: main
10+
- pipeline: DartLab
11+
source: DartLab
12+
branch: main
13+
repositories:
14+
- repository: DartLabTemplates
15+
type: git
16+
name: DartLab.Templates
17+
ref: refs/heads/dev/bradwhit/RemoveCheckoutNone
18+
19+
variables:
20+
- name: XUNIT_LOGS
21+
value: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)
22+
23+
stages:
24+
- template: \stages\visual-studio\base.yml@DartLabTemplates
25+
parameters:
26+
displayName: VS Integration
27+
testLabPoolName: VS-Platform2
28+
visualStudioBootstrapperURI: https://vsdrop.corp.microsoft.com/file/v1/$(VisualStudio.BuildUnderTest.ProductsDropName);bootstrappers/Enterprise/vs_enterprise.exe
29+
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
30+
testExecutionJobStrategy:
31+
maxParallel: 4
32+
matrix:
33+
debug_32:
34+
_configuration: Debug
35+
_oop64bit: false
36+
debug_64:
37+
_configuration: Debug
38+
_oop64bit: true
39+
release_32:
40+
_configuration: Release
41+
_oop64bit: false
42+
release_64:
43+
_configuration: Release
44+
_oop64bit: true
45+
testMachineTotalCount: 4
46+
testAgentElevated: true
47+
preTestMachineConfigurationStepList:
48+
- checkout: none
49+
- download: VisualStudioBuildUnderTest
50+
- task: PowerShell@2
51+
name: SetProductsDropName
52+
displayName: Set 'VisualStudio.BuildUnderTest.ProductsDropName'
53+
inputs:
54+
filePath: $(DartLab.Path)\Scripts\VisualStudio\Build\Get-VisualStudioDropName.ps1
55+
arguments: -DropNamePrefix 'Products' -VstsDropUrlsJson '$(Pipeline.Workspace)\VisualStudioBuildUnderTest\BuildArtifacts\VstsDropUrls.json' -OutVariableName 'VisualStudio.BuildUnderTest.ProductsDropName'
56+
deployAndRunTestsStepList:
57+
- template: eng/pipelines/test-integration-job.yml
58+
parameters:
59+
configuration: $(_configuration)
60+
oop64bit: $(_oop64bit)
61+
lspEditor: false
62+
shallowCheckout: false

azure-pipelines-official.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ stages:
6868
displayName: Build and Test
6969

7070
jobs:
71-
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.0-vs-deps') }}:
71+
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.1-vs-deps') }}:
7272
- template: /eng/common/templates/job/onelocbuild.yml
7373
parameters:
7474
MirrorRepo: roslyn
75-
MirrorBranch: release/dev17.0-vs-deps
75+
MirrorBranch: release/dev17.1-vs-deps
7676
LclSource: lclFilesfromPackage
7777
LclPackageId: 'LCL-JUNO-PROD-ROSLYN'
7878

azure-pipelines.yml

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ jobs:
3030
configuration: Release
3131
queueName: Build.Windows.Amd64.VS2022.Pre.Open
3232

33-
- template: eng/pipelines/test-windows-job.yml
34-
parameters:
35-
testRunName: 'Test Windows Desktop Debug 32'
36-
jobName: Test_Windows_Desktop_Debug_32
37-
buildJobName: Build_Windows_Debug
38-
testArtifactName: Transport_Artifacts_Windows_Debug
39-
configuration: Debug
40-
testArguments: -testDesktop -test32
33+
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
34+
- template: eng/pipelines/test-windows-job.yml
35+
parameters:
36+
testRunName: 'Test Windows Desktop Debug 32'
37+
jobName: Test_Windows_Desktop_Debug_32
38+
buildJobName: Build_Windows_Debug
39+
testArtifactName: Transport_Artifacts_Windows_Debug
40+
configuration: Debug
41+
testArguments: -testDesktop -test32
4142

4243
- template: eng/pipelines/test-windows-job.yml
4344
parameters:
@@ -57,14 +58,15 @@ jobs:
5758
configuration: Debug
5859
testArguments: -testCoreClr
5960

60-
- template: eng/pipelines/test-windows-job-single-machine.yml
61-
parameters:
62-
testRunName: 'Test Windows CoreClr Debug Single Machine'
63-
jobName: Test_Windows_CoreClr_Debug_Single_Machine
64-
buildJobName: Build_Windows_Debug
65-
testArtifactName: Transport_Artifacts_Windows_Debug
66-
configuration: Debug
67-
testArguments: -testCoreClr
61+
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
62+
- template: eng/pipelines/test-windows-job-single-machine.yml
63+
parameters:
64+
testRunName: 'Test Windows CoreClr Debug Single Machine'
65+
jobName: Test_Windows_CoreClr_Debug_Single_Machine
66+
buildJobName: Build_Windows_Debug
67+
testArtifactName: Transport_Artifacts_Windows_Debug
68+
configuration: Debug
69+
testArguments: -testCoreClr
6870

6971
- template: eng/pipelines/test-windows-job.yml
7072
parameters:
@@ -77,21 +79,22 @@ jobs:
7779

7880
- template: eng/pipelines/test-windows-job.yml
7981
parameters:
80-
testRunName: 'Test Windows Desktop Spanish Release 32'
81-
jobName: Test_Windows_Desktop_Spanish_Release_32
82+
testRunName: 'Test Windows Desktop Spanish Release 64'
83+
jobName: Test_Windows_Desktop_Spanish_Release_64
8284
buildJobName: Build_Windows_Release
8385
testArtifactName: Transport_Artifacts_Windows_Release
8486
configuration: Release
85-
testArguments: -testDesktop -test32 -helixQueueName Windows.10.Amd64.Server19H1.ES.Open
86-
87-
- template: eng/pipelines/test-windows-job.yml
88-
parameters:
89-
testRunName: 'Test Windows Desktop Release 64'
90-
jobName: Test_Windows_Desktop_Release_64
91-
buildJobName: Build_Windows_Release
92-
testArtifactName: Transport_Artifacts_Windows_Release
93-
configuration: Release
94-
testArguments: -testDesktop -test64
87+
testArguments: -testDesktop -test64 -helixQueueName Windows.10.Amd64.Server19H1.ES.Open
88+
89+
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
90+
- template: eng/pipelines/test-windows-job.yml
91+
parameters:
92+
testRunName: 'Test Windows Desktop Release 64'
93+
jobName: Test_Windows_Desktop_Release_64
94+
buildJobName: Build_Windows_Release
95+
testArtifactName: Transport_Artifacts_Windows_Release
96+
configuration: Release
97+
testArguments: -testDesktop -test64
9598

9699
- template: eng/pipelines/test-windows-job.yml
97100
parameters:
@@ -128,15 +131,16 @@ jobs:
128131
configuration: Debug
129132
testArguments: --testCoreClr --helixQueueName Ubuntu.1804.Amd64.Open
130133

131-
- template: eng/pipelines/test-unix-job-single-machine.yml
132-
parameters:
133-
testRunName: 'Test Linux Debug Single Machine'
134-
jobName: Test_Linux_Debug_Single_Machine
135-
buildJobName: Build_Unix_Debug
136-
testArtifactName: Transport_Artifacts_Unix_Debug
137-
configuration: Debug
138-
testArguments: --testCoreClr
139-
queueName: 'Build.Ubuntu.1804.amd64.Open'
134+
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
135+
- template: eng/pipelines/test-unix-job-single-machine.yml
136+
parameters:
137+
testRunName: 'Test Linux Debug Single Machine'
138+
jobName: Test_Linux_Debug_Single_Machine
139+
buildJobName: Build_Unix_Debug
140+
testArtifactName: Transport_Artifacts_Unix_Debug
141+
configuration: Debug
142+
testArguments: --testCoreClr
143+
queueName: 'Build.Ubuntu.1804.amd64.Open'
140144

141145
- template: eng/pipelines/test-unix-job.yml
142146
parameters:

docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
}
3636
```
3737

38-
3938
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`.
4039
https://github.com/dotnet/roslyn/issues/57025
4140
@@ -56,3 +55,25 @@ https://github.com/dotnet/roslyn/issues/57025
5655
[UnmanagedCallersOnly]
5756
static void M5(out int o) => throw null; // error CS8977: Cannot use 'ref', 'in', or 'out' in a method attributed with 'UnmanagedCallersOnly'.
5857
```
58+
59+
4. Beginning with C# 11.0, `Length` and `Count` properties on countable and indexable types
60+
are assumed to be non-negative for purpose of subsumption and exhaustiveness analysis of patterns and switches.
61+
Those types can be used with implicit Index indexer and list patterns.
62+
63+
```csharp
64+
void M(int[] i)
65+
{
66+
if (i is { Length: -1 }) {} // error: impossible under assumption of non-negative length
67+
}
68+
```
69+
70+
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.
71+
https://github.com/dotnet/roslyn/issues/5775
72+
73+
```csharp
74+
using System;
75+
76+
Console.WriteLine($"{{{12:X}}}");
77+
78+
//prints now: "{C}" - not "{X}}"
79+
```

docs/compilers/CSharp/Warnversion Warning Waves.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ The table below describes all of the warnings controlled by warning levels `5` o
3333
| CS8892 | 5 | [Multiple entry points](https://github.com/dotnet/roslyn/issues/46831) |
3434
| CS8897 | 5 | [Static class used as the parameter type of a method in an interface type](https://github.com/dotnet/roslyn/issues/38256) |
3535
| CS8898 | 5 | [Static class used as the return type of a method in an interface type](https://github.com/dotnet/roslyn/issues/38256) |
36+
| CS8981 | 7 | [Type names only containing lower-cased ascii characters may become reserved for the language](https://github.com/dotnet/roslyn/issues/56653) |

docs/contributing/Building, Debugging, and Testing on Unix.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Building, Debugging and Testing on Unix
2-
This guide is meant to help developers setup an environment for debugging / contributing to Roslyn from Linux.
3-
Particularly for developers who aren't experienced with .NET Core development on Linux.
2+
This guide is meant to help developers setup an environment for debugging / contributing to Roslyn from Linux.
3+
Particularly for developers who aren't experienced with .NET Core development on Linux.
44

55
## Working with the code
66
1. Ensure the commands `git` and `curl` are available
@@ -12,7 +12,7 @@ Particularly for developers who aren't experienced with .NET Core development on
1212
1. Install [VS Code](https://code.visualstudio.com/Download)
1313
- After you install VS Code, install the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)
1414
- Important tip: You can look up editor commands by name by hitting *Ctrl+Shift+P*, or by hitting *Ctrl+P* and typing a `>` character. This will help you get familiar with editor commands mentioned below. On a Mac, use ** instead of *Ctrl*.
15-
2. Install the [.NET 6.0 RC 2 SDK](https://dotnet.microsoft.com/download/dotnet-core/6.0).
15+
2. Install the [.NET 6.0 SDK](https://dotnet.microsoft.com/download/dotnet-core/6.0).
1616
3. You can build from VS Code by running the *Run Build Task* command, then selecting an appropriate task such as *build* or *build current project* (the latter builds the containing project for the current file you're viewing in the editor).
1717
4. You can run tests from VS Code by opening a test class in the editor, then using the *Run Tests in Context* and *Debug Tests in Context* editor commands. You may want to bind these commands to keyboard shortcuts that match their Visual Studio equivalents (**Ctrl+R, T** for *Run Tests in Context* and **Ctrl+R, Ctrl+T** for *Debug Tests in Context*).
1818

@@ -23,14 +23,14 @@ To run all tests in a single project, it's recommended to use the `dotnet test p
2323

2424
## GitHub
2525
The best way to clone and push is to use SSH. On Windows you typically use HTTPS and this is not directly compatible
26-
with two factor authentication (requires a PAT). The SSH setup is much simpler and GitHub has a great HOWTO for
26+
with two factor authentication (requires a PAT). The SSH setup is much simpler and GitHub has a great HOWTO for
2727
getting this setup.
2828

2929
https://help.github.com/articles/connecting-to-github-with-ssh/
3030

3131
## Debugging test failures
3232
The best way to debug is using lldb with the SOS plugin. This is the same SOS as used in WinDbg and if you're familiar
33-
with it then lldb debugging will be pretty straight forward.
33+
with it then lldb debugging will be pretty straight forward.
3434

3535
The [dotnet/diagnostics](https://github.com/dotnet/diagnostics) repo has more information:
3636

@@ -45,10 +45,10 @@ CoreCLR also has some guidelines for specific Linux debugging scenarios:
4545

4646
Corrections:
4747
- LLDB and createdump must be run as root
48-
- `dotnet tool install -g dotnet-symbol` must be run from `$HOME`
48+
- `dotnet tool install -g dotnet-symbol` must be run from `$HOME`
4949

5050
### Core Dumps
51-
The CoreClr does not used the standard core dumping mechanisms on Linux. Instead you must specify via
51+
The CoreClr does not used the standard core dumping mechanisms on Linux. Instead you must specify via
5252
environment variables that you want a core dump to be produced. The simplest setup is to do the following:
5353

5454
```
@@ -79,12 +79,12 @@ indeed crashing in the GC.
7979
Note: this variables can also be used on Windows as well.
8080

8181
## Ubuntu 18.04
82-
The recommended OS for developing Roslyn is Ubuntu 18.04. This guide was written using Ubuntu 18.04 but should be
82+
The recommended OS for developing Roslyn is Ubuntu 18.04. This guide was written using Ubuntu 18.04 but should be
8383
applicable to most Linux environments. Ubuntu 18.04 was chosen here due to it's support for enhanced VMs in Hyper-V.
8484
This makes it easier to use from a Windows machine: full screen, copy / paste, etc ...
8585

8686
### Hyper-V
87-
Hyper-V has a builtin Ubuntu 18.04 image which supports enhanced mode. Here is a tutorial for creating
87+
Hyper-V has a builtin Ubuntu 18.04 image which supports enhanced mode. Here is a tutorial for creating
8888
such an image:
8989

9090
https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/quick-create-virtual-machine
@@ -93,10 +93,10 @@ When following this make sure to:
9393
1. Click Installation Source and uncheck "Windows Secure Boot"
9494
1. Complete the Ubuntu installation wizard. Full screen mode won't be available until this is done.
9595

96-
Overall this takes about 5-10 minutes to complete.
96+
Overall this takes about 5-10 minutes to complete.
9797

9898
### Source Link
99-
Many of the repositories that need to be built use source link and it crashes on Ubuntu 18.04 due to dependency changes.
99+
Many of the repositories that need to be built use source link and it crashes on Ubuntu 18.04 due to dependency changes.
100100
To disable source link add the following to the `Directory.Build.props` file in the root of the repository.
101101

102102
``` xml
@@ -109,6 +109,6 @@ To disable source link add the following to the `Directory.Build.props` file in
109109
Make sure to install the following via `apt install`
110110

111111
- clang
112-
- lldb
112+
- lldb
113113
- cmake
114114
- xrdp

0 commit comments

Comments
 (0)