Skip to content

Commit

Permalink
Merge branch 'main' into merges/release/dev17.4-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich committed Oct 20, 2022
2 parents df3e083 + 158ba3a commit ccf25bc
Show file tree
Hide file tree
Showing 1,657 changed files with 46,142 additions and 13,763 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/localization-suggestion.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ https://github.com/dotnet/roslyn

<!-- Do not make changes below this line. -->
---
## Roslyn Team Instructions

A Roslyn team member will file a bug through https://aka.ms/ceLocBug which the translation team will consider.

Internal Tracking Issue: {Update with tracking issue URL.}
Internal Tracking Issue: {Update with tracking issue URL.}
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/artifacts/bin/BuildValidator/Debug/net6.0/BuildValidator.dll",
"program": "${workspaceFolder}/artifacts/bin/BuildValidator/Debug/net7.0/BuildValidator.dll",
"args": [
"--assembliesPath", "./artifacts/obj/csc/Debug/net6.0",
"--referencesPath", "./artifacts/bin",
Expand All @@ -29,8 +29,8 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/artifacts/bin/RunTests/Debug/net6.0/RunTests.dll",
"args": ["--tfm", "net6.0", "--sequential", "--html"],
"program": "${workspaceFolder}/artifacts/bin/RunTests/Debug/net7.0/RunTests.dll",
"args": ["--tfm", "net7.0", "--sequential", "--html"],
"cwd": "${workspaceFolder}/artifacts/bin/RunTests",
"stopAtEntry": false,
"console": "internalConsole"
Expand All @@ -41,7 +41,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/artifacts/bin/PrepareTests/Debug/net6.0/PrepareTests.dll",
"program": "${workspaceFolder}/artifacts/bin/PrepareTests/Debug/net7.0/PrepareTests.dll",
"args": [
"--source", "${workspaceFolder}",
"--destination", "${workspaceFolder}/artifacts/testPayload"
Expand Down
16 changes: 1 addition & 15 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Project>
<!-- use the source-built version of the reference packs if building in source-build -->
<ItemGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<KnownFrameworkReference Update="Microsoft.NETCore.App">
<TargetingPackVersion Condition="'%(TargetFramework)' == 'net6.0'">6.0.0</TargetingPackVersion>
</KnownFrameworkReference>
<KnownFrameworkReference Update="Microsoft.AspNetCore.App">
<TargetingPackVersion Condition="'%(TargetFramework)' == 'net6.0'">6.0.0</TargetingPackVersion>
</KnownFrameworkReference>
</ItemGroup>

<!-- do not restore or use the 6.0 app host in source-build -->
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<UseAppHost>false</UseAppHost>
</PropertyGroup>

<Import Project="eng\targets\Imports.BeforeArcade.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="eng\targets\Imports.targets" />
</Project>
21 changes: 21 additions & 0 deletions Roslyn.sln
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Net.Compilers.Too
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests", "src\Compilers\CSharp\Test\EndToEnd\Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests.csproj", "{C247414A-8946-4BAB-BE1F-C82B90C63EF6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CommonLanguageServerProtocol.Framework", "src\Features\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\Microsoft.CommonLanguageServerProtocol.Framework.csproj", "{D2589BCE-4F2E-4113-B7E7-37392C0C5492}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CommonLanguageServerProtocol.Framework.Example", "src\Features\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework.Example\Microsoft.CommonLanguageServerProtocol.Framework.Example.csproj", "{BD9539EB-AA5E-4E67-AC7F-97D7CBC4D0C9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CommonLanguageServerProtocol.Framework.UnitTests", "src\Features\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework.UnitTests\Microsoft.CommonLanguageServerProtocol.Framework.UnitTests.csproj", "{58AD1B2C-6FFC-47CB-838A-54D0CA2BF0C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1241,6 +1247,18 @@ Global
{C247414A-8946-4BAB-BE1F-C82B90C63EF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C247414A-8946-4BAB-BE1F-C82B90C63EF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C247414A-8946-4BAB-BE1F-C82B90C63EF6}.Release|Any CPU.Build.0 = Release|Any CPU
{D2589BCE-4F2E-4113-B7E7-37392C0C5492}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2589BCE-4F2E-4113-B7E7-37392C0C5492}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2589BCE-4F2E-4113-B7E7-37392C0C5492}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2589BCE-4F2E-4113-B7E7-37392C0C5492}.Release|Any CPU.Build.0 = Release|Any CPU
{BD9539EB-AA5E-4E67-AC7F-97D7CBC4D0C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD9539EB-AA5E-4E67-AC7F-97D7CBC4D0C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD9539EB-AA5E-4E67-AC7F-97D7CBC4D0C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD9539EB-AA5E-4E67-AC7F-97D7CBC4D0C9}.Release|Any CPU.Build.0 = Release|Any CPU
{58AD1B2C-6FFC-47CB-838A-54D0CA2BF0C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58AD1B2C-6FFC-47CB-838A-54D0CA2BF0C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58AD1B2C-6FFC-47CB-838A-54D0CA2BF0C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58AD1B2C-6FFC-47CB-838A-54D0CA2BF0C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1473,6 +1491,9 @@ Global
{6131713D-DFB4-49B5-8010-50071FED3E85} = {C52D8057-43AF-40E6-A01B-6CDBB7301985}
{A9A8ADE5-F123-4109-9FA4-4B92F1657043} = {C52D8057-43AF-40E6-A01B-6CDBB7301985}
{C247414A-8946-4BAB-BE1F-C82B90C63EF6} = {32A48625-F0AD-419D-828B-A50BDABA38EA}
{D2589BCE-4F2E-4113-B7E7-37392C0C5492} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
{BD9539EB-AA5E-4E67-AC7F-97D7CBC4D0C9} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
{58AD1B2C-6FFC-47CB-838A-54D0CA2BF0C8} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29}
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ variables:
- name: _DotNetValidationArtifactsCategory
value: .NETCoreValidation
- group: DotNet-Roslyn-SDLValidation-Params
- name: Codeql.Enabled
value: true​

# To retrieve OptProf data we need to authenticate to the VS drop storage.
# Get access token with $dn-bot-devdiv-drop-rw-code-rw and dn-bot-dnceng-build-rw-code-rw from DotNet-VSTS-Infra-Access
Expand Down
9 changes: 9 additions & 0 deletions azure-pipelines-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ stages:
/p:IgnoreIbcMergeErrors=true
condition: succeeded()

- template: eng\common\templates\steps\generate-sbom.yml

- task: PowerShell@2
displayName: Publish Assets
inputs:
filePath: 'eng\publish-assets.ps1'
arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)"'
condition: succeeded()

# Publish OptProf generated JSON files as a build artifact. This allows for easy inspection from
# a build execution.
- task: PublishBuildArtifacts@1
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ stages:
testArtifactName: Transport_Artifacts_Windows_Debug
configuration: Debug
queueName: windows.vs2022preview.amd64.open
restoreArguments: -msbuildEngine dotnet /p:UsingToolPdbConverter=false /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false
buildArguments: -msbuildEngine dotnet /p:UsingToolPdbConverter=false /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false /p:PublishReadyToRun=false
restoreArguments: -msbuildEngine dotnet /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false
buildArguments: -msbuildEngine dotnet /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false /p:PublishReadyToRun=false

- stage: Windows_Release_Build
dependsOn: []
Expand All @@ -50,8 +50,8 @@ stages:
testArtifactName: Transport_Artifacts_Windows_Release
configuration: Release
queueName: windows.vs2022preview.amd64.open
restoreArguments: -msbuildEngine dotnet /p:UsingToolPdbConverter=false /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false
buildArguments: -msbuildEngine dotnet /p:UsingToolPdbConverter=false /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false /p:PublishReadyToRun=false
restoreArguments: -msbuildEngine dotnet /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false
buildArguments: -msbuildEngine dotnet /p:UsingToolVSSDK=false /p:GenerateSatelliteAssemblies=false /p:PublishReadyToRun=false

- stage: Unix_Build
dependsOn: []
Expand Down
7 changes: 7 additions & 0 deletions docs/Breaking API Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ Roslyn does not support implementing completion for arbitrary languages.
### `Microsoft.CodeAnalysis.CodeStyle.NotificationOption` is now immutable

All property setters now throw an exception.

# Version 4.4.0

`Workspace.OnWorkspaceFailed` is no longer called when an error occurs while reading source file content from disk.

The `Workspace` and `DocumentId` parameters of `TextLoader.LoadTextAndVersionAsync(Workspace, DocumentId, CancellationToken)` are deprecated.
The method now receives `null` `Workspace` and `DocumentId`.
27 changes: 27 additions & 0 deletions docs/compilers/CSharp/Compiler Breaking Changes - DotNet 7.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,33 @@ Possible workarounds are:
Also, implicit conversions between `IntPtr`/`UIntPtr` and other numeric types are treated as standard
conversions on such platforms. This can affect overload resolution in some cases.

These changes could cause a behavioral change if the user code was depending on overflow exceptions in an
unchecked context, or if it was not expecting overflow exceptions in a checked context. An analyzer was
[added in 7.0](https://github.com/dotnet/runtime/issues/74022) to help detect such behavioral changes
and take appropriate action. The analyzer will produce diagnostics on potential behavioral changes, which default
to info severity but can be upgraded to warnings via [editorconfig](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#severity-level).
## Addition of System.UIntPtr and System.Int32

***Introduced in .NET SDK 7.0.100, Visual Studio 2022 version 17.3.***

When the platform supports __numeric__ `IntPtr` and `UIntPtr` types (as indicated by the presence of
`System.Runtime.CompilerServices.RuntimeFeature.NumericIntPtr`), the operator `+(UIntPtr, int)` defined in `System.UIntPtr`
can no longer be used.
Instead, adding expressions of types `System.UIntPtr` and a `System.Int32` results in an error:

```csharp
UIntPtr M(UIntPtr x, int y)
{
return x + y; // error: Operator '+' is ambiguous on operands of type 'nuint' and 'int'
}
```

Possible workarounds are:

1. Use the `UIntPtr.Add(UIntPtr, int)` method: `UIntPtr.Add(x, y)`
2. Apply an unchecked cast to type `nuint` on the second operand: `x + unchecked((nuint)y)`

## Nameof operator in attribute on method or local function

***Introduced in .NET SDK 6.0.400, Visual Studio 2022 version 17.3.***
Expand Down
2 changes: 1 addition & 1 deletion docs/compilers/Design/Unexpected Conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ These are [guidelines](https://www.youtube.com/watch?v=6GMkuPiIZ2k) for writing

- Use `Debug.Assert(Condition)` to document invariants in the code. Although these dissolve away into nothing in non-Debug builds, as an open-source project we have little control over whether our customers are running our code with Debug enabled. Therefore such assertions should not consume excessive execution time. We may consider having such assertions run in production builds in the future. If we find they are too expensive we may create work items to improve their performance.
- If you write a switch statement that is intended to be exhaustive of the possibilities, add a default branch with `throw ExceptionUtilities.UnexpectedValue(switchExpression);`.
- Similarly, if you have a sequence of `if-then-else if` statements that is intended to be exhaustive of the possibilities, add a final "impossible" else branch with `throw ExceptionUtilities.Unreachable;` or, if is convenient to provide interesting, easy to obtain data for the diagnostic, use `ExceptionUtilities.UnexpectedValue`. Do this also for other situations where the code reaches a point that is "impossible".
- Similarly, if you have a sequence of `if-then-else if` statements that is intended to be exhaustive of the possibilities, add a final "impossible" else branch with `throw ExceptionUtilities.Unreachable();` or, if is convenient to provide interesting, easy to obtain data for the diagnostic, use `ExceptionUtilities.UnexpectedValue`. Do this also for other situations where the code reaches a point that is "impossible".
- Validation of preconditions in public APIs should be done with plain code. Report a diagnostic if one exists for the situation (e.g. a syntax error), or throw an appropriate exception such as `ArgumentNullException` or `ArgumentException`.
- If you run into some other weird error case that would be fatal, throw `InvalidOperationException` with interesting, straightforward to get, data in the message. These should be rare and should be accompanied by a comment explaining why an `Assert` is not sufficient.

Expand Down
8 changes: 8 additions & 0 deletions docs/ide/external-access.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# External Access Policies

## API Tracking

We track the APIs that we've exposed with a roslyn analyzer, which will fail the build if APIs are removed. Unlike our public APIs, we are allowed to have breaking changes here, but these will often cause insertion failures. Any removal of an existing API (whether the API is fully removed, or the parameters/return changed) needs to have sign off from the current infrastructure rotation, and will potentially require a test insertion before merging to ensure VS isn't broken, or coordinated insertion with the affected partner team.

Because "shipping" for EA projects occurs every time a change is checked in, we don't bother updating the `InternalAPI.Shipped.txt` file for these projects.

Every EA project has an `Internal` namespace that is considered Roslyn implementation details. For example, the OmniSharp namespace is `Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.Internal`. We do not track the APIs under these namespaces, and it's on the dependent projects to not reference anything from these namespaces. Not every EA project actually uses this namespace. If an EA project that doesn't currently use their `Internal` namespace wants to start, modify `/src/Tools/ExternalAccess/.editorconfig` to set the `dotnet_public_api_analyzer.skip_namespaces` key to that namespace for the affected files. Multiple namespaces can be included by using a `,` separator.

## OmniSharp

When a change needs to be made to an API in the ExternalAccess.OmniSharp or ExternalAccess.OmniSharp.CSharp packages, ping @333fred, @JoeRobich, @filipw, or @david-driscoll as a heads up. Breaking changes are allowed, but please wait for acknowledgement and followup questions to ensure that we don't completely break OmniSharp scenarios.
3 changes: 3 additions & 0 deletions docs/wiki/NuGet-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Below are the versions of the language available in the NuGet packages. Remember
- Version `3.10` includes C# 9.0 (Visual Studio 2019 version 16.10, .NET 5)
- Version `3.11` includes C# 9.0 (Visual Studio 2019 version 16.11, .NET 5)
- Version `4.0` includes C# 10.0 (Visual Studio 2022 version 17.0, .NET 6)
- Version `4.1` includes C# 10.0 (Visual Studio 2022 version 17.1, .NET 6)
- Version `4.2` includes C# 10.0 (Visual Studio 2022 version 17.2, .NET 6)
- Version `4.3.1` includes C# 10.0 (Visual Studio 2022 version 17.3, .NET 6)

See the [history of C# language features](https://github.com/dotnet/csharplang/blob/main/Language-Version-History.md) for more details.

Expand Down
Loading

0 comments on commit ccf25bc

Please sign in to comment.