Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into merge-main-to-requi…
Browse files Browse the repository at this point in the history
…red-members

* upstream/main: (50 commits)
  Fix top-level speculation (dotnet#60274)
  Skip CodeDefinitionWindows integration tests
  Avoid resizing array builder while get unaliased references (dotnet#60220)
  Fix our x86 test execution (dotnet#60323)
  [LSP] Don't adjust breakpoints when there are diagnostics in the document (dotnet#60334)
  Allow VS Mac to access a few options and a helper method (dotnet#60333)
  Add support for CheckedStatement for smart break line (dotnet#60308)
  Initialize MEF parts before switching to the UI thread (dotnet#60289)
  Don't offer convert to switch when an implicit cast is present (dotnet#60224)
  Fix
  Add basic TS LSP server (dotnet#59639)
  Fix issue when multiple different diagnostics share a single fixer
  Update dependencies from https://github.com/dotnet/arcade build 20220321.2 (dotnet#60315)
  Check for reference assembly before deciding which language to show (dotnet#60271)
  Fix XLF files that were manually edited
  Revert "Fix a typo and an inconsistency"
  Fix conversion issues in null coalescing operator (dotnet#60202)
  Fix type parameter scoping for local functions (dotnet#60098)
  Update SDK version in docs, etc. (dotnet#60299)
  Edit the breaking change doc for publishing on docs (dotnet#60260)
  ...
  • Loading branch information
333fred committed Mar 24, 2022
2 parents 9cfe9e1 + 373411a commit f7be5de
Show file tree
Hide file tree
Showing 260 changed files with 5,187 additions and 1,508 deletions.
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"omnisharp.disableMSBuildDiagnosticWarning": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableImportCompletion": true,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.useModernNet": true,
"omnisharp.enableAsyncCompletion": true,
// ms-vscode.powershell settings
Expand All @@ -54,4 +53,4 @@
"ms-azure-devops.azure-pipelines"
],
"postCreateCommand": "${containerWorkspaceFolder}/restore.sh"
}
}
10 changes: 5 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
buildJobName: Build_Windows_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testDesktop -test32
testArguments: -testDesktop -testArch x86

- template: eng/pipelines/test-windows-job.yml
parameters:
Expand All @@ -53,7 +53,7 @@ jobs:
buildJobName: Build_Windows_Debug
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
testArguments: -testDesktop -test64
testArguments: -testDesktop -testArch x64

- template: eng/pipelines/test-windows-job.yml
parameters:
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
buildJobName: Build_Windows_Release
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -test32
testArguments: -testDesktop -testArch x86

- template: eng/pipelines/test-windows-job.yml
parameters:
Expand All @@ -90,7 +90,7 @@ jobs:
buildJobName: Build_Windows_Release
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -test64 -helixQueueName Windows.10.Amd64.Server19H1.ES.Open
testArguments: -testDesktop -testArch x64 -helixQueueName Windows.10.Amd64.Server19H1.ES.Open

- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: eng/pipelines/test-windows-job.yml
Expand All @@ -100,7 +100,7 @@ jobs:
buildJobName: Build_Windows_Release
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
testArguments: -testDesktop -test64
testArguments: -testDesktop -testArch x64

- template: eng/pipelines/test-windows-job.yml
parameters:
Expand Down
306 changes: 205 additions & 101 deletions docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The minimal required version of .NET Framework is 4.7.2.
- Ensure C#, VB, MSBuild, .NET Core and Visual Studio Extensibility are included in the selected work loads
- Ensure "Use previews of the .NET Core SDK" is checked in Tools -> Options -> Environment -> Preview Features
- Restart Visual Studio
1. [.NET 6.0 SDK](https://dotnet.microsoft.com/download/dotnet-core/6.0) [Windows x64 installer](https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-6.0.100-windows-x64-installer)
1. [.NET 6.0.2xx SDK](https://dotnet.microsoft.com/download/dotnet-core/6.0) [Windows x64 installer](https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-6.0.200-windows-x64-installer)
1. [PowerShell 5.0 or newer](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell). If you are on Windows 10, you are fine; you'll only need to upgrade if you're on earlier versions of Windows. The download link is under the ["Upgrading existing Windows PowerShell"](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell) heading.
1. Run Restore.cmd
1. Open Roslyn.sln
Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22168.2">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>bafd55901b50d6fc3507c8ed96a7777fcca1796f</Sha>
<Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.1.0-5.22128.4">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>5d10d428050c0d6afef30a072c4ae68776621877</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.22168.2">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>bafd55901b50d6fc3507c8ed96a7777fcca1796f</Sha>
<Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
25 changes: 6 additions & 19 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ param (
[string]$officialVisualStudioDropAccessToken = "",

# Test actions
[switch]$test32,
[switch]$test64,
[string]$testArch = "x64",
[switch]$testVsi,
[switch][Alias('test')]$testDesktop,
[switch]$testCoreClr,
Expand Down Expand Up @@ -93,8 +92,7 @@ function Print-Usage() {
Write-Host " -help Print help and exit"
Write-Host ""
Write-Host "Test actions"
Write-Host " -test32 Run unit tests in the 32-bit runner"
Write-Host " -test64 Run units tests in the 64-bit runner"
Write-Host " -testArch Maps to --arch parameter of dotnet test"
Write-Host " -testDesktop Run Desktop unit tests (short: -test)"
Write-Host " -testCoreClr Run CoreClr unit tests"
Write-Host " -testCompilerOnly Run only the compiler unit tests"
Expand Down Expand Up @@ -175,11 +173,6 @@ function Process-Arguments() {
}
}

if ($test32 -and $test64) {
Write-Host "Cannot combine -test32 and -test64"
exit 1
}

$anyUnit = $testDesktop -or $testCoreClr
if ($anyUnit -and $testVsi) {
Write-Host "Cannot combine unit and VSI testing"
Expand All @@ -206,8 +199,6 @@ function Process-Arguments() {
$script:restore = $true
}

$script:test32 = -not $test64

foreach ($property in $properties) {
if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) {
Write-Host "Invalid argument: $property"
Expand Down Expand Up @@ -410,7 +401,7 @@ function TestUsingRunTests() {
$args += " --include '\.UnitTests'"
}

if (-not $test32) {
if ($testArch -ne "x86") {
$args += " --exclude '\.InteractiveHost'"
}

Expand All @@ -437,12 +428,7 @@ function TestUsingRunTests() {
$args += " --collectdumps";
}

if ($test64) {
$args += " --platform x64"
}
else {
$args += " --platform x86"
}
$args += " --arch $testArch"

if ($sequential) {
$args += " --sequential"
Expand Down Expand Up @@ -733,7 +719,8 @@ try {
try
{
if ($bootstrap) {
$bootstrapDir = Make-BootstrapBuild -force32:$test32
$force32 = $testArch -eq "x86"
$bootstrapDir = Make-BootstrapBuild -force32:$force32
}
}
catch
Expand Down
5 changes: 5 additions & 0 deletions eng/config/BannedSymbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ M:Microsoft.CodeAnalysis.Completion.CompletionService.GetRules; Use internal ove
M:Microsoft.CodeAnalysis.QuickInfo.QuickInfoService.GetQuickInfoAsync(Microsoft.CodeAnalysis.Document,System.Int32,System.Threading.CancellationToken); Use internal overload instead
M:Microsoft.CodeAnalysis.CodeFixes.FixAllContext.#ctor(Microsoft.CodeAnalysis.Document,Microsoft.CodeAnalysis.CodeFixes.CodeFixProvider,Microsoft.CodeAnalysis.CodeFixes.FixAllScope,System.String,System.Collections.Generic.IEnumerable{System.String},Microsoft.CodeAnalysis.CodeFixes.FixAllContext.DiagnosticProvider,System.Threading.CancellationToken); Use internal overload instead
M:Microsoft.CodeAnalysis.CodeFixes.FixAllContext.#ctor(Microsoft.CodeAnalysis.Project,Microsoft.CodeAnalysis.CodeFixes.CodeFixProvider,Microsoft.CodeAnalysis.CodeFixes.FixAllScope,System.String,System.Collections.Generic.IEnumerable{System.String},Microsoft.CodeAnalysis.CodeFixes.FixAllContext.DiagnosticProvider,System.Threading.CancellationToken); Use internal overload instead
M:Microsoft.VisualStudio.Shell.ServiceExtensions.GetService``2(System.IServiceProvider); Use RoslynServiceExtensions instead. This extension internally relies on ThreadHelper, which is incompatible with testing.
M:Microsoft.VisualStudio.Shell.ServiceExtensions.GetService``2(System.IServiceProvider,System.Boolean); Use RoslynServiceExtensions instead. This extension internally relies on ThreadHelper, which is incompatible with testing
M:Microsoft.VisualStudio.Shell.ServiceExtensions.GetServiceAsync``2(Microsoft.VisualStudio.Shell.IAsyncServiceProvider); Use RoslynServiceExtensions instead. This extension internally relies on ThreadHelper, which is incompatible with testing
M:Microsoft.VisualStudio.Shell.ServiceExtensions.GetServiceAsync``2(Microsoft.VisualStudio.Shell.IAsyncServiceProvider,System.Boolean); Use RoslynServiceExtensions instead. This extension internally relies on ThreadHelper, which is incompatible with testing
P:Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory; Use IThreadingContext.JoinableTaskFactory instead.
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"xcopy-msbuild": "16.10.0-preview2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22168.2",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22168.2"
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22171.2",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22171.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12768,5 +12768,80 @@ static Delegate M(object o)
NumberOfFixAllIterations = 2,
}.RunAsync();
}

[WorkItem(60248, "https://github.com/dotnet/roslyn/issues/60248")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryCast)]
public async Task RemoveCastInTopLevelPrograms()
{
var test = new VerifyCS.Test()
{
TestCode = @"
int x = 1;
int y = [|(int)|]x;
",
FixedCode = @"
int x = 1;
int y = x;
",
LanguageVersion = LanguageVersion.CSharp10,
TestState =
{
OutputKind = OutputKind.ConsoleApplication,
},
};

await test.RunAsync();
}

[WorkItem(60292, "https://github.com/dotnet/roslyn/issues/60292")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnnecessaryCast)]
public async Task KeepNecessaryExplicitNullableCast()
{
var code = @"
using System;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
for (var i = 0; i < 100; i++)
{
bool should = Should();
Test? test = ShouldTest();
int? testId = should ? (int?)test : null; // incorrect IDE0004
}
}
private static bool Should()
{
return new Random().Next() % 2 == 0;
}
private static Test? ShouldTest()
{
var value = new Random().Next(3);
if (Enum.IsDefined(typeof(Test), value))
return (Test)value;
return null;
}
}
public enum Test
{
Foo = 1,
Bar = 2,
}
}
";
await new VerifyCS.Test
{
TestCode = code,
FixedCode = code,
LanguageVersion = LanguageVersion.CSharp10,
}.RunAsync();
}
}
}
2 changes: 1 addition & 1 deletion src/Analyzers/Core/Analyzers/AnalyzersResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<value>Use 'throw' expression</value>
</data>
<data name="Add_this_or_Me_qualification" xml:space="preserve">
<value>Add 'this' or 'Me' qualification.</value>
<value>Add 'this' or 'Me' qualification</value>
</data>
<data name="Member_access_should_be_qualified" xml:space="preserve">
<value>Member access should be qualified.</value>
Expand Down
4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f7be5de

Please sign in to comment.