diff --git a/.editorconfig b/.editorconfig index 54698466925f7..3a08978605e93 100644 --- a/.editorconfig +++ b/.editorconfig @@ -245,10 +245,6 @@ csharp_preserve_single_line_statements = true # https://github.com/dotnet/roslyn/pull/54259 has been published. dotnet_style_allow_statement_immediately_after_block_experimental = false -[src/CodeStyle/**.{cs,vb}] -# warning RS0005: Do not use generic CodeAction.Create to create CodeAction -dotnet_diagnostic.RS0005.severity = none - [src/{Analyzers,CodeStyle,Features,Workspaces,EditorFeatures,VisualStudio}/**/*.{cs,vb}] # IDE0011: Add braces diff --git a/README.md b/README.md index 248a13804b4e5..0a1726e7ca0fc 100644 --- a/README.md +++ b/README.md @@ -81,10 +81,10 @@ Visit [Roslyn Architecture Overview](https://docs.microsoft.com/en-us/dotnet/csh #### Misc Tests -|Branch|Determinism|Build Correctness|Source build|Spanish|MacOS| -|:--:|:--:|:--|:--:|:--:|:--:| -**main**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Correctness_Determinism&configuration=Correctness_Determinism&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Correctness_Build&configuration=Correctness_Build&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Correctness_SourceBuild&configuration=Correctness_SourceBuild&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Test_Windows_Desktop_Spanish_Release_32&configuration=Test_Windows_Desktop_Spanish_Release_32&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Test_macOS_Debug&configuration=Test_macOS_Debug&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)| -**main-vs-deps**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Correctness_Determinism&configuration=Correctness_Determinism&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Correctness_Build&configuration=Correctness_Build&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Correctness_SourceBuild&configuration=Correctness_SourceBuild&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Test_Windows_Desktop_Spanish_Release_32&configuration=Test_Windows_Desktop_Spanish_Release_32&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Test_macOS_Debug&configuration=Test_macOS_Debug&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)| +|Branch|Determinism|Build Correctness|Rebuild from artifacts|Source build|Spanish|MacOS| +|:--:|:--:|:--|:--:|:--:|:--:|:--:| +**main**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Correctness_Determinism&configuration=Correctness_Determinism&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Correctness_Build&configuration=Correctness_Build&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchName=main&jobName=Correctness_Rebuild)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Correctness_SourceBuild&configuration=Correctness_SourceBuild&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Test_Windows_Desktop_Spanish_Release_32&configuration=Test_Windows_Desktop_Spanish_Release_32&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main&jobname=Test_macOS_Debug&configuration=Test_macOS_Debug&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main&view=logs)| +**main-vs-deps**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Correctness_Determinism&configuration=Correctness_Determinism&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Correctness_Build&configuration=Correctness_Build&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchName=main-vs-deps&jobName=Correctness_Rebuild)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchName=main-vs-deps)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Correctness_SourceBuild&configuration=Correctness_SourceBuild&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Test_Windows_Desktop_Spanish_Release_32&configuration=Test_Windows_Desktop_Spanish_Release_32&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/roslyn/roslyn-CI?branchname=main-vs-deps&jobname=Test_macOS_Debug&configuration=Test_macOS_Debug&label=build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=15&branchname=main-vs-deps&view=logs)| [//]: # (End current test results) diff --git a/azure-pipelines-integration-corehost.yml b/azure-pipelines-integration-corehost.yml index 6d499f5903594..ae9c832d11972 100644 --- a/azure-pipelines-integration-corehost.yml +++ b/azure-pipelines-integration-corehost.yml @@ -22,6 +22,7 @@ pr: paths: exclude: - docs/* + - eng/config/PublishData.json - .vscode/* - .github/* - .devcontainer/* diff --git a/azure-pipelines-integration.yml b/azure-pipelines-integration.yml index 4bc45b097d825..891bf384d9706 100644 --- a/azure-pipelines-integration.yml +++ b/azure-pipelines-integration.yml @@ -18,6 +18,7 @@ pr: paths: exclude: - docs/* + - eng/config/PublishData.json - .vscode/* - .github/* - .devcontainer/ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6db159e4aab55..25342c1531094 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,6 +18,7 @@ pr: paths: exclude: - docs/* + - eng/config/PublishData.json - .vscode/* - .github/* - .devcontainer/* @@ -97,7 +98,7 @@ jobs: buildJobName: Build_Windows_Release testArtifactName: Transport_Artifacts_Windows_Release configuration: Release - testArguments: -testDesktop -testArch x64 -helixQueueName Windows.10.Amd64.Server19H1.ES.Open + testArguments: -testDesktop -testArch x64 -helixQueueName Windows.10.Amd64.Server2022.ES.Open - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - template: eng/pipelines/test-windows-job.yml diff --git a/docs/Language Feature Status.md b/docs/Language Feature Status.md index 731ff614266a2..5b20b0e94a580 100644 --- a/docs/Language Feature Status.md +++ b/docs/Language Feature Status.md @@ -28,8 +28,10 @@ efforts behind them. | [nameof accessing instance members](https://github.com/dotnet/roslyn/issues/40229) | main | [In Progress](https://github.com/dotnet/roslyn/pull/48754) | [YairHalberstadt ](https://github.com/YairHalberstadt) | [333fred](https://github.com/333fred), [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred) | | [Utf8 String Literals](https://github.com/dotnet/csharplang/issues/184) | [Utf8StringLiterals](https://github.com/dotnet/roslyn/tree/features/Utf8StringLiterals) | [In Progress](https://github.com/dotnet/roslyn/issues/58848) | [AlekseyTs](https://github.com/AlekseyTs) | [cston](https://github.com/cston), [RikkiGibson](https://github.com/RikkiGibson) | [MadsTorgersen](https://github.com/MadsTorgersen) | | [ref fields](https://github.com/dotnet/csharplang/blob/main/proposals/low-level-struct-improvements.md) | [ref-fields](https://github.com/dotnet/roslyn/tree/features/ref-fields) | [In Progress](https://github.com/dotnet/roslyn/issues/59194) | [cston](https://github.com/cston) | [RikkiGibson](https://github.com/RikkiGibson), [AlekseyTs](https://github.com/AlekseyTs) | [jaredpar](https://github.com/jaredpar) | -| [checked operators](https://github.com/dotnet/csharplang/issues/4665) | [CheckedUserDefinedOperators](https://github.com/dotnet/roslyn/tree/features/CheckedUserDefinedOperators) | [In Progress](https://github.com/dotnet/roslyn/issues/59458) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [chsienki](https://github.com/chsienki) | [AlekseyTs](https://github.com/AlekseyTs) | -| [auto-default structs](https://github.com/dotnet/csharplang/issues/5737) | main | [In Progress](https://github.com/dotnet/roslyn/issues/60167) | [RikkiGibson](https://github.com/RikkiGibson) | [cston](https://github.com/cston), [jcouv](https://github.com/jcouv) | +| [Checked Operators](https://github.com/dotnet/csharplang/issues/4665) | [CheckedUserDefinedOperators](https://github.com/dotnet/roslyn/tree/features/CheckedUserDefinedOperators) | [In Progress](https://github.com/dotnet/roslyn/issues/59458) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [chsienki](https://github.com/chsienki) | [AlekseyTs](https://github.com/AlekseyTs) | +| [auto-default structs](https://github.com/dotnet/csharplang/issues/5737) | main | [Merged into 17.3p1](https://github.com/dotnet/roslyn/issues/60167) | [RikkiGibson](https://github.com/RikkiGibson) | [cston](https://github.com/cston), [jcouv](https://github.com/jcouv) | +| [Unsigned Right Shift](https://github.com/dotnet/csharplang/issues/4682) | [UnsignedRightShift](https://github.com/dotnet/roslyn/tree/features/UnsignedRightShift) | [In Progress](https://github.com/dotnet/roslyn/issues/60433) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs) | + # C# 10.0 diff --git a/docs/contributing/Building, Debugging, and Testing on Windows.md b/docs/contributing/Building, Debugging, and Testing on Windows.md index 1536f77e8e3d1..5e1e5ee638512 100644 --- a/docs/contributing/Building, Debugging, and Testing on Windows.md +++ b/docs/contributing/Building, Debugging, and Testing on Windows.md @@ -196,6 +196,20 @@ See more details in the [IOperation test hook](https://github.com/dotnet/roslyn/ `C:\Source\roslyn> cd ..` `C:\Source> dotnet-format analyzers .\roslyn\Compilers.sln --diagnostics=RS0016 --no-restore --include-generated -v diag` +## Replicating Failures in the Used Assemblies leg + +In order to replicate test failures in that leg, there are a few options: + +1. Uncomment `src/Compilers/Test/Core/Compilation/CompilationExtensions.cs:9`, which defines `ROSLYN_TEST_USEDASSEMBLIES`, and run your tests. Do _not_ check this in, as it +will enable the test hook for every test in every project and significantly slow down regular test runs. +2. Set the `ROSLYN_TEST_USEDASSEMBLIES` environment variable and restart VS with it set. +3. Set a breakpoint at the start of `CSharpTestBase.VerifyUsedAssemblyReferences` in `src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs`. When it breaks, use VS's jump to location or +drag the instruction pointer past the early check and return on `EnableVerifyUsedAssemblies`. + +When a test failure is isolated, please add a _dedicated_ test for this (ie. failing even when the Used Assemblies validation isn't enabled) to make it easier to avoid future regressions. +Preferrably, don't replicate the entire original test, just enough to hit the bug to ensure that it's protected against regressions. +Before pushing a relevant fix to CI, you can validate locally using the `-testUsedAssemblies` command-line option for `build.cmd`. For example: `build.cmd -testCoreClr -testCompilerOnly -testUsedAssemblies`. + ## Contributing Please see [Contributing Code](https://github.com/dotnet/roslyn/blob/main/CONTRIBUTING.md) for details on contributing changes back to the code. diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b5edcb31630b9..73634212ab677 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,18 +13,18 @@ - + https://github.com/dotnet/arcade - c8a95297e2622251c125aa5c0ef7c822275a792d + 1527dc867ccb652def4c0f57fbd2ebbed3a94019 https://github.com/dotnet/roslyn 5d10d428050c0d6afef30a072c4ae68776621877 - + https://github.com/dotnet/arcade - c8a95297e2622251c125aa5c0ef7c822275a792d + 1527dc867ccb652def4c0f57fbd2ebbed3a94019 diff --git a/eng/Versions.props b/eng/Versions.props index 4af90cbc78468..3342c7e8206f8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -6,9 +6,9 @@ --> 4 - 2 + 3 0 - 3 + 1 $(MajorVersion).$(MinorVersion).$(PatchVersion) - 3.3.4-beta1.22160.2 + 3.3.4-beta1.22204.1 6.0.0-rc1.21366.2 1.1.2-beta1.22122.4 0.1.132-beta diff --git a/eng/build.ps1 b/eng/build.ps1 index 028c793adf182..8cb1c38bab99d 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -98,7 +98,7 @@ function Print-Usage() { Write-Host " -testCompilerOnly Run only the compiler unit tests" Write-Host " -testVsi Run all integration tests" Write-Host " -testIOperation Run extra checks to validate IOperations" - Write-Host " -testUsedAssemblies Run extra checks to validate used assemblies feature" + Write-Host " -testUsedAssemblies Run extra checks to validate used assemblies feature (see ROSLYN_TEST_USEDASSEMBLIES in codebase)" Write-Host "" Write-Host "Advanced settings:" Write-Host " -ci Set when running on CI server" diff --git a/eng/config/PublishData.json b/eng/config/PublishData.json index 32dc2a1f67f66..c1b1d036f5155 100644 --- a/eng/config/PublishData.json +++ b/eng/config/PublishData.json @@ -221,9 +221,8 @@ "packageFeeds": "default", "channels": [], "vsBranch": "rel/d17.2", - "insertionCreateDraftPR": true, "vsMajorVersion": 17, - "insertionTitlePrefix": "[d17.2p2]" + "insertionTitlePrefix": "[d17.2]" }, "main": { "nugetKind": [ @@ -249,19 +248,6 @@ "vsBranch": "main", "vsMajorVersion": 17, "insertionCreateDraftPR": false, - "insertionTitlePrefix": "[d17.2p3]" - }, - "release/dev17.3": { - "nugetKind": [ - "Shipping", - "NonShipping" - ], - "version": "4.3.*", - "packageFeeds": "default", - "channels": [], - "vsBranch": "main", - "vsMajorVersion": 17, - "insertionCreateDraftPR": true, "insertionTitlePrefix": "[d17.3p1]" }, "features/NullableReferenceTypes": { diff --git a/eng/config/globalconfigs/NonShipping.globalconfig b/eng/config/globalconfigs/NonShipping.globalconfig index 7523f70490077..b606135bcebad 100644 --- a/eng/config/globalconfigs/NonShipping.globalconfig +++ b/eng/config/globalconfigs/NonShipping.globalconfig @@ -20,8 +20,6 @@ dotnet_diagnostic.RS1026.severity = none dotnet_diagnostic.RS1032.severity = none # Define diagnostic description correctly dotnet_diagnostic.RS1033.severity = none -# Do not use generic CodeAction.Create to create CodeAction - not useful for tests -dotnet_diagnostic.RS0005.severity = none # Do not call 'GetTestAccessor()' from production code: does not apply to tests dotnet_diagnostic.RS0043.severity = none diff --git a/eng/config/globalconfigs/Shipping.globalconfig b/eng/config/globalconfigs/Shipping.globalconfig index f5d5ed9e48545..f474ff296597b 100644 --- a/eng/config/globalconfigs/Shipping.globalconfig +++ b/eng/config/globalconfigs/Shipping.globalconfig @@ -3,7 +3,5 @@ is_global = true dotnet_diagnostic.CA1802.severity = warning dotnet_diagnostic.CA2007.severity = warning -dotnet_diagnostic.RS0005.severity = warning - # CA2016: Forward the 'CancellationToken' parameter to methods dotnet_diagnostic.CA2016.severity = warning diff --git a/eng/pipelines/test-integration-job.yml b/eng/pipelines/test-integration-job.yml index d12843eef7182..2f1156bbc8007 100644 --- a/eng/pipelines/test-integration-job.yml +++ b/eng/pipelines/test-integration-job.yml @@ -47,7 +47,16 @@ steps: condition: not(succeeded()) - task: PublishBuildArtifacts@1 - displayName: Publish Screenshots and Test Attachments + displayName: Publish Test Attachments + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\bin\Microsoft.VisualStudio.LanguageServices.New.IntegrationTests\${{ parameters.configuration }}\net472\TestResults' + ArtifactName: '$(System.JobAttempt)-Blame ${{ parameters.configuration }} OOP64_${{ parameters.oop64bit }} OOPCoreClr_${{ parameters.oopCoreClr }} LspEditor_${{ parameters.lspEditor }} $(Build.BuildNumber)' + publishLocation: Container + continueOnError: true + condition: not(succeeded()) + + - task: PublishBuildArtifacts@1 + displayName: Publish Screenshots and Test Attachments (Old Tests) inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\bin\Microsoft.VisualStudio.LanguageServices.IntegrationTests\${{ parameters.configuration }}\net472\TestResults' ArtifactName: '$(System.JobAttempt)-Screenshots ${{ parameters.configuration }} OOP64_${{ parameters.oop64bit }} OOPCoreClr_${{ parameters.oopCoreClr }} LspEditor_${{ parameters.lspEditor }} $(Build.BuildNumber)' diff --git a/global.json b/global.json index 4932c3ed106d3..28e6b436a0b25 100644 --- a/global.json +++ b/global.json @@ -12,7 +12,7 @@ "xcopy-msbuild": "16.10.0-preview2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22171.2", - "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22171.2" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22179.1", + "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22179.1" } } diff --git a/src/Analyzers/CSharp/Analyzers/UsePatternCombinators/AnalyzedPattern.cs b/src/Analyzers/CSharp/Analyzers/UsePatternCombinators/AnalyzedPattern.cs index 31b610a0b1e66..5c001fbb29c90 100644 --- a/src/Analyzers/CSharp/Analyzers/UsePatternCombinators/AnalyzedPattern.cs +++ b/src/Analyzers/CSharp/Analyzers/UsePatternCombinators/AnalyzedPattern.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Operations; using Roslyn.Utilities; @@ -23,9 +24,55 @@ private AnalyzedPattern(IOperation target) /// internal sealed class Type : AnalyzedPattern { + private static readonly SyntaxAnnotation s_annotation = new(); + + public static Type? TryCreate(BinaryExpressionSyntax binaryExpression, IIsTypeOperation operation) + { + Contract.ThrowIfNull(operation.SemanticModel); + if (binaryExpression.Right is not TypeSyntax typeSyntax) + { + return null; + } + + // We are coming from a type pattern, which likes to bind to types, but converting to + // patters which like to bind to expressions. For example, given: + // + // if (T is C.X || T is Y) { } + // + // we would want to convert to: + // + // if (T is C.X or Y) + // + // In the first case the compiler will bind to types named C or Y that are in scope + // but in the second it will also bind to a fields, methods etc. which for 'Y' changes + // semantics, and for 'C.X' could be a compile error. + // + // So lets create a pattern syntax and make sure the result is the same + var dummyStatement = SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + SyntaxFactory.IdentifierName("_"), + SyntaxFactory.IsPatternExpression( + binaryExpression.Left, + SyntaxFactory.ConstantPattern(SyntaxFactory.ParenthesizedExpression(binaryExpression.Right.WithAdditionalAnnotations(s_annotation))) + ) + )); + + if (operation.SemanticModel.TryGetSpeculativeSemanticModel(typeSyntax.SpanStart, dummyStatement, out var speculativeModel)) + { + var originalInfo = operation.SemanticModel.GetTypeInfo(binaryExpression.Right); + var newInfo = speculativeModel.GetTypeInfo(dummyStatement.GetAnnotatedNodes(s_annotation).Single()); + if (!originalInfo.Equals(newInfo)) + { + return null; + } + } + + return new Type(typeSyntax, operation.ValueOperand); + } + public readonly TypeSyntax TypeSyntax; - public Type(TypeSyntax type, IOperation target) : base(target) + private Type(TypeSyntax type, IOperation target) : base(target) => TypeSyntax = type; } diff --git a/src/Analyzers/CSharp/Analyzers/UsePatternCombinators/CSharpUsePatternCombinatorsAnalyzer.cs b/src/Analyzers/CSharp/Analyzers/UsePatternCombinators/CSharpUsePatternCombinatorsAnalyzer.cs index d809df97b04b0..f915fa2dd5d4f 100644 --- a/src/Analyzers/CSharp/Analyzers/UsePatternCombinators/CSharpUsePatternCombinatorsAnalyzer.cs +++ b/src/Analyzers/CSharp/Analyzers/UsePatternCombinators/CSharpUsePatternCombinatorsAnalyzer.cs @@ -59,8 +59,8 @@ private enum ConstantResult case IUnaryOperation { OperatorKind: UnaryOperatorKind.Not } op: return Not.TryCreate(ParsePattern(op.Operand)); - case IIsTypeOperation { Syntax: BinaryExpressionSyntax { Right: TypeSyntax type } } op: - return new Type(type, op.ValueOperand); + case IIsTypeOperation { Syntax: BinaryExpressionSyntax binaryExpression } op: + return Type.TryCreate(binaryExpression, op); case IIsPatternOperation { Pattern: { Syntax: PatternSyntax pattern } } op: return new Source(pattern, op.Value); diff --git a/src/Analyzers/CSharp/CodeFixes/AddBraces/CSharpAddBracesCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/AddBraces/CSharpAddBracesCodeFixProvider.cs index d137b4a34b012..9d97e81df37fc 100644 --- a/src/Analyzers/CSharp/CodeFixes/AddBraces/CSharpAddBracesCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/AddBraces/CSharpAddBracesCodeFixProvider.cs @@ -32,8 +32,6 @@ public CSharpAddBracesCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.AddBracesDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix( diff --git a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems index 80e167d2963a9..33e4b824c2eee 100644 --- a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems +++ b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems @@ -16,9 +16,12 @@ + + + @@ -80,4 +83,4 @@ - \ No newline at end of file + diff --git a/src/Features/CSharp/Portable/ConvertNamespace/ConvertNamespaceCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/ConvertNamespace/ConvertNamespaceCodeFixProvider.cs similarity index 97% rename from src/Features/CSharp/Portable/ConvertNamespace/ConvertNamespaceCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/ConvertNamespace/ConvertNamespaceCodeFixProvider.cs index 23f3c9dd11369..22408004fec96 100644 --- a/src/Features/CSharp/Portable/ConvertNamespace/ConvertNamespaceCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/ConvertNamespace/ConvertNamespaceCodeFixProvider.cs @@ -31,8 +31,6 @@ internal class ConvertNamespaceCodeFixProvider : SyntaxEditorBasedCodeFixProvide public ConvertNamespaceCodeFixProvider() { } - - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseBlockScopedNamespaceDiagnosticId, IDEDiagnosticIds.UseFileScopedNamespaceDiagnosticId); diff --git a/src/Features/CSharp/Portable/ConvertNamespace/ConvertNamespaceTransform.cs b/src/Analyzers/CSharp/CodeFixes/ConvertNamespace/ConvertNamespaceTransform.cs similarity index 96% rename from src/Features/CSharp/Portable/ConvertNamespace/ConvertNamespaceTransform.cs rename to src/Analyzers/CSharp/CodeFixes/ConvertNamespace/ConvertNamespaceTransform.cs index f46abe8ab84ad..b0288f5ba386c 100644 --- a/src/Features/CSharp/Portable/ConvertNamespace/ConvertNamespaceTransform.cs +++ b/src/Analyzers/CSharp/CodeFixes/ConvertNamespace/ConvertNamespaceTransform.cs @@ -87,13 +87,17 @@ public static async Task ConvertAsync(Document document, BaseNamespace if (openBraceLine == closeBraceLine) return null; +#if CODE_STYLE + var options = document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(namespaceDeclaration.SyntaxTree!); +#else var options = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); - var style = options.GetOption(FormattingOptions.SmartIndent, document.Project.Language); +#endif + var style = options.GetOption(FormattingOptions2.SmartIndent, document.Project.Language); - var indentation = indentationService.GetIndentation(document, openBraceLine + 1, style, cancellationToken); + var indentation = indentationService.GetIndentation(document, openBraceLine + 1, (FormattingOptions.IndentStyle)style, cancellationToken); - var useTabs = options.GetOption(FormattingOptions.UseTabs); - var tabSize = options.GetOption(FormattingOptions.TabSize); + var useTabs = options.GetOption(FormattingOptions2.UseTabs); + var tabSize = options.GetOption(FormattingOptions2.TabSize); return indentation.GetIndentationString(sourceText, useTabs, tabSize); } diff --git a/src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs index c648b541302cf..373b735e8a99b 100644 --- a/src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs @@ -38,8 +38,6 @@ public ConvertSwitchStatementToExpressionCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.ConvertSwitchStatementToExpressionDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { var switchLocation = context.Diagnostics.First().AdditionalLocations[0]; diff --git a/src/Analyzers/CSharp/CodeFixes/InlineDeclaration/CSharpInlineDeclarationCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/InlineDeclaration/CSharpInlineDeclarationCodeFixProvider.cs index b7219ae686992..2dd7c8d841248 100644 --- a/src/Analyzers/CSharp/CodeFixes/InlineDeclaration/CSharpInlineDeclarationCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/InlineDeclaration/CSharpInlineDeclarationCodeFixProvider.cs @@ -47,8 +47,6 @@ public CSharpInlineDeclarationCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.InlineDeclarationDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/InvokeDelegateWithConditionalAccess/InvokeDelegateWithConditionalAccessCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/InvokeDelegateWithConditionalAccess/InvokeDelegateWithConditionalAccessCodeFixProvider.cs index e51cafabec0d7..8ad1a0deae791 100644 --- a/src/Analyzers/CSharp/CodeFixes/InvokeDelegateWithConditionalAccess/InvokeDelegateWithConditionalAccessCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/InvokeDelegateWithConditionalAccess/InvokeDelegateWithConditionalAccessCodeFixProvider.cs @@ -33,8 +33,6 @@ public InvokeDelegateWithConditionalAccessCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.InvokeDelegateWithConditionalAccessId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - // Filter out the diagnostics we created for the faded out code. We don't want // to try to fix those as well as the normal diagnostics we created. protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) diff --git a/src/Analyzers/CSharp/CodeFixes/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs index 584bff79be040..4589db37d1033 100644 --- a/src/Analyzers/CSharp/CodeFixes/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs @@ -32,8 +32,6 @@ public CSharpMakeStructFieldsWritableCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.MakeStructFieldsWritable); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeQuality; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastCodeFixProvider.cs index 69309be37e093..8274c3447015c 100644 --- a/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastCodeFixProvider.cs @@ -36,8 +36,6 @@ public CSharpRemoveUnnecessaryCastCodeFixProvider() public sealed override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryCastDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryDiscardDesignation/CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryDiscardDesignation/CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs index 5642f196cd1fa..51a563474c861 100644 --- a/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryDiscardDesignation/CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryDiscardDesignation/CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs @@ -33,8 +33,6 @@ public CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryDiscardDesignationDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics.First(); diff --git a/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryLambdaExpression/CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryLambdaExpression/CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs index d5f32eb3fb2bc..42e754fbb80e1 100644 --- a/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryLambdaExpression/CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryLambdaExpression/CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs @@ -34,8 +34,6 @@ public CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryLambdaExpressionDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix( diff --git a/src/Analyzers/CSharp/CodeFixes/RemoveUnreachableCode/CSharpRemoveUnreachableCodeCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/RemoveUnreachableCode/CSharpRemoveUnreachableCodeCodeFixProvider.cs index 1d74d5c70b02b..5538e6eb7ff66 100644 --- a/src/Analyzers/CSharp/CodeFixes/RemoveUnreachableCode/CSharpRemoveUnreachableCodeCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/RemoveUnreachableCode/CSharpRemoveUnreachableCodeCodeFixProvider.cs @@ -33,8 +33,6 @@ public CSharpRemoveUnreachableCodeCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.RemoveUnreachableCodeDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeQuality; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics[0]; diff --git a/src/Analyzers/CSharp/CodeFixes/RemoveUnusedParametersAndValues/CSharpRemoveUnusedValuesCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/RemoveUnusedParametersAndValues/CSharpRemoveUnusedValuesCodeFixProvider.cs index 5c7de40348a80..8c4a9d8eb06fd 100644 --- a/src/Analyzers/CSharp/CodeFixes/RemoveUnusedParametersAndValues/CSharpRemoveUnusedValuesCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/RemoveUnusedParametersAndValues/CSharpRemoveUnusedValuesCodeFixProvider.cs @@ -35,8 +35,8 @@ public CSharpRemoveUnusedValuesCodeFixProvider() } #if CODE_STYLE - protected override ISyntaxFormattingService GetSyntaxFormattingService() - => CSharpSyntaxFormattingService.Instance; + protected override ISyntaxFormatting GetSyntaxFormatting() + => CSharpSyntaxFormatting.Instance; #endif protected override BlockSyntax WrapWithBlockIfNecessary(IEnumerable statements) diff --git a/src/Analyzers/CSharp/CodeFixes/SimplifyPropertyPattern/CSharpSimplifyPropertyPatternCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/SimplifyPropertyPattern/CSharpSimplifyPropertyPatternCodeFixProvider.cs index 0db665fb9fc1c..61ed86c7fbe7f 100644 --- a/src/Analyzers/CSharp/CodeFixes/SimplifyPropertyPattern/CSharpSimplifyPropertyPatternCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/SimplifyPropertyPattern/CSharpSimplifyPropertyPatternCodeFixProvider.cs @@ -34,8 +34,6 @@ public CSharpSimplifyPropertyPatternCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.SimplifyPropertyPatternDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/TransposeRecordKeyword/CSharpTransposeRecordKeywordCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/TransposeRecordKeyword/CSharpTransposeRecordKeywordCodeFixProvider.cs index 069f6e147be94..c19c14d8a628f 100644 --- a/src/Analyzers/CSharp/CodeFixes/TransposeRecordKeyword/CSharpTransposeRecordKeywordCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/TransposeRecordKeyword/CSharpTransposeRecordKeywordCodeFixProvider.cs @@ -32,9 +32,6 @@ public CSharpTransposeRecordKeywordCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(CS9012); - internal override CodeFixCategory CodeFixCategory - => CodeFixCategory.Compile; - private static bool TryGetRecordDeclaration( Diagnostic diagnostic, CancellationToken cancellationToken, [NotNullWhen(true)] out RecordDeclarationSyntax? recordDeclaration) { diff --git a/src/Analyzers/CSharp/CodeFixes/UseCompoundAssignment/CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseCompoundAssignment/CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs index fbebb1082c7d4..de1ba38635c05 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseCompoundAssignment/CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseCompoundAssignment/CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs @@ -31,8 +31,6 @@ public CSharpUseCompoundCoalesceAssignmentCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseCoalesceCompoundAssignmentDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { var document = context.Document; diff --git a/src/Analyzers/CSharp/CodeFixes/UseConditionalExpression/CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseConditionalExpression/CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs index 0c478bdb97205..c1b7f821b23f8 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseConditionalExpression/CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseConditionalExpression/CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs @@ -66,8 +66,8 @@ protected override ExpressionSyntax ConvertToExpression(IThrowOperation throwOpe => CSharpUseConditionalExpressionHelpers.ConvertToExpression(throwOperation); #if CODE_STYLE - protected override ISyntaxFormattingService GetSyntaxFormattingService() - => CSharpSyntaxFormattingService.Instance; + protected override ISyntaxFormatting GetSyntaxFormatting() + => CSharpSyntaxFormatting.Instance; #endif } } diff --git a/src/Analyzers/CSharp/CodeFixes/UseConditionalExpression/CSharpUseConditionalExpressionForReturnCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseConditionalExpression/CSharpUseConditionalExpressionForReturnCodeFixProvider.cs index 68069c4736e75..ccc2af8af9862 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseConditionalExpression/CSharpUseConditionalExpressionForReturnCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseConditionalExpression/CSharpUseConditionalExpressionForReturnCodeFixProvider.cs @@ -52,8 +52,8 @@ protected override ExpressionSyntax ConvertToExpression(IThrowOperation throwOpe => CSharpUseConditionalExpressionHelpers.ConvertToExpression(throwOperation); #if CODE_STYLE - protected override ISyntaxFormattingService GetSyntaxFormattingService() - => CSharpSyntaxFormattingService.Instance; + protected override ISyntaxFormatting GetSyntaxFormatting() + => CSharpSyntaxFormatting.Instance; #endif } } diff --git a/src/Analyzers/CSharp/CodeFixes/UseDeconstruction/CSharpUseDeconstructionCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseDeconstruction/CSharpUseDeconstructionCodeFixProvider.cs index f3cbd2965bf58..01cd9955a39d1 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseDeconstruction/CSharpUseDeconstructionCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseDeconstruction/CSharpUseDeconstructionCodeFixProvider.cs @@ -34,8 +34,6 @@ public CSharpUseDeconstructionCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseDeconstructionDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix( diff --git a/src/Analyzers/CSharp/CodeFixes/UseDefaultLiteral/CSharpUseDefaultLiteralCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseDefaultLiteral/CSharpUseDefaultLiteralCodeFixProvider.cs index 3b25dde36faef..b72d9e7b09bd6 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseDefaultLiteral/CSharpUseDefaultLiteralCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseDefaultLiteral/CSharpUseDefaultLiteralCodeFixProvider.cs @@ -35,8 +35,6 @@ public CSharpUseDefaultLiteralCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseDefaultLiteralDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/UseExpressionBody/UseExpressionBodyCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseExpressionBody/UseExpressionBodyCodeFixProvider.cs index eee0034fba488..d84665dbaeb8b 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseExpressionBody/UseExpressionBodyCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseExpressionBody/UseExpressionBodyCodeFixProvider.cs @@ -27,8 +27,6 @@ internal partial class UseExpressionBodyCodeFixProvider : SyntaxEditorBasedCodeF { public sealed override ImmutableArray FixableDiagnosticIds { get; } - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - private static readonly ImmutableArray _helpers = UseExpressionBodyHelper.Helpers; [ImportingConstructor] diff --git a/src/Analyzers/CSharp/CodeFixes/UseImplicitObjectCreation/CSharpUseImplicitObjectCreationCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseImplicitObjectCreation/CSharpUseImplicitObjectCreationCodeFixProvider.cs index a8d67d3d24a1d..ab7463f40ab3c 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseImplicitObjectCreation/CSharpUseImplicitObjectCreationCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseImplicitObjectCreation/CSharpUseImplicitObjectCreationCodeFixProvider.cs @@ -33,8 +33,6 @@ public CSharpUseImplicitObjectCreationCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseImplicitObjectCreationDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) => !diagnostic.IsSuppressed; diff --git a/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseExplicitTypeCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseExplicitTypeCodeFixProvider.cs index abdfb11cf27e6..3b7508506e5ea 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseExplicitTypeCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseExplicitTypeCodeFixProvider.cs @@ -35,8 +35,6 @@ public UseExplicitTypeCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseExplicitTypeDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseImplicitTypeCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseImplicitTypeCodeFixProvider.cs index ba9d48d17ee40..95b776c1e364a 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseImplicitTypeCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseImplicitTypeCodeFixProvider.cs @@ -33,8 +33,6 @@ public UseImplicitTypeCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseImplicitTypeDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix( diff --git a/src/Analyzers/CSharp/CodeFixes/UseIndexOrRangeOperator/CSharpUseIndexOperatorCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseIndexOrRangeOperator/CSharpUseIndexOperatorCodeFixProvider.cs index 75b429ac0e901..e3ebdf74ae9f6 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseIndexOrRangeOperator/CSharpUseIndexOperatorCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseIndexOrRangeOperator/CSharpUseIndexOperatorCodeFixProvider.cs @@ -34,8 +34,6 @@ public CSharpUseIndexOperatorCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseIndexOperatorDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/UseIndexOrRangeOperator/CSharpUseRangeOperatorCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseIndexOrRangeOperator/CSharpUseRangeOperatorCodeFixProvider.cs index 4d33644bc22d6..b481faf807eb7 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseIndexOrRangeOperator/CSharpUseRangeOperatorCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseIndexOrRangeOperator/CSharpUseRangeOperatorCodeFixProvider.cs @@ -39,8 +39,6 @@ public CSharpUseRangeOperatorCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseRangeOperatorDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/UseIsNullCheck/CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseIsNullCheck/CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs index 2ca0c12fc87cc..cf99552eb8019 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseIsNullCheck/CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseIsNullCheck/CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs @@ -35,8 +35,6 @@ public CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseIsNullCheckDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - private static bool IsSupportedDiagnostic(Diagnostic diagnostic) => diagnostic.Properties[UseIsNullConstants.Kind] == UseIsNullConstants.CastAndEqualityKey; diff --git a/src/Analyzers/CSharp/CodeFixes/UseIsNullCheck/CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseIsNullCheck/CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs index d588e3941ec53..a6cf1401a8875 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseIsNullCheck/CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseIsNullCheck/CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs @@ -35,8 +35,6 @@ public CSharpUseNullCheckOverTypeCheckCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseNullCheckOverTypeCheckDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics.First(); diff --git a/src/Analyzers/CSharp/CodeFixes/UseParameterNullChecking/CSharpUseParameterNullCheckingCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseParameterNullChecking/CSharpUseParameterNullCheckingCodeFixProvider.cs index 3b3badcacc4e8..be70fadf101b2 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseParameterNullChecking/CSharpUseParameterNullCheckingCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseParameterNullChecking/CSharpUseParameterNullCheckingCodeFixProvider.cs @@ -33,8 +33,6 @@ public CSharpUseParameterNullCheckingCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseParameterNullCheckingId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics[0]; diff --git a/src/Features/CSharp/Portable/UsePatternCombinators/CSharpUsePatternCombinatorsCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UsePatternCombinators/CSharpUsePatternCombinatorsCodeFixProvider.cs similarity index 97% rename from src/Features/CSharp/Portable/UsePatternCombinators/CSharpUsePatternCombinatorsCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/UsePatternCombinators/CSharpUsePatternCombinatorsCodeFixProvider.cs index 9a02160af5a77..21c3a8aeecd19 100644 --- a/src/Features/CSharp/Portable/UsePatternCombinators/CSharpUsePatternCombinatorsCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UsePatternCombinators/CSharpUsePatternCombinatorsCodeFixProvider.cs @@ -54,8 +54,6 @@ private static SyntaxKind MapToSyntaxKind(BinaryOperatorKind kind) public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UsePatternCombinatorsDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll( Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) { @@ -118,7 +116,7 @@ private static PatternSyntax AsPatternSyntax(AnalyzedPattern pattern) private static ExpressionSyntax AsExpressionSyntax(ExpressionSyntax expr, AnalyzedPattern p) { var semanticModel = p.Target.SemanticModel; - Debug.Assert(semanticModel != null); + RoslynDebug.Assert(semanticModel != null); var type = semanticModel.GetTypeInfo(expr).Type; if (type != null) { @@ -148,7 +146,9 @@ public MyCodeAction(string title, Func> create { } +#if !CODE_STYLE // 'CodeActionPriority' is not a public API, hence not supported in CodeStyle layer. internal override CodeActionPriority Priority => CodeActionPriority.Low; +#endif } } } diff --git a/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpAsAndNullCheckCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpAsAndNullCheckCodeFixProvider.cs index 8a18396dd7340..c95bf01481667 100644 --- a/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpAsAndNullCheckCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpAsAndNullCheckCodeFixProvider.cs @@ -35,8 +35,6 @@ public CSharpAsAndNullCheckCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.InlineAsTypeCheckId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpIsAndCastCheckCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpIsAndCastCheckCodeFixProvider.cs index 195c4b6dfae69..0bd39de79a50e 100644 --- a/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpIsAndCastCheckCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpIsAndCastCheckCodeFixProvider.cs @@ -35,8 +35,6 @@ public CSharpIsAndCastCheckCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.InlineIsTypeCheckId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpUseNotPatternCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpUseNotPatternCodeFixProvider.cs index eff776debdf9b..d27e1c0d1b5b9 100644 --- a/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpUseNotPatternCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UsePatternMatching/CSharpUseNotPatternCodeFixProvider.cs @@ -32,8 +32,6 @@ public CSharpUseNotPatternCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseNotPatternDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/UseSimpleUsingStatement/UseSimpleUsingStatementCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseSimpleUsingStatement/UseSimpleUsingStatementCodeFixProvider.cs index b5f0be3a94cfa..cdfa96f2030cf 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseSimpleUsingStatement/UseSimpleUsingStatementCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseSimpleUsingStatement/UseSimpleUsingStatementCodeFixProvider.cs @@ -39,8 +39,6 @@ public UseSimpleUsingStatementCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseSimpleUsingStatementDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/CSharp/CodeFixes/UseTupleSwap/CSharpUseTupleSwapCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseTupleSwap/CSharpUseTupleSwapCodeFixProvider.cs index 0eb78ed1f3d54..e61c3fa4744b7 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseTupleSwap/CSharpUseTupleSwapCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseTupleSwap/CSharpUseTupleSwapCodeFixProvider.cs @@ -35,8 +35,6 @@ public CSharpUseTupleSwapCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseTupleSwapDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/Core/CodeFixes/AddAccessibilityModifiers/AbstractAddAccessibilityModifiersCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/AddAccessibilityModifiers/AbstractAddAccessibilityModifiersCodeFixProvider.cs index 653b69703b24c..e78fa1d48c6d9 100644 --- a/src/Analyzers/Core/CodeFixes/AddAccessibilityModifiers/AbstractAddAccessibilityModifiersCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/AddAccessibilityModifiers/AbstractAddAccessibilityModifiersCodeFixProvider.cs @@ -23,8 +23,6 @@ internal abstract class AbstractAddAccessibilityModifiersCodeFixProvider : Synta public sealed override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.AddAccessibilityModifiersDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics.First(); diff --git a/src/Analyzers/Core/CodeFixes/AddRequiredParentheses/AddRequiredParenthesesCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/AddRequiredParentheses/AddRequiredParenthesesCodeFixProvider.cs index f381b917e35a2..3098f0ab1180b 100644 --- a/src/Analyzers/Core/CodeFixes/AddRequiredParentheses/AddRequiredParenthesesCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/AddRequiredParentheses/AddRequiredParenthesesCodeFixProvider.cs @@ -28,8 +28,6 @@ public AddRequiredParenthesesCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.AddRequiredParenthesesDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) => diagnostic.Properties.ContainsKey(AddRequiredParenthesesConstants.IncludeInFixAll) && diagnostic.Properties[AddRequiredParenthesesConstants.EquivalenceKey] == equivalenceKey; diff --git a/src/Analyzers/Core/CodeFixes/ConvertTypeOfToNameOf/AbstractConvertTypeOfToNameOfCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/ConvertTypeOfToNameOf/AbstractConvertTypeOfToNameOfCodeFixProvider.cs index e5874726f07de..118796b8f186e 100644 --- a/src/Analyzers/Core/CodeFixes/ConvertTypeOfToNameOf/AbstractConvertTypeOfToNameOfCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/ConvertTypeOfToNameOf/AbstractConvertTypeOfToNameOfCodeFixProvider.cs @@ -20,8 +20,6 @@ internal abstract class AbstractConvertTypeOfToNameOfCodeFixProvider : SyntaxEdi { public sealed override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.ConvertTypeOfToNameOfDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/Core/CodeFixes/MakeFieldReadonly/AbstractMakeFieldReadonlyCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/MakeFieldReadonly/AbstractMakeFieldReadonlyCodeFixProvider.cs index 66ce04cb44d1c..08e7593b267ff 100644 --- a/src/Analyzers/Core/CodeFixes/MakeFieldReadonly/AbstractMakeFieldReadonlyCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/MakeFieldReadonly/AbstractMakeFieldReadonlyCodeFixProvider.cs @@ -26,8 +26,6 @@ internal abstract class AbstractMakeFieldReadonlyCodeFixProvider FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.MakeFieldReadonlyDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeQuality; - protected abstract SyntaxNode GetInitializerNode(TSymbolSyntax declaration); protected abstract ImmutableList GetVariableDeclarators(TFieldDeclarationSyntax declaration); diff --git a/src/Analyzers/Core/CodeFixes/OrderModifiers/AbstractOrderModifiersCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/OrderModifiers/AbstractOrderModifiersCodeFixProvider.cs index dd65e23df21c8..fd2a8bb32a8f3 100644 --- a/src/Analyzers/Core/CodeFixes/OrderModifiers/AbstractOrderModifiersCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/OrderModifiers/AbstractOrderModifiersCodeFixProvider.cs @@ -40,8 +40,6 @@ protected AbstractOrderModifiersCodeFixProvider( public sealed override ImmutableArray FixableDiagnosticIds => FixableCompilerErrorIds.Add(IDEDiagnosticIds.OrderModifiersDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var syntaxTree = await context.Document.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false); diff --git a/src/Analyzers/Core/CodeFixes/PopulateSwitch/AbstractPopulateSwitchCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/PopulateSwitch/AbstractPopulateSwitchCodeFixProvider.cs index 3968a0d2c709e..0cb1d3b361882 100644 --- a/src/Analyzers/Core/CodeFixes/PopulateSwitch/AbstractPopulateSwitchCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/PopulateSwitch/AbstractPopulateSwitchCodeFixProvider.cs @@ -50,8 +50,6 @@ protected abstract void FixOneDiagnostic( bool hasMissingCases, bool hasMissingDefaultCase, TSwitchSyntax switchNode, TSwitchOperation switchOperation); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.Custom; - public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics.First(); diff --git a/src/Analyzers/Core/CodeFixes/QualifyMemberAccess/AbstractQualifyMemberAccessCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/QualifyMemberAccess/AbstractQualifyMemberAccessCodeFixProvider.cs index 1651e6376a2ec..3800dba1d46f9 100644 --- a/src/Analyzers/Core/CodeFixes/QualifyMemberAccess/AbstractQualifyMemberAccessCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/QualifyMemberAccess/AbstractQualifyMemberAccessCodeFixProvider.cs @@ -24,8 +24,6 @@ internal abstract class AbstractQualifyMemberAccessCodeFixprovider FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.AddQualificationDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/Core/CodeFixes/RemoveRedundantEquality/RemoveRedundantEqualityCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/RemoveRedundantEquality/RemoveRedundantEqualityCodeFixProvider.cs index 5439d8e62fe55..dc06e6b518c90 100644 --- a/src/Analyzers/Core/CodeFixes/RemoveRedundantEquality/RemoveRedundantEqualityCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/RemoveRedundantEquality/RemoveRedundantEqualityCodeFixProvider.cs @@ -30,8 +30,6 @@ public RemoveRedundantEqualityCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.RemoveRedundantEqualityDiagnosticId); - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { foreach (var diagnostic in context.Diagnostics) diff --git a/src/Analyzers/Core/CodeFixes/RemoveUnnecessaryParentheses/AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/RemoveUnnecessaryParentheses/AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs index 1a3d1af29c3fc..8444e2b14ba92 100644 --- a/src/Analyzers/Core/CodeFixes/RemoveUnnecessaryParentheses/AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/RemoveUnnecessaryParentheses/AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs @@ -22,8 +22,6 @@ internal abstract class AbstractRemoveUnnecessaryParenthesesCodeFixProvider FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryParenthesesDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected abstract bool CanRemoveParentheses( TParenthesizedExpressionSyntax current, SemanticModel semanticModel, CancellationToken cancellationToken); diff --git a/src/Analyzers/Core/CodeFixes/RemoveUnnecessarySuppressions/RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/RemoveUnnecessarySuppressions/RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs index a32e49f2c2681..2d4ab370fd174 100644 --- a/src/Analyzers/Core/CodeFixes/RemoveUnnecessarySuppressions/RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/RemoveUnnecessarySuppressions/RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs @@ -28,9 +28,6 @@ public RemoveUnnecessaryAttributeSuppressionsCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.InvalidSuppressMessageAttributeDiagnosticId); - internal override CodeFixCategory CodeFixCategory - => CodeFixCategory.CodeQuality; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); diff --git a/src/Analyzers/Core/CodeFixes/RemoveUnnecessarySuppressions/RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/RemoveUnnecessarySuppressions/RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs index b88b1acb6a3df..eb7afd7f56f29 100644 --- a/src/Analyzers/Core/CodeFixes/RemoveUnnecessarySuppressions/RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/RemoveUnnecessarySuppressions/RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs @@ -33,9 +33,6 @@ public RemoveUnnecessaryInlineSuppressionsCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessarySuppressionDiagnosticId); - internal override CodeFixCategory CodeFixCategory - => CodeFixCategory.CodeQuality; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); diff --git a/src/Analyzers/Core/CodeFixes/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs index 7bcdd977308fe..ded56b472ca8a 100644 --- a/src/Analyzers/Core/CodeFixes/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs @@ -25,8 +25,6 @@ internal abstract class AbstractRemoveUnusedMembersCodeFixProvider FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.RemoveUnusedMembersDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeQuality; - /// /// This method adjusts the to remove based on whether or not all variable declarators /// within a field declaration should be removed, diff --git a/src/Analyzers/Core/CodeFixes/RemoveUnusedParametersAndValues/AbstractRemoveUnusedValuesCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/RemoveUnusedParametersAndValues/AbstractRemoveUnusedValuesCodeFixProvider.cs index adf04d8fc912a..2098335064734 100644 --- a/src/Analyzers/Core/CodeFixes/RemoveUnusedParametersAndValues/AbstractRemoveUnusedValuesCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/RemoveUnusedParametersAndValues/AbstractRemoveUnusedValuesCodeFixProvider.cs @@ -64,10 +64,8 @@ public sealed override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.ExpressionValueIsUnusedDiagnosticId, IDEDiagnosticIds.ValueAssignedIsUnusedDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeQuality; - #if CODE_STYLE - protected abstract ISyntaxFormattingService GetSyntaxFormattingService(); + protected abstract ISyntaxFormatting GetSyntaxFormatting(); #endif /// /// Method to update the identifier token for the local/parameter declaration or reference @@ -269,7 +267,7 @@ private static async Task PreprocessDocumentAsync(Document document, I protected sealed override async Task FixAllAsync(Document document, ImmutableArray diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) { #if CODE_STYLE - var provider = GetSyntaxFormattingService(); + var provider = GetSyntaxFormatting(); var options = provider.GetFormattingOptions(document.Project.AnalyzerOptions.GetAnalyzerOptionSet(editor.OriginalRoot.SyntaxTree, cancellationToken)); #else var provider = document.Project.Solution.Workspace.Services; @@ -832,7 +830,7 @@ private async Task AdjustLocalDeclarationsAsync( // Run formatter prior to invoking IMoveDeclarationNearReferenceService. #if CODE_STYLE - var provider = GetSyntaxFormattingService(); + var provider = GetSyntaxFormatting(); rootWithTrackedNodes = FormatterHelper.Format(rootWithTrackedNodes, originalDeclStatementsToMoveOrRemove.Select(s => s.Span), provider, options, rules: null, cancellationToken); #else var provider = document.Project.Solution.Workspace.Services; diff --git a/src/Analyzers/Core/CodeFixes/SimplifyBooleanExpression/SimplifyConditionalCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/SimplifyBooleanExpression/SimplifyConditionalCodeFixProvider.cs index 5603d7eadd6ca..9602b413c003e 100644 --- a/src/Analyzers/Core/CodeFixes/SimplifyBooleanExpression/SimplifyConditionalCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/SimplifyBooleanExpression/SimplifyConditionalCodeFixProvider.cs @@ -32,9 +32,6 @@ public SimplifyConditionalCodeFixProvider() public sealed override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.SimplifyConditionalExpressionDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory - => CodeFixCategory.CodeQuality; - public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/Core/CodeFixes/SimplifyInterpolation/AbstractSimplifyInterpolationCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/SimplifyInterpolation/AbstractSimplifyInterpolationCodeFixProvider.cs index 11826a68d818b..963a414d5764b 100644 --- a/src/Analyzers/Core/CodeFixes/SimplifyInterpolation/AbstractSimplifyInterpolationCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/SimplifyInterpolation/AbstractSimplifyInterpolationCodeFixProvider.cs @@ -33,8 +33,6 @@ internal abstract class AbstractSimplifyInterpolationCodeFixProvider< public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.SimplifyInterpolationId); - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected abstract AbstractSimplifyInterpolationHelpers GetHelpers(); protected abstract TInterpolationSyntax WithExpression(TInterpolationSyntax interpolation, TExpressionSyntax expression); diff --git a/src/Analyzers/Core/CodeFixes/SimplifyLinqExpression/AbstractSimplifyLinqExpressionCodeFixProvider`3.cs b/src/Analyzers/Core/CodeFixes/SimplifyLinqExpression/AbstractSimplifyLinqExpressionCodeFixProvider`3.cs index e4470516c8738..a46cbfacc40b4 100644 --- a/src/Analyzers/Core/CodeFixes/SimplifyLinqExpression/AbstractSimplifyLinqExpressionCodeFixProvider`3.cs +++ b/src/Analyzers/Core/CodeFixes/SimplifyLinqExpression/AbstractSimplifyLinqExpressionCodeFixProvider`3.cs @@ -25,8 +25,6 @@ internal abstract class AbstractSimplifyLinqExpressionCodeFixProvider FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.SimplifyLinqExpressionDiagnosticId); - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeQuality; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/Core/CodeFixes/UpdateLegacySuppressions/UpdateLegacySuppressionsCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UpdateLegacySuppressions/UpdateLegacySuppressionsCodeFixProvider.cs index c0698b2b73192..c9ff7acfb47c9 100644 --- a/src/Analyzers/Core/CodeFixes/UpdateLegacySuppressions/UpdateLegacySuppressionsCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UpdateLegacySuppressions/UpdateLegacySuppressionsCodeFixProvider.cs @@ -29,9 +29,6 @@ public UpdateLegacySuppressionsCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.LegacyFormatSuppressMessageAttributeDiagnosticId); - internal override CodeFixCategory CodeFixCategory - => CodeFixCategory.CodeQuality; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var root = await context.Document.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); diff --git a/src/Analyzers/Core/CodeFixes/UseCoalesceExpression/UseCoalesceExpressionCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseCoalesceExpression/UseCoalesceExpressionCodeFixProvider.cs index f572e087a4fe9..28b1ce648075d 100644 --- a/src/Analyzers/Core/CodeFixes/UseCoalesceExpression/UseCoalesceExpressionCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseCoalesceExpression/UseCoalesceExpressionCodeFixProvider.cs @@ -30,8 +30,6 @@ public UseCoalesceExpressionCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseCoalesceExpressionDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) => !diagnostic.Descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary); diff --git a/src/Analyzers/Core/CodeFixes/UseCoalesceExpression/UseCoalesceExpressionForNullableCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseCoalesceExpression/UseCoalesceExpressionForNullableCodeFixProvider.cs index b189fa68e52b1..e637ffbe5be59 100644 --- a/src/Analyzers/Core/CodeFixes/UseCoalesceExpression/UseCoalesceExpressionForNullableCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseCoalesceExpression/UseCoalesceExpressionForNullableCodeFixProvider.cs @@ -29,8 +29,6 @@ public UseCoalesceExpressionForNullableCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseCoalesceExpressionForNullableDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) => !diagnostic.Descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary); diff --git a/src/Analyzers/Core/CodeFixes/UseCollectionInitializer/AbstractUseCollectionInitializerCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseCollectionInitializer/AbstractUseCollectionInitializerCodeFixProvider.cs index b06948430ce62..30cf4e5ab1441 100644 --- a/src/Analyzers/Core/CodeFixes/UseCollectionInitializer/AbstractUseCollectionInitializerCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseCollectionInitializer/AbstractUseCollectionInitializerCodeFixProvider.cs @@ -41,8 +41,6 @@ internal abstract class AbstractUseCollectionInitializerCodeFixProvider< public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseCollectionInitializerDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) => !diagnostic.Descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary); diff --git a/src/Analyzers/Core/CodeFixes/UseCompoundAssignment/AbstractUseCompoundAssignmentCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseCompoundAssignment/AbstractUseCompoundAssignmentCodeFixProvider.cs index 07a38d48f5d2f..5d506744a74c8 100644 --- a/src/Analyzers/Core/CodeFixes/UseCompoundAssignment/AbstractUseCompoundAssignmentCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseCompoundAssignment/AbstractUseCompoundAssignmentCodeFixProvider.cs @@ -25,8 +25,6 @@ internal abstract class AbstractUseCompoundAssignmentCodeFixProvider< public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseCompoundAssignmentDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - // See comments in the analyzer for what these maps are for. private readonly ImmutableDictionary _binaryToAssignmentMap; diff --git a/src/Analyzers/Core/CodeFixes/UseConditionalExpression/AbstractUseConditionalExpressionCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseConditionalExpression/AbstractUseConditionalExpressionCodeFixProvider.cs index 30018fd0c3f3d..4732c77cee13d 100644 --- a/src/Analyzers/Core/CodeFixes/UseConditionalExpression/AbstractUseConditionalExpressionCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseConditionalExpression/AbstractUseConditionalExpressionCodeFixProvider.cs @@ -35,13 +35,11 @@ internal abstract class AbstractUseConditionalExpressionCodeFixProvider< where TExpressionSyntax : SyntaxNode where TConditionalExpressionSyntax : TExpressionSyntax { - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected abstract ISyntaxFacts SyntaxFacts { get; } protected abstract AbstractFormattingRule GetMultiLineFormattingRule(); #if CODE_STYLE - protected abstract ISyntaxFormattingService GetSyntaxFormattingService(); + protected abstract ISyntaxFormatting GetSyntaxFormatting(); #endif protected abstract TExpressionSyntax ConvertToExpression(IThrowOperation throwOperation); @@ -77,7 +75,7 @@ await FixOneAsync( var rules = new List { GetMultiLineFormattingRule() }; #if CODE_STYLE - var provider = GetSyntaxFormattingService(); + var provider = GetSyntaxFormatting(); var options = provider.GetFormattingOptions(document.Project.AnalyzerOptions.GetAnalyzerOptionSet(root.SyntaxTree, cancellationToken)); #else var provider = document.Project.Solution.Workspace.Services; diff --git a/src/Analyzers/Core/CodeFixes/UseExplicitTupleName/UseExplicitTupleNameCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseExplicitTupleName/UseExplicitTupleNameCodeFixProvider.cs index f38c06d61765b..c8271ef751b68 100644 --- a/src/Analyzers/Core/CodeFixes/UseExplicitTupleName/UseExplicitTupleNameCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseExplicitTupleName/UseExplicitTupleNameCodeFixProvider.cs @@ -29,8 +29,6 @@ public UseExplicitTupleNameCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseExplicitTupleNameDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/Core/CodeFixes/UseInferredMemberName/AbstractUseInferredMemberNameCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseInferredMemberName/AbstractUseInferredMemberNameCodeFixProvider.cs index d0fe865eaa397..e9db689b6ee9d 100644 --- a/src/Analyzers/Core/CodeFixes/UseInferredMemberName/AbstractUseInferredMemberNameCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseInferredMemberName/AbstractUseInferredMemberNameCodeFixProvider.cs @@ -22,8 +22,6 @@ internal abstract class AbstractUseInferredMemberNameCodeFixProvider : SyntaxEdi public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseInferredMemberNameDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Analyzers/Core/CodeFixes/UseIsNullCheck/AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseIsNullCheck/AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs index fac3945add703..29266e98095ee 100644 --- a/src/Analyzers/Core/CodeFixes/UseIsNullCheck/AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseIsNullCheck/AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs @@ -24,8 +24,6 @@ internal abstract class AbstractUseIsNullCheckForReferenceEqualsCodeFixProvider< public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseIsNullCheckDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected abstract string GetTitle(bool negated, ParseOptions options); protected abstract SyntaxNode CreateNullCheck(TExpressionSyntax argument, bool isUnconstrainedGeneric); diff --git a/src/Analyzers/Core/CodeFixes/UseNullPropagation/AbstractUseNullPropagationCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseNullPropagation/AbstractUseNullPropagationCodeFixProvider.cs index 1b2a2737bf937..325b44e11577e 100644 --- a/src/Analyzers/Core/CodeFixes/UseNullPropagation/AbstractUseNullPropagationCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseNullPropagation/AbstractUseNullPropagationCodeFixProvider.cs @@ -45,8 +45,6 @@ internal abstract class AbstractUseNullPropagationCodeFixProvider< public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseNullPropagationDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) => !diagnostic.Descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary); diff --git a/src/Analyzers/Core/CodeFixes/UseObjectInitializer/AbstractUseObjectInitializerCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseObjectInitializer/AbstractUseObjectInitializerCodeFixProvider.cs index c242651cf9215..ed79af014c3bd 100644 --- a/src/Analyzers/Core/CodeFixes/UseObjectInitializer/AbstractUseObjectInitializerCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseObjectInitializer/AbstractUseObjectInitializerCodeFixProvider.cs @@ -39,8 +39,6 @@ internal abstract class AbstractUseObjectInitializerCodeFixProvider< public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseObjectInitializerDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) => !diagnostic.Descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary); diff --git a/src/Analyzers/Core/CodeFixes/UseSystemHashCode/UseSystemHashCodeCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseSystemHashCode/UseSystemHashCodeCodeFixProvider.cs index fcb56ab24908b..fcd2a9d8956b2 100644 --- a/src/Analyzers/Core/CodeFixes/UseSystemHashCode/UseSystemHashCodeCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseSystemHashCode/UseSystemHashCodeCodeFixProvider.cs @@ -30,9 +30,6 @@ public UseSystemHashCodeCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseSystemHashCode); - internal override CodeFixCategory CodeFixCategory { get; } - = CodeFixCategory.CodeQuality; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { var document = context.Document; diff --git a/src/Analyzers/Core/CodeFixes/UseThrowExpression/UseThrowExpressionCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UseThrowExpression/UseThrowExpressionCodeFixProvider.cs index 80242b963c701..ca9f1ff663360 100644 --- a/src/Analyzers/Core/CodeFixes/UseThrowExpression/UseThrowExpressionCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UseThrowExpression/UseThrowExpressionCodeFixProvider.cs @@ -31,8 +31,6 @@ public UseThrowExpressionCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseThrowExpressionDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) => !diagnostic.Descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary); diff --git a/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryByVal/VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryByVal/VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb index bd730f1af920b..82de49db13484 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryByVal/VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryByVal/VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb @@ -26,8 +26,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryByVal Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) = ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryByValDiagnosticId) - Friend Overrides ReadOnly Property CodeFixCategory As CodeFixCategory = CodeFixCategory.CodeStyle - Public Overrides Function RegisterCodeFixesAsync(context As CodeFixContext) As Task For Each diagnostic In context.Diagnostics context.RegisterCodeFix(New MyCodeAction( diff --git a/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb index 9b168e1c56811..10059e139b180 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryCast/VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb @@ -30,12 +30,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryCast Public NotOverridable Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) = ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryCastDiagnosticId) - Friend NotOverridable Overrides ReadOnly Property CodeFixCategory As CodeFixCategory - Get - Return CodeFixCategory.CodeStyle - End Get - End Property - Public Overrides Function RegisterCodeFixesAsync(context As CodeFixContext) As Task context.RegisterCodeFix(New MyCodeAction( Function(c) FixAsync(context.Document, context.Diagnostics.First(), c)), diff --git a/src/Analyzers/VisualBasic/CodeFixes/RemoveUnusedParametersAndValues/VisualBasicRemoveUnusedValuesCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnusedParametersAndValues/VisualBasicRemoveUnusedValuesCodeFixProvider.vb index a751f08efa9a1..e184ec00eb87b 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/RemoveUnusedParametersAndValues/VisualBasicRemoveUnusedValuesCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnusedParametersAndValues/VisualBasicRemoveUnusedValuesCodeFixProvider.vb @@ -26,8 +26,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.RemoveUnusedParametersAndValues End Sub #If CODE_STYLE Then - Protected Overrides Function GetSyntaxFormattingService() As ISyntaxFormattingService - Return VisualBasicSyntaxFormattingService.Instance + Protected Overrides Function GetSyntaxFormatting() As ISyntaxFormatting + Return VisualBasicSyntaxFormatting.Instance End Function #End If diff --git a/src/Analyzers/VisualBasic/CodeFixes/SimplifyObjectCreation/VisualBasicSimplifyObjectCreationCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/SimplifyObjectCreation/VisualBasicSimplifyObjectCreationCodeFixProvider.vb index caf3cc969f0c6..e9017da936990 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/SimplifyObjectCreation/VisualBasicSimplifyObjectCreationCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/SimplifyObjectCreation/VisualBasicSimplifyObjectCreationCodeFixProvider.vb @@ -24,8 +24,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.SimplifyObjectCreation Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) = ImmutableArray.Create(IDEDiagnosticIds.SimplifyObjectCreationDiagnosticId) - Friend Overrides ReadOnly Property CodeFixCategory As CodeFixCategory = CodeFixCategory.CodeStyle - Public Overrides Function RegisterCodeFixesAsync(context As CodeFixContext) As Task For Each diagnostic In context.Diagnostics context.RegisterCodeFix(New MyCodeAction( diff --git a/src/Analyzers/VisualBasic/CodeFixes/UseConditionalExpression/VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/UseConditionalExpression/VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb index 978af318745ca..5a92840da3542 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/UseConditionalExpression/VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/UseConditionalExpression/VisualBasicUseConditionalExpressionForAssignmentCodeFixProvider.vb @@ -60,8 +60,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UseConditionalExpression End Function #If CODE_STYLE Then - Protected Overrides Function GetSyntaxFormattingService() As ISyntaxFormattingService - Return VisualBasicSyntaxFormattingService.Instance + Protected Overrides Function GetSyntaxFormatting() As ISyntaxFormatting + Return VisualBasicSyntaxFormatting.Instance End Function #End If End Class diff --git a/src/Analyzers/VisualBasic/CodeFixes/UseConditionalExpression/VisualBasicUseConditionalExpressionForReturnCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/UseConditionalExpression/VisualBasicUseConditionalExpressionForReturnCodeFixProvider.vb index ead0c5dff0848..a546148b18c7f 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/UseConditionalExpression/VisualBasicUseConditionalExpressionForReturnCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/UseConditionalExpression/VisualBasicUseConditionalExpressionForReturnCodeFixProvider.vb @@ -44,8 +44,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UseConditionalExpression End Function #If CODE_STYLE Then - Protected Overrides Function GetSyntaxFormattingService() As ISyntaxFormattingService - Return VisualBasicSyntaxFormattingService.Instance + Protected Overrides Function GetSyntaxFormatting() As ISyntaxFormatting + Return VisualBasicSyntaxFormatting.Instance End Function #End If End Class diff --git a/src/Analyzers/VisualBasic/CodeFixes/UseIsNotExpression/VisualBasicUseIsNotExpressionCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/UseIsNotExpression/VisualBasicUseIsNotExpressionCodeFixProvider.vb index 9c2d3c88b0f55..6bc3cc829269f 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/UseIsNotExpression/VisualBasicUseIsNotExpressionCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/UseIsNotExpression/VisualBasicUseIsNotExpressionCodeFixProvider.vb @@ -25,8 +25,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UseIsNotExpression Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) = ImmutableArray.Create(IDEDiagnosticIds.UseIsNotExpressionDiagnosticId) - Friend Overrides ReadOnly Property CodeFixCategory As CodeFixCategory = CodeFixCategory.CodeStyle - Public Overrides Function RegisterCodeFixesAsync(context As CodeFixContext) As Task context.RegisterCodeFix(New MyCodeAction( Function(c) FixAsync(context.Document, context.Diagnostics.First(), c)), diff --git a/src/CodeStyle/CSharp/Analyzers/CSharpFormattingAnalyzer.cs b/src/CodeStyle/CSharp/Analyzers/CSharpFormattingAnalyzer.cs index 4951f7e8f2335..3f31dd0f3a08f 100644 --- a/src/CodeStyle/CSharp/Analyzers/CSharpFormattingAnalyzer.cs +++ b/src/CodeStyle/CSharp/Analyzers/CSharpFormattingAnalyzer.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - using Microsoft.CodeAnalysis.CSharp.Formatting; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Formatting; @@ -13,7 +11,7 @@ namespace Microsoft.CodeAnalysis.CodeStyle [DiagnosticAnalyzer(LanguageNames.CSharp)] internal class CSharpFormattingAnalyzer : AbstractFormattingAnalyzer { - protected override ISyntaxFormattingService SyntaxFormattingService - => CSharpSyntaxFormattingService.Instance; + protected override ISyntaxFormatting SyntaxFormatting + => CSharpSyntaxFormatting.Instance; } } diff --git a/src/CodeStyle/CSharp/CodeFixes/CSharpFormattingCodeFixProvider.cs b/src/CodeStyle/CSharp/CodeFixes/CSharpFormattingCodeFixProvider.cs index 482aa5cba637a..9476008efaaa6 100644 --- a/src/CodeStyle/CSharp/CodeFixes/CSharpFormattingCodeFixProvider.cs +++ b/src/CodeStyle/CSharp/CodeFixes/CSharpFormattingCodeFixProvider.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - using System; using System.Composition; using Microsoft.CodeAnalysis.CodeFixes; @@ -13,8 +11,7 @@ namespace Microsoft.CodeAnalysis.CodeStyle { - [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.FixFormatting)] - [Shared] + [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.FixFormatting), Shared] internal class CSharpFormattingCodeFixProvider : AbstractFormattingCodeFixProvider { [ImportingConstructor] @@ -23,6 +20,6 @@ public CSharpFormattingCodeFixProvider() { } - protected override ISyntaxFormattingService SyntaxFormattingService => CSharpSyntaxFormattingService.Instance; + protected override ISyntaxFormatting SyntaxFormatting => CSharpSyntaxFormatting.Instance; } } diff --git a/src/CodeStyle/Core/Analyzers/AbstractFormattingAnalyzer.cs b/src/CodeStyle/Core/Analyzers/AbstractFormattingAnalyzer.cs index dbeaf6f74148b..a39030841d90e 100644 --- a/src/CodeStyle/Core/Analyzers/AbstractFormattingAnalyzer.cs +++ b/src/CodeStyle/Core/Analyzers/AbstractFormattingAnalyzer.cs @@ -27,15 +27,15 @@ public sealed override ImmutableArray SupportedDiagnostics public sealed override DiagnosticAnalyzerCategory GetAnalyzerCategory() => DiagnosticAnalyzerCategory.SyntaxTreeWithoutSemanticsAnalysis; - protected abstract ISyntaxFormattingService SyntaxFormattingService { get; } + protected abstract ISyntaxFormatting SyntaxFormatting { get; } protected sealed override void InitializeWorker(AnalysisContext context) => context.RegisterSyntaxTreeAction(AnalyzeSyntaxTree); private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context) { - var options = SyntaxFormattingService.GetFormattingOptions(context.Options.AnalyzerConfigOptionsProvider.GetOptions(context.Tree)); - FormattingAnalyzerHelper.AnalyzeSyntaxTree(context, SyntaxFormattingService, Descriptor, options); + var options = SyntaxFormatting.GetFormattingOptions(context.Options.AnalyzerConfigOptionsProvider.GetOptions(context.Tree)); + FormattingAnalyzerHelper.AnalyzeSyntaxTree(context, SyntaxFormatting, Descriptor, options); } } } diff --git a/src/CodeStyle/Core/Analyzers/Formatting/FormatterHelper.cs b/src/CodeStyle/Core/Analyzers/Formatting/FormatterHelper.cs index 54db1c6918b95..eb90f80e93436 100644 --- a/src/CodeStyle/Core/Analyzers/Formatting/FormatterHelper.cs +++ b/src/CodeStyle/Core/Analyzers/Formatting/FormatterHelper.cs @@ -19,7 +19,7 @@ internal static class FormatterHelper /// /// Gets the formatting rules that would be applied if left unspecified. /// - internal static IEnumerable GetDefaultFormattingRules(ISyntaxFormattingService syntaxFormattingService) + internal static IEnumerable GetDefaultFormattingRules(ISyntaxFormatting syntaxFormattingService) => syntaxFormattingService.GetDefaultFormattingRules(); /// @@ -29,10 +29,10 @@ internal static IEnumerable GetDefaultFormattingRules(IS /// An optional set of formatting options. If these options are not supplied the current set of options from the workspace will be used. /// An optional cancellation token. /// The formatted tree's root node. - public static SyntaxNode Format(SyntaxNode node, ISyntaxFormattingService syntaxFormattingService, SyntaxFormattingOptions options, CancellationToken cancellationToken) + public static SyntaxNode Format(SyntaxNode node, ISyntaxFormatting syntaxFormattingService, SyntaxFormattingOptions options, CancellationToken cancellationToken) => Format(node, SpecializedCollections.SingletonEnumerable(node.FullSpan), syntaxFormattingService, options, rules: null, cancellationToken: cancellationToken); - public static SyntaxNode Format(SyntaxNode node, TextSpan spanToFormat, ISyntaxFormattingService syntaxFormattingService, SyntaxFormattingOptions options, CancellationToken cancellationToken) + public static SyntaxNode Format(SyntaxNode node, TextSpan spanToFormat, ISyntaxFormatting syntaxFormattingService, SyntaxFormattingOptions options, CancellationToken cancellationToken) => Format(node, SpecializedCollections.SingletonEnumerable(spanToFormat), syntaxFormattingService, options, rules: null, cancellationToken: cancellationToken); /// @@ -43,16 +43,16 @@ public static SyntaxNode Format(SyntaxNode node, TextSpan spanToFormat, ISyntaxF /// An optional set of formatting options. If these options are not supplied the current set of options from the workspace will be used. /// An optional cancellation token. /// The formatted tree's root node. - public static SyntaxNode Format(SyntaxNode node, SyntaxAnnotation annotation, ISyntaxFormattingService syntaxFormattingService, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken) + public static SyntaxNode Format(SyntaxNode node, SyntaxAnnotation annotation, ISyntaxFormatting syntaxFormattingService, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken) => Format(node, GetAnnotatedSpans(node, annotation), syntaxFormattingService, options, rules, cancellationToken: cancellationToken); - internal static SyntaxNode Format(SyntaxNode node, IEnumerable spans, ISyntaxFormattingService syntaxFormattingService, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken) + internal static SyntaxNode Format(SyntaxNode node, IEnumerable spans, ISyntaxFormatting syntaxFormattingService, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken) => GetFormattingResult(node, spans, syntaxFormattingService, options, rules, cancellationToken).GetFormattedRoot(cancellationToken); - internal static IList GetFormattedTextChanges(SyntaxNode node, IEnumerable spans, ISyntaxFormattingService syntaxFormattingService, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken) + internal static IList GetFormattedTextChanges(SyntaxNode node, IEnumerable spans, ISyntaxFormatting syntaxFormattingService, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken) => GetFormattingResult(node, spans, syntaxFormattingService, options, rules, cancellationToken).GetTextChanges(cancellationToken); - internal static IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable spans, ISyntaxFormattingService syntaxFormattingService, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken) + internal static IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable spans, ISyntaxFormatting syntaxFormattingService, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken) => syntaxFormattingService.GetFormattingResult(node, spans, options, rules, cancellationToken); /// @@ -62,7 +62,7 @@ internal static IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerab /// An optional set of formatting options. If these options are not supplied the current set of options from the workspace will be used. /// An optional cancellation token. /// The changes necessary to format the tree. - public static IList GetFormattedTextChanges(SyntaxNode node, ISyntaxFormattingService syntaxFormattingService, SyntaxFormattingOptions options, CancellationToken cancellationToken) + public static IList GetFormattedTextChanges(SyntaxNode node, ISyntaxFormatting syntaxFormattingService, SyntaxFormattingOptions options, CancellationToken cancellationToken) => GetFormattedTextChanges(node, SpecializedCollections.SingletonEnumerable(node.FullSpan), syntaxFormattingService, options, rules: null, cancellationToken: cancellationToken); } } diff --git a/src/CodeStyle/Core/Analyzers/FormattingAnalyzerHelper.cs b/src/CodeStyle/Core/Analyzers/FormattingAnalyzerHelper.cs index e6a0dd174a082..59dc6e4062dcb 100644 --- a/src/CodeStyle/Core/Analyzers/FormattingAnalyzerHelper.cs +++ b/src/CodeStyle/Core/Analyzers/FormattingAnalyzerHelper.cs @@ -10,7 +10,7 @@ #if CODE_STYLE using Formatter = Microsoft.CodeAnalysis.Formatting.FormatterHelper; -using FormattingProvider = Microsoft.CodeAnalysis.Formatting.ISyntaxFormattingService; +using FormattingProvider = Microsoft.CodeAnalysis.Formatting.ISyntaxFormatting; #else using FormattingProvider = Microsoft.CodeAnalysis.Host.HostWorkspaceServices; #endif diff --git a/src/CodeStyle/Core/CodeFixes/FormattingCodeFixHelper.cs b/src/CodeStyle/Core/CodeFixes/FormattingCodeFixHelper.cs index c6f074a545a51..1b9522d6e249b 100644 --- a/src/CodeStyle/Core/CodeFixes/FormattingCodeFixHelper.cs +++ b/src/CodeStyle/Core/CodeFixes/FormattingCodeFixHelper.cs @@ -9,7 +9,7 @@ #if CODE_STYLE using Formatter = Microsoft.CodeAnalysis.Formatting.FormatterHelper; -using FormattingProvider = Microsoft.CodeAnalysis.Formatting.ISyntaxFormattingService; +using FormattingProvider = Microsoft.CodeAnalysis.Formatting.ISyntaxFormatting; #else using Microsoft.CodeAnalysis.Options; using FormattingProvider = Microsoft.CodeAnalysis.Host.HostWorkspaceServices; diff --git a/src/CodeStyle/Core/CodeFixes/FormattingCodeFixProvider.cs b/src/CodeStyle/Core/CodeFixes/FormattingCodeFixProvider.cs index e7550a1dde299..225866e0482b4 100644 --- a/src/CodeStyle/Core/CodeFixes/FormattingCodeFixProvider.cs +++ b/src/CodeStyle/Core/CodeFixes/FormattingCodeFixProvider.cs @@ -22,7 +22,7 @@ internal abstract class AbstractFormattingCodeFixProvider : CodeFixProvider public sealed override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.FormattingDiagnosticId); - protected abstract ISyntaxFormattingService SyntaxFormattingService { get; } + protected abstract ISyntaxFormatting SyntaxFormatting { get; } public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) { @@ -43,7 +43,7 @@ private async Task FixOneAsync(CodeFixContext context, Diagnostic diag { var options = await GetOptionsAsync(context.Document, cancellationToken).ConfigureAwait(false); var tree = await context.Document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); - var updatedTree = await FormattingCodeFixHelper.FixOneAsync(tree, SyntaxFormattingService, options, diagnostic, cancellationToken).ConfigureAwait(false); + var updatedTree = await FormattingCodeFixHelper.FixOneAsync(tree, this.SyntaxFormatting, options, diagnostic, cancellationToken).ConfigureAwait(false); return context.Document.WithText(await updatedTree.GetTextAsync(cancellationToken).ConfigureAwait(false)); } @@ -51,7 +51,7 @@ private async Task GetOptionsAsync(Document document, C { var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); var analyzerConfigOptions = document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(tree); - return SyntaxFormattingService.GetFormattingOptions(analyzerConfigOptions); + return this.SyntaxFormatting.GetFormattingOptions(analyzerConfigOptions); } public sealed override FixAllProvider GetFixAllProvider() @@ -60,7 +60,7 @@ public sealed override FixAllProvider GetFixAllProvider() var cancellationToken = context.CancellationToken; var options = await GetOptionsAsync(document, cancellationToken).ConfigureAwait(false); var syntaxRoot = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); - var updatedSyntaxRoot = Formatter.Format(syntaxRoot, this.SyntaxFormattingService, options, cancellationToken); + var updatedSyntaxRoot = Formatter.Format(syntaxRoot, this.SyntaxFormatting, options, cancellationToken); return document.WithSyntaxRoot(updatedSyntaxRoot); }); } diff --git a/src/CodeStyle/VisualBasic/Analyzers/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj b/src/CodeStyle/VisualBasic/Analyzers/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj index bcc0932af7fa4..82876f7300463 100644 --- a/src/CodeStyle/VisualBasic/Analyzers/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj +++ b/src/CodeStyle/VisualBasic/Analyzers/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj @@ -31,7 +31,7 @@ - + diff --git a/src/CodeStyle/VisualBasic/Analyzers/VisualBasicFormattingAnalyzer.vb b/src/CodeStyle/VisualBasic/Analyzers/VisualBasicFormattingAnalyzer.vb index 6d4e5c6883742..fdd627c81a7f8 100644 --- a/src/CodeStyle/VisualBasic/Analyzers/VisualBasicFormattingAnalyzer.vb +++ b/src/CodeStyle/VisualBasic/Analyzers/VisualBasicFormattingAnalyzer.vb @@ -11,9 +11,9 @@ Namespace Microsoft.CodeAnalysis.CodeStyle Friend Class VisualBasicFormattingAnalyzer Inherits AbstractFormattingAnalyzer - Protected Overrides ReadOnly Property SyntaxFormattingService As ISyntaxFormattingService + Protected Overrides ReadOnly Property SyntaxFormatting As ISyntaxFormatting Get - Return VisualBasicSyntaxFormattingService.Instance + Return VisualBasicSyntaxFormatting.Instance End Get End Property End Class diff --git a/src/CodeStyle/VisualBasic/CodeFixes/VisualBasicFormattingCodeFixProvider.vb b/src/CodeStyle/VisualBasic/CodeFixes/VisualBasicFormattingCodeFixProvider.vb index f46110e6b3c62..f8887597a692c 100644 --- a/src/CodeStyle/VisualBasic/CodeFixes/VisualBasicFormattingCodeFixProvider.vb +++ b/src/CodeStyle/VisualBasic/CodeFixes/VisualBasicFormattingCodeFixProvider.vb @@ -19,9 +19,9 @@ Namespace Microsoft.CodeAnalysis.CodeStyle Public Sub New() End Sub - Protected Overrides ReadOnly Property SyntaxFormattingService As ISyntaxFormattingService + Protected Overrides ReadOnly Property SyntaxFormatting As ISyntaxFormatting Get - Return VisualBasicSyntaxFormattingService.Instance + Return VisualBasicSyntaxFormatting.Instance End Get End Property End Class diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs index 8125e1fa18a12..43292e6743c67 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs @@ -3397,7 +3397,8 @@ private BoundArrayInitialization ConvertAndBindArrayInitialization( int?[] knownSizes, int dimension, ImmutableArray boundInitExpr, - ref int boundInitExprIndex) + ref int boundInitExprIndex, + bool isInferred) { Debug.Assert(!boundInitExpr.IsDefault); @@ -3427,7 +3428,7 @@ private BoundArrayInitialization ConvertAndBindArrayInitialization( if (expr.Kind() == SyntaxKind.ArrayInitializerExpression) { init = ConvertAndBindArrayInitialization(diagnostics, (InitializerExpressionSyntax)expr, - type, knownSizes, dimension + 1, boundInitExpr, ref boundInitExprIndex); + type, knownSizes, dimension + 1, boundInitExpr, ref boundInitExprIndex, isInferred); } else { @@ -3466,7 +3467,7 @@ private BoundArrayInitialization ConvertAndBindArrayInitialization( } } - return new BoundArrayInitialization(node, initializers.ToImmutableAndFree(), hasErrors: hasErrors); + return new BoundArrayInitialization(node, isInferred, initializers.ToImmutableAndFree(), hasErrors: hasErrors); } private BoundArrayInitialization BindArrayInitializerList( @@ -3475,6 +3476,7 @@ private BoundArrayInitialization BindArrayInitializerList( ArrayTypeSymbol type, int?[] knownSizes, int dimension, + bool isInferred, ImmutableArray boundInitExprOpt = default(ImmutableArray)) { // Bind the array initializer expressions, if not already bound. @@ -3488,7 +3490,7 @@ private BoundArrayInitialization BindArrayInitializerList( // Convert the bound array initializer expressions to array's element type and // generate BoundArrayInitialization with the converted initializers. int boundInitExprIndex = 0; - return ConvertAndBindArrayInitialization(diagnostics, node, type, knownSizes, dimension, boundInitExprOpt, ref boundInitExprIndex); + return ConvertAndBindArrayInitialization(diagnostics, node, type, knownSizes, dimension, boundInitExprOpt, ref boundInitExprIndex, isInferred); } private BoundArrayInitialization BindUnexpectedArrayInitializer( @@ -3502,11 +3504,12 @@ private BoundArrayInitialization BindUnexpectedArrayInitializer( node, this.Compilation.CreateArrayTypeSymbol(GetSpecialType(SpecialType.System_Object, diagnostics, node)), new int?[1], - dimension: 1); + dimension: 1, + isInferred: false); if (!result.HasAnyErrors) { - result = new BoundArrayInitialization(node, result.Initializers, hasErrors: true); + result = new BoundArrayInitialization(node, isInferred: false, result.Initializers, hasErrors: true); } Error(diagnostics, errorCode, errorNode ?? node); @@ -3580,7 +3583,8 @@ private BoundArrayCreation BindArrayCreationWithInitializer( // KnownSizes is further mutated by BindArrayInitializerList as it works out more // information about the sizes. - BoundArrayInitialization initializer = BindArrayInitializerList(diagnostics, initSyntax, type, knownSizes, 1, boundInitExprOpt); + var isInferred = creationSyntax.IsKind(SyntaxKind.ImplicitArrayCreationExpression); + BoundArrayInitialization initializer = BindArrayInitializerList(diagnostics, initSyntax, type, knownSizes, 1, isInferred, boundInitExprOpt); hasErrors = hasErrors || initializer.HasAnyErrors; @@ -3825,7 +3829,8 @@ private BoundExpression BindStackAllocWithInitializer( { WasCompilerGenerated = true }; } - return new BoundStackAllocArrayCreation(node, elementType, sizeOpt, new BoundArrayInitialization(initSyntax, boundInitExprOpt), type, hasErrors); + bool isInferred = node.IsKind(SyntaxKind.ImplicitStackAllocArrayCreationExpression); + return new BoundStackAllocArrayCreation(node, elementType, sizeOpt, new BoundArrayInitialization(initSyntax, isInferred, boundInitExprOpt), type, hasErrors); } private static int? GetIntegerConstantForArraySize(BoundExpression expression) diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundArrayInitialization.cs b/src/Compilers/CSharp/Portable/BoundTree/BoundArrayInitialization.cs new file mode 100644 index 0000000000000..e9ee765f03eed --- /dev/null +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundArrayInitialization.cs @@ -0,0 +1,16 @@ +// 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. + +using System.Collections.Immutable; + +namespace Microsoft.CodeAnalysis.CSharp +{ + internal partial class BoundArrayInitialization + { + public BoundArrayInitialization Update(ImmutableArray initializers) + { + return Update(this.IsInferred, initializers); + } + } +} diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml b/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml index 86443deed2996..02bf464bfdf77 100644 --- a/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundNodes.xml @@ -1987,6 +1987,8 @@ + + diff --git a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs index 7c0fe97b4ecca..5e5aa7687a5c4 100644 --- a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs +++ b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs @@ -3885,13 +3885,12 @@ private int GetOrCreatePlaceholderSlot(object identifier, TypeWithAnnotations ty return null; } - bool isInferred = node.Syntax.Kind() == SyntaxKind.ImplicitArrayCreationExpression; - var arrayType = VisitArrayInitialization(node.Type, isInferred, initialization, node.HasErrors); + var arrayType = VisitArrayInitialization(node.Type, initialization, node.HasErrors); SetResultType(node, TypeWithState.Create(arrayType, NullableFlowState.NotNull)); return null; } - private TypeSymbol VisitArrayInitialization(TypeSymbol type, bool isInferred, BoundArrayInitialization initialization, bool hasErrors) + private TypeSymbol VisitArrayInitialization(TypeSymbol type, BoundArrayInitialization initialization, bool hasErrors) { TakeIncrementalSnapshot(initialization); var expressions = ArrayBuilder.GetInstance(initialization.Initializers.Length); @@ -3909,7 +3908,7 @@ private TypeSymbol VisitArrayInitialization(TypeSymbol type, bool isInferred, Bo }; var resultType = type; - if (!isInferred) + if (!initialization.IsInferred) { foreach (var expr in expressions) { @@ -10752,8 +10751,7 @@ protected override void VisitInterpolatedStringHandlerConstructor(BoundExpressio } Debug.Assert(node.Type is not null); - bool isInferred = node.Syntax.Kind() == SyntaxKind.ImplicitStackAllocArrayCreationExpression; - var type = VisitArrayInitialization(node.Type, isInferred, initialization, node.HasErrors); + var type = VisitArrayInitialization(node.Type, initialization, node.HasErrors); SetResultType(node, TypeWithState.Create(type, NullableFlowState.NotNull)); return null; } diff --git a/src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs b/src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs index af98de7773ece..7ab4a23dcdfc8 100644 --- a/src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs +++ b/src/Compilers/CSharp/Portable/Generated/BoundNodes.xml.Generated.cs @@ -7054,27 +7054,30 @@ public BoundArrayCreation Update(ImmutableArray bounds, BoundAr internal sealed partial class BoundArrayInitialization : BoundExpression { - public BoundArrayInitialization(SyntaxNode syntax, ImmutableArray initializers, bool hasErrors = false) + public BoundArrayInitialization(SyntaxNode syntax, bool isInferred, ImmutableArray initializers, bool hasErrors = false) : base(BoundKind.ArrayInitialization, syntax, null, hasErrors || initializers.HasErrors()) { RoslynDebug.Assert(!initializers.IsDefault, "Field 'initializers' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)"); + this.IsInferred = isInferred; this.Initializers = initializers; } public new TypeSymbol? Type => base.Type; + public bool IsInferred { get; } + public ImmutableArray Initializers { get; } [DebuggerStepThrough] public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitArrayInitialization(this); - public BoundArrayInitialization Update(ImmutableArray initializers) + public BoundArrayInitialization Update(bool isInferred, ImmutableArray initializers) { - if (initializers != this.Initializers) + if (isInferred != this.IsInferred || initializers != this.Initializers) { - var result = new BoundArrayInitialization(this.Syntax, initializers, this.HasErrors); + var result = new BoundArrayInitialization(this.Syntax, isInferred, initializers, this.HasErrors); result.CopyAttributes(this); return result; } @@ -11671,7 +11674,7 @@ internal abstract partial class BoundTreeRewriter : BoundTreeVisitor { ImmutableArray initializers = this.VisitList(node.Initializers); TypeSymbol? type = this.VisitType(node.Type); - return node.Update(initializers); + return node.Update(node.IsInferred, initializers); } public override BoundNode? VisitStackAllocArrayCreation(BoundStackAllocArrayCreation node) { @@ -13949,12 +13952,12 @@ public NullabilityRewriter(ImmutableDictionary new TreeDumperNode("arrayInitialization", null, new TreeDumperNode[] { + new TreeDumperNode("isInferred", node.IsInferred, null), new TreeDumperNode("initializers", null, from x in node.Initializers select Visit(x, null)), new TreeDumperNode("type", node.Type, null), new TreeDumperNode("isSuppressed", node.IsSuppressed, null), diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs index e5c7af97c517c..c721939835811 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs @@ -1108,7 +1108,7 @@ private static BoundExpression CreateParamArrayArgument(SyntaxNode syntax, return new BoundArrayCreation( syntax, ImmutableArray.Create(arraySize), - new BoundArrayInitialization(syntax, arrayArgs) { WasCompilerGenerated = true }, + new BoundArrayInitialization(syntax, isInferred: false, arrayArgs) { WasCompilerGenerated = true }, paramArrayType) { WasCompilerGenerated = true }; } diff --git a/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs b/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs index a221190fe0d1e..ad2fc09b1bd38 100644 --- a/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs +++ b/src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs @@ -1357,7 +1357,7 @@ public BoundExpression Array(TypeSymbol elementType, ImmutableArray(Literal(elements.Length)), - new BoundArrayInitialization(Syntax, elements) { WasCompilerGenerated = true }, + new BoundArrayInitialization(Syntax, isInferred: false, elements) { WasCompilerGenerated = true }, Compilation.CreateArrayTypeSymbol(elementType)); } diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/CompilationEventTests.cs b/src/Compilers/CSharp/Test/Emit2/Diagnostics/CompilationEventTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/Diagnostics/CompilationEventTests.cs rename to src/Compilers/CSharp/Test/Emit2/Diagnostics/CompilationEventTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.AllInOne.cs b/src/Compilers/CSharp/Test/Emit2/Diagnostics/DiagnosticAnalyzerTests.AllInOne.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.AllInOne.cs rename to src/Compilers/CSharp/Test/Emit2/Diagnostics/DiagnosticAnalyzerTests.AllInOne.cs diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.cs b/src/Compilers/CSharp/Test/Emit2/Diagnostics/DiagnosticAnalyzerTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.cs rename to src/Compilers/CSharp/Test/Emit2/Diagnostics/DiagnosticAnalyzerTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticSuppressorTests.cs b/src/Compilers/CSharp/Test/Emit2/Diagnostics/DiagnosticSuppressorTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticSuppressorTests.cs rename to src/Compilers/CSharp/Test/Emit2/Diagnostics/DiagnosticSuppressorTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/GetDiagnosticsTests.cs b/src/Compilers/CSharp/Test/Emit2/Diagnostics/GetDiagnosticsTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/Diagnostics/GetDiagnosticsTests.cs rename to src/Compilers/CSharp/Test/Emit2/Diagnostics/GetDiagnosticsTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/MethodGroupConversion.cs b/src/Compilers/CSharp/Test/Emit2/Diagnostics/MethodGroupConversion.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/Diagnostics/MethodGroupConversion.cs rename to src/Compilers/CSharp/Test/Emit2/Diagnostics/MethodGroupConversion.cs diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs b/src/Compilers/CSharp/Test/Emit2/Diagnostics/OperationAnalyzerTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs rename to src/Compilers/CSharp/Test/Emit2/Diagnostics/OperationAnalyzerTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowDiagnosticTests.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/FlowDiagnosticTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowDiagnosticTests.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/FlowDiagnosticTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowTestBase.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/FlowTestBase.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowTestBase.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/FlowTestBase.cs diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowTests.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/FlowTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowTests.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/FlowTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/IterationJumpYieldStatementTests.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/IterationJumpYieldStatementTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/IterationJumpYieldStatementTests.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/IterationJumpYieldStatementTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/LocalFunctions.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/LocalFunctions.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/LocalFunctions.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/LocalFunctions.cs diff --git a/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/PatternMatchingTest5.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/PatternMatchingTest5.cs new file mode 100644 index 0000000000000..84ea57980d28e --- /dev/null +++ b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/PatternMatchingTest5.cs @@ -0,0 +1,50 @@ +// 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. + +#nullable disable + +using System.Linq; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.CSharp.Test.Utilities; +using Microsoft.CodeAnalysis.Test.Utilities; +using Roslyn.Test.Utilities; +using Xunit; + +namespace Microsoft.CodeAnalysis.CSharp.UnitTests.FlowAnalysis +{ + public class PatternMatchingTest5 + { + public class FlowAnalysisTests : FlowTestBase + { + [Fact] + public void RegionInIsPattern01() + { + var dataFlowAnalysisResults = CompileAndAnalyzeDataFlowExpression(@" +class C +{ + static void M(object o) + { + _ = o switch + { + string { Length: 0 } s => /**/s.ToString()/**/, + _ = throw null + }; + } +}"); + Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.VariablesDeclared)); + Assert.Equal("s", GetSymbolNamesJoined(dataFlowAnalysisResults.DataFlowsIn)); + Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.DataFlowsOut)); + Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.AlwaysAssigned)); + Assert.Equal("s", GetSymbolNamesJoined(dataFlowAnalysisResults.ReadInside)); + Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.WrittenInside)); + Assert.Equal("o", GetSymbolNamesJoined(dataFlowAnalysisResults.ReadOutside)); + Assert.Equal("o, s", GetSymbolNamesJoined(dataFlowAnalysisResults.WrittenOutside)); + Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.Captured)); + Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.CapturedInside)); + Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.CapturedOutside)); + Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.UnsafeAddressTaken)); + } + } + } +} diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/PatternsVsRegions.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/PatternsVsRegions.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/PatternsVsRegions.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/PatternsVsRegions.cs diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/RegionAnalysisTests.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/RegionAnalysisTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/RegionAnalysisTests.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/RegionAnalysisTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/StructTests.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/StructTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/StructTests.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/StructTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/TryLockUsingStatementTests.cs b/src/Compilers/CSharp/Test/Emit2/FlowAnalysis/TryLockUsingStatementTests.cs similarity index 100% rename from src/Compilers/CSharp/Test/Semantic/FlowAnalysis/TryLockUsingStatementTests.cs rename to src/Compilers/CSharp/Test/Emit2/FlowAnalysis/TryLockUsingStatementTests.cs diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs index 4ca2443041161..e3152edfd8706 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs @@ -47684,7 +47684,7 @@ class CL1 Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "x1").WithLocation(11, 15)); } - /// Ported from . + // Ported from . [Theory] [InlineData("true", "false")] [InlineData("FIELD_TRUE", "FIELD_FALSE")] @@ -47805,7 +47805,7 @@ static void M(bool b, object? x) ); } - /// Ported from . + // Ported from . [Theory] [InlineData("true", "false")] [InlineData("FIELD_TRUE", "FIELD_FALSE")] @@ -47926,7 +47926,7 @@ static void M(bool b, object? x) ); } - /// Ported from + // Ported from [Fact] public void IfConditional_ComplexCondition_ConstantConsequence() { @@ -48469,7 +48469,7 @@ static void M4(C? c, bool? b) ); } - /// Ported from . + // Ported from . [Theory] [InlineData("b")] [InlineData("true")] @@ -48526,7 +48526,7 @@ public void M4(C? c, object? x, bool b) ); } - /// Ported from . + // Ported from . [Theory] [InlineData("i")] [InlineData("42")] @@ -48582,7 +48582,7 @@ public void M4(C? c, object? x, int i) ); } - /// Ported from . + // Ported from . [Theory] [InlineData("object?")] [InlineData("int?")] @@ -48639,7 +48639,7 @@ public void M4(C? c, object? x) ); } - /// Ported from . + // Ported from . [Theory] [InlineData("bool", "false")] [InlineData("int", "1")] @@ -48696,7 +48696,7 @@ public void M4(C? c, object? x, object? y) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_04_02() { @@ -48762,7 +48762,7 @@ public void M4(C? c, object? x, object? y) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_04_03() { @@ -48819,7 +48819,7 @@ public void M4(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_04_04() { @@ -48853,7 +48853,7 @@ public void M2(C? c, object? x, object? y) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_05() { @@ -48892,7 +48892,7 @@ public void M2(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_06() { @@ -48916,7 +48916,7 @@ public void M1(C c, object? x, object? y) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_07() { @@ -48975,7 +48975,7 @@ public void M4(S? s, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_08() { @@ -49036,7 +49036,7 @@ public void M4(S? s, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_09() { @@ -49107,7 +49107,7 @@ public void M4(S? s, object? x) ); } - /// Ported from . + // Ported from . [Theory] [InlineData("S? left, S? right")] [InlineData("S? left, S right")] @@ -49148,7 +49148,7 @@ public void M2(S? s, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_11() { @@ -49211,7 +49211,7 @@ public void M4(T? t, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_12() { @@ -49258,7 +49258,7 @@ void M3(C? c, object? x, object? obj) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_13() { @@ -49281,7 +49281,7 @@ void M(C? c, object? x, int i) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_14() { @@ -49332,7 +49332,7 @@ void M3(C? c, object? x, [DisallowNull] int? i) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_15() { @@ -49355,7 +49355,7 @@ void M(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_16() { @@ -49374,7 +49374,7 @@ void M(object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_17() { @@ -49400,7 +49400,7 @@ void M(C? c, object? x, object? y) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_18() { @@ -49459,7 +49459,7 @@ public void M4(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_19() { @@ -49554,7 +49554,7 @@ public void M1(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void IsCondAccess_01() { @@ -49588,7 +49588,7 @@ void M2(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void IsCondAccess_02() { @@ -49682,7 +49682,7 @@ void M8(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void IsCondAccess_03() { @@ -49752,7 +49752,7 @@ void M5(C? c, object? x, object? y) ); } - /// Ported from . + // Ported from . [Fact] public void IsCondAccess_04() { @@ -49838,7 +49838,7 @@ void M7(C? c, object? x) ); } - /// Ported from . + // Ported from . [Theory] [InlineData("int")] [InlineData("int?")] @@ -49914,7 +49914,7 @@ void M6(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void IsCondAccess_06() { @@ -49938,7 +49938,7 @@ void M1(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void IsCondAccess_07() { @@ -49972,7 +49972,7 @@ void M2(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void IsCondAccess_08() { @@ -50007,7 +50007,7 @@ void M2(C? c, object? x) ); } - /// Ported from . + // Ported from . [Fact] public void IsCondAccess_09() { @@ -50539,7 +50539,7 @@ class C Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "b.C.Prop").WithLocation(16, 13)); } - /// Ported from . + // Ported from . [Fact] public void EqualsCondAccess_LeftCondAccess() { @@ -51080,7 +51080,7 @@ static void M1(bool? flag) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_01() { @@ -51114,7 +51114,7 @@ void M2(C c, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_02() { @@ -51148,7 +51148,7 @@ void M2(C c1, C c2, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_03() { @@ -51183,7 +51183,7 @@ void M2(C c1, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_04() { @@ -51218,7 +51218,7 @@ void M2(C c1, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_05() { @@ -51256,7 +51256,7 @@ void M2(C c1, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_06() { @@ -51290,7 +51290,7 @@ void M2(C c1, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_07() { @@ -51317,7 +51317,7 @@ void M1(bool b, C c1, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_08() { @@ -51361,7 +51361,7 @@ void M3(C c1, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_09() { @@ -51396,7 +51396,7 @@ void M2(C c1, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void CondAccess_NullCoalescing_10() { @@ -51430,7 +51430,7 @@ void M2(C c1, object? x) Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "x").WithLocation(15, 15)); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_ConditionalLeft() { @@ -51478,7 +51478,7 @@ void M3(C c1, bool b, object? x, object? y) ); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_CondAccess_Throw() { @@ -51497,7 +51497,7 @@ void M1(C c1, bool b, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_CondAccess_Cast() { @@ -51519,7 +51519,7 @@ void M1(C c1, bool b, object? x) Diagnostic(ErrorCode.WRN_ConvertingNullableToNonNullable, "(object)c1?.M(x = 0)").WithLocation(6, 13)); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_CondAccess_UserDefinedConv_01() { @@ -51546,7 +51546,7 @@ void M1(C? c1, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_CondAccess_UserDefinedConv_02() { @@ -51569,7 +51569,7 @@ void M1(C c1, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_CondAccess_UserDefinedConv_03() { @@ -51592,7 +51592,7 @@ void M1(C? c1, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_CondAccess_UserDefinedConv_04() { @@ -51615,7 +51615,7 @@ void M1(C? c1, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_CondAccess_UserDefinedConv_05() { @@ -51640,7 +51640,7 @@ static void M1(C c1, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51673,7 +51673,7 @@ void M1(C? c1, object? x) ); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51711,7 +51711,7 @@ void M1(C? c1, object? x) ); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51739,7 +51739,7 @@ void M1(C c1, object? x) Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "x").WithLocation(10, 9)); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51767,7 +51767,7 @@ void M1(C c1, object? x) Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "x").WithLocation(10, 9)); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51798,7 +51798,7 @@ void M1(C c1, object? x) Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "x").WithLocation(13, 9)); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51829,7 +51829,7 @@ void M1(C c1, object? x) Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "x").WithLocation(13, 9)); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51861,7 +51861,7 @@ void M1(C c1, object? x) ); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51886,7 +51886,7 @@ void M1(C? c1, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51911,7 +51911,7 @@ void M1(C? c1, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51942,7 +51942,7 @@ static void M1(C c1, object? x) ); } - ///Ported from . + //Ported from . [Theory] [InlineData("explicit")] [InlineData("implicit")] @@ -51978,7 +51978,7 @@ static void M1(C c1, object? x) ); } - ///Ported from . + //Ported from . [Fact] public void NullCoalescing_CondAccess_NullableEnum() { @@ -51999,7 +51999,7 @@ static void M2(E? e, object? x) CreateNullableCompilation(source).VerifyDiagnostics(); } - /// Ported from . + // Ported from . [Fact] public void NullCoalescing_CondAccess_NonNullConstantLeft() { @@ -52029,7 +52029,7 @@ static void M2(object? x, object? y) Diagnostic(ErrorCode.WRN_NullReferenceReceiver, "y").WithLocation(17, 30)); } - /// Ported from . + // Ported from . [Fact] public void NullCoalescing_NonNullConstantLeft() { diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests5.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests5.cs index 7f1dc5f54628c..ea24eed999d78 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests5.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests5.cs @@ -1949,37 +1949,5 @@ public void Repro55184() Diagnostic(ErrorCode.ERR_NoSuchMember, "Error").WithArguments("int", "Error").WithLocation(7, 19) ); } - - public class FlowAnalysisTests : FlowTestBase - { - [Fact] - public void RegionInIsPattern01() - { - var dataFlowAnalysisResults = CompileAndAnalyzeDataFlowExpression(@" -class C -{ - static void M(object o) - { - _ = o switch - { - string { Length: 0 } s => /**/s.ToString()/**/, - _ = throw null - }; - } -}"); - Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.VariablesDeclared)); - Assert.Equal("s", GetSymbolNamesJoined(dataFlowAnalysisResults.DataFlowsIn)); - Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.DataFlowsOut)); - Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.AlwaysAssigned)); - Assert.Equal("s", GetSymbolNamesJoined(dataFlowAnalysisResults.ReadInside)); - Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.WrittenInside)); - Assert.Equal("o", GetSymbolNamesJoined(dataFlowAnalysisResults.ReadOutside)); - Assert.Equal("o, s", GetSymbolNamesJoined(dataFlowAnalysisResults.WrittenOutside)); - Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.Captured)); - Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.CapturedInside)); - Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.CapturedOutside)); - Assert.Null(GetSymbolNamesJoined(dataFlowAnalysisResults.UnsafeAddressTaken)); - } - } } } diff --git a/src/Compilers/Test/Core/Compilation/CompilationExtensions.cs b/src/Compilers/Test/Core/Compilation/CompilationExtensions.cs index b32953150b1a8..b09de6ec1964e 100644 --- a/src/Compilers/Test/Core/Compilation/CompilationExtensions.cs +++ b/src/Compilers/Test/Core/Compilation/CompilationExtensions.cs @@ -6,15 +6,16 @@ // Uncomment to enable the IOperation test hook on all test runs. Do not commit this uncommented. //#define ROSLYN_TEST_IOPERATION +// Uncomment to enable the Used Assemblies test hook on all test runs. Do not commit this uncommented. +//#define ROSLYN_TEST_USEDASSEMBLIES + using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; using System.IO; using System.Linq; -using System.Reflection.Metadata; using System.Text; -using System.Text.RegularExpressions; using System.Threading; using Microsoft.CodeAnalysis.CodeGen; using Microsoft.CodeAnalysis.CSharp; @@ -22,11 +23,9 @@ using Microsoft.CodeAnalysis.FlowAnalysis; using Microsoft.CodeAnalysis.Operations; using Microsoft.CodeAnalysis.PooledObjects; -using Microsoft.CodeAnalysis.Symbols; using Roslyn.Test.Utilities; using Roslyn.Utilities; using Xunit; -using Xunit.Sdk; namespace Microsoft.CodeAnalysis.Test.Utilities { @@ -39,7 +38,12 @@ public static class CompilationExtensions !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ROSLYN_TEST_IOPERATION")); #endif - internal static bool EnableVerifyUsedAssemblies { get; } = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ROSLYN_TEST_USEDASSEMBLIES")); + internal static bool EnableVerifyUsedAssemblies { get; } = +#if ROSLYN_TEST_USEDASSEMBLIES + true; +#else + !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ROSLYN_TEST_USEDASSEMBLIES")); +#endif internal static ImmutableArray EmitToArray( this Compilation compilation, diff --git a/src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs b/src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs index 7ec96c09388a9..69bfc90a919a4 100644 --- a/src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs +++ b/src/Compilers/Test/Utilities/CSharp/CSharpTestBase.cs @@ -1210,6 +1210,7 @@ private static void ValidateCompilation(Func createCompilatio private static void VerifyUsedAssemblyReferences(Func createCompilationLambda) { + // To run the additional validation below, comment this out or define ROSLYN_TEST_USEDASSEMBLIES if (!CompilationExtensions.EnableVerifyUsedAssemblies) { return; diff --git a/src/EditorFeatures/CSharpTest/AddParameter/AddParameterTests.cs b/src/EditorFeatures/CSharpTest/AddParameter/AddParameterTests.cs index 958cf1812f78b..3a230f21fe671 100644 --- a/src/EditorFeatures/CSharpTest/AddParameter/AddParameterTests.cs +++ b/src/EditorFeatures/CSharpTest/AddParameter/AddParameterTests.cs @@ -2902,5 +2902,31 @@ public static class IsExternalInit { } } ", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsAddParameter)] + [WorkItem(56952, "https://github.com/dotnet/roslyn/issues/56952")] + public async Task TestRecordsNamingConventions() + { + await TestInRegularAndScript1Async(@"[|new Test(""repro"")|]; + +record Test(); +", @"new Test(""repro""); + +record Test(string V); +"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsAddParameter)] + [WorkItem(56952, "https://github.com/dotnet/roslyn/issues/56952")] + public async Task TestRecordsNamingConventions_RecordStruct() + { + await TestInRegularAndScript1Async(@"[|new Test(""repro"")|]; + +record struct Test(); +", @"new Test(""repro""); + +record struct Test(string V); +"); + } } } diff --git a/src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticBraceCompletionTests.cs b/src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticBraceCompletionTests.cs index d9a223fec282c..0a023118f0741 100644 --- a/src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticBraceCompletionTests.cs +++ b/src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticBraceCompletionTests.cs @@ -1120,7 +1120,7 @@ public void X() var optionSet = new Dictionary { { new OptionKey2(AutoFormattingOptions.Metadata.AutoFormattingOnCloseBrace, LanguageNames.CSharp), false }, - { new OptionKey2(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.Block } + { new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.Block } }; using var session = CreateSession(code, optionSet); Assert.NotNull(session); @@ -1149,7 +1149,7 @@ public class C1 var optionSet = new Dictionary { - { new OptionKey2(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.None } + { new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.None } }; using var session = CreateSession(code, optionSet); Assert.NotNull(session); @@ -1184,7 +1184,7 @@ public class C1 var optionSet = new Dictionary { - { new OptionKey2(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.Block } + { new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.Block } }; using var session = CreateSession(code, optionSet); Assert.NotNull(session); @@ -1227,7 +1227,7 @@ public class C1 var optionSet = new Dictionary { - { new OptionKey2(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.Block } + { new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.Block } }; using var session = CreateSession(code, optionSet); Assert.NotNull(session); diff --git a/src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticLiteralCompletionTests.cs b/src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticLiteralCompletionTests.cs index cb7076a293295..da05f60f93d59 100644 --- a/src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticLiteralCompletionTests.cs +++ b/src/EditorFeatures/CSharpTest/AutomaticCompletion/AutomaticLiteralCompletionTests.cs @@ -429,6 +429,71 @@ void Method() CheckStart(session.Session, expectValidSession: false); } + [WpfFact, Trait(Traits.Feature, Traits.Features.AutomaticCompletion)] + [WorkItem(59178, "https://github.com/dotnet/roslyn/issues/59178")] + public void String_CompleteLiteral() + { + var code = @"class C +{ + void Method() + { + var s = ""this"" + $$that""; + } +}"; + using var session = CreateSessionDoubleQuote(code); + Assert.NotNull(session); + CheckStart(session.Session, expectValidSession: false); + } + + [WpfFact, Trait(Traits.Feature, Traits.Features.AutomaticCompletion)] + [WorkItem(59178, "https://github.com/dotnet/roslyn/issues/59178")] + public void String_BeforeOtherString1() + { + var code = @"class C +{ + void Method() + { + var s = $$ + "" + bar""; + } +}"; + using var session = CreateSessionDoubleQuote(code); + Assert.NotNull(session); + CheckStart(session.Session); + } + + [WpfFact, Trait(Traits.Feature, Traits.Features.AutomaticCompletion)] + [WorkItem(59178, "https://github.com/dotnet/roslyn/issues/59178")] + public void String_BeforeOtherString2() + { + var code = @"class C +{ + void Method() + { + var s = $$ + ""; } ""; + } +}"; + using var session = CreateSessionDoubleQuote(code); + Assert.NotNull(session); + CheckStart(session.Session); + } + + [WpfFact, Trait(Traits.Feature, Traits.Features.AutomaticCompletion)] + [WorkItem(59178, "https://github.com/dotnet/roslyn/issues/59178")] + public void String_DontCompleteVerbatim() + { + var code = @"class C +{ + void Method() + { + var s = ""this"" + @$$that + and this""; + } +}"; + using var session = CreateSessionDoubleQuote(code); + Assert.NotNull(session); + CheckStart(session.Session); + } + internal static Holder CreateSessionSingleQuote(string code) { return CreateSession( diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeTests.cs b/src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeTests.cs index 4cbadb49c6f86..6b6124785e54b 100644 --- a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeTests.cs +++ b/src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeTests.cs @@ -4747,7 +4747,7 @@ public async Task TestDisplayStringForGlobalNamespace() { await TestSmartTagTextAsync( @"class C : [|Goo|]", -string.Format(FeaturesResources.Generate_0_1_in_new_file, "class", "Goo", FeaturesResources.Global_Namespace)); +string.Format(FeaturesResources.Generate_0_1_in_new_file, "class", "Goo")); } [WorkItem(543853, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543853")] @@ -4854,7 +4854,7 @@ static void Main(string[] args) await TestExactActionSetOfferedAsync(code, new[] { - string.Format(FeaturesResources.Generate_0_1_in_new_file, "class", "Goo", FeaturesResources.Global_Namespace), + string.Format(FeaturesResources.Generate_0_1_in_new_file, "class", "Goo"), string.Format(FeaturesResources.Generate_nested_0_1, "class", "Goo", "Program"), FeaturesResources.Generate_new_type }); diff --git a/src/EditorFeatures/CSharpTest/Formatting/FormattingEngineTests.cs b/src/EditorFeatures/CSharpTest/Formatting/FormattingEngineTests.cs index 65149d894dba2..4c8e81713cd35 100644 --- a/src/EditorFeatures/CSharpTest/Formatting/FormattingEngineTests.cs +++ b/src/EditorFeatures/CSharpTest/Formatting/FormattingEngineTests.cs @@ -34,7 +34,7 @@ private static Dictionary SmartIndentButDoNotFormatWhileTypi { return new Dictionary { - { new OptionKey2(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.Smart }, + { new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.Smart }, { new OptionKey2(AutoFormattingOptions.Metadata.AutoFormattingOnTyping, LanguageNames.CSharp), false }, { new OptionKey2(AutoFormattingOptions.Metadata.AutoFormattingOnCloseBrace, LanguageNames.CSharp), false }, }; @@ -1072,7 +1072,7 @@ class C1 }"; var optionSet = new Dictionary { - { new OptionKey2(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.None } + { new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp), FormattingOptions.IndentStyle.None } }; AssertFormatAfterTypeChar(code, expected, optionSet); } diff --git a/src/EditorFeatures/CSharpTest/Formatting/Indentation/CSharpFormatterTestsBase.cs b/src/EditorFeatures/CSharpTest/Formatting/Indentation/CSharpFormatterTestsBase.cs index ab19697d14108..1ff1d0ead7677 100644 --- a/src/EditorFeatures/CSharpTest/Formatting/Indentation/CSharpFormatterTestsBase.cs +++ b/src/EditorFeatures/CSharpTest/Formatting/Indentation/CSharpFormatterTestsBase.cs @@ -5,6 +5,7 @@ #nullable disable using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -80,11 +81,11 @@ private static async Task TokenFormatWorkerAsync(TestWorkspace workspace, ITextB var formattingRuleProvider = workspace.Services.GetService(); - var rules = formattingRuleProvider.CreateRule(document, position).Concat(Formatter.GetDefaultFormattingRules(document)); + var rules = ImmutableArray.Create(formattingRuleProvider.CreateRule(document, position)).AddRange(Formatter.GetDefaultFormattingRules(document)); var options = await IndentationOptions.FromDocumentAsync(document, CancellationToken.None); var formatter = new CSharpSmartTokenFormatter(options, rules, root); - var changes = await formatter.FormatTokenAsync(workspace.Services, token, CancellationToken.None); + var changes = await formatter.FormatTokenAsync(token, CancellationToken.None); ApplyChanges(buffer, changes); } diff --git a/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartIndenterEnterOnTokenTests.cs b/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartIndenterEnterOnTokenTests.cs index f8d087ef82fef..56b80e0a3389d 100644 --- a/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartIndenterEnterOnTokenTests.cs +++ b/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartIndenterEnterOnTokenTests.cs @@ -19,7 +19,7 @@ using Xunit; using Xunit.Abstractions; using static Microsoft.CodeAnalysis.Formatting.FormattingOptions2; -using IndentStyle = Microsoft.CodeAnalysis.Formatting.FormattingOptions.IndentStyle; +using IndentStyle = Microsoft.CodeAnalysis.Formatting.FormattingOptions2.IndentStyle; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Formatting.Indentation { @@ -1546,7 +1546,7 @@ private static async Task AssertIndentNotUsingSmartTokenFormatterButUsingIndente // create tree service using var workspace = TestWorkspace.CreateCSharp(code); workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options - .WithChangedOption(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp, indentStyle) + .WithChangedOption(FormattingOptions2.SmartIndent, LanguageNames.CSharp, indentStyle) .WithChangedOption(UseTabs, LanguageNames.CSharp, useTabs))); var hostdoc = workspace.Documents.First(); var buffer = hostdoc.GetTextBuffer(); diff --git a/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartIndenterTests.cs b/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartIndenterTests.cs index eaac1999653f6..5d10d463a14be 100644 --- a/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartIndenterTests.cs +++ b/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartIndenterTests.cs @@ -16,7 +16,7 @@ using Xunit; using Xunit.Abstractions; using static Microsoft.CodeAnalysis.Formatting.FormattingOptions2; -using IndentStyle = Microsoft.CodeAnalysis.Formatting.FormattingOptions.IndentStyle; +using IndentStyle = Microsoft.CodeAnalysis.Formatting.FormattingOptions2.IndentStyle; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Formatting.Indentation { @@ -3013,7 +3013,7 @@ private static void AssertSmartIndentInProjection( using var workspace = TestWorkspace.CreateCSharp(markup, parseOptions: option, composition: s_compositionWithTestFormattingRules); workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options - .WithChangedOption(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp, indentStyle) + .WithChangedOption(FormattingOptions2.SmartIndent, LanguageNames.CSharp, indentStyle) .WithChangedOption(UseTabs, LanguageNames.CSharp, useTabs))); var subjectDocument = workspace.Documents.Single(); @@ -3061,7 +3061,7 @@ private static void AssertSmartIndent( using var workspace = TestWorkspace.CreateCSharp(code, parseOptions: option); workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options - .WithChangedOption(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp, indentStyle) + .WithChangedOption(FormattingOptions2.SmartIndent, LanguageNames.CSharp, indentStyle) .WithChangedOption(UseTabs, LanguageNames.CSharp, useTabs))); TestIndentation(workspace, indentationLine, expectedIndentation); } @@ -3093,7 +3093,7 @@ private static void AssertSmartIndent( using var workspace = TestWorkspace.CreateCSharp(code, parseOptions: option); workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options - .WithChangedOption(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp, indentStyle) + .WithChangedOption(FormattingOptions2.SmartIndent, LanguageNames.CSharp, indentStyle) .WithChangedOption(UseTabs, LanguageNames.CSharp, useTabs))); var wpfTextView = workspace.Documents.First().GetTextView(); var line = wpfTextView.TextBuffer.CurrentSnapshot.GetLineFromPosition(wpfTextView.Caret.Position.BufferPosition).LineNumber; diff --git a/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartTokenFormatterFormatRangeTests.cs b/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartTokenFormatterFormatRangeTests.cs index 3f5ef74ec4eaf..7381ad106a6b1 100644 --- a/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartTokenFormatterFormatRangeTests.cs +++ b/src/EditorFeatures/CSharpTest/Formatting/Indentation/SmartTokenFormatterFormatRangeTests.cs @@ -3604,7 +3604,7 @@ private static async Task AutoFormatOnMarkerAsync(string initialMarkup, string e return; } - var changes = formatter.FormatRange(workspace.Services, tokenRange.Value.Item1, tokenRange.Value.Item2, CancellationToken.None); + var changes = formatter.FormatRange(tokenRange.Value.Item1, tokenRange.Value.Item2, CancellationToken.None); var actual = GetFormattedText(buffer, changes); Assert.Equal(expected, actual); } diff --git a/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs b/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs index 093dd5c8b8500..f3380570364e8 100644 --- a/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs +++ b/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs @@ -8293,6 +8293,412 @@ public async Task TestInaccessibleMember_03() }.RunAsync(); } + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_Property() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + Goo MyProperty { get; } +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + Goo MyProperty { get; } +} + +public class C : {|CS0535:I|} +{ + Goo I.MyProperty + { + get + { + throw new System.NotImplementedException(); + } + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_Method_InaccessibleReturnType() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + Goo M(); +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + Goo M(); +} + +public class C : {|CS0535:I|} +{ + Goo I.M() + { + throw new System.NotImplementedException(); + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_Method_InaccessibleParameterType() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + void M(Goo goo); +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + void M(Goo goo); +} + +public class C : {|CS0535:I|} +{ + void I.M(Goo goo) + { + throw new System.NotImplementedException(); + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_Event() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal delegate void MyDelegate(); + +internal interface I +{ + event MyDelegate Event; +} + +public class C : {|CS0535:I|} +{ +}", +@"internal delegate void MyDelegate(); + +internal interface I +{ + event MyDelegate Event; +} + +public class C : {|CS0535:I|} +{ + event MyDelegate I.Event + { + add + { + throw new System.NotImplementedException(); + } + + remove + { + throw new System.NotImplementedException(); + } + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_Indexer_InaccessibleReturnType() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + Goo this[int i] { get; } +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + Goo this[int i] { get; } +} + +public class C : {|CS0535:I|} +{ + Goo I.this[int i] + { + get + { + throw new System.NotImplementedException(); + } + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_Indexer_InaccessibleParameterType() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + int this[Goo goo] { get; } +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + int this[Goo goo] { get; } +} + +public class C : {|CS0535:I|} +{ + int I.this[Goo goo] + { + get + { + throw new System.NotImplementedException(); + } + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_InaccessibleMemberAsGenericArgument() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"using System.Collections.Generic; + +internal class Goo {} + +internal interface I +{ + List M(); +} + +public class C : {|CS0535:I|} +{ +}", +@"using System.Collections.Generic; + +internal class Goo {} + +internal interface I +{ + List M(); +} + +public class C : {|CS0535:I|} +{ + List I.M() + { + throw new System.NotImplementedException(); + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_InaccessibleMemberDueToContainingType() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Container +{ + public class Goo {} +} + +internal interface I +{ + Container.Goo M(); +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Container +{ + public class Goo {} +} + +internal interface I +{ + Container.Goo M(); +} + +public class C : {|CS0535:I|} +{ + Container.Goo I.M() + { + throw new System.NotImplementedException(); + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_InaccessibleGenericConstraintAsReturnType() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + T M() where T: Goo; +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + T M() where T: Goo; +} + +public class C : {|CS0535:I|} +{ + T I.M() + { + throw new System.NotImplementedException(); + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_InaccessibleGenericConstraintAsParameter() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + void M(T arg) where T: Goo; +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + void M(T arg) where T: Goo; +} + +public class C : {|CS0535:I|} +{ + void I.M(T arg) + { + throw new System.NotImplementedException(); + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_InaccessibleGenericConstraintWhichIsNotUsed() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + void M() where T: Goo; +} + +public class C : {|CS0535:I|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + void M() where T: Goo; +} + +public class C : {|CS0535:I|} +{ + void I.M() + { + throw new System.NotImplementedException(); + } +}"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] + [WorkItem(4146, "https://github.com/dotnet/roslyn/issues/4146")] + public async Task TestAccessibility_SeveralMembers_ShouldExplicitlyImplementOnlyInaccessible() + { + await TestWithAllCodeStyleOptionsOffAsync( +@"internal class Goo {} + +internal interface I +{ + int N(); + Goo M(); +} + +public class C : {|CS0535:{|CS0535:I|}|} +{ +}", +@"internal class Goo {} + +internal interface I +{ + int N(); + Goo M(); +} + +public class C : {|CS0535:{|CS0535:I|}|} +{ + public int N() + { + throw new System.NotImplementedException(); + } + + Goo I.M() + { + throw new System.NotImplementedException(); + } +}"); + } + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)] public async Task TestInaccessibleAccessor_01() { diff --git a/src/EditorFeatures/CSharpTest/KeywordHighlighting/AwaitHighlighterTests.cs b/src/EditorFeatures/CSharpTest/KeywordHighlighting/AwaitHighlighterTests.cs index 300f1103c6e8e..2f97ca1e1ce4d 100644 --- a/src/EditorFeatures/CSharpTest/KeywordHighlighting/AwaitHighlighterTests.cs +++ b/src/EditorFeatures/CSharpTest/KeywordHighlighting/AwaitHighlighterTests.cs @@ -323,5 +323,14 @@ class C } }"); } + + [WorkItem(60400, "https://github.com/dotnet/roslyn/issues/60400")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] + public async Task TestTopLevelStatements() + { + await TestAsync( +@"[|await|] Task.Delay(1000); +{|Cursor:[|await|]|} Task.Run(() => { })"); + } } } diff --git a/src/EditorFeatures/CSharpTest/KeywordHighlighting/ReturnStatementHighlighterTests.cs b/src/EditorFeatures/CSharpTest/KeywordHighlighting/ReturnStatementHighlighterTests.cs index cf65cd3e02634..2c98a44fd523a 100644 --- a/src/EditorFeatures/CSharpTest/KeywordHighlighting/ReturnStatementHighlighterTests.cs +++ b/src/EditorFeatures/CSharpTest/KeywordHighlighting/ReturnStatementHighlighterTests.cs @@ -462,5 +462,13 @@ void M() } }"); } + + [Fact, Trait(Traits.Feature, Traits.Features.KeywordHighlighting)] + public async Task TestInTopLevelStatements() + { + await TestAsync( +@"if (args.Length > 0) [|return|] 0; +{|Cursor:[|return|]|} 1;"); + } } } diff --git a/src/EditorFeatures/CSharpTest/SplitStringLiteral/SplitStringLiteralCommandHandlerTests.cs b/src/EditorFeatures/CSharpTest/SplitStringLiteral/SplitStringLiteralCommandHandlerTests.cs index c44723ac7b064..d6649e87f5e0a 100644 --- a/src/EditorFeatures/CSharpTest/SplitStringLiteral/SplitStringLiteralCommandHandlerTests.cs +++ b/src/EditorFeatures/CSharpTest/SplitStringLiteral/SplitStringLiteralCommandHandlerTests.cs @@ -24,7 +24,7 @@ using Roslyn.Test.Utilities; using Xunit; using static Microsoft.CodeAnalysis.Formatting.FormattingOptions2; -using IndentStyle = Microsoft.CodeAnalysis.Formatting.FormattingOptions.IndentStyle; +using IndentStyle = Microsoft.CodeAnalysis.Formatting.FormattingOptions2.IndentStyle; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.SplitStringLiteral { @@ -49,7 +49,7 @@ private static void TestWorker( // TODO: set SmartIndent to textView.Options (https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1412138) workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(workspace.Options - .WithChangedOption(AutoFormattingOptions.Metadata.SmartIndent, LanguageNames.CSharp, indentStyle))); + .WithChangedOption(FormattingOptions2.SmartIndent, LanguageNames.CSharp, indentStyle))); if (useTabs && expectedOutputMarkup != null) { diff --git a/src/EditorFeatures/CSharpTest/UsePatternCombinators/CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs b/src/EditorFeatures/CSharpTest/UsePatternCombinators/CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs index 6e5ab88b5a2af..a95c7375ac0d4 100644 --- a/src/EditorFeatures/CSharpTest/UsePatternCombinators/CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs +++ b/src/EditorFeatures/CSharpTest/UsePatternCombinators/CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs @@ -105,6 +105,8 @@ public async Task TestMissingOnExpression(string expression) [InlineData("i == default || i > default(int)", "i is default(int) or > (default(int))")] [InlineData("!(o is C c)", "o is not C c")] [InlineData("o is int ii && o is long jj", "o is int ii and long jj")] + [InlineData("o is string || o is Exception", "o is string or Exception")] + [InlineData("o is System.String || o is System.Exception", "o is System.String or System.Exception")] [InlineData("!(o is C)", "o is not C")] [InlineData("!(o is C _)", "o is not C _")] [InlineData("i == (0x02 | 0x04) || i != 0", "i is (0x02 | 0x04) or not 0")] @@ -477,6 +479,151 @@ void M(char c) } } } +"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUsePatternCombinators)] + [WorkItem(57199, "https://github.com/dotnet/roslyn/issues/57199")] + public async Task TestMissingInNonConvertibleTypePattern1() + { + await TestMissingAsync( +@" +static class C +{ + public struct S1 : I { } + public struct S2 : I { } + public interface I { } +} + +class Test +{ + public readonly T C; + bool P => [|C is C.S1 || C is C.S2|]; +} +"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUsePatternCombinators)] + [WorkItem(57199, "https://github.com/dotnet/roslyn/issues/57199")] + public async Task TestMissingInNonConvertibleTypePattern2() + { + await TestMissingAsync( +@" + class Goo + { + private class X { } + private class Y { } + + private void M(object o) + { + var X = 1; + var Y = 2; + + if [|(o is X || o is Y)|] + { + } + } + } +"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUsePatternCombinators)] + [WorkItem(57199, "https://github.com/dotnet/roslyn/issues/57199")] + public async Task TestMissingInNonConvertibleTypePattern3() + { + await TestMissingAsync( +@" + class Goo + { + private class X { } + private class Y { } + private void M(object o) + { + var X = 1; + var Y = 2; + if [|(o is global::Goo.X || o is Y)|] + { + } + } + } +"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUsePatternCombinators)] + [WorkItem(57199, "https://github.com/dotnet/roslyn/issues/57199")] + public async Task TestInConvertibleTypePattern() + { + await TestInRegularAndScriptAsync( +@" +static class C +{ + public struct S1 : I { } + public struct S2 : I { } + public interface I { } +} + +class Test +{ + bool P => [|C is C.S1 || C is C.S2|]; +} +", + +@" +static class C +{ + public struct S1 : I { } + public struct S2 : I { } + public interface I { } +} + +class Test +{ + bool P => C is C.S1 or C.S2; +} +"); + } + + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUsePatternCombinators)] + [WorkItem(57199, "https://github.com/dotnet/roslyn/issues/57199")] + public async Task TestInConvertibleTypePattern2() + { + await TestInRegularAndScriptAsync( +@" +public class Goo +{ + private class X { } + private class Y { } + + private void M(object o) + { + var X = 1; + var Y = 2; + + var @int = 1; + var @long = 2; + if [|(o is int || o is long)|] + { + } + } +} +", @" +public class Goo +{ + private class X { } + private class Y { } + + private void M(object o) + { + var X = 1; + var Y = 2; + + var @int = 1; + var @long = 2; + if (o is int or long) + { + } + } +} "); } } diff --git a/src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs b/src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs index fcd410160483d..baf43e6825a95 100644 --- a/src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs +++ b/src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests.cs @@ -1278,20 +1278,20 @@ public void TestSolutionWithOptions() workspace.AddTestProject(project1); var solution = workspace.CurrentSolution; - var optionKey = new OptionKey2(FormattingOptions.SmartIndent, LanguageNames.CSharp); + var optionKey = new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp); var optionValue = solution.Options.GetOption(optionKey); - Assert.Equal(FormattingOptions.IndentStyle.Smart, optionValue); + Assert.Equal(FormattingOptions2.IndentStyle.Smart, optionValue); - var newOptions = solution.Options.WithChangedOption(optionKey, FormattingOptions.IndentStyle.Block); + var newOptions = solution.Options.WithChangedOption(optionKey, FormattingOptions2.IndentStyle.Block); var newSolution = solution.WithOptions(newOptions); var newOptionValue = newSolution.Options.GetOption(optionKey); - Assert.Equal(FormattingOptions.IndentStyle.Block, newOptionValue); + Assert.Equal(FormattingOptions2.IndentStyle.Block, newOptionValue); var applied = workspace.TryApplyChanges(newSolution); Assert.True(applied); var currentOptionValue = workspace.CurrentSolution.Options.GetOption(optionKey); - Assert.Equal(FormattingOptions.IndentStyle.Block, currentOptionValue); + Assert.Equal(FormattingOptions2.IndentStyle.Block, currentOptionValue); } [CombinatorialData] @@ -1312,9 +1312,9 @@ public void TestOptionChangedHandlerInvokedAfterCurrentSolutionChanged(bool test var beforeSolutionForPrimaryWorkspace = primaryWorkspace.CurrentSolution; var beforeSolutionForSecondaryWorkspace = secondaryWorkspace.CurrentSolution; - var optionKey = new OptionKey2(FormattingOptions.SmartIndent, LanguageNames.CSharp); - Assert.Equal(FormattingOptions.IndentStyle.Smart, primaryWorkspace.Options.GetOption(optionKey)); - Assert.Equal(FormattingOptions.IndentStyle.Smart, secondaryWorkspace.Options.GetOption(optionKey)); + var optionKey = new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp); + Assert.Equal(FormattingOptions2.IndentStyle.Smart, primaryWorkspace.Options.GetOption(optionKey)); + Assert.Equal(FormattingOptions2.IndentStyle.Smart, secondaryWorkspace.Options.GetOption(optionKey)); // Hook up the option changed event handler. var optionService = primaryWorkspace.Services.GetRequiredService(); @@ -1324,12 +1324,12 @@ public void TestOptionChangedHandlerInvokedAfterCurrentSolutionChanged(bool test if (testDeprecatedOptionsSetter) { #pragma warning disable CS0618 // Type or member is obsolete - this test ensures that deprecated "Workspace.set_Options" API's functionality is preserved. - primaryWorkspace.Options = primaryWorkspace.Options.WithChangedOption(optionKey, FormattingOptions.IndentStyle.Block); + primaryWorkspace.Options = primaryWorkspace.Options.WithChangedOption(optionKey, FormattingOptions2.IndentStyle.Block); #pragma warning restore CS0618 // Type or member is obsolete } else { - primaryWorkspace.SetOptions(primaryWorkspace.Options.WithChangedOption(optionKey, FormattingOptions.IndentStyle.Block)); + primaryWorkspace.SetOptions(primaryWorkspace.Options.WithChangedOption(optionKey, FormattingOptions2.IndentStyle.Block)); } // Verify current solution and option change for both workspaces. @@ -1353,9 +1353,9 @@ static void VerifyCurrentSolutionAndOptionChange(Workspace workspace, Solution b Assert.NotEqual(beforeOptionChangedSolution, currentSolution); // Verify workspace.CurrentSolution has changed option. - var optionKey = new OptionKey2(FormattingOptions.SmartIndent, LanguageNames.CSharp); - Assert.Equal(FormattingOptions.IndentStyle.Smart, beforeOptionChangedSolution.Options.GetOption(optionKey)); - Assert.Equal(FormattingOptions.IndentStyle.Block, currentSolution.Options.GetOption(optionKey)); + var optionKey = new OptionKey2(FormattingOptions2.SmartIndent, LanguageNames.CSharp); + Assert.Equal(FormattingOptions2.IndentStyle.Smart, beforeOptionChangedSolution.Options.GetOption(optionKey)); + Assert.Equal(FormattingOptions2.IndentStyle.Block, currentSolution.Options.GetOption(optionKey)); } } } diff --git a/src/EditorFeatures/CSharpTest2/Recommendations/AsyncKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest2/Recommendations/AsyncKeywordRecommenderTests.cs index 087ed6b5f5ebb..5263fa23ec4f1 100644 --- a/src/EditorFeatures/CSharpTest2/Recommendations/AsyncKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest2/Recommendations/AsyncKeywordRecommenderTests.cs @@ -40,6 +40,15 @@ await VerifyKeywordAsync(@"class C }"); } + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public async Task TestMethodDeclarationAsyncAfterCursor() + { + await VerifyKeywordAsync(@"class C +{ + public $$ async void goo() { } +}"); + } + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestInsideInterface() { @@ -219,7 +228,7 @@ static void Main(string[] args) } [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] - public async Task TestNotIfAlreadyAsync2() + public async Task TestNotIfAlreadyAsyncInLambda() { await VerifyAbsenceAsync(@" class Program @@ -231,6 +240,30 @@ static void Main(string[] args) }"); } + [WorkItem(60340, "https://github.com/dotnet/roslyn/issues/60340")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public async Task TestNotIfAlreadyAsyncBeforeOtherMember() + { + await VerifyAbsenceAsync(@" +class Program +{ + async $$ + + public void M() {} +}"); + } + + [WorkItem(60340, "https://github.com/dotnet/roslyn/issues/60340")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public async Task TestNotIfAlreadyAsyncAsLastMember() + { + await VerifyAbsenceAsync(@" +class Program +{ + async $$ +}"); + } + [WorkItem(578061, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/578061")] [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public async Task TestNotInNamespace() diff --git a/src/EditorFeatures/Core.Cocoa/Lsp/VSMacLspLoggerFactoryWrapper.cs b/src/EditorFeatures/Core.Cocoa/Lsp/VSMacLspLoggerFactoryWrapper.cs index 00a6a4bc30d1a..4f33afef6eae2 100644 --- a/src/EditorFeatures/Core.Cocoa/Lsp/VSMacLspLoggerFactoryWrapper.cs +++ b/src/EditorFeatures/Core.Cocoa/Lsp/VSMacLspLoggerFactoryWrapper.cs @@ -29,9 +29,9 @@ public VSMacLspLoggerFactoryWrapper(IVSMacLspLoggerFactory loggerFactory) _loggerFactory = loggerFactory; } - public async Task CreateLoggerAsync(string serverTypeName, string? clientName, JsonRpc jsonRpc, CancellationToken cancellationToken) + public async Task CreateLoggerAsync(string serverTypeName, JsonRpc jsonRpc, CancellationToken cancellationToken) { - var vsMacLogger = await _loggerFactory.CreateLoggerAsync(serverTypeName, clientName, jsonRpc, cancellationToken).ConfigureAwait(false); + var vsMacLogger = await _loggerFactory.CreateLoggerAsync(serverTypeName, jsonRpc, cancellationToken).ConfigureAwait(false); return new VSMacLspLoggerWrapper(vsMacLogger); } } diff --git a/src/EditorFeatures/Core.Wpf/Adornments/AbstractAdornmentManager.cs b/src/EditorFeatures/Core.Wpf/Adornments/AbstractAdornmentManager.cs index ced60fb3c0f4b..a685720685954 100644 --- a/src/EditorFeatures/Core.Wpf/Adornments/AbstractAdornmentManager.cs +++ b/src/EditorFeatures/Core.Wpf/Adornments/AbstractAdornmentManager.cs @@ -284,7 +284,7 @@ protected bool ShouldDrawTag(SnapshotSpan snapshotSpan, IMappingTagSpan mappi } var mappedPoint = TextView.BufferGraph.MapUpToSnapshot( - point.Value, PointTrackingMode.Negative, PositionAffinity.Predecessor, TextView.VisualSnapshot); + point.Value, PointTrackingMode.Negative, PositionAffinity.Predecessor, TextView.TextSnapshot); if (mappedPoint == null) { return null; diff --git a/src/EditorFeatures/Core.Wpf/InlineDiagnostics/InlineDiagnosticsAdornmentManager.cs b/src/EditorFeatures/Core.Wpf/InlineDiagnostics/InlineDiagnosticsAdornmentManager.cs index e18c043e3052b..f17b0c91163a3 100644 --- a/src/EditorFeatures/Core.Wpf/InlineDiagnostics/InlineDiagnosticsAdornmentManager.cs +++ b/src/EditorFeatures/Core.Wpf/InlineDiagnostics/InlineDiagnosticsAdornmentManager.cs @@ -130,41 +130,49 @@ protected override void AddAdornmentsToAdornmentLayer_CallOnlyOnUIThread(Normali } var viewLines = TextView.TextViewLines; - using var _ = PooledDictionary>.GetInstance(out var map); - AddSpansOnEachLine(changedSpanCollection, map); - foreach (var (lineNum, tagMappingSpan) in map) - { - // Mapping the IMappingTagSpan back up to the TextView's visual snapshot to ensure there will - // be no adornments drawn on disjoint spans. - if (!TryMapToSingleSnapshotSpan(tagMappingSpan.Span, TextView.TextSnapshot, out var span)) - { - continue; - } + using var _ = PooledDictionary>.GetInstance(out var map); - var geometry = viewLines.GetMarkerGeometry(span); - if (geometry is null) + // First loop iterates through the snap collection and determines if an inline diagnostic can be drawn. + // Creates a mapping of the view line to the IMappingTagSpan with getting the first error that appears + // on the line if there are multiple. + foreach (var changedSpan in changedSpanCollection) + { + if (!viewLines.IntersectsBufferSpan(changedSpan)) { continue; } - // Need to get the SnapshotPoint to be able to get the IWpfTextViewLine - var point = tagMappingSpan.Span.End.GetPoint(TextView.TextSnapshot, PositionAffinity.Predecessor); - if (point == null) + var tagSpans = TagAggregator.GetTags(changedSpan); + foreach (var tagMappingSpan in tagSpans) { - continue; - } + if (!ShouldDrawTag(changedSpan, tagMappingSpan, out var mappedPoint)) + { + continue; + } - var lineView = viewLines.GetTextViewLineContainingBufferPosition(point.Value); + var viewLine = viewLines.GetTextViewLineContainingBufferPosition(mappedPoint); - if (lineView is null) - { - continue; + // If the line does not have an associated tagMappingSpan and changedSpan, then add the first one. + if (!map.TryGetValue(viewLine, out var value)) + { + map.Add(viewLine, tagMappingSpan); + } + else if (value.Tag.ErrorType is not PredefinedErrorTypeNames.SyntaxError && tagMappingSpan.Tag.ErrorType is PredefinedErrorTypeNames.SyntaxError) + { + // Draw the first instance of an error, if what is stored in the map at a specific line is + // not an error, then replace it. Otherwise, just get the first warning on the line. + map[viewLine] = tagMappingSpan; + } } + } + // Second loop iterates through the map to go through and create the graphics that is being drawn + // on the canvas as well adding the tag to the Inline Diagnostics adornment layer. + foreach (var (lineView, tagMappingSpan) in map) + { // Looking for IEndOfLineTags and seeing if they exist on the same line as where the // diagnostic would be drawn. If they are the same, then we do not want to draw // the diagnostic. - var obstructingTags = _endLineTagAggregator.GetTags(lineView.Extent); if (obstructingTags.Where(tag => tag.Tag.Type is not "Inline Diagnostics").Any()) { @@ -173,9 +181,12 @@ protected override void AddAdornmentsToAdornmentLayer_CallOnlyOnUIThread(Normali var tag = tagMappingSpan.Tag; var classificationType = _classificationRegistryService.GetClassificationType(InlineDiagnosticsTag.GetClassificationId(tag.ErrorType)); - var graphicsResult = tag.GetGraphics(TextView, geometry, GetFormat(classificationType)); + + // Pass in null! because the geometry is unused for drawing anything for Inline Diagnostics + var graphicsResult = tag.GetGraphics(TextView, unused: null!, GetFormat(classificationType)); var visualElement = graphicsResult.VisualElement; + // Only place the diagnostics if the diagnostic would not intersect with the editor window if (lineView.Right >= TextView.ViewportWidth - visualElement.DesiredSize.Width) { @@ -188,7 +199,7 @@ protected override void AddAdornmentsToAdornmentLayer_CallOnlyOnUIThread(Normali tag.Location == InlineDiagnosticsLocations.PlacedAtEndOfEditor ? TextView.ViewportRight - visualElement.DesiredSize.Width : throw ExceptionUtilities.UnexpectedValue(tag.Location)); - Canvas.SetTop(visualElement, geometry.Bounds.Bottom - visualElement.DesiredSize.Height); + Canvas.SetTop(visualElement, lineView.Bottom - visualElement.DesiredSize.Height); AdornmentLayer.AddAdornment( behavior: AdornmentPositioningBehavior.TextRelative, @@ -198,46 +209,5 @@ protected override void AddAdornmentsToAdornmentLayer_CallOnlyOnUIThread(Normali removedCallback: delegate { graphicsResult.Dispose(); }); } } - - /// - /// Get the spans located on each line so that it can only display the first one that appears on the line - /// - private void AddSpansOnEachLine(NormalizedSnapshotSpanCollection changedSpanCollection, - Dictionary> map) - { - var viewLines = TextView.TextViewLines; - - foreach (var changedSpan in changedSpanCollection) - { - if (!viewLines.IntersectsBufferSpan(changedSpan)) - { - continue; - } - - var tagSpans = TagAggregator.GetTags(changedSpan); - foreach (var tagMappingSpan in tagSpans) - { - if (!ShouldDrawTag(changedSpan, tagMappingSpan, out var mappedPoint)) - { - continue; - } - - // mappedPoint is known to not be null here because it is checked in the ShouldDrawTag method call. - var lineNum = mappedPoint.GetContainingLine().LineNumber; - - // If the line does not have an associated tagMappingSpan and changedSpan, then add the first one. - if (!map.TryGetValue(lineNum, out var value)) - { - map.Add(lineNum, tagMappingSpan); - } - else if (value.Tag.ErrorType is not PredefinedErrorTypeNames.SyntaxError && tagMappingSpan.Tag.ErrorType is PredefinedErrorTypeNames.SyntaxError) - { - // Draw the first instance of an error, if what is stored in the map at a specific line is - // not an error, then replace it. Otherwise, just get the first warning on the line. - map[lineNum] = tagMappingSpan; - } - } - } - } } } diff --git a/src/EditorFeatures/Core.Wpf/InlineDiagnostics/InlineDiagnosticsTag.cs b/src/EditorFeatures/Core.Wpf/InlineDiagnostics/InlineDiagnosticsTag.cs index 8d1dd3d88f723..b79b6c05a895a 100644 --- a/src/EditorFeatures/Core.Wpf/InlineDiagnostics/InlineDiagnosticsTag.cs +++ b/src/EditorFeatures/Core.Wpf/InlineDiagnostics/InlineDiagnosticsTag.cs @@ -64,7 +64,7 @@ public InlineDiagnosticsTag(string errorType, DiagnosticData diagnostic, IEditor /// /// Creates a GraphicsResult object which is the error block based on the geometry and formatting set for the item. /// - public override GraphicsResult GetGraphics(IWpfTextView view, Geometry bounds, TextFormattingRunProperties format) + public override GraphicsResult GetGraphics(IWpfTextView view, Geometry unused, TextFormattingRunProperties format) { var block = new TextBlock { diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeFixSuggestedAction.cs b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeFixSuggestedAction.cs index 7683ebb3fa7db..1a56faba462d8 100644 --- a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeFixSuggestedAction.cs +++ b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/CodeFixSuggestedAction.cs @@ -7,8 +7,8 @@ using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; +using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.UnifiedSuggestions.UnifiedSuggestedActions; using Microsoft.VisualStudio.Language.Intellisense; using Microsoft.VisualStudio.Text; diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/FixAllSuggestedAction.cs b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/FixAllSuggestedAction.cs index 4450286298856..93f22d2cdc34d 100644 --- a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/FixAllSuggestedAction.cs +++ b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/FixAllSuggestedAction.cs @@ -9,9 +9,9 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Internal.Log; +using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.Utilities; using Microsoft.CodeAnalysis.UnifiedSuggestions.UnifiedSuggestedActions; using Microsoft.VisualStudio.Language.Intellisense; @@ -58,7 +58,7 @@ public override bool TryGetTelemetryId(out Guid telemetryId) // We get the telemetry id for the original code action we are fixing, // not the special 'FixAllCodeAction'. that is the .CodeAction this // SuggestedAction is pointing at. - telemetryId = OriginalCodeAction.GetType().GetTelemetryId(FixAllState.Scope.GetScopeIdForTelemetry()); + telemetryId = OriginalCodeAction.GetTelemetryId(FixAllState.Scope); return true; } diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/SuggestedAction.cs b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/SuggestedAction.cs index 619e455ae9dfb..cc8cc3fea3e6e 100644 --- a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/SuggestedAction.cs +++ b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActions/SuggestedAction.cs @@ -11,11 +11,11 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.Extensions; using Microsoft.CodeAnalysis.Internal.Log; +using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.CodeAnalysis.Shared.Utilities; using Microsoft.CodeAnalysis.Text; @@ -65,12 +65,9 @@ internal SuggestedAction( internal virtual CodeActionPriority Priority => CodeAction.Priority; - internal bool IsForCodeQualityImprovement - => (Provider as SyntaxEditorBasedCodeFixProvider)?.CodeFixCategory == CodeFixCategory.CodeQuality; - public virtual bool TryGetTelemetryId(out Guid telemetryId) { - telemetryId = CodeAction.GetType().GetTelemetryId(); + telemetryId = CodeAction.GetTelemetryId(); return true; } diff --git a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFormattingInteractionService.cs b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFormattingInteractionService.cs index 6326622d89390..58f6c23112de4 100644 --- a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFormattingInteractionService.cs +++ b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFormattingInteractionService.cs @@ -31,7 +31,7 @@ public VSTypeScriptFormattingInteractionService(IVSTypeScriptFormattingInteracti public bool SupportsFormatOnPaste => _implementation.SupportsFormatOnPaste; public bool SupportsFormatOnReturn => _implementation.SupportsFormatOnReturn; - public bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptions options, char ch) + public bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptions options, FormattingOptions2.IndentStyle indentStyle, char ch) => _implementation.SupportsFormattingOnTypedCharacter(document, ch); public Task> GetFormattingChangesAsync(Document document, TextSpan? textSpan, DocumentOptionSet? documentOptions, CancellationToken cancellationToken) diff --git a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptInProcLanguageClient.cs b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptInProcLanguageClient.cs index 581a73347d60f..abaab663d4662 100644 --- a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptInProcLanguageClient.cs +++ b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptInProcLanguageClient.cs @@ -45,7 +45,7 @@ public VSTypeScriptInProcLanguageClient( DefaultCapabilitiesProvider defaultCapabilitiesProvider, ILspLoggerFactory lspLoggerFactory, IThreadingContext threadingContext) - : base(requestDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext, diagnosticsClientName: null) + : base(requestDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext) { _typeScriptCapabilitiesProvider = typeScriptCapabilitiesProvider; } diff --git a/src/EditorFeatures/Core/Formatting/FormatCommandHandler.cs b/src/EditorFeatures/Core/Formatting/FormatCommandHandler.cs index 5ea96bd45e286..e94b614a21149 100644 --- a/src/EditorFeatures/Core/Formatting/FormatCommandHandler.cs +++ b/src/EditorFeatures/Core/Formatting/FormatCommandHandler.cs @@ -168,7 +168,8 @@ private void ExecuteReturnOrTypeCommandWorker(EditorCommandArgs args, Cancellati else if (args is TypeCharCommandArgs typeCharArgs) { var options = AutoFormattingOptions.From(document.Project); - if (!service.SupportsFormattingOnTypedCharacter(document, options, typeCharArgs.TypedChar)) + var indentStyle = document.Project.Solution.Options.GetOption(FormattingOptions2.SmartIndent, document.Project.Language); + if (!service.SupportsFormattingOnTypedCharacter(document, options, indentStyle, typeCharArgs.TypedChar)) { return; } diff --git a/src/EditorFeatures/Core/LanguageServer/AbstractInProcLanguageClient.cs b/src/EditorFeatures/Core/LanguageServer/AbstractInProcLanguageClient.cs index 4d83d2f9e422b..3d8f6f3083604 100644 --- a/src/EditorFeatures/Core/LanguageServer/AbstractInProcLanguageClient.cs +++ b/src/EditorFeatures/Core/LanguageServer/AbstractInProcLanguageClient.cs @@ -24,7 +24,6 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.LanguageClient { internal abstract partial class AbstractInProcLanguageClient : ILanguageClient, ILanguageServerFactory, ICapabilitiesProvider { - private readonly string? _diagnosticsClientName; private readonly IThreadingContext _threadingContext; private readonly ILspLoggerFactory _lspLoggerFactory; @@ -86,14 +85,12 @@ public AbstractInProcLanguageClient( IAsynchronousOperationListenerProvider listenerProvider, LspWorkspaceRegistrationService lspWorkspaceRegistrationService, ILspLoggerFactory lspLoggerFactory, - IThreadingContext threadingContext, - string? diagnosticsClientName) + IThreadingContext threadingContext) { _requestDispatcherFactory = requestDispatcherFactory; GlobalOptions = globalOptions; _listenerProvider = listenerProvider; _lspWorkspaceRegistrationService = lspWorkspaceRegistrationService; - _diagnosticsClientName = diagnosticsClientName; _lspLoggerFactory = lspLoggerFactory; _threadingContext = threadingContext; } @@ -146,7 +143,6 @@ public AbstractInProcLanguageClient( serverStream, serverStream, _lspLoggerFactory, - _diagnosticsClientName, cancellationToken).ConfigureAwait(false); return new Connection(clientStream, clientStream); @@ -180,7 +176,6 @@ internal static async Task CreateAsync( Stream inputStream, Stream outputStream, ILspLoggerFactory lspLoggerFactory, - string? clientName, CancellationToken cancellationToken) { var jsonMessageFormatter = new JsonMessageFormatter(); @@ -193,7 +188,7 @@ internal static async Task CreateAsync( var serverTypeName = languageClient.GetType().Name; - var logger = await lspLoggerFactory.CreateLoggerAsync(serverTypeName, clientName, jsonRpc, cancellationToken).ConfigureAwait(false); + var logger = await lspLoggerFactory.CreateLoggerAsync(serverTypeName, jsonRpc, cancellationToken).ConfigureAwait(false); var server = languageClient.Create( jsonRpc, @@ -219,7 +214,6 @@ public ILanguageServerTarget Create( _listenerProvider, logger, SupportedLanguages, - clientName: _diagnosticsClientName, ServerKind); } diff --git a/src/EditorFeatures/Core/LanguageServer/AlwaysActivateInProcLanguageClient.cs b/src/EditorFeatures/Core/LanguageServer/AlwaysActivateInProcLanguageClient.cs index 00a02e18d5d98..211391339e227 100644 --- a/src/EditorFeatures/Core/LanguageServer/AlwaysActivateInProcLanguageClient.cs +++ b/src/EditorFeatures/Core/LanguageServer/AlwaysActivateInProcLanguageClient.cs @@ -43,7 +43,7 @@ public AlwaysActivateInProcLanguageClient( DefaultCapabilitiesProvider defaultCapabilitiesProvider, ILspLoggerFactory lspLoggerFactory, IThreadingContext threadingContext) - : base(csharpVBRequestDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext, diagnosticsClientName: null) + : base(csharpVBRequestDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext) { _defaultCapabilitiesProvider = defaultCapabilitiesProvider; } diff --git a/src/EditorFeatures/Core/LanguageServer/Handlers/CodeActions/CodeActionHelpers.cs b/src/EditorFeatures/Core/LanguageServer/Handlers/CodeActions/CodeActionHelpers.cs index fe0d76181d2a5..3b12bbabee444 100644 --- a/src/EditorFeatures/Core/LanguageServer/Handlers/CodeActions/CodeActionHelpers.cs +++ b/src/EditorFeatures/Core/LanguageServer/Handlers/CodeActions/CodeActionHelpers.cs @@ -236,7 +236,7 @@ private static CodeAction GetNestedActionsFromActionSet(IUnifiedSuggestedAction } } - return new CodeActionWithNestedActions( + return CodeActionWithNestedActions.Create( codeAction.Title, nestedActions.ToImmutable(), codeAction.IsInlinable, codeAction.Priority); } diff --git a/src/EditorFeatures/Core/LanguageServer/Handlers/Completion/CompletionHandler.cs b/src/EditorFeatures/Core/LanguageServer/Handlers/Completion/CompletionHandler.cs index aa228551b3a21..a8b0632caa5d9 100644 --- a/src/EditorFeatures/Core/LanguageServer/Handlers/Completion/CompletionHandler.cs +++ b/src/EditorFeatures/Core/LanguageServer/Handlers/Completion/CompletionHandler.cs @@ -127,7 +127,7 @@ public CompletionHandler( var completionItemResolveData = supportsCompletionListData ? null : completionResolveData; var lspCompletionItem = await CreateLSPCompletionItemAsync( request, document, item, completionItemResolveData, lspVSClientCapability, commitCharactersRuleCache, - completionService, context.ClientName, returnTextEdits, snippetsSupported, stringBuilder, documentText, + completionService, returnTextEdits, snippetsSupported, stringBuilder, documentText, defaultSpan, defaultRange, cancellationToken).ConfigureAwait(false); lspCompletionItems.Add(lspCompletionItem); } @@ -177,7 +177,6 @@ bool IsValidTriggerCharacterForDocument(Document document, char triggerCharacter bool supportsVSExtensions, Dictionary, string[]> commitCharacterRulesCache, CompletionService completionService, - string? clientName, bool returnTextEdits, bool snippetsSupported, StringBuilder stringBuilder, diff --git a/src/EditorFeatures/Core/LanguageServer/LiveShareInProcLanguageClient.cs b/src/EditorFeatures/Core/LanguageServer/LiveShareInProcLanguageClient.cs index b7be5bf149e8c..231749f28b82f 100644 --- a/src/EditorFeatures/Core/LanguageServer/LiveShareInProcLanguageClient.cs +++ b/src/EditorFeatures/Core/LanguageServer/LiveShareInProcLanguageClient.cs @@ -37,7 +37,7 @@ public LiveShareInProcLanguageClient( DefaultCapabilitiesProvider defaultCapabilitiesProvider, ILspLoggerFactory lspLoggerFactory, IThreadingContext threadingContext) - : base(csharpVBRequestDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext, diagnosticsClientName: null) + : base(csharpVBRequestDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext) { _defaultCapabilitiesProvider = defaultCapabilitiesProvider; } diff --git a/src/EditorFeatures/Core/LanguageServer/RazorInProcLanguageClient.cs b/src/EditorFeatures/Core/LanguageServer/RazorInProcLanguageClient.cs index cc71b2be6f93d..53ee0686aa249 100644 --- a/src/EditorFeatures/Core/LanguageServer/RazorInProcLanguageClient.cs +++ b/src/EditorFeatures/Core/LanguageServer/RazorInProcLanguageClient.cs @@ -55,7 +55,7 @@ public RazorInProcLanguageClient( DefaultCapabilitiesProvider defaultCapabilitiesProvider, IThreadingContext threadingContext, ILspLoggerFactory lspLoggerFactory) - : base(csharpVBRequestDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext, ClientName) + : base(csharpVBRequestDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext) { _defaultCapabilitiesProvider = defaultCapabilitiesProvider; } diff --git a/src/EditorFeatures/Test2/InlineHints/CSharpInlineParameterNameHintsTests.vb b/src/EditorFeatures/Test2/InlineHints/CSharpInlineParameterNameHintsTests.vb index 2f4b27d604871..9552ad7909e3c 100644 --- a/src/EditorFeatures/Test2/InlineHints/CSharpInlineParameterNameHintsTests.vb +++ b/src/EditorFeatures/Test2/InlineHints/CSharpInlineParameterNameHintsTests.vb @@ -704,6 +704,31 @@ class A Await VerifyParamHints(input, input) End Function + + + Public Async Function TestNotOnEnableDisableBoolean3() As Task + Dim input = + + + +class A +{ + void Main() + { + EnableLogging(true); + + void EnableLogging(bool value) + { + } + } +} + + + + + Await VerifyParamHints(input, input) + End Function + Public Async Function TestOnEnableDisableNonBoolean1() As Task diff --git a/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs b/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs index b81852b34b06e..29a69e5b506cb 100644 --- a/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs +++ b/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs @@ -288,8 +288,8 @@ private protected static CodeActionResolveData CreateCodeActionResolveData(strin protected Task CreateTestLspServerAsync(string markup, LSP.ClientCapabilities? clientCapabilities = null) => CreateTestLspServerAsync(new string[] { markup }, Array.Empty(), LanguageNames.CSharp, clientCapabilities); - protected Task CreateVisualBasicTestLspServerAsync(string markup, LSP.ClientCapabilities? clientCapabilities = null) - => CreateTestLspServerAsync(new string[] { markup }, Array.Empty(), LanguageNames.VisualBasic, clientCapabilities); + private protected Task CreateVisualBasicTestLspServerAsync(string markup, LSP.ClientCapabilities? clientCapabilities = null, WellKnownLspServerKinds serverKind = WellKnownLspServerKinds.AlwaysActiveVSLspServer) + => CreateTestLspServerAsync(new string[] { markup }, Array.Empty(), LanguageNames.VisualBasic, clientCapabilities, serverKind); protected Task CreateMultiProjectLspServerAsync(string xmlMarkup, LSP.ClientCapabilities? clientCapabilities = null) => CreateTestLspServerAsync(TestWorkspace.Create(xmlMarkup, composition: Composition), clientCapabilities, WellKnownLspServerKinds.AlwaysActiveVSLspServer); @@ -579,7 +579,6 @@ private static LanguageServerTarget CreateLanguageServer(Stream inputStream, Str listenerProvider, NoOpLspLogger.Instance, ProtocolConstants.RoslynLspLanguages, - clientName: null, serverKind); jsonRpc.StartListening(); diff --git a/src/EditorFeatures/VisualBasic/NavigationBar/VisualBasicEditorNavigationBarItemService_CodeGeneration.vb b/src/EditorFeatures/VisualBasic/NavigationBar/VisualBasicEditorNavigationBarItemService_CodeGeneration.vb index fc3cc823452f7..c38b116e3da29 100644 --- a/src/EditorFeatures/VisualBasic/NavigationBar/VisualBasicEditorNavigationBarItemService_CodeGeneration.vb +++ b/src/EditorFeatures/VisualBasic/NavigationBar/VisualBasicEditorNavigationBarItemService_CodeGeneration.vb @@ -10,6 +10,7 @@ Imports Microsoft.CodeAnalysis.Editing Imports Microsoft.CodeAnalysis.Editor.Shared.Utilities Imports Microsoft.CodeAnalysis.Editor.VisualBasic.Utilities Imports Microsoft.CodeAnalysis.Formatting +Imports Microsoft.CodeAnalysis.Formatting.Rules Imports Microsoft.CodeAnalysis.NavigationBar Imports Microsoft.CodeAnalysis.NavigationBar.RoslynNavigationBarItem Imports Microsoft.CodeAnalysis.PooledObjects @@ -62,7 +63,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.NavigationBar Dim formatterRules = Formatter.GetDefaultFormattingRules(newDocument) If ShouldApplyLineAdjustmentFormattingRule(generateCodeItem) Then - formatterRules = LineAdjustmentFormattingRule.Instance.Concat(formatterRules) + formatterRules = ImmutableArray.Create(Of AbstractFormattingRule)(LineAdjustmentFormattingRule.Instance).AddRange(formatterRules) End If Dim documentOptions = Await document.GetOptionsAsync(cancellationToken).ConfigureAwait(False) diff --git a/src/EditorFeatures/VisualBasicTest/Diagnostics/GenerateType/GenerateTypeTests.vb b/src/EditorFeatures/VisualBasicTest/Diagnostics/GenerateType/GenerateTypeTests.vb index 75234dd27cf34..6d3c1fa0eeca8 100644 --- a/src/EditorFeatures/VisualBasicTest/Diagnostics/GenerateType/GenerateTypeTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Diagnostics/GenerateType/GenerateTypeTests.vb @@ -1239,7 +1239,7 @@ Class Program End Class #End ExternalSource .NormalizedValue, -{String.Format(FeaturesResources.Generate_0_1_in_new_file, "class", "Goo", FeaturesResources.Global_Namespace), String.Format(FeaturesResources.Generate_nested_0_1, "class", "Goo", "Program"), FeaturesResources.Generate_new_type}) +{String.Format(FeaturesResources.Generate_0_1_in_new_file, "class", "Goo"), String.Format(FeaturesResources.Generate_nested_0_1, "class", "Goo"), FeaturesResources.Generate_new_type}) End Function @@ -1258,8 +1258,8 @@ Class Bar End Class #End ExternalSource .NormalizedValue, -{String.Format(FeaturesResources.Generate_0_1_in_new_file, "class", "Goo", FeaturesResources.Global_Namespace), -String.Format(FeaturesResources.Generate_0_1, "class", "Goo", FeaturesResources.Global_Namespace), +{String.Format(FeaturesResources.Generate_0_1_in_new_file, "class", "Goo"), +String.Format(FeaturesResources.Generate_0_1, "class", "Goo"), String.Format(FeaturesResources.Generate_nested_0_1, "class", "Goo"), FeaturesResources.Generate_new_type}) End Function diff --git a/src/EditorFeatures/VisualBasicTest/Formatting/Indentation/SmartTokenFormatter_FormatTokenTests.vb b/src/EditorFeatures/VisualBasicTest/Formatting/Indentation/SmartTokenFormatter_FormatTokenTests.vb index 82ed93b5b91c6..c6d3f8b59e506 100644 --- a/src/EditorFeatures/VisualBasicTest/Formatting/Indentation/SmartTokenFormatter_FormatTokenTests.vb +++ b/src/EditorFeatures/VisualBasicTest/Formatting/Indentation/SmartTokenFormatter_FormatTokenTests.vb @@ -2,10 +2,12 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. +Imports System.Collections.Immutable Imports System.Threading Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces Imports Microsoft.CodeAnalysis.Formatting +Imports Microsoft.CodeAnalysis.Formatting.Rules Imports Microsoft.CodeAnalysis.Options Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.Text.Shared.Extensions @@ -153,7 +155,7 @@ $$) End Class .Value.Replace(vbLf, vbCrLf) - Await ExpectException_TestAsync(code, 4, FormattingOptions.IndentStyle.Block) + Await ExpectException_TestAsync(code, 4, FormattingOptions2.IndentStyle.Block) End Function @@ -166,14 +168,14 @@ $$) End Class .Value.Replace(vbLf, vbCrLf) - Await ExpectException_TestAsync(code, indentation:=0, indentStyle:=FormattingOptions.IndentStyle.None) + Await ExpectException_TestAsync(code, indentation:=0, indentStyle:=FormattingOptions2.IndentStyle.None) End Function - Private Shared Async Function ExpectException_TestAsync(codeWithMarkup As String, indentation As Integer, Optional indentStyle As FormattingOptions.IndentStyle = FormattingOptions.IndentStyle.Smart) As Task + Private Shared Async Function ExpectException_TestAsync(codeWithMarkup As String, indentation As Integer, Optional indentStyle As FormattingOptions2.IndentStyle = FormattingOptions2.IndentStyle.Smart) As Task Assert.NotNull(Await Record.ExceptionAsync(Function() TestAsync(codeWithMarkup, indentation, indentStyle:=indentStyle))) End Function - Private Shared Async Function TestAsync(codeWithMarkup As String, indentation As Integer, Optional indentStyle As FormattingOptions.IndentStyle = FormattingOptions.IndentStyle.Smart) As Threading.Tasks.Task + Private Shared Async Function TestAsync(codeWithMarkup As String, indentation As Integer, Optional indentStyle As FormattingOptions2.IndentStyle = FormattingOptions2.IndentStyle.Smart) As Threading.Tasks.Task Dim code As String = Nothing Dim position As Integer = 0 MarkupTestFile.GetPosition(codeWithMarkup, code, position) @@ -189,7 +191,7 @@ End Class Dim root = DirectCast(Await document.GetSyntaxRootAsync(), CompilationUnitSyntax) Dim options = Await SyntaxFormattingOptions.FromDocumentAsync(document, CancellationToken.None) - Dim formattingRules = New SpecialFormattingRule(indentStyle).Concat(Formatter.GetDefaultFormattingRules(document)) + Dim formattingRules = ImmutableArray.Create(Of AbstractFormattingRule)(New SpecialFormattingRule(indentStyle)).AddRange(Formatter.GetDefaultFormattingRules(document)) ' get token Dim token = root.FindToken(position) @@ -202,7 +204,7 @@ End Class Dim formatOptions = Await SyntaxFormattingOptions.FromDocumentAsync(document, CancellationToken.None) Dim smartFormatter = New VisualBasicSmartTokenFormatter(formatOptions, formattingRules, root) - Dim changes = Await smartFormatter.FormatTokenAsync(workspace.Services, token, Nothing) + Dim changes = Await smartFormatter.FormatTokenAsync(token, Nothing) Using edit = buffer.CreateEdit() For Each change In changes diff --git a/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Rewriters/LocalDeclarationRewriter.cs b/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Rewriters/LocalDeclarationRewriter.cs index eac363440360d..28debd342d1a9 100644 --- a/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Rewriters/LocalDeclarationRewriter.cs +++ b/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/Rewriters/LocalDeclarationRewriter.cs @@ -161,7 +161,7 @@ private static BoundExpression GetCustomTypeInfoPayload(LocalSymbol local, Synta return new BoundArrayCreation( syntax, ImmutableArray.Create(lengthExpr), - new BoundArrayInitialization(syntax, initializerExprs.ToImmutableAndFree()), + new BoundArrayInitialization(syntax, isInferred: false, initializerExprs.ToImmutableAndFree()), byteArrayType); } } diff --git a/src/Features/CSharp/Portable/AssignOutParameters/AbstractAssignOutParametersCodeFixProvider.cs b/src/Features/CSharp/Portable/AssignOutParameters/AbstractAssignOutParametersCodeFixProvider.cs index 450c71e631c62..6ed8324636798 100644 --- a/src/Features/CSharp/Portable/AssignOutParameters/AbstractAssignOutParametersCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/AssignOutParameters/AbstractAssignOutParametersCodeFixProvider.cs @@ -28,8 +28,6 @@ internal abstract class AbstractAssignOutParametersCodeFixProvider : SyntaxEdito public sealed override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(CS0177); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) { var cancellationToken = context.CancellationToken; diff --git a/src/Features/CSharp/Portable/BraceCompletion/AbstractCurlyBraceOrBracketCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/AbstractCurlyBraceOrBracketCompletionService.cs index 59f1d7906edb5..f551ca8b2940d 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/AbstractCurlyBraceOrBracketCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/AbstractCurlyBraceOrBracketCompletionService.cs @@ -219,7 +219,7 @@ static ImmutableArray GetMergedChanges(TextChange newLineEdit, Immut var startPoint = openingPoint; var endPoint = AdjustFormattingEndPoint(text, root, startPoint, closingPoint); - if (options.AutoFormattingOptions.IndentStyle == FormattingOptions.IndentStyle.Smart) + if (options.IndentStyle == FormattingOptions2.IndentStyle.Smart) { // Set the formatting start point to be the beginning of the first word to the left // of the opening brace location. diff --git a/src/Features/CSharp/Portable/BraceCompletion/CurlyBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/CurlyBraceCompletionService.cs index 41f463b88acc9..67164dd5f8977 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/CurlyBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/CurlyBraceCompletionService.cs @@ -83,7 +83,7 @@ protected override int AdjustFormattingEndPoint(SourceText text, SyntaxNode root protected override ImmutableArray GetBraceFormattingIndentationRulesAfterReturn(IndentationOptions options) { - var indentStyle = options.AutoFormattingOptions.IndentStyle; + var indentStyle = options.IndentStyle; return ImmutableArray.Create(BraceCompletionFormattingRule.ForIndentStyle(indentStyle)); } @@ -92,25 +92,25 @@ private sealed class BraceCompletionFormattingRule : BaseFormattingRule private static readonly Predicate s_predicate = o => o == null || o.Option.IsOn(SuppressOption.NoWrapping); private static readonly ImmutableArray s_instances = ImmutableArray.Create( - new BraceCompletionFormattingRule(FormattingOptions.IndentStyle.None), - new BraceCompletionFormattingRule(FormattingOptions.IndentStyle.Block), - new BraceCompletionFormattingRule(FormattingOptions.IndentStyle.Smart)); + new BraceCompletionFormattingRule(FormattingOptions2.IndentStyle.None), + new BraceCompletionFormattingRule(FormattingOptions2.IndentStyle.Block), + new BraceCompletionFormattingRule(FormattingOptions2.IndentStyle.Smart)); - private readonly FormattingOptions.IndentStyle _indentStyle; + private readonly FormattingOptions2.IndentStyle _indentStyle; private readonly CSharpSyntaxFormattingOptions _options; - public BraceCompletionFormattingRule(FormattingOptions.IndentStyle indentStyle) + public BraceCompletionFormattingRule(FormattingOptions2.IndentStyle indentStyle) : this(indentStyle, CSharpSyntaxFormattingOptions.Default) { } - private BraceCompletionFormattingRule(FormattingOptions.IndentStyle indentStyle, CSharpSyntaxFormattingOptions options) + private BraceCompletionFormattingRule(FormattingOptions2.IndentStyle indentStyle, CSharpSyntaxFormattingOptions options) { _indentStyle = indentStyle; _options = options; } - public static AbstractFormattingRule ForIndentStyle(FormattingOptions.IndentStyle indentStyle) + public static AbstractFormattingRule ForIndentStyle(FormattingOptions2.IndentStyle indentStyle) { Debug.Assert(s_instances[(int)indentStyle]._indentStyle == indentStyle); return s_instances[(int)indentStyle]; @@ -250,7 +250,7 @@ private static bool IsControlBlock(SyntaxNode? node) public override void AddAlignTokensOperations(List list, SyntaxNode node, in NextAlignTokensOperationAction nextOperation) { base.AddAlignTokensOperations(list, node, in nextOperation); - if (_indentStyle == FormattingOptions.IndentStyle.Block) + if (_indentStyle == FormattingOptions2.IndentStyle.Block) { var bracePair = node.GetBracePair(); if (bracePair.IsValidBracketOrBracePair()) diff --git a/src/Features/CSharp/Portable/BraceCompletion/StringLiteralBraceCompletionService.cs b/src/Features/CSharp/Portable/BraceCompletion/StringLiteralBraceCompletionService.cs index 0ae0c5025aea4..106fa4d11fdd4 100644 --- a/src/Features/CSharp/Portable/BraceCompletion/StringLiteralBraceCompletionService.cs +++ b/src/Features/CSharp/Portable/BraceCompletion/StringLiteralBraceCompletionService.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.BraceCompletion; +using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.LanguageServices; using Microsoft.CodeAnalysis.Shared.Extensions; @@ -53,6 +54,27 @@ protected override Task IsValidOpenBraceTokenAtPositionAsync(SyntaxToken t return SpecializedTasks.False; } + // If the single token that the user typed is a string literal that is more than just + // the one double quote character they typed, and the line doesn't have errors, then + // it means it is completing an existing token, from the start. For example given: + // + // var s = "te$$st"; + // + // When the user types `" + "` to split the string into two literals, the first + // quote won't be completed (because its in a string literal), and with this check + // the second quote won't either. + // + // We don't do this optimization for verbatim strings because they are multi-line so + // the flow on effects from us getting it wrong are much greater, and it can really change + // the tree. + if (token.IsKind(SyntaxKind.StringLiteralToken) && + !token.IsVerbatimStringLiteral() && + token.Span.Length > 1 && + !RestOfLineContainsDiagnostics(token)) + { + return SpecializedTasks.False; + } + if (token.SpanStart == position) { return SpecializedTasks.True; @@ -63,5 +85,21 @@ protected override Task IsValidOpenBraceTokenAtPositionAsync(SyntaxToken t // is the @ character and the " is one past the token start. return Task.FromResult(token.SpanStart + 1 == position && token.IsVerbatimStringLiteral()); } + + private static bool RestOfLineContainsDiagnostics(SyntaxToken token) + { + while (!token.TrailingTrivia.Contains(t => t.IsEndOfLine())) + { + if (token.ContainsDiagnostics) + return true; + + token = token.GetNextToken(); + } + + if (token.ContainsDiagnostics) + return true; + + return false; + } } } diff --git a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx index f044789c39656..1329eb6c1b4da 100644 --- a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx +++ b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx @@ -134,12 +134,6 @@ Add 'await' and 'ConfigureAwait(false)' {Locked="await"} "await" is a C# keyword and should not be localized. - - Simplify lambda expression - - - Simplify all occurrences - <lambda expression> @@ -152,12 +146,6 @@ Autoselect disabled due to possible explicitly named anonymous type member creation. - - <element name> : - - - Autoselect disabled due to possible tuple type element creation. - <pattern variable> @@ -185,9 +173,6 @@ Remove 'this' qualification - - Name can be simplified - Can't determine valid range of statements to extract @@ -197,9 +182,6 @@ Selection does not contain a valid node - - Invalid selection. - Contains invalid selection. @@ -242,9 +224,6 @@ Organize Usings - - Insert 'await'. - Make {0} return Task instead of void. @@ -429,9 +408,6 @@ attribute target - - '{0}' does not contain a constructor that takes that many arguments. - The name '{0}' does not exist in the current context. @@ -522,9 +498,6 @@ Add required braces for single-line control statements - - Apply 'this.' qualification preferences - Apply expression/block body preferences @@ -566,9 +539,6 @@ Warning: Inlining temporary variable may change code meaning. - - Warning: Expression may have side effects. Code meaning may change. - local variable declaration @@ -592,10 +562,6 @@ Compare to '{0}' - - Apply preferred 'using' placement preferences - 'using' is a C# keyword and should not be localized - Remove 'in' keyword {Locked="in"} "in" is a C# keyword and should not be localized. @@ -657,9 +623,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply parameter null preferences diff --git a/src/Features/CSharp/Portable/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs b/src/Features/CSharp/Portable/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs index a400321dc60b8..11f916f8722d1 100644 --- a/src/Features/CSharp/Portable/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs @@ -41,8 +41,6 @@ public AddInheritdocCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(CS1591); - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var document = context.Document; diff --git a/src/Features/CSharp/Portable/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs b/src/Features/CSharp/Portable/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs index 9a34aa77c5a5a..bcd70a639da1b 100644 --- a/src/Features/CSharp/Portable/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs @@ -39,8 +39,6 @@ public CSharpFixReturnTypeCodeFixProvider() { } - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var document = context.Document; diff --git a/src/Features/CSharp/Portable/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs b/src/Features/CSharp/Portable/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs index 5954268d1726a..f7ab582f2d4e9 100644 --- a/src/Features/CSharp/Portable/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs @@ -34,8 +34,6 @@ public CSharpMakeStatementAsynchronousCodeFixProvider() // error CS8418: 'IAsyncDisposable': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'? public sealed override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create("CS8414", "CS8418"); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics.First(); diff --git a/src/Features/CSharp/Portable/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs b/src/Features/CSharp/Portable/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs index a332643629287..24eb36fa2a840 100644 --- a/src/Features/CSharp/Portable/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs @@ -44,8 +44,6 @@ public CSharpDeclareAsNullableCodeFixProvider() // warning CS8618: Non-nullable property is uninitialized public sealed override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create("CS8603", "CS8600", "CS8625", "CS8618"); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics.First(); diff --git a/src/Features/CSharp/Portable/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs b/src/Features/CSharp/Portable/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs index fbeabc2b41b9e..4f61fe029862e 100644 --- a/src/Features/CSharp/Portable/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs @@ -35,8 +35,6 @@ public CSharpUseInterpolatedVerbatimStringCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create("CS8401"); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - private const string InterpolatedVerbatimText = "$@\""; public override Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Features/CSharp/Portable/CodeRefactorings/SyncNamespace/CSharpSyncNamespaceCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/CodeRefactorings/SyncNamespace/CSharpSyncNamespaceCodeRefactoringProvider.cs index 1bd683cfdeb52..a18d0f1c39500 100644 --- a/src/Features/CSharp/Portable/CodeRefactorings/SyncNamespace/CSharpSyncNamespaceCodeRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/CodeRefactorings/SyncNamespace/CSharpSyncNamespaceCodeRefactoringProvider.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - using System.Collections.Immutable; using System.Composition; using System.Diagnostics.CodeAnalysis; @@ -28,14 +26,15 @@ public CSharpSyncNamespaceCodeRefactoringProvider() { } - protected override async Task TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken) + protected override async Task TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken) { if (!span.IsEmpty) return null; - var position = span.Start; + if (await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false) is not CompilationUnitSyntax compilationUnit) + return null; - var compilationUnit = (CompilationUnitSyntax)await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); + var position = span.Start; var namespaceDecls = compilationUnit.DescendantNodes(n => n is CompilationUnitSyntax or BaseNamespaceDeclarationSyntax) .OfType().ToImmutableArray(); diff --git a/src/Features/CSharp/Portable/Completion/KeywordRecommenders/AsyncKeywordRecommender.cs b/src/Features/CSharp/Portable/Completion/KeywordRecommenders/AsyncKeywordRecommender.cs index 352a3008eb108..f4f7c4fd92320 100644 --- a/src/Features/CSharp/Portable/Completion/KeywordRecommenders/AsyncKeywordRecommender.cs +++ b/src/Features/CSharp/Portable/Completion/KeywordRecommenders/AsyncKeywordRecommender.cs @@ -27,7 +27,8 @@ public AsyncKeywordRecommender() protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken) { - if (context.TargetToken.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword)) + if (context.TargetToken.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword) || + context.PrecedingModifiers.Contains(SyntaxKind.AsyncKeyword)) { return false; } diff --git a/src/Features/CSharp/Portable/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs b/src/Features/CSharp/Portable/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs index 37eda381c1831..852be55ded761 100644 --- a/src/Features/CSharp/Portable/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs @@ -39,9 +39,6 @@ public CSharpDisambiguateSameVariableCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(CS1717, CS1718); - internal override CodeFixCategory CodeFixCategory - => CodeFixCategory.Compile; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var document = context.Document; diff --git a/src/Features/CSharp/Portable/Formatting/CSharpFormattingInteractionService.cs b/src/Features/CSharp/Portable/Formatting/CSharpFormattingInteractionService.cs index 5f292e5ad6d07..1ca6189a71089 100644 --- a/src/Features/CSharp/Portable/Formatting/CSharpFormattingInteractionService.cs +++ b/src/Features/CSharp/Portable/Formatting/CSharpFormattingInteractionService.cs @@ -44,9 +44,9 @@ public CSharpFormattingInteractionService() public bool SupportsFormatSelection => true; public bool SupportsFormatOnReturn => false; - public bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptions options, char ch) + public bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptions options, FormattingOptions2.IndentStyle indentStyle, char ch) { - var smartIndentOn = options.IndentStyle == FormattingOptions.IndentStyle.Smart; + var smartIndentOn = indentStyle == FormattingOptions2.IndentStyle.Smart; // We consider the proper placement of a close curly or open curly when it is typed at // the start of the line to be a smart-indentation operation. As such, even if "format @@ -133,11 +133,13 @@ public async Task> GetFormattingChangesOnPasteAsync( return result.GetTextChanges(cancellationToken).ToImmutableArray(); } - private static IEnumerable GetFormattingRules(Document document, int position, SyntaxToken tokenBeforeCaret) + private static ImmutableArray GetFormattingRules(Document document, int position, SyntaxToken tokenBeforeCaret) { var workspace = document.Project.Solution.Workspace; var formattingRuleFactory = workspace.Services.GetRequiredService(); - return formattingRuleFactory.CreateRule(document, position).Concat(GetTypingRules(tokenBeforeCaret)).Concat(Formatter.GetDefaultFormattingRules(document)); + return ImmutableArray.Create(formattingRuleFactory.CreateRule(document, position)) + .AddRange(GetTypingRules(tokenBeforeCaret)) + .AddRange(Formatter.GetDefaultFormattingRules(document)); } Task> IFormattingInteractionService.GetFormattingChangesOnReturnAsync( @@ -294,22 +296,23 @@ private static async Task GetTokenBeforeTheCaretAsync(Document docu return token; } - private static async Task> FormatTokenAsync(Document document, IndentationOptions options, SyntaxToken token, IEnumerable formattingRules, CancellationToken cancellationToken) + private static async Task> FormatTokenAsync( + Document document, IndentationOptions options, SyntaxToken token, ImmutableArray formattingRules, CancellationToken cancellationToken) { var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); var formatter = CreateSmartTokenFormatter(options, formattingRules, root); - var changes = await formatter.FormatTokenAsync(document.Project.Solution.Workspace.Services, token, cancellationToken).ConfigureAwait(false); + var changes = await formatter.FormatTokenAsync(token, cancellationToken).ConfigureAwait(false); return changes; } - private static ISmartTokenFormatter CreateSmartTokenFormatter(IndentationOptions options, IEnumerable formattingRules, SyntaxNode root) + private static ISmartTokenFormatter CreateSmartTokenFormatter(IndentationOptions options, ImmutableArray formattingRules, SyntaxNode root) => new CSharpSmartTokenFormatter(options, formattingRules, (CompilationUnitSyntax)root); private static async Task> FormatRangeAsync( Document document, IndentationOptions options, SyntaxToken endToken, - IEnumerable formattingRules, + ImmutableArray formattingRules, CancellationToken cancellationToken) { if (!IsEndToken(endToken)) @@ -332,7 +335,7 @@ private static async Task> FormatRangeAsync( var formatter = new CSharpSmartTokenFormatter(options, formattingRules, (CompilationUnitSyntax)root); - var changes = formatter.FormatRange(document.Project.Solution.Workspace.Services, tokenRange.Value.Item1, tokenRange.Value.Item2, cancellationToken); + var changes = formatter.FormatRange(tokenRange.Value.Item1, tokenRange.Value.Item2, cancellationToken); return changes.ToImmutableArray(); } diff --git a/src/Features/CSharp/Portable/Highlighting/KeywordHighlighters/AsyncAwaitHighlighter.cs b/src/Features/CSharp/Portable/Highlighting/KeywordHighlighters/AsyncAwaitHighlighter.cs index 0ab3840d6ee87..ceeda438aa24a 100644 --- a/src/Features/CSharp/Portable/Highlighting/KeywordHighlighters/AsyncAwaitHighlighter.cs +++ b/src/Features/CSharp/Portable/Highlighting/KeywordHighlighters/AsyncAwaitHighlighter.cs @@ -31,7 +31,7 @@ public AsyncAwaitHighlighter() } protected override bool IsHighlightableNode(SyntaxNode node) - => node.IsReturnableConstruct(); + => node.IsReturnableConstructOrTopLevelCompilationUnit(); protected override void AddHighlightsForNode(SyntaxNode node, List highlights, CancellationToken cancellationToken) { diff --git a/src/Features/CSharp/Portable/Highlighting/KeywordHighlighters/ReturnStatementHighlighter.cs b/src/Features/CSharp/Portable/Highlighting/KeywordHighlighters/ReturnStatementHighlighter.cs index 53f181f0c3a32..343aebba09a6f 100644 --- a/src/Features/CSharp/Portable/Highlighting/KeywordHighlighters/ReturnStatementHighlighter.cs +++ b/src/Features/CSharp/Portable/Highlighting/KeywordHighlighters/ReturnStatementHighlighter.cs @@ -32,7 +32,7 @@ protected override void AddHighlights( { var parent = returnStatement .GetAncestorsOrThis() - .FirstOrDefault(n => n.IsReturnableConstruct()); + .FirstOrDefault(n => n.IsReturnableConstructOrTopLevelCompilationUnit()); if (parent == null) { diff --git a/src/Features/CSharp/Portable/ImplementInterface/AbstractChangeImplementionCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/ImplementInterface/AbstractChangeImplementionCodeRefactoringProvider.cs index b26fefffa18c3..8ec4133700b49 100644 --- a/src/Features/CSharp/Portable/ImplementInterface/AbstractChangeImplementionCodeRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/ImplementInterface/AbstractChangeImplementionCodeRefactoringProvider.cs @@ -114,7 +114,7 @@ public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContex c => ChangeImplementationAsync(project, implementedMembersFromAllInterfaces, c))); } - context.RegisterRefactoring(new CodeAction.CodeActionWithNestedActions( + context.RegisterRefactoring(CodeAction.CodeActionWithNestedActions.Create( Implement, nestedActions.ToImmutableAndFree(), isInlinable: true)); } diff --git a/src/Features/CSharp/Portable/MakeLocalFunctionStatic/MakeLocalFunctionStaticCodeFixProvider.cs b/src/Features/CSharp/Portable/MakeLocalFunctionStatic/MakeLocalFunctionStaticCodeFixProvider.cs index 3e058351eef3c..d987d0c642bb4 100644 --- a/src/Features/CSharp/Portable/MakeLocalFunctionStatic/MakeLocalFunctionStaticCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/MakeLocalFunctionStatic/MakeLocalFunctionStaticCodeFixProvider.cs @@ -30,8 +30,6 @@ public MakeLocalFunctionStaticCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.MakeLocalFunctionStaticDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeQuality; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Features/CSharp/Portable/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProvider.cs b/src/Features/CSharp/Portable/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProvider.cs index e82692de0fcc7..6ab2eb858e8c9 100644 --- a/src/Features/CSharp/Portable/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProvider.cs @@ -30,8 +30,6 @@ public PassInCapturedVariablesAsArgumentsCodeFixProvider() // "CS8421: A static local function can't contain a reference to ." public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create("CS8421"); - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { var diagnostic = context.Diagnostics.First(); diff --git a/src/Features/CSharp/Portable/RemoveUnusedLocalFunction/CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs b/src/Features/CSharp/Portable/RemoveUnusedLocalFunction/CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs index e36b3845a235a..815fb2eba8d64 100644 --- a/src/Features/CSharp/Portable/RemoveUnusedLocalFunction/CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/RemoveUnusedLocalFunction/CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs @@ -36,8 +36,6 @@ public CSharpRemoveUnusedLocalFunctionCodeFixProvider() public sealed override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(CS8321); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeQuality; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix( diff --git a/src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs b/src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs index 19dbb99b310eb..501ca38ca08b1 100644 --- a/src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs @@ -41,8 +41,6 @@ public CSharpUseLocalFunctionCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.UseLocalFunctionDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) => !diagnostic.IsSuppressed; diff --git a/src/Features/CSharp/Portable/UsePatternMatching/CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs b/src/Features/CSharp/Portable/UsePatternMatching/CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs index 77045f1fd4069..a1364f058ddfd 100644 --- a/src/Features/CSharp/Portable/UsePatternMatching/CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/UsePatternMatching/CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs @@ -35,8 +35,6 @@ public CSharpIsAndCastCheckWithoutNameCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.InlineIsTypeWithoutNameCheckDiagnosticsId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { context.RegisterCodeFix( diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf index 85c8bbbd044d4..0ea840ad2fded 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - Použít předvolby kvalifikace this. - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Použít upřednostňované předvolby umístění using - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ Výběr nemůže obsahovat příkazy nejvyšší úrovně. - - Simplify lambda expression - Zjednodušit výraz lambda - - - - Simplify all occurrences - Zjednodušit všechny výskyty - - Unseal class '{0}' Rozpečetit třídu {0} @@ -287,11 +262,6 @@ Použít rekurzivní vzory - - Warning: Expression may have side effects. Code meaning may change. - Upozornění: Výraz může mít vedlejší účinky. Význam kódu se může změnit. - - Warning: Inlining temporary into conditional method call. Upozornění: dočasné vkládání do volání podmíněné metody. @@ -342,16 +312,6 @@ Automatický výběr je zakázaný kvůli možnému vytvoření explicitně pojmenovaného člena anonymního typu. - - <element name> : - <název prvku>: - - - - Autoselect disabled due to possible tuple type element creation. - Automatický výběr je zakázaný kvůli možnému vytvoření elementu typu řazená kolekce členů. - - <pattern variable> <proměnná vzoru> @@ -382,11 +342,6 @@ Odebrat kvalifikaci this - - Name can be simplified - Název může být zjednodušený. - - Can't determine valid range of statements to extract Nemůže určit platný rozsah příkazů k extrakci. @@ -402,11 +357,6 @@ Výběr neobsahuje platný uzel. - - Invalid selection. - Neplatný výběr - - Contains invalid selection. Obsahuje neplatný výběr. @@ -477,11 +427,6 @@ Uspořádat direktivy using - - Insert 'await'. - Vložit operátor Await - - Make {0} return Task instead of void. Nastavit, že {0} má místo hodnoty typu Void vracet hodnotu Task @@ -727,11 +672,6 @@ cíl atributu - - '{0}' does not contain a constructor that takes that many arguments. - {0} neobsahuje konstruktor, který přebírá tolik argumentů. - - The name '{0}' does not exist in the current context. Název {0} v aktuálním kontextu neexistuje. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf index c12082919f2b8..27b31785f30c7 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - Einstellungen zur Qualifikation "this." anwenden - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Bevorzugte using-Platzierungseinstellungen anwenden - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ Die Auswahl darf keine Anweisungen der obersten Ebene enthalten. - - Simplify lambda expression - Lambdaausdruck vereinfachen - - - - Simplify all occurrences - Alle Vorkommen vereinfachen - - Unseal class '{0}' Versiegelung der Klasse "{0}" aufheben @@ -287,11 +262,6 @@ Verwenden rekursiver Muster - - Warning: Expression may have side effects. Code meaning may change. - Warnung: Der Ausdruck kann Nebeneffekte haben. Die Bedeutung des Codes kann sich ändern. - - Warning: Inlining temporary into conditional method call. Warnung: temporäres Inlining in bedingtem Methodenaufruf. @@ -342,16 +312,6 @@ Automatische Auswahl aufgrund der möglichen Erstellung eines explizit genannten anonymen Typmembers deaktiviert. - - <element name> : - <Elementname> : - - - - Autoselect disabled due to possible tuple type element creation. - Die automatische Auswahl wurde aufgrund einer möglichen Tupeltyp-Elementerstellung deaktiviert. - - <pattern variable> <Mustervariable> @@ -382,11 +342,6 @@ Qualifikation 'this' entfernen - - Name can be simplified - Der Name kann vereinfacht werden - - Can't determine valid range of statements to extract Ein gültiger Bereich der zu extrahierenden Anweisungen kann nicht ermittelt werden. @@ -402,11 +357,6 @@ Auswahl enthält keinen gültigen Knoten. - - Invalid selection. - Ungültige Auswahl. - - Contains invalid selection. Enthält eine ungültige Auswahl. @@ -477,11 +427,6 @@ Using-Direktiven organisieren - - Insert 'await'. - "await" einfügen. - - Make {0} return Task instead of void. "{0}" in Rückgabeaufgabe umwandeln, statt leer zu lassen. @@ -727,11 +672,6 @@ Attributziel - - '{0}' does not contain a constructor that takes that many arguments. - "{0}" enthält keinen Konstruktor, der viele Argumente verwendet. - - The name '{0}' does not exist in the current context. Der Name "{0}" ist im aktuellen Kontext nicht vorhanden. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf index 80ab9c22659f4..a667b4420e930 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - Aplicar preferencias de calificación “this.” - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Aplicar preferencias de selección de ubicación de "using" - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ La selección no puede incluir instrucciones de nivel superior - - Simplify lambda expression - Simplificar expresión lambda - - - - Simplify all occurrences - Simplificar todas las repeticiones - - Unseal class '{0}' Quitar el sello de la clase "{0}" @@ -287,11 +262,6 @@ Usar patrones recursivos - - Warning: Expression may have side effects. Code meaning may change. - Advertencia: la expresión puede tener efectos secundarios. El significado del código puede cambiar. - - Warning: Inlining temporary into conditional method call. Advertencia: Inserción de una llamada temporal en otra de método condicional. @@ -342,16 +312,6 @@ La selección automática se ha deshabilitado debido a la creación de un miembro de tipo anónimo nombrado explícitamente. - - <element name> : - <nombre de elemento> : - - - - Autoselect disabled due to possible tuple type element creation. - La selección automática se deshabilitó debido a la posible creación de elementos de tipo de tupla. - - <pattern variable> <variable de patrón> @@ -382,11 +342,6 @@ Quitar calificación 'this' - - Name can be simplified - El nombre se puede simplificar - - Can't determine valid range of statements to extract No se puede determinar el intervalo válido de instrucciones para extraer. @@ -402,11 +357,6 @@ La selección no contiene un nodo válido - - Invalid selection. - Selección no válida. - - Contains invalid selection. Contiene una selección no válida. @@ -477,11 +427,6 @@ Organizar instrucciones Using - - Insert 'await'. - Insertar 'await'. - - Make {0} return Task instead of void. Hacer que {0} devuelva Tarea en lugar de void. @@ -727,11 +672,6 @@ destino de atributo - - '{0}' does not contain a constructor that takes that many arguments. - '{0}' no contiene un constructor que tome tantos argumentos. - - The name '{0}' does not exist in the current context. El nombre '{0}' no existe en el contexto actual. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf index 01e211a5331a2..0638bc1055007 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - Appliquer les préférences de qualification 'this.' - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Appliquer les préférences de placement de 'using' par défaut - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ La sélection ne peut pas inclure d'instructions de niveau supérieur - - Simplify lambda expression - Simplifier l'expression lambda - - - - Simplify all occurrences - Simplifier toutes les occurrences - - Unseal class '{0}' Classe unsealed '{0}' @@ -287,11 +262,6 @@ Utiliser des modèles récursifs - - Warning: Expression may have side effects. Code meaning may change. - Avertissement : L'expression peut avoir des effets secondaires. La signification du code peut changer. - - Warning: Inlining temporary into conditional method call. Avertissement : Inlining temporaire dans un appel de méthode conditionnel. @@ -342,16 +312,6 @@ Sélection automatique désactivée en raison de la création éventuelle d'un membre de type anonyme nommé explicitement. - - <element name> : - <nom d'élément> : - - - - Autoselect disabled due to possible tuple type element creation. - Sélection automatique désactivée en raison de la création possible d'un élément de type tuple. - - <pattern variable> <variable de modèle> @@ -382,11 +342,6 @@ Supprimer la qualification 'this' - - Name can be simplified - Le nom peut être simplifié - - Can't determine valid range of statements to extract Impossible de déterminer la plage valide d'instructions à extraire @@ -402,11 +357,6 @@ La sélection ne contient pas un nœud valide - - Invalid selection. - Sélection incorrecte. - - Contains invalid selection. Contient une sélection incorrecte. @@ -477,11 +427,6 @@ Organiser les instructions Using - - Insert 'await'. - Insérez 'await'. - - Make {0} return Task instead of void. {0} doit retourner Task au lieu de void. @@ -727,11 +672,6 @@ cible d'attribut - - '{0}' does not contain a constructor that takes that many arguments. - '{0}' ne contient pas de constructeur prenant en charge autant d'arguments. - - The name '{0}' does not exist in the current context. Le nom '{0}' n'existe pas dans le contexte actuel. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf index b9c2e6a6c5a2b..89c6738fce05a 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - Applica le preferenze relative alla qualificazione 'this.' - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Applica le preferenze di posizionamento per 'using' - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ La selezione non può includere istruzioni di primo livello - - Simplify lambda expression - Semplifica l'espressione lambda - - - - Simplify all occurrences - Semplifica tutte le occorrenze - - Unseal class '{0}' Rimuovi seal dalla classe '{0}' @@ -287,11 +262,6 @@ Usa criteri ricorsivi - - Warning: Expression may have side effects. Code meaning may change. - Avviso: l'espressione può avere effetti collaterali. Il significato del codice può cambiare. - - Warning: Inlining temporary into conditional method call. Avviso: incorporamento dell'elemento temporaneo nella chiamata a un metodo condizionale. @@ -342,16 +312,6 @@ La selezione automatica è disabilitata a causa della creazione di possibili membri di tipo anonimo denominati in modo esplicito. - - <element name> : - <nome elemento>: - - - - Autoselect disabled due to possible tuple type element creation. - La selezione automatica è disabilitata a causa della potenziale creazione di elementi di tipo tupla. - - <pattern variable> <variabile di criterio> @@ -382,11 +342,6 @@ Rimuove la qualificazione 'this' - - Name can be simplified - Il nome può essere semplificato - - Can't determine valid range of statements to extract Non è possibile determinare l'intervallo valido di istruzioni da estrarre @@ -402,11 +357,6 @@ La selezione non contiene un nodo valido - - Invalid selection. - Selezione non valida. - - Contains invalid selection. Contiene una selezione non valida. @@ -477,11 +427,6 @@ Organizza using - - Insert 'await'. - Inserire 'await'. - - Make {0} return Task instead of void. Fa in modo che {0} restituisca Task invece di void. @@ -727,11 +672,6 @@ destinazione dell'attributo - - '{0}' does not contain a constructor that takes that many arguments. - '{0}' non contiene un costruttore che accetta un tale numero di argomenti. - - The name '{0}' does not exist in the current context. Il nome '{0}' non esiste nel contesto corrente. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf index 1f9b8b637eaff..a1e0d8b0af932 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - 'this.' 修飾の基本設定を適用します - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - 優先する 'using' 配置設定を適用する - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ 選択に最上位レベルのステートメントを含めることはできません - - Simplify lambda expression - ラムダ式の簡略化 - - - - Simplify all occurrences - すべての出現箇所を簡素化します - - Unseal class '{0}' クラス '{0}' のシールを解除 @@ -287,11 +262,6 @@ 再帰パターンを使用する - - Warning: Expression may have side effects. Code meaning may change. - 警告: 式に副作用がある可能性があります。コードの意味が変更される可能性があります。 - - Warning: Inlining temporary into conditional method call. 警告: 一時メソッド呼び出しを条件付きメソッド呼び出しにインライン展開しています。 @@ -342,16 +312,6 @@ 明示的に指定された匿名型メンバーの作成である可能性があるため、自動選択は無効になっています。 - - <element name> : - <要素名> : - - - - Autoselect disabled due to possible tuple type element creation. - タプル型の要素が作成された可能性があるため、自動選択は無効になっています。 - - <pattern variable> <pattern variable> @@ -382,11 +342,6 @@ this' 修飾子を削除します - - Name can be simplified - 名前を簡素化できます - - Can't determine valid range of statements to extract 抽出するステートメントの有効な範囲を決定できません @@ -402,11 +357,6 @@ 選択には有効なノードは含まれません - - Invalid selection. - 選択が無効です。 - - Contains invalid selection. 無効な選択が含まれています。 @@ -477,11 +427,6 @@ using の整理 - - Insert 'await'. - await' を挿入します。 - - Make {0} return Task instead of void. {0} が void ではなくタスクを返すようにします。 @@ -727,11 +672,6 @@ 属性ターゲット - - '{0}' does not contain a constructor that takes that many arguments. - '{0}' には、多数の引数を指定できるコンストラクターがありません。 - - The name '{0}' does not exist in the current context. 名前 '{0}' は、現在のコンテキストに存在しません。 diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf index 1de66d4ea5304..443fefb5618b9 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - 'this.' 한정자 기본 설정 적용 - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - 기본 'using' 배치 기본 설정 적용 - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ 선택 영역에는 최상위 문을 포함할 수 없습니다. - - Simplify lambda expression - 람다 식 단순화 - - - - Simplify all occurrences - 모든 항목 단순화 - - Unseal class '{0}' '{0}' 클래스 봉인 해제 @@ -287,11 +262,6 @@ 재귀 패턴 사용 - - Warning: Expression may have side effects. Code meaning may change. - 경고: 식에 부작용이 있을 수 있습니다. 코드 의미가 변경될 수 있습니다. - - Warning: Inlining temporary into conditional method call. 경고: 임시 작업을 조건부 메서드 호출로 인라인 처리합니다. @@ -342,16 +312,6 @@ 명시적으로 이름이 지정된 익명 형식 멤버가 만들어질 수 있어 자동 선택을 사용하지 않도록 설정했습니다. - - <element name> : - <요소 이름>: - - - - Autoselect disabled due to possible tuple type element creation. - 가능한 튜플 형식 요소 만들기로 인해 자동 선택을 사용할 수 없습니다. - - <pattern variable> <pattern variable> @@ -382,11 +342,6 @@ this' 한정자 제거 - - Name can be simplified - 이름을 단순화할 수 있습니다. - - Can't determine valid range of statements to extract 추출할 문의 유효한 범위를 결정할 수 없습니다. @@ -402,11 +357,6 @@ 선택 항목에 유효한 노드가 포함되어 있지 않습니다. - - Invalid selection. - 잘못된 선택 항목입니다. - - Contains invalid selection. 잘못된 선택 항목을 포함합니다. @@ -477,11 +427,6 @@ Using 구성 - - Insert 'await'. - Await'를 삽입합니다. - - Make {0} return Task instead of void. {0}에서 void 대신 Task를 반환하도록 설정합니다. @@ -727,11 +672,6 @@ 특성 대상 - - '{0}' does not contain a constructor that takes that many arguments. - '{0}'에 해당 개수의 인수를 사용하는 생성자가 없습니다. - - The name '{0}' does not exist in the current context. 이름 '{0}'이(가) 현재 컨텍스트에 없습니다. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf index fa44f615f1c3b..4993fb6e3ed79 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - Zastosuj preferencje kwalifikacji „this.” - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Zastosuj preferowane preferencje umieszczania elementu „using” - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ Zaznaczenie nie może zawierać instrukcji najwyższego poziomu - - Simplify lambda expression - Uprość wyrażenie lambda - - - - Simplify all occurrences - Uprość wszystkie wystąpienia - - Unseal class '{0}' Odpieczętuj klasę „{0}” @@ -287,11 +262,6 @@ Używanie wzorców rekursywnych - - Warning: Expression may have side effects. Code meaning may change. - Ostrzeżenie: wyrażenie może mieć efekty uboczne. Znaczenie kodu może ulec zmianie. - - Warning: Inlining temporary into conditional method call. Ostrzeżenie: tymczasowe wbudowywanie do wywołania metody warunkowej. @@ -342,16 +312,6 @@ Automatyczne zaznaczanie zostało wyłączone z powodu możliwego utworzenia jawnie nazwanej anonimowej składowej typu. - - <element name> : - <nazwa elementu>: - - - - Autoselect disabled due to possible tuple type element creation. - Funkcja automatycznego wyboru została wyłączona ze względu na prawdopodobne utworzenie elementu typu krotki. - - <pattern variable> <zmienna wzorca> @@ -382,11 +342,6 @@ Usuń kwalifikację „this” - - Name can be simplified - Nazwę można uprościć - - Can't determine valid range of statements to extract Nie można określić prawidłowego zakresu instrukcji do wyodrębnienia @@ -402,11 +357,6 @@ Zaznaczenie nie zawiera prawidłowego węzła - - Invalid selection. - Nieprawidłowe zaznaczenie. - - Contains invalid selection. Zawiera nieprawidłowe zaznaczenie. @@ -477,11 +427,6 @@ Organizuj użycia - - Insert 'await'. - Wstaw element „await”. - - Make {0} return Task instead of void. Ustaw element {0}, aby zwracał zadanie zamiast elementu void. @@ -727,11 +672,6 @@ cel atrybutu - - '{0}' does not contain a constructor that takes that many arguments. - 'Element „{0}” nie zawiera konstruktora, który przyjmuje wiele argumentów. - - The name '{0}' does not exist in the current context. Nazwa „{0}” nie istnieje w bieżącym kontekście. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf index 7007a8aa54150..7185bd6671b77 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - Aplicar as preferências de qualificação 'this.' - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Aplicar preferências de posicionamento preferencial 'using' - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ A seleção não pode incluir instruções de nível superior - - Simplify lambda expression - Simplificar expressão lambda - - - - Simplify all occurrences - Simplificar todas as ocorrências - - Unseal class '{0}' Desselar a classe '{0}' @@ -287,11 +262,6 @@ Usar padrões recursivos - - Warning: Expression may have side effects. Code meaning may change. - Aviso: A expressão pode ter efeitos colaterais. O significado do código pode alterar. - - Warning: Inlining temporary into conditional method call. Aviso: embutindo a chamada de método temporária na condicional. @@ -342,16 +312,6 @@ Seleção automática desabilitada devido à possível criação de membros do tipo anônimo nomeados explicitamente. - - <element name> : - <nome do elemento> : - - - - Autoselect disabled due to possible tuple type element creation. - Seleção automática desabilitada devido a uma possível criação de elemento do tipo tupla. - - <pattern variable> <variável de padrão> @@ -382,11 +342,6 @@ Remover qualificação ''this'' - - Name can be simplified - O nome pode ser simplificado - - Can't determine valid range of statements to extract Não é possível determinar o intervalo válido de instruções para extrair @@ -402,11 +357,6 @@ A seleção não contém um nó válido - - Invalid selection. - Seleção inválida. - - Contains invalid selection. Contém uma seleção inválida. @@ -477,11 +427,6 @@ Organizar Usos - - Insert 'await'. - Inserir "aguardar". - - Make {0} return Task instead of void. Fazer com que {0} retorne Tarefa em vez de nulo. @@ -727,11 +672,6 @@ destino do atributo - - '{0}' does not contain a constructor that takes that many arguments. - '{0}' não tem um construtor que aceite que muitos argumentos. - - The name '{0}' does not exist in the current context. O nome '{0}' não existe no contexto atual. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf index b2a6c537e66e3..7e4800916a2e4 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - Применять предпочтения для квалификации this. - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Применить предпочтительные параметры размещения "using" - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ Выбор не может включать операторы верхнего уровня - - Simplify lambda expression - Упростить лямбда-выражение - - - - Simplify all occurrences - Упростить все вхождения - - Unseal class '{0}' Распечатать класс "{0}" @@ -287,11 +262,6 @@ Использовать рекурсивные шаблоны - - Warning: Expression may have side effects. Code meaning may change. - Внимание! Выражение может иметь побочные эффекты. Значение кода может измениться. - - Warning: Inlining temporary into conditional method call. Предупреждение: встраивание временных элементов в условный вызов метода. @@ -342,16 +312,6 @@ Автовыбор отключен из-за возможного создания явно названного участника анонимного типа. - - <element name> : - <имя элемента>: - - - - Autoselect disabled due to possible tuple type element creation. - Автовыбор отключен из-за возможного создания элемента типа кортежа. - - <pattern variable> <переменная шаблона> @@ -382,11 +342,6 @@ Удаление квалификации this - - Name can be simplified - Имя может быть упрощено - - Can't determine valid range of statements to extract Невозможно определить допустимый диапазон операторов для извлечения @@ -402,11 +357,6 @@ Выделение не содержит допустимый узел - - Invalid selection. - Недопустимое выделение. - - Contains invalid selection. Содержит недопустимое выделение. @@ -477,11 +427,6 @@ Упорядочение Using - - Insert 'await'. - Вставьте "await". - - Make {0} return Task instead of void. Сделать {0} задачей возврата вместо void. @@ -727,11 +672,6 @@ назначение атрибута - - '{0}' does not contain a constructor that takes that many arguments. - "{0}" не содержит конструктор, который принимает такое количество аргументов. - - The name '{0}' does not exist in the current context. Имя "{0}" не существует в текущем контексте. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf index 0c473c063dddf..2ac691e051b42 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - 'this.' nitelemesi tercihlerini uygula - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - Tercih edilen 'using' yerleştirme tercihlerini uygulayın - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ Seçim en üst düzey deyimleri içeremez - - Simplify lambda expression - Lambda ifadesini basitleştir - - - - Simplify all occurrences - Tüm yinelemeleri basitleştir - - Unseal class '{0}' '{0}' sınıfının mührünü aç @@ -287,11 +262,6 @@ Özyinelemeli desenler kullan - - Warning: Expression may have side effects. Code meaning may change. - Uyarı: İfadenin yan etkileri olabilir. Kod anlamı değişebilir. - - Warning: Inlining temporary into conditional method call. Uyarı: Koşullu yöntem çağrısında geçici öğe satır içinde kullanılıyor. @@ -342,16 +312,6 @@ Otomatik seçim, olası açık adlı anonim tür üyesi oluşturma nedeniyle devre dışı bırakıldı. - - <element name> : - <öğe adı>: - - - - Autoselect disabled due to possible tuple type element creation. - Olası demet türü öğe oluşturma işleminden dolayı Otomatik seçim devre dışı bırakıldı. - - <pattern variable> <desen değişkeni> @@ -382,11 +342,6 @@ this' nitelemesini kaldır - - Name can be simplified - Ad basitleştirilebilir - - Can't determine valid range of statements to extract Ayıklanacak deyimlerin geçerli aralığı belirlenemiyor @@ -402,11 +357,6 @@ Seçim, geçerli bir düğüm içermiyor - - Invalid selection. - Geçersiz seçim. - - Contains invalid selection. Geçersiz seçimi içerir. @@ -477,11 +427,6 @@ Kullanımları Düzenle - - Insert 'await'. - await' ekle. - - Make {0} return Task instead of void. {0} öğesi boşluk yerine Görev döndürsün. @@ -727,11 +672,6 @@ öznitelik hedefi - - '{0}' does not contain a constructor that takes that many arguments. - '{0}' bu kadar çok sayıda bağımsız değişken alan bir oluşturucu içermiyor. - - The name '{0}' does not exist in the current context. '{0}' adı geçerli bağlamda yok. diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf index 6c100501b63c1..55326efe8ee60 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - 应用 “this.” 资格首选项 - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - 应用首选的 "using" 放置首选项 - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ 所选内容不能包含顶级语句 - - Simplify lambda expression - 简化 lambda 表达式 - - - - Simplify all occurrences - 简化所有事件 - - Unseal class '{0}' Unseal 类 "{0}" @@ -287,11 +262,6 @@ 使用递归模式 - - Warning: Expression may have side effects. Code meaning may change. - 警告: 表达式可能有副作用。代码含义可能更改。 - - Warning: Inlining temporary into conditional method call. 警告: 即将在条件方法调用中内联临时内容。 @@ -342,16 +312,6 @@ 由于可能导致创建显式命名的匿名类型成员,自动选择已禁用。 - - <element name> : - <元素名称>: - - - - Autoselect disabled due to possible tuple type element creation. - 由于可能的元组类型元素创建,已禁用自动选择。 - - <pattern variable> <模式变量> @@ -382,11 +342,6 @@ 删除 "this" 资格 - - Name can be simplified - 可简化名称 - - Can't determine valid range of statements to extract 无法确定要提取的语句的有效范围 @@ -402,11 +357,6 @@ 所选内容不包含有效节点 - - Invalid selection. - 无效的选择。 - - Contains invalid selection. 包含无效的选择。 @@ -477,11 +427,6 @@ 组织 Using - - Insert 'await'. - 插入“await”。 - - Make {0} return Task instead of void. 使 {0} 返回 Task,而不是 void。 @@ -727,11 +672,6 @@ 属性目标 - - '{0}' does not contain a constructor that takes that many arguments. - “{0}”不包含采用许多参数的构造函数。 - - The name '{0}' does not exist in the current context. 当前上下文中不存在名称“{0}”。 diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf index f496739b07296..bf0550849a1ab 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf @@ -87,11 +87,6 @@ Apply new() preferences - - Apply object collection initialization preferences - Apply object collection initialization preferences - - Apply parameter null preferences Apply parameter null preferences @@ -112,21 +107,11 @@ Apply static local function preferences - - Apply 'this.' qualification preferences - 套用 'this.' 資格喜好設定 - - Apply throw expression preferences Apply throw expression preferences - - Apply preferred 'using' placement preferences - 套用慣用的 'using' 放置喜好設定 - 'using' is a C# keyword and should not be localized - Apply using statement preferences Apply using statement preferences @@ -267,16 +252,6 @@ 選取範圍不能包含最上層陳述式 - - Simplify lambda expression - 簡化 Lambda 運算式 - - - - Simplify all occurrences - 簡化所有項目 - - Unseal class '{0}' 為類別 '{0}' 解密 @@ -287,11 +262,6 @@ 使用遞迴模式 - - Warning: Expression may have side effects. Code meaning may change. - 警告: 運算式可能有副作用。代碼意義可能變更。 - - Warning: Inlining temporary into conditional method call. 警告: 內嵌臨時加入條件式方法呼叫。 @@ -342,16 +312,6 @@ 由於可能會建立明確命名的匿名類型成員,所以停用自動選取。 - - <element name> : - <元素名稱>: - - - - Autoselect disabled due to possible tuple type element creation. - 因為可能建立元組類型元素,所以停用自動選擇。 - - <pattern variable> <樣式變數> @@ -382,11 +342,6 @@ 移除 'this' 限定性條件 - - Name can be simplified - 可以簡化名稱 - - Can't determine valid range of statements to extract 無法判斷要擷取的有效陳述式範圍 @@ -402,11 +357,6 @@ 選取範圍沒有包含有效的節點 - - Invalid selection. - 無效的選取範圍。 - - Contains invalid selection. 包含無效的選取範圍。 @@ -477,11 +427,6 @@ 組合管理 Using - - Insert 'await'. - 插入 'await'。 - - Make {0} return Task instead of void. 使 {0} 傳回 Task 而不是 void。 @@ -727,11 +672,6 @@ 屬性目標 - - '{0}' does not contain a constructor that takes that many arguments. - '{0}' 不包含接受許多引數的建構函式。 - - The name '{0}' does not exist in the current context. 目前內容中沒有名稱 '{0}'。 diff --git a/src/Features/Core/Portable/AddAnonymousTypeMemberName/AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs b/src/Features/Core/Portable/AddAnonymousTypeMemberName/AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs index 74461187ac38f..3e521d5bc1001 100644 --- a/src/Features/Core/Portable/AddAnonymousTypeMemberName/AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs +++ b/src/Features/Core/Portable/AddAnonymousTypeMemberName/AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs @@ -34,8 +34,6 @@ protected AbstractAddAnonymousTypeMemberNameCodeFixProvider() protected abstract TAnonymousObjectMemberDeclaratorSyntax WithName(TAnonymousObjectMemberDeclaratorSyntax declarator, SyntaxToken name); protected abstract IEnumerable GetAnonymousObjectMemberNames(TAnonymousObjectInitializer initializer); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var document = context.Document; diff --git a/src/Features/Core/Portable/AddConstructorParametersFromMembers/AddConstructorParametersFromMembersCodeRefactoringProvider.cs b/src/Features/Core/Portable/AddConstructorParametersFromMembers/AddConstructorParametersFromMembersCodeRefactoringProvider.cs index 2490539d53a7e..c31f1a999bcb1 100644 --- a/src/Features/Core/Portable/AddConstructorParametersFromMembers/AddConstructorParametersFromMembersCodeRefactoringProvider.cs +++ b/src/Features/Core/Portable/AddConstructorParametersFromMembers/AddConstructorParametersFromMembersCodeRefactoringProvider.cs @@ -83,13 +83,13 @@ private static ImmutableArray GetGroupedActions(AddConstructorParame { if (!result.RequiredParameterActions.IsDefaultOrEmpty) { - actions.Add(new CodeAction.CodeActionWithNestedActions( + actions.Add(CodeAction.CodeActionWithNestedActions.Create( FeaturesResources.Add_parameter_to_constructor, result.RequiredParameterActions.Cast(), isInlinable: false)); } - actions.Add(new CodeAction.CodeActionWithNestedActions( + actions.Add(CodeAction.CodeActionWithNestedActions.Create( FeaturesResources.Add_optional_parameter_to_constructor, result.OptionalParameterActions.Cast(), isInlinable: false)); diff --git a/src/Features/Core/Portable/AddImport/CodeActions/InstallPackageAndAddImportCodeAction.cs b/src/Features/Core/Portable/AddImport/CodeActions/InstallPackageAndAddImportCodeAction.cs index 91c28ecc3ad37..bccad2bf2e91a 100644 --- a/src/Features/Core/Portable/AddImport/CodeActions/InstallPackageAndAddImportCodeAction.cs +++ b/src/Features/Core/Portable/AddImport/CodeActions/InstallPackageAndAddImportCodeAction.cs @@ -50,7 +50,7 @@ protected override async Task> ComputePreviewOp { // Make a SolutionChangeAction. This way we can let it generate the diff // preview appropriately. - var solutionChangeAction = new SolutionChangeAction("", c => GetUpdatedSolutionAsync(c), ""); + var solutionChangeAction = SolutionChangeAction.Create("", c => GetUpdatedSolutionAsync(c), ""); using var _ = ArrayBuilder.GetInstance(out var result); result.AddRange(await solutionChangeAction.GetPreviewOperationsAsync(cancellationToken).ConfigureAwait(false)); diff --git a/src/Features/Core/Portable/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs b/src/Features/Core/Portable/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs index 3d8a78d4c50c4..f45e4a8a97f2b 100644 --- a/src/Features/Core/Portable/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs +++ b/src/Features/Core/Portable/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs @@ -30,8 +30,6 @@ protected AbstractAddObsoleteAttributeCodeFixProvider( _title = title; } - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var cancellationToken = context.CancellationToken; diff --git a/src/Features/Core/Portable/AddParameter/AbstractAddParameterCodeFixProvider.cs b/src/Features/Core/Portable/AddParameter/AbstractAddParameterCodeFixProvider.cs index 7cd5fb2b89dfe..f1cb798cc20ef 100644 --- a/src/Features/Core/Portable/AddParameter/AbstractAddParameterCodeFixProvider.cs +++ b/src/Features/Core/Portable/AddParameter/AbstractAddParameterCodeFixProvider.cs @@ -257,7 +257,7 @@ ImmutableArray NestByOverload() var titleForNesting = GetCodeFixTitle(FeaturesResources.Add_parameter_to_0, data.Method, includeParameters: true); var titleCascading = GetCodeFixTitle(FeaturesResources.Add_parameter_to_0_and_overrides_implementations, data.Method, includeParameters: true); - codeAction = new CodeAction.CodeActionWithNestedActions( + codeAction = CodeAction.CodeActionWithNestedActions.Create( title: titleForNesting, ImmutableArray.Create( codeAction, @@ -297,14 +297,14 @@ ImmutableArray NestByCascading() // Create a sub-menu entry with all the non-cascading CodeActions. // We make sure the IDE does not inline. Otherwise the context menu gets flooded with our fixes. - builder.Add(new CodeAction.CodeActionWithNestedActions(nestedNonCascadingTitle, nonCascadingActions, isInlinable: false)); + builder.Add(CodeAction.CodeActionWithNestedActions.Create(nestedNonCascadingTitle, nonCascadingActions, isInlinable: false)); if (cascadingActions.Length > 0) { // if there are cascading CodeActions create a second sub-menu. var nestedCascadingTitle = GetCodeFixTitle(FeaturesResources.Add_parameter_to_0_and_overrides_implementations, aMethod, includeParameters: false); - builder.Add(new CodeAction.CodeActionWithNestedActions(nestedCascadingTitle, cascadingActions, isInlinable: false)); + builder.Add(CodeAction.CodeActionWithNestedActions.Create(nestedCascadingTitle, cascadingActions, isInlinable: false)); } return builder.ToImmutable(); @@ -370,7 +370,7 @@ private static async Task FixAsync( // The argumentNameSuggestion is the base for the parameter name. // For each method declaration the name is made unique to avoid name collisions. var (argumentNameSuggestion, isNamedArgument) = await GetNameSuggestionForArgumentAsync( - invocationDocument, argument, cancellationToken).ConfigureAwait(false); + invocationDocument, argument, method.ContainingType, cancellationToken).ConfigureAwait(false); var newParameterIndex = isNamedArgument ? (int?)null : argumentList.IndexOf(argument); return await AddParameterService.AddParameterAsync( @@ -396,7 +396,7 @@ private static async Task FixAsync( } private static async Task<(string argumentNameSuggestion, bool isNamed)> GetNameSuggestionForArgumentAsync( - Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken) + Document invocationDocument, TArgumentSyntax argument, INamedTypeSymbol containingType, CancellationToken cancellationToken) { var syntaxFacts = invocationDocument.GetRequiredLanguageService(); @@ -411,7 +411,7 @@ private static async Task FixAsync( var expression = syntaxFacts.GetExpressionOfArgument(argument); var semanticFacts = invocationDocument.GetRequiredLanguageService(); argumentName = semanticFacts.GenerateNameForExpression( - semanticModel, expression, capitalize: false, cancellationToken: cancellationToken); + semanticModel, expression, capitalize: containingType.IsRecord, cancellationToken: cancellationToken); return (argumentNameSuggestion: argumentName, isNamed: false); } } diff --git a/src/Features/Core/Portable/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs b/src/Features/Core/Portable/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs index ece6c991a3617..767965b44485a 100644 --- a/src/Features/Core/Portable/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs +++ b/src/Features/Core/Portable/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs @@ -62,7 +62,7 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) } var groupingTitle = string.Format(FeaturesResources.Alias_ambiguous_type_0, diagnosticNode.ToString()); - var groupingCodeAction = new CodeActionWithNestedActions(groupingTitle, codeActionsBuilder.ToImmutable(), isInlinable: true); + var groupingCodeAction = CodeActionWithNestedActions.Create(groupingTitle, codeActionsBuilder.ToImmutable(), isInlinable: true); context.RegisterCodeFix(groupingCodeAction, context.Diagnostics.First()); } } diff --git a/src/Features/Core/Portable/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs b/src/Features/Core/Portable/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs index 8b32808fe75a2..b2f3baf872b36 100644 --- a/src/Features/Core/Portable/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs +++ b/src/Features/Core/Portable/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs @@ -31,8 +31,6 @@ internal abstract partial class AbstractAddExplicitCastCodeFixProvider SyntaxFacts = syntaxFacts; - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - protected ISyntaxFacts SyntaxFacts { get; } protected abstract SyntaxNode ApplyFix(SyntaxNode currentRoot, TExpressionSyntax targetNode, ITypeSymbol conversionType); protected abstract CommonConversion ClassifyConversion(SemanticModel semanticModel, TExpressionSyntax expression, ITypeSymbol type); @@ -102,7 +100,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) ReportTelemetryIfNecessary(potentialConversionTypes); - context.RegisterCodeFix(new CodeAction.CodeActionWithNestedActions( + context.RegisterCodeFix(CodeAction.CodeActionWithNestedActions.Create( FeaturesResources.Add_explicit_cast, actions.ToImmutable(), isInlinable: false), context.Diagnostics); diff --git a/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureCodeStyle/ConfigureCodeStyleOptionCodeFixProvider.cs b/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureCodeStyle/ConfigureCodeStyleOptionCodeFixProvider.cs index 70021dca9b330..593e436ad09f4 100644 --- a/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureCodeStyle/ConfigureCodeStyleOptionCodeFixProvider.cs +++ b/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureCodeStyle/ConfigureCodeStyleOptionCodeFixProvider.cs @@ -162,7 +162,7 @@ void AddCodeActionWithOptionValue(ICodeStyleOption codeStyleOption, object newVa // Add code action to configure the optionValue. nestedActions.Add( - new SolutionChangeAction( + SolutionChangeAction.Create( parts.optionValue, solution => ConfigurationUpdater.ConfigureCodeStyleOptionAsync(parts.optionName, parts.optionValue, diagnostic, isPerLanguage, project, cancellationToken), parts.optionValue)); diff --git a/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureSeverity/ConfigureSeverityLevelCodeFixProvider.cs b/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureSeverity/ConfigureSeverityLevelCodeFixProvider.cs index 59a7fb5cedb59..098add79e1558 100644 --- a/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureSeverity/ConfigureSeverityLevelCodeFixProvider.cs +++ b/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureSeverity/ConfigureSeverityLevelCodeFixProvider.cs @@ -60,7 +60,7 @@ private static ImmutableArray GetConfigurations(Project project, IEnume foreach (var (value, title) in s_editorConfigSeverityStrings) { nestedActions.Add( - new SolutionChangeAction( + SolutionChangeAction.Create( title, solution => ConfigurationUpdater.ConfigureSeverityAsync(value, diagnostic, project, cancellationToken), value)); @@ -101,7 +101,7 @@ void AddBulkConfigurationCodeFixes(ImmutableArray diagnostics, strin foreach (var (value, title) in s_editorConfigSeverityStrings) { nestedActions.Add( - new SolutionChangeAction( + SolutionChangeAction.Create( title, solution => category != null ? ConfigurationUpdater.BulkConfigureSeverityAsync(value, category, project, cancellationToken) diff --git a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionBatchFixAllProvider.cs b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionBatchFixAllProvider.cs index 7f1aa3017b8d5..22e76e7b5813f 100644 --- a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionBatchFixAllProvider.cs +++ b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionBatchFixAllProvider.cs @@ -242,7 +242,7 @@ protected virtual Task AddProjectFixesAsync( if (newSolution != null && newSolution != solution) { var title = GetFixAllTitle(fixAllState); - return new CodeAction.SolutionChangeAction(title, _ => Task.FromResult(newSolution), title); + return CodeAction.SolutionChangeAction.Create(title, _ => Task.FromResult(newSolution), title); } return null; diff --git a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs index f996ab9889318..3fc63d39a17a9 100644 --- a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs +++ b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs @@ -31,14 +31,11 @@ public static CodeAction CreateBatchPragmaFix( FixAllState fixAllState, CancellationToken cancellationToken) { - // This is a temporary generated code action, which doesn't need telemetry, hence suppressing RS0005. -#pragma warning disable RS0005 // Do not use generic CodeAction.Create to create CodeAction return CodeAction.Create( ((CodeAction)pragmaActions[0]).Title, createChangedDocument: ct => BatchPragmaFixesAsync(suppressionFixProvider, document, pragmaActions, pragmaDiagnostics, cancellationToken), equivalenceKey: fixAllState.CodeActionEquivalenceKey); -#pragma warning restore RS0005 // Do not use generic CodeAction.Create to create CodeAction } private static async Task BatchPragmaFixesAsync( diff --git a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs index 9c310dbe6a5a1..0df4f432e0d33 100644 --- a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs +++ b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs @@ -145,13 +145,10 @@ public override async Task TryGetMergedFixAsync( currentSolution = currentSolution.WithDocumentSyntaxRoot(document.Id, newRoot); } - // This is a temporary generated code action, which doesn't need telemetry, hence suppressing RS0005. -#pragma warning disable RS0005 // Do not use generic CodeAction.Create to create CodeAction var batchAttributeRemoveFix = CodeAction.Create( attributeRemoveFixes.First().Title, createChangedSolution: ct => Task.FromResult(currentSolution), equivalenceKey: fixAllState.CodeActionEquivalenceKey); -#pragma warning restore RS0005 // Do not use generic CodeAction.Create to create CodeAction newBatchOfFixes.Insert(0, (diagnostic: null, batchAttributeRemoveFix)); } diff --git a/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs b/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs index cfb19127cff22..66211617436c9 100644 --- a/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs +++ b/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs @@ -172,7 +172,7 @@ public async Task> GetRefactoringsAsync( // Add the Refactoring Provider Name to the parent CodeAction's CustomTags. // Always add a name even in cases of 3rd party refactorings that do not export // name metadata. - action.AddCustomTag(providerMetadata?.Name ?? provider.GetTypeDisplayName()); + action.AddCustomTagAndTelemetryInfo(providerMetadata, provider); actions.Add((action, applicableToSpan)); } diff --git a/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs b/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs index a129c38618712..e251d8d797f2b 100644 --- a/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs +++ b/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -14,6 +12,7 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.PooledObjects; +using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CodeRefactorings.SyncNamespace @@ -42,12 +41,11 @@ public MoveFileCodeAction(State state, ImmutableArray newFolders) protected override async Task> ComputeOperationsAsync(CancellationToken cancellationToken) { - var id = _state.Document.Id; + var document = _state.Document; var solution = _state.Document.Project.Solution; - var document = solution.GetDocument(id); var newDocumentId = DocumentId.CreateNewId(document.Project.Id, document.Name); - solution = solution.RemoveDocument(id); + solution = solution.RemoveDocument(document.Id); var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false); solution = solution.AddDocument(newDocumentId, document.Name, text, folders: _newfolders); diff --git a/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.State.cs b/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.State.cs index 9346e60d8705b..5690a4596014d 100644 --- a/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.State.cs +++ b/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.State.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -43,7 +41,7 @@ internal sealed class State /// This is the new name we want to change the namespace to. /// Empty string means global namespace, whereas null means change namespace action is not available. /// - public string TargetNamespace { get; } + public string? TargetNamespace { get; } /// /// This is the part of the declared namespace that is contained in default namespace. @@ -51,13 +49,13 @@ internal sealed class State /// For example, if default namespace is `A` and declared namespace is `A.B.C`, /// this would be `B.C`. /// - public string RelativeDeclaredNamespace { get; } + public string? RelativeDeclaredNamespace { get; } private State( Document document, SyntaxNode container, - string targetNamespace, - string relativeDeclaredNamespace) + string? targetNamespace, + string? relativeDeclaredNamespace) { Document = document; Container = container; @@ -65,7 +63,7 @@ private State( RelativeDeclaredNamespace = relativeDeclaredNamespace; } - public static async Task CreateAsync( + public static async Task CreateAsync( AbstractSyncNamespaceCodeRefactoringProvider provider, Document document, TextSpan textSpan, @@ -93,7 +91,7 @@ public static async Task CreateAsync( return null; } - var changeNamespaceService = document.GetLanguageService(); + var changeNamespaceService = document.GetRequiredLanguageService(); var canChange = await changeNamespaceService.CanChangeNamespaceAsync(document, applicableNode, cancellationToken).ConfigureAwait(false); if (!canChange || !IsDocumentPathRootedInProjectFolder(document)) @@ -101,7 +99,7 @@ public static async Task CreateAsync( return null; } - var syntaxFacts = document.GetLanguageService(); + var syntaxFacts = document.GetRequiredLanguageService(); // We can't determine what the expected namespace would be without knowing the default namespace. var defaultNamespace = GetDefaultNamespace(document, syntaxFacts); @@ -152,36 +150,40 @@ public static async Task CreateAsync( /// private static bool IsDocumentPathRootedInProjectFolder(Document document) { + var absoluteDircetoryPath = PathUtilities.GetDirectoryName(document.FilePath); + if (absoluteDircetoryPath is null) + return false; + var projectRoot = PathUtilities.GetDirectoryName(document.Project.FilePath); - var folderPath = Path.Combine(document.Folders.ToArray()); + if (projectRoot is null) + return false; - var absoluteDircetoryPath = PathUtilities.GetDirectoryName(document.FilePath); + var folderPath = Path.Combine(document.Folders.ToArray()); var logicalDirectoryPath = PathUtilities.CombineAbsoluteAndRelativePaths(projectRoot, folderPath); + if (logicalDirectoryPath is null) + return false; return PathUtilities.PathsEqual(absoluteDircetoryPath, logicalDirectoryPath); } - private static string GetDefaultNamespace(Document document, ISyntaxFactsService syntaxFacts) + private static string? GetDefaultNamespace(Document document, ISyntaxFactsService syntaxFacts) { var solution = document.Project.Solution; var linkedIds = document.GetLinkedDocumentIds(); - var documents = linkedIds.SelectAsArray(id => solution.GetDocument(id)).Add(document); + var documents = linkedIds.SelectAsArray(id => solution.GetRequiredDocument(id)).Add(document); // For all projects containing all the linked documents, bail if // 1. Any of them doesn't have default namespace, or // 2. Multiple default namespace are found. (this might be possible by tweaking project file). // The refactoring depends on a single default namespace to operate. - var defaultNamespaceFromProjects = new HashSet( + var defaultNamespaceFromProjects = new HashSet( documents.Select(d => d.Project.DefaultNamespace), syntaxFacts.StringComparer); - if (defaultNamespaceFromProjects.Count != 1 - || defaultNamespaceFromProjects.First() == null) - { + if (defaultNamespaceFromProjects.Count > 1) return null; - } - return defaultNamespaceFromProjects.Single(); + return defaultNamespaceFromProjects.SingleOrDefault(); } /// @@ -195,7 +197,7 @@ private static string GetDefaultNamespace(Document document, ISyntaxFactsService /// the relative namespace is "". /// - If is "" then the relative namespace us . /// - private static string GetRelativeNamespace(string relativeTo, string @namespace, ISyntaxFactsService syntaxFacts) + private static string? GetRelativeNamespace(string relativeTo, string @namespace, ISyntaxFactsService syntaxFacts) { Debug.Assert(relativeTo != null && @namespace != null); @@ -213,7 +215,7 @@ private static string GetRelativeNamespace(string relativeTo, string @namespace, } var containingText = relativeTo + "."; - var namespacePrefix = @namespace.Substring(0, containingText.Length); + var namespacePrefix = @namespace[..containingText.Length]; return syntaxFacts.StringComparer.Equals(containingText, namespacePrefix) ? @namespace[(relativeTo.Length + 1)..] diff --git a/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.cs b/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.cs index c76493f0ee874..95d0fb8d24e5e 100644 --- a/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.cs +++ b/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - using System; using System.Threading; using System.Threading.Tasks; @@ -69,7 +67,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte // is global namespace, i.e. default namespace is "" and the file is located at project // root directory, and no namespace declaration in the document, respectively. - var service = document.GetLanguageService(); + var service = document.GetRequiredLanguageService(); var solutionChangeAction = new ChangeNamespaceCodeAction( state.TargetNamespace.Length == 0 @@ -91,7 +89,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte /// declaration in global namespace and there's no namespace declaration in this document. /// (3) otherwise, null. /// - protected abstract Task TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken); + protected abstract Task TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken); protected abstract string EscapeIdentifier(string identifier); diff --git a/src/Features/Core/Portable/CodeStyle/AbstractCodeStyleProvider.Fixing.cs b/src/Features/Core/Portable/CodeStyle/AbstractCodeStyleProvider.Fixing.cs index 133f4b76d99b7..cfe719b06103c 100644 --- a/src/Features/Core/Portable/CodeStyle/AbstractCodeStyleProvider.Fixing.cs +++ b/src/Features/Core/Portable/CodeStyle/AbstractCodeStyleProvider.Fixing.cs @@ -40,8 +40,6 @@ protected CodeFixProvider() FixableDiagnosticIds = ImmutableArray.Create(_codeStyleProvider._descriptorId); } - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public sealed override ImmutableArray FixableDiagnosticIds { get; } public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Features/Core/Portable/ConvertAnonymousType/AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs b/src/Features/Core/Portable/ConvertAnonymousType/AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs index 6049e6de76f8f..1d8c234f1f29d 100644 --- a/src/Features/Core/Portable/ConvertAnonymousType/AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs +++ b/src/Features/Core/Portable/ConvertAnonymousType/AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs @@ -51,7 +51,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte // anonymous type, and one to fixup all anonymous types. if (allAnonymousNodes.Any(t => !anonymousType.Equals(t.symbol, SymbolEqualityComparer.Default))) { - context.RegisterRefactoring(new CodeAction.CodeActionWithNestedActions( + context.RegisterRefactoring(CodeAction.CodeActionWithNestedActions.Create( FeaturesResources.Convert_to_tuple, ImmutableArray.Create( new MyCodeAction(FeaturesResources.just_this_anonymous_type, c => FixInCurrentMemberAsync(document, anonymousNode, anonymousType, allAnonymousTypes: false, c)), diff --git a/src/Features/Core/Portable/ConvertTupleToStruct/AbstractConvertTupleToStructCodeRefactoringProvider.cs b/src/Features/Core/Portable/ConvertTupleToStruct/AbstractConvertTupleToStructCodeRefactoringProvider.cs index eb41179388067..8c13540bb2921 100644 --- a/src/Features/Core/Portable/ConvertTupleToStruct/AbstractConvertTupleToStructCodeRefactoringProvider.cs +++ b/src/Features/Core/Portable/ConvertTupleToStruct/AbstractConvertTupleToStructCodeRefactoringProvider.cs @@ -93,7 +93,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte if (recordChildActions.Length > 0) { context.RegisterRefactoring( - new CodeAction.CodeActionWithNestedActions( + CodeAction.CodeActionWithNestedActions.Create( FeaturesResources.Convert_to_record_struct, recordChildActions, isInlinable: false), @@ -105,7 +105,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte if (childActions.Length > 0) { context.RegisterRefactoring( - new CodeAction.CodeActionWithNestedActions( + CodeAction.CodeActionWithNestedActions.Create( FeaturesResources.Convert_to_struct, childActions, isInlinable: false), diff --git a/src/Features/Core/Portable/EmbeddedLanguages/Json/LanguageServices/AbstractJsonDetectionCodeFixProvider.cs b/src/Features/Core/Portable/EmbeddedLanguages/Json/LanguageServices/AbstractJsonDetectionCodeFixProvider.cs index ba58b37a4d19d..cf3811b79e64d 100644 --- a/src/Features/Core/Portable/EmbeddedLanguages/Json/LanguageServices/AbstractJsonDetectionCodeFixProvider.cs +++ b/src/Features/Core/Portable/EmbeddedLanguages/Json/LanguageServices/AbstractJsonDetectionCodeFixProvider.cs @@ -30,8 +30,6 @@ protected AbstractJsonDetectionCodeFixProvider( protected abstract void AddComment(SyntaxEditor editor, SyntaxToken stringLiteral, string commentContents); - internal override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(AbstractJsonDetectionAnalyzer.DiagnosticId); diff --git a/src/Features/Core/Portable/FeaturesResources.resx b/src/Features/Core/Portable/FeaturesResources.resx index 41b1e6733cf0b..c7a1a563e0a4a 100644 --- a/src/Features/Core/Portable/FeaturesResources.resx +++ b/src/Features/Core/Portable/FeaturesResources.resx @@ -252,9 +252,6 @@ Generate nested {0} '{1}' - - Global Namespace - Implement all members explicitly @@ -558,10 +555,6 @@ Modifying {0} which contains the stackalloc operator requires restarting the application. {Locked="stackalloc"} "stackalloc" is C# keyword and should not be localized. - - Modifying an active {0} which contains On Error or Resume statements requires restarting the application. - {Locked="On Error"}{Locked="Resume"} is VB keyword and should not be localized. - Modifying {0} which contains an Aggregate, Group By, or Join query clauses requires restarting the application. {Locked="Aggregate"}{Locked="Group By"}{Locked="Join"} are VB keywords and should not be localized. @@ -584,9 +577,6 @@ Unexpected interface member kind: {0} - - Unknown symbol kind - Generate abstract property '{0}' @@ -596,9 +586,6 @@ Generate method '{0}' - - Requested assembly already loaded from '{0}'. - The symbol does not have an icon. @@ -710,18 +697,6 @@ Do you want to continue? Suppress {0} - - Re-triage {0}(currently '{1}') - - - Argument cannot have a null element. - - - Argument cannot be empty. - - - Reported diagnostic with ID '{0}' is not supported by the analyzer. - Computing fix all occurrences code fix... @@ -908,9 +883,6 @@ This version used in: {2} Interfaces - - Locals - Methods @@ -1005,18 +977,6 @@ This version used in: {2} Snippets - - All lowercase - - - All uppercase - - - First word capitalized - - - Pascal Case - Remove document '{0}' @@ -1131,9 +1091,6 @@ This version used in: {2} in {0} (project {1}) - - Add accessibility modifiers - Move declaration near reference @@ -1167,9 +1124,6 @@ This version used in: {2} Warning: Iteration variable crossed function boundary. - - Warning: Collection may be modified during iteration. - Convert to LINQ @@ -1391,9 +1345,6 @@ This version used in: {2} Rude edit - - Edit and Continue disallowed by module - Cannot apply changes -- unexpected error: '{0}' @@ -1403,9 +1354,6 @@ This version used in: {2} Changes made in project '{0}' require restarting the application: {1} - - Changes made in project '{0}' will not be applied while the application is running - The current content of source file '{0}' does not match the built source. Any changes made to this file while debugging won't be applied until its content matches the built source. @@ -2310,9 +2258,6 @@ Two or more character ranges can be concatenated. For example, to specify the ra Two or more character ranges can be concatenated. For example, to specify the range of decimal digits from "0" through "9", the range of lowercase letters from "a" through "f", and the range of uppercase letters from "A" through "F", use [0-9a-fA-F]. - - negative character range - The regular expression construct \P{ name } matches any character that does not belong to a Unicode general category or named block, where name is the category abbreviation or named block name. @@ -2793,9 +2738,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Inline and keep '{0}' - - Pull member(s) up to new base class... - Operators @@ -2817,9 +2759,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Sort accessibility modifiers - - Format document - Error creating instance of CodeFixProvider @@ -2854,9 +2793,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Convert to record - - Introduce parameter - Introduce parameter for '{0}' @@ -3211,4 +3147,4 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Sort Imports or usings - + \ No newline at end of file diff --git a/src/Features/Core/Portable/Formatting/FormattingCodeFixProvider.cs b/src/Features/Core/Portable/Formatting/FormattingCodeFixProvider.cs index ba339b3690055..88bb28d94b3ec 100644 --- a/src/Features/Core/Portable/Formatting/FormattingCodeFixProvider.cs +++ b/src/Features/Core/Portable/Formatting/FormattingCodeFixProvider.cs @@ -30,8 +30,6 @@ public FormattingCodeFixProvider() public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.FormattingDiagnosticId); - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.CodeStyle; - public override Task RegisterCodeFixesAsync(CodeFixContext context) { foreach (var diagnostic in context.Diagnostics) diff --git a/src/Features/Core/Portable/Formatting/IFormattingInteractionService.cs b/src/Features/Core/Portable/Formatting/IFormattingInteractionService.cs index 84296fa0cb7c2..8a5667549f5fd 100644 --- a/src/Features/Core/Portable/Formatting/IFormattingInteractionService.cs +++ b/src/Features/Core/Portable/Formatting/IFormattingInteractionService.cs @@ -22,7 +22,7 @@ internal interface IFormattingInteractionService : ILanguageService /// True if this service would like to format the document based on the user typing the /// provided character. /// - bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptions options, char ch); + bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptions options, FormattingOptions2.IndentStyle indentStyle, char ch); /// /// Returns the text changes necessary to format the document. If "textSpan" is provided, diff --git a/src/Features/Core/Portable/GenerateComparisonOperators/GenerateComparisonOperatorsCodeRefactoringProvider.cs b/src/Features/Core/Portable/GenerateComparisonOperators/GenerateComparisonOperatorsCodeRefactoringProvider.cs index 9ccad19ba7c4c..90ccc457d8363 100644 --- a/src/Features/Core/Portable/GenerateComparisonOperators/GenerateComparisonOperatorsCodeRefactoringProvider.cs +++ b/src/Features/Core/Portable/GenerateComparisonOperators/GenerateComparisonOperatorsCodeRefactoringProvider.cs @@ -113,7 +113,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte nameof(FeaturesResources.Generate_for_0) + "_" + displayString)); } - context.RegisterRefactoring(new CodeAction.CodeActionWithNestedActions( + context.RegisterRefactoring(CodeAction.CodeActionWithNestedActions.Create( FeaturesResources.Generate_comparison_operators, nestedActions.ToImmutable(), isInlinable: false)); diff --git a/src/Features/Core/Portable/Highlighting/Keywords/AbstractKeywordHighlighter.cs b/src/Features/Core/Portable/Highlighting/Keywords/AbstractKeywordHighlighter.cs index aa1183be975bb..b5bc18acf5efb 100644 --- a/src/Features/Core/Portable/Highlighting/Keywords/AbstractKeywordHighlighter.cs +++ b/src/Features/Core/Portable/Highlighting/Keywords/AbstractKeywordHighlighter.cs @@ -5,11 +5,9 @@ #nullable disable using System.Collections.Generic; -using System.Linq; using System.Threading; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Text; -using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Highlighting { diff --git a/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.AccessibilityHelper.cs b/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.AccessibilityHelper.cs new file mode 100644 index 0000000000000..3a6c1e5608a82 --- /dev/null +++ b/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.AccessibilityHelper.cs @@ -0,0 +1,144 @@ +// 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. + +using System.Collections.Generic; + +namespace Microsoft.CodeAnalysis.ImplementInterface +{ + internal abstract partial class AbstractImplementInterfaceService + { + private static class AccessibilityHelper + { + public static bool IsLessAccessibleThan(ISymbol? first, INamedTypeSymbol second) + { + if (first is null) + { + return false; + } + + if (first.DeclaredAccessibility <= Accessibility.NotApplicable || + second.DeclaredAccessibility <= Accessibility.NotApplicable) + { + return false; + } + + if (first.DeclaredAccessibility < second.DeclaredAccessibility) + { + return true; + } + + switch (first) + { + case IPropertySymbol propertySymbol: + if (IsTypeLessAccessibleThanOtherType(propertySymbol.Type, second, new())) + { + return true; + } + + if (IsLessAccessibleThan(propertySymbol.GetMethod, second)) + { + return true; + } + + if (IsLessAccessibleThan(propertySymbol.SetMethod, second)) + { + return true; + } + + return false; + + case IMethodSymbol methodSymbol: + if (IsTypeLessAccessibleThanOtherType(methodSymbol.ReturnType, second, new())) + { + return true; + } + + foreach (var parameter in methodSymbol.Parameters) + { + if (IsTypeLessAccessibleThanOtherType(parameter.Type, second, new())) + { + return true; + } + } + + foreach (var typeArg in methodSymbol.TypeArguments) + { + if (IsTypeLessAccessibleThanOtherType(typeArg, second, new())) + { + return true; + } + } + + return false; + + case IEventSymbol eventSymbol: + return IsTypeLessAccessibleThanOtherType(eventSymbol.Type, second, new()); + + default: + return false; + } + } + + private static bool IsTypeLessAccessibleThanOtherType(ITypeSymbol? first, INamedTypeSymbol second, HashSet alreadyCheckingTypes) + { + if (first is null) + { + return false; + } + + alreadyCheckingTypes.Add(first); + + if (first is ITypeParameterSymbol typeParameter) + { + foreach (var constraint in typeParameter.ConstraintTypes) + { + if (alreadyCheckingTypes.Contains(constraint)) + { + continue; + } + + if (IsTypeLessAccessibleThanOtherType(constraint, second, alreadyCheckingTypes)) + { + return true; + } + } + } + + if (first.DeclaredAccessibility <= Accessibility.NotApplicable || + second.DeclaredAccessibility <= Accessibility.NotApplicable) + { + return false; + } + + if (first.DeclaredAccessibility < second.DeclaredAccessibility) + { + return true; + } + + if (first is INamedTypeSymbol namedType) + { + foreach (var genericParam in namedType.TypeArguments) + { + if (alreadyCheckingTypes.Contains(genericParam)) + { + continue; + } + + if (IsTypeLessAccessibleThanOtherType(genericParam, second, alreadyCheckingTypes)) + { + return true; + } + } + } + + if (IsTypeLessAccessibleThanOtherType(first.ContainingType, second, alreadyCheckingTypes)) + { + return true; + } + + return false; + } + } + } +} diff --git a/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs b/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs index 359183f3815c6..4e73cbbb3ea53 100644 --- a/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs +++ b/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs @@ -311,7 +311,7 @@ private ISymbol GenerateMember( // See if we need to generate an invisible member. If we do, then reset the name // back to what then member wants it to be. - var generateInvisibleMember = GenerateInvisibleMember(member, memberName); + var generateInvisibleMember = ShouldGenerateInvisibleMember(member, memberName); memberName = generateInvisibleMember ? member.Name : memberName; // The language doesn't allow static abstract implementations of interface methods. i.e, @@ -332,7 +332,7 @@ private ISymbol GenerateMember( addNew, addUnsafe, propertyGenerationBehavior); } - private bool GenerateInvisibleMember(ISymbol member, string memberName) + private bool ShouldGenerateInvisibleMember(ISymbol member, string memberName) { if (Service.HasHiddenExplicitImplementation) { @@ -355,6 +355,13 @@ private bool GenerateInvisibleMember(ISymbol member, string memberName) { return true; } + + // If the member is less accessible than type, for which we are implementing it, + // then only explicit implementation is valid. + if (AccessibilityHelper.IsLessAccessibleThan(member, State.ClassOrStructType)) + { + return true; + } } // Can't generate an invisible member if the language doesn't support it. diff --git a/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.cs b/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.cs index b551def32576f..0e2e1a871a7fe 100644 --- a/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.cs +++ b/src/Features/Core/Portable/ImplementInterface/AbstractImplementInterfaceService.cs @@ -72,7 +72,28 @@ private IEnumerable GetActions(Document document, ImplementTypeOptio if (state.MembersWithoutExplicitOrImplicitImplementationWhichCanBeImplicitlyImplemented.Length > 0) { - yield return ImplementInterfaceCodeAction.CreateImplementCodeAction(this, document, options, state); + var totalMemberCount = 0; + var inaccessibleMemberCount = 0; + + foreach (var (_, members) in state.MembersWithoutExplicitOrImplicitImplementationWhichCanBeImplicitlyImplemented) + { + foreach (var member in members) + { + totalMemberCount++; + + if (AccessibilityHelper.IsLessAccessibleThan(member, state.ClassOrStructType)) + { + inaccessibleMemberCount++; + } + } + } + + // If all members to implement are inaccessible, then "Implement interface" codeaction + // will be the same as "Implement interface explicitly", so there is no point in having both of them + if (totalMemberCount != inaccessibleMemberCount) + { + yield return ImplementInterfaceCodeAction.CreateImplementCodeAction(this, document, options, state); + } if (ShouldImplementDisposePattern(state, explicitly: false)) { diff --git a/src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs b/src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs index 83030a157023d..14cd9a45ab867 100644 --- a/src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs +++ b/src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs @@ -218,8 +218,8 @@ protected static bool MatchesMethodIntent(IParameterSymbol? parameter) // Methods like `SetColor(color: "y")` `FromResult(result: "x")` `Enable/DisablePolling(bool)` don't need // parameter names to improve clarity. The parameter is clear from the context of the method name. - // First, this only applies to methods (as we're looking at the method name itself) so filter down to those. - if (parameter is not { ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.Ordinary } method }) + // First, this only applies to methods/local functions (as we're looking at the method name itself) so filter down to those. + if (parameter is not { ContainingSymbol: IMethodSymbol { MethodKind: MethodKind.Ordinary or MethodKind.LocalFunction } method }) return false; // We only care when dealing with the first parameter. Note: we don't have to worry parameter reordering diff --git a/src/Features/Core/Portable/InlineMethod/AbstractInlineMethodRefactoringProvider.cs b/src/Features/Core/Portable/InlineMethod/AbstractInlineMethodRefactoringProvider.cs index 63faa8218d45f..fd1cf6cf010ff 100644 --- a/src/Features/Core/Portable/InlineMethod/AbstractInlineMethodRefactoringProvider.cs +++ b/src/Features/Core/Portable/InlineMethod/AbstractInlineMethodRefactoringProvider.cs @@ -235,7 +235,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte callerDeclarationNode, inlineExpression, invocationOperation); - var nestedCodeAction = new CodeAction.CodeActionWithNestedActions( + var nestedCodeAction = CodeAction.CodeActionWithNestedActions.Create( string.Format(FeaturesResources.Inline_0, calleeMethodSymbol.ToNameDisplayString()), codeActions, isInlinable: true); diff --git a/src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceParameterService.cs b/src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceParameterService.cs index f874b000e3696..d90a39faee03d 100644 --- a/src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceParameterService.cs +++ b/src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceParameterService.cs @@ -128,13 +128,13 @@ public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContex if (actions.Value.actions.Length > 0) { - context.RegisterRefactoring(new CodeActionWithNestedActions( + context.RegisterRefactoring(CodeActionWithNestedActions.Create( string.Format(FeaturesResources.Introduce_parameter_for_0, nodeString), actions.Value.actions, isInlinable: false, priority: CodeActionPriority.Low), textSpan); } if (actions.Value.actionsAllOccurrences.Length > 0) { - context.RegisterRefactoring(new CodeActionWithNestedActions( + context.RegisterRefactoring(CodeActionWithNestedActions.Create( string.Format(FeaturesResources.Introduce_parameter_for_all_occurrences_of_0, nodeString), actions.Value.actionsAllOccurrences, isInlinable: false, priority: CodeActionPriority.Low), textSpan); } diff --git a/src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceVariableService.cs b/src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceVariableService.cs index 837c9bba3023d..9a9c1de6a9940 100644 --- a/src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceVariableService.cs +++ b/src/Features/Core/Portable/IntroduceVariable/AbstractIntroduceVariableService.cs @@ -80,7 +80,7 @@ public async Task IntroduceVariableAsync( // the code action as 'inlinable' so that if the lightbulb is not cluttered // then the nested items can just be lifted into it, giving the user fast // access to them. - return new CodeActionWithNestedActions(title, actions, isInlinable: true); + return CodeActionWithNestedActions.Create(title, actions, isInlinable: true); } } diff --git a/src/Features/Core/Portable/MakeClassAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs b/src/Features/Core/Portable/MakeClassAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs index 357c93d403cf8..6eb4d716ae6fd 100644 --- a/src/Features/Core/Portable/MakeClassAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs +++ b/src/Features/Core/Portable/MakeClassAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs @@ -19,8 +19,6 @@ internal abstract class AbstractMakeTypeAbstractCodeFixProvider CodeFixCategory.Compile; - public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) { if (IsValidRefactoringContext(context.Diagnostics[0].Location?.FindNode(context.CancellationToken), out _)) diff --git a/src/Features/Core/Portable/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs b/src/Features/Core/Portable/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs index 9e1ebb32365e3..f0a64f60e2c6c 100644 --- a/src/Features/Core/Portable/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs +++ b/src/Features/Core/Portable/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs @@ -16,8 +16,6 @@ namespace Microsoft.CodeAnalysis.MakeMemberStatic { internal abstract class AbstractMakeMemberStaticCodeFixProvider : SyntaxEditorBasedCodeFixProvider { - internal sealed override CodeFixCategory CodeFixCategory => CodeFixCategory.Compile; - protected abstract bool TryGetMemberDeclaration(SyntaxNode node, [NotNullWhen(true)] out SyntaxNode? memberDeclaration); public sealed override Task RegisterCodeFixesAsync(CodeFixContext context) diff --git a/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj b/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj index c3a347c1f3ec7..8be2c42729317 100644 --- a/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj +++ b/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj @@ -57,6 +57,7 @@ + + + + + + + + + - + diff --git a/src/Tools/BuildActionTelemetryTable/Program.cs b/src/Tools/BuildActionTelemetryTable/Program.cs index 3d53d49fdf2ce..bd932351283df 100644 --- a/src/Tools/BuildActionTelemetryTable/Program.cs +++ b/src/Tools/BuildActionTelemetryTable/Program.cs @@ -11,7 +11,9 @@ using System.Reflection; using System.Text; using Microsoft.CodeAnalysis.CodeActions; -using Microsoft.CodeAnalysis.Editor.Shared.Extensions; +using Microsoft.CodeAnalysis.CodeFixes; +using Microsoft.CodeAnalysis.CodeRefactorings; +using Microsoft.CodeAnalysis.Shared.Extensions; using TelemetryInfo = System.Tuple; namespace BuildActionTelemetryTable @@ -33,65 +35,65 @@ public class Program private static ImmutableDictionary CodeActionDescriptionMap { get; } = new Dictionary() { - { "Microsoft.CodeAnalysis.CSharp.TypeStyle.UseExplicitTypeCodeFixProvider+MyCodeAction", "Use Explicit Type" }, - { "Microsoft.CodeAnalysis.CSharp.TypeStyle.UseImplicitTypeCodeFixProvider+MyCodeAction", "Use Implicit Type" }, - { "Microsoft.CodeAnalysis.CSharp.UseSimpleUsingStatement.UseSimpleUsingStatementCodeFixProvider+MyCodeAction", "Use Simple Using Statement" }, - { "Microsoft.CodeAnalysis.CSharp.UseIsNullCheck.CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider+MyCodeAction", "Use 'Is Null' Check" }, - { "Microsoft.CodeAnalysis.CSharp.UseIndexOrRangeOperator.CSharpUseIndexOperatorCodeFixProvider+MyCodeAction", "Use Index Operator" }, - { "Microsoft.CodeAnalysis.CSharp.UseIndexOrRangeOperator.CSharpUseRangeOperatorCodeFixProvider+MyCodeAction", "Use Range Operator" }, - { "Microsoft.CodeAnalysis.CSharp.UseImplicitObjectCreation.CSharpUseImplicitObjectCreationCodeFixProvider+MyCodeAction", "Use Implicit Object Creation" }, - { "Microsoft.CodeAnalysis.CSharp.RemoveUnnecessaryCast.CSharpRemoveUnnecessaryCastCodeFixProvider+MyCodeAction", "Remove Unnecessary Cast" }, - { "Microsoft.CodeAnalysis.CSharp.UseDefaultLiteral.CSharpUseDefaultLiteralCodeFixProvider+MyCodeAction", "Use Default Literal" }, - { "Microsoft.CodeAnalysis.CSharp.UseDeconstruction.CSharpUseDeconstructionCodeFixProvider+MyCodeAction", "Use Deconstruction" }, - { "Microsoft.CodeAnalysis.CSharp.UseCompoundAssignment.CSharpUseCompoundCoalesceAssignmentCodeFixProvider+MyCodeAction", "Use Compound Assignment" }, - { "Microsoft.CodeAnalysis.CSharp.RemoveUnreachableCode.CSharpRemoveUnreachableCodeCodeFixProvider+MyCodeAction", "Remove Unreachable Code" }, + { "Microsoft.CodeAnalysis.CSharp.TypeStyle.UseExplicitTypeCodeFixProvider", "Use Explicit Type" }, + { "Microsoft.CodeAnalysis.CSharp.TypeStyle.UseImplicitTypeCodeFixProvider", "Use Implicit Type" }, + { "Microsoft.CodeAnalysis.CSharp.UseSimpleUsingStatement.UseSimpleUsingStatementCodeFixProvider", "Use Simple Using Statement" }, + { "Microsoft.CodeAnalysis.CSharp.UseIsNullCheck.CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider", "Use 'Is Null' Check" }, + { "Microsoft.CodeAnalysis.CSharp.UseIndexOrRangeOperator.CSharpUseIndexOperatorCodeFixProvider", "Use Index Operator" }, + { "Microsoft.CodeAnalysis.CSharp.UseIndexOrRangeOperator.CSharpUseRangeOperatorCodeFixProvider", "Use Range Operator" }, + { "Microsoft.CodeAnalysis.CSharp.UseImplicitObjectCreation.CSharpUseImplicitObjectCreationCodeFixProvider", "Use Implicit Object Creation" }, + { "Microsoft.CodeAnalysis.CSharp.RemoveUnnecessaryCast.CSharpRemoveUnnecessaryCastCodeFixProvider", "Remove Unnecessary Cast" }, + { "Microsoft.CodeAnalysis.CSharp.UseDefaultLiteral.CSharpUseDefaultLiteralCodeFixProvider", "Use Default Literal" }, + { "Microsoft.CodeAnalysis.CSharp.UseDeconstruction.CSharpUseDeconstructionCodeFixProvider", "Use Deconstruction" }, + { "Microsoft.CodeAnalysis.CSharp.UseCompoundAssignment.CSharpUseCompoundCoalesceAssignmentCodeFixProvider", "Use Compound Assignment" }, + { "Microsoft.CodeAnalysis.CSharp.RemoveUnreachableCode.CSharpRemoveUnreachableCodeCodeFixProvider", "Remove Unreachable Code" }, { "Microsoft.CodeAnalysis.CSharp.MisplacedUsingDirectives.MisplacedUsingDirectivesCodeFixProvider+MoveMisplacedUsingsCodeAction", "Misplaced Using Directives" }, - { "Microsoft.CodeAnalysis.CSharp.MakeStructFieldsWritable.CSharpMakeStructFieldsWritableCodeFixProvider+MyCodeAction", "Make Struct Fields Writable" }, - { "Microsoft.CodeAnalysis.CSharp.InvokeDelegateWithConditionalAccess.InvokeDelegateWithConditionalAccessCodeFixProvider+MyCodeAction", "Invoke Delegate With Conditional Access" }, - { "Microsoft.CodeAnalysis.CSharp.InlineDeclaration.CSharpInlineDeclarationCodeFixProvider+MyCodeAction", "Inline Declaration" }, - { "Microsoft.CodeAnalysis.CSharp.ConvertSwitchStatementToExpression.ConvertSwitchStatementToExpressionCodeFixProvider+MyCodeAction", "Convert Switch Statement To Expression" }, - { "Microsoft.CodeAnalysis.CSharp.RemoveConfusingSuppression.CSharpRemoveConfusingSuppressionCodeFixProvider+MyCodeAction", "Remove Confusing Suppressino" }, - { "Microsoft.CodeAnalysis.CSharp.RemoveUnnecessaryDiscardDesignation.CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider+MyCodeAction", "Remove Unneccessary Discard Designation" }, - { "Microsoft.CodeAnalysis.CSharp.NewLines.EmbeddedStatementPlacement.EmbeddedStatementPlacementCodeFixProvider+MyCodeAction", "New Lines: Embedded Statement Placement" }, - { "Microsoft.CodeAnalysis.CSharp.NewLines.ConstructorInitializerPlacement.ConstructorInitializerPlacementCodeFixProvider+MyCodeAction", "New Lines: Constructor Initializer Placement" }, - { "Microsoft.CodeAnalysis.CSharp.NewLines.ConsecutiveBracePlacement.ConsecutiveBracePlacementCodeFixProvider+MyCodeAction", "New Lines: Consecutive Brace Placement" }, - { "Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpIsAndCastCheckWithoutNameCodeFixProvider+MyCodeAction", "Use Pattern Matching: Is And Cast Check Without Name" }, - { "Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpUseNotPatternCodeFixProvider+MyCodeAction", "Use Pattern Matching: Use Not Pattern" }, - { "Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpAsAndNullCheckCodeFixProvider+MyCodeAction", "Use Pattern Matching: As And Null Check" }, - { "Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpIsAndCastCheckCodeFixProvider+MyCodeAction", "Use Pattern Matching: Is And Cast Check" }, - { "Microsoft.CodeAnalysis.CSharp.UsePatternCombinators.CSharpUsePatternCombinatorsCodeFixProvider+MyCodeAction", "Use Pattern Mathcing: Use Pattern Combinators" }, - { "Microsoft.CodeAnalysis.CSharp.UseLocalFunction.CSharpUseLocalFunctionCodeFixProvider+MyCodeAction", "Use Local Function" }, - { "Microsoft.CodeAnalysis.CSharp.UseExpressionBody.UseExpressionBodyCodeRefactoringProvider+MyCodeAction", "Use Expression Body (Refactoring)" }, - { "Microsoft.CodeAnalysis.CSharp.UseExpressionBody.UseExpressionBodyCodeFixProvider+MyCodeAction", "Use Expression Body (Codefix)" }, - { "Microsoft.CodeAnalysis.CSharp.UseExpressionBodyForLambda.UseExpressionBodyForLambdaCodeStyleProvider+MyCodeAction", "Use Expression Body For Lambda" }, - { "Microsoft.CodeAnalysis.CSharp.UseExplicitTypeForConst.UseExplicitTypeForConstCodeFixProvider+MyCodeAction", "Use Explicit Type For Const" }, - { "Microsoft.CodeAnalysis.CSharp.ReverseForStatement.CSharpReverseForStatementCodeRefactoringProvider+MyCodeAction", "Reverse For Statement" }, - { "Microsoft.CodeAnalysis.CSharp.ReplaceDefaultLiteral.CSharpReplaceDefaultLiteralCodeFixProvider+MyCodeAction", "Replace Default Literal" }, - { "Microsoft.CodeAnalysis.CSharp.RemoveUnusedLocalFunction.CSharpRemoveUnusedLocalFunctionCodeFixProvider+MyCodeAction", "Remove Unused Local Function" }, - { "Microsoft.CodeAnalysis.CSharp.MakeRefStruct.MakeRefStructCodeFixProvider+MyCodeAction", "Make Ref Struct" }, - { "Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic.MakeLocalFunctionStaticCodeFixProvider+MyCodeAction", "Make Local Function Static (CodeFix)" }, - { "Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic.MakeLocalFunctionStaticCodeRefactoringProvider+MyCodeAction", "Make Local Function Static (Refactoring)" }, - { "Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic.PassInCapturedVariablesAsArgumentsCodeFixProvider+MyCodeAction", "Make Local Function Static Pass In Captured Variables As Arguments" }, - { "Microsoft.CodeAnalysis.CSharp.ImplementInterface.AbstractChangeImplementionCodeRefactoringProvider+MyCodeAction", "Implement Interface" }, - { "Microsoft.CodeAnalysis.CSharp.DisambiguateSameVariable.CSharpDisambiguateSameVariableCodeFixProvider+MyCodeAction", "Disambiguate Same Variable" }, - { "Microsoft.CodeAnalysis.CSharp.Diagnostics.AddBraces.CSharpAddBracesCodeFixProvider+MyCodeAction", "Add Braces" }, - { "Microsoft.CodeAnalysis.CSharp.ConvertBetweenRegularAndVerbatimString.AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider`1+MyCodeAction", "Convert Between Regular And Verbatim String" }, - { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.UseType.AbstractUseTypeCodeRefactoringProvider+MyCodeAction", "Use Type" }, - { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.LambdaSimplifier.LambdaSimplifierCodeRefactoringProvider+MyCodeAction", "Lambda Simplifier" }, - { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.InlineTemporary.CSharpInlineTemporaryCodeRefactoringProvider+MyCodeAction", "Inline Temporary" }, - { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.EnableNullable.EnableNullableCodeRefactoringProvider+MyCodeAction", "Enable nullable" }, - { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.ConvertLocalFunctionToMethod.CSharpConvertLocalFunctionToMethodCodeRefactoringProvider+MyCodeAction", "Convert Local Function To Method" }, - { "Microsoft.CodeAnalysis.CSharp.UseInterpolatedVerbatimString.CSharpUseInterpolatedVerbatimStringCodeFixProvider+MyCodeAction", "Use Interpolated Verbatim String" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.RemoveNewModifier.RemoveNewModifierCodeFixProvider+MyCodeAction", "Remove New Modifier" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.RemoveInKeyword.RemoveInKeywordCodeFixProvider+MyCodeAction", "Remove In Keyword" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.DeclareAsNullable.CSharpDeclareAsNullableCodeFixProvider+MyCodeAction", "Declare As Nullable" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.MakeStatementAsynchronous.CSharpMakeStatementAsynchronousCodeFixProvider+MyCodeAction", "Make Statement Asynchronous" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.Iterator.CSharpAddYieldCodeFixProvider+MyCodeAction", "Add Yield" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.Iterator.CSharpChangeToIEnumerableCodeFixProvider+MyCodeAction", "Change To IEnumerable" }, + { "Microsoft.CodeAnalysis.CSharp.MakeStructFieldsWritable.CSharpMakeStructFieldsWritableCodeFixProvider", "Make Struct Fields Writable" }, + { "Microsoft.CodeAnalysis.CSharp.InvokeDelegateWithConditionalAccess.InvokeDelegateWithConditionalAccessCodeFixProvider", "Invoke Delegate With Conditional Access" }, + { "Microsoft.CodeAnalysis.CSharp.InlineDeclaration.CSharpInlineDeclarationCodeFixProvider", "Inline Declaration" }, + { "Microsoft.CodeAnalysis.CSharp.ConvertSwitchStatementToExpression.ConvertSwitchStatementToExpressionCodeFixProvider", "Convert Switch Statement To Expression" }, + { "Microsoft.CodeAnalysis.CSharp.RemoveConfusingSuppression.CSharpRemoveConfusingSuppressionCodeFixProvider", "Remove Confusing Suppressino" }, + { "Microsoft.CodeAnalysis.CSharp.RemoveUnnecessaryDiscardDesignation.CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider", "Remove Unneccessary Discard Designation" }, + { "Microsoft.CodeAnalysis.CSharp.NewLines.EmbeddedStatementPlacement.EmbeddedStatementPlacementCodeFixProvider", "New Lines: Embedded Statement Placement" }, + { "Microsoft.CodeAnalysis.CSharp.NewLines.ConstructorInitializerPlacement.ConstructorInitializerPlacementCodeFixProvider", "New Lines: Constructor Initializer Placement" }, + { "Microsoft.CodeAnalysis.CSharp.NewLines.ConsecutiveBracePlacement.ConsecutiveBracePlacementCodeFixProvider", "New Lines: Consecutive Brace Placement" }, + { "Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpIsAndCastCheckWithoutNameCodeFixProvider", "Use Pattern Matching: Is And Cast Check Without Name" }, + { "Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpUseNotPatternCodeFixProvider", "Use Pattern Matching: Use Not Pattern" }, + { "Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpAsAndNullCheckCodeFixProvider", "Use Pattern Matching: As And Null Check" }, + { "Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpIsAndCastCheckCodeFixProvider", "Use Pattern Matching: Is And Cast Check" }, + { "Microsoft.CodeAnalysis.CSharp.UsePatternCombinators.CSharpUsePatternCombinatorsCodeFixProvider", "Use Pattern Mathcing: Use Pattern Combinators" }, + { "Microsoft.CodeAnalysis.CSharp.UseLocalFunction.CSharpUseLocalFunctionCodeFixProvider", "Use Local Function" }, + { "Microsoft.CodeAnalysis.CSharp.UseExpressionBody.UseExpressionBodyCodeRefactoringProvider", "Use Expression Body (Refactoring)" }, + { "Microsoft.CodeAnalysis.CSharp.UseExpressionBody.UseExpressionBodyCodeFixProvider", "Use Expression Body (Codefix)" }, + { "Microsoft.CodeAnalysis.CSharp.UseExpressionBodyForLambda.UseExpressionBodyForLambdaCodeStyleProvider", "Use Expression Body For Lambda" }, + { "Microsoft.CodeAnalysis.CSharp.UseExplicitTypeForConst.UseExplicitTypeForConstCodeFixProvider", "Use Explicit Type For Const" }, + { "Microsoft.CodeAnalysis.CSharp.ReverseForStatement.CSharpReverseForStatementCodeRefactoringProvider", "Reverse For Statement" }, + { "Microsoft.CodeAnalysis.CSharp.ReplaceDefaultLiteral.CSharpReplaceDefaultLiteralCodeFixProvider", "Replace Default Literal" }, + { "Microsoft.CodeAnalysis.CSharp.RemoveUnusedLocalFunction.CSharpRemoveUnusedLocalFunctionCodeFixProvider", "Remove Unused Local Function" }, + { "Microsoft.CodeAnalysis.CSharp.MakeRefStruct.MakeRefStructCodeFixProvider", "Make Ref Struct" }, + { "Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic.MakeLocalFunctionStaticCodeFixProvider", "Make Local Function Static (CodeFix)" }, + { "Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic.MakeLocalFunctionStaticCodeRefactoringProvider", "Make Local Function Static (Refactoring)" }, + { "Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic.PassInCapturedVariablesAsArgumentsCodeFixProvider", "Make Local Function Static Pass In Captured Variables As Arguments" }, + { "Microsoft.CodeAnalysis.CSharp.ImplementInterface.AbstractChangeImplementionCodeRefactoringProvider", "Implement Interface" }, + { "Microsoft.CodeAnalysis.CSharp.DisambiguateSameVariable.CSharpDisambiguateSameVariableCodeFixProvider", "Disambiguate Same Variable" }, + { "Microsoft.CodeAnalysis.CSharp.Diagnostics.AddBraces.CSharpAddBracesCodeFixProvider", "Add Braces" }, + { "Microsoft.CodeAnalysis.CSharp.ConvertBetweenRegularAndVerbatimString.AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider`1", "Convert Between Regular And Verbatim String" }, + { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.UseType.AbstractUseTypeCodeRefactoringProvider", "Use Type" }, + { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.LambdaSimplifier.LambdaSimplifierCodeRefactoringProvider", "Lambda Simplifier" }, + { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.InlineTemporary.CSharpInlineTemporaryCodeRefactoringProvider", "Inline Temporary" }, + { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.EnableNullable.EnableNullableCodeRefactoringProvider", "Enable nullable" }, + { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.ConvertLocalFunctionToMethod.CSharpConvertLocalFunctionToMethodCodeRefactoringProvider", "Convert Local Function To Method" }, + { "Microsoft.CodeAnalysis.CSharp.UseInterpolatedVerbatimString.CSharpUseInterpolatedVerbatimStringCodeFixProvider", "Use Interpolated Verbatim String" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.RemoveNewModifier.RemoveNewModifierCodeFixProvider", "Remove New Modifier" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.RemoveInKeyword.RemoveInKeywordCodeFixProvider", "Remove In Keyword" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.DeclareAsNullable.CSharpDeclareAsNullableCodeFixProvider", "Declare As Nullable" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.MakeStatementAsynchronous.CSharpMakeStatementAsynchronousCodeFixProvider", "Make Statement Asynchronous" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.Iterator.CSharpAddYieldCodeFixProvider", "Add Yield" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.Iterator.CSharpChangeToIEnumerableCodeFixProvider", "Change To IEnumerable" }, { "Microsoft.CodeAnalysis.CSharp.CodeFixes.HideBase.HideBaseCodeFixProvider+AddNewKeywordAction", "Hide Basen" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.FixReturnType.CSharpFixReturnTypeCodeFixProvider+MyCodeAction", "Fix Return Type" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.ConditionalExpressionInStringInterpolation.CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider+MyCodeAction", "Add Parentheses Around Conditional Expression In String Interpolation" }, - { "Microsoft.CodeAnalysis.CSharp.AssignOutParameters.AbstractAssignOutParametersCodeFixProvider+MyCodeAction", "Assign Out Parameters" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.FixReturnType.CSharpFixReturnTypeCodeFixProvider", "Fix Return Type" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.ConditionalExpressionInStringInterpolation.CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider", "Add Parentheses Around Conditional Expression In String Interpolation" }, + { "Microsoft.CodeAnalysis.CSharp.AssignOutParameters.AbstractAssignOutParametersCodeFixProvider", "Assign Out Parameters" }, { "Microsoft.CodeAnalysis.Wrapping.WrapItemsAction", "Wrap Items" }, { "Microsoft.CodeAnalysis.UpgradeProject.ProjectOptionsChangeAction", "Upgrade Project" }, { "Microsoft.CodeAnalysis.ExtractInterface.ExtractInterfaceCodeAction", "Extract Interface" }, @@ -103,125 +105,125 @@ public class Program { "Microsoft.CodeAnalysis.AddPackage.InstallPackageParentCodeAction", "Install Package Parent" }, { "Microsoft.CodeAnalysis.AddPackage.InstallWithPackageManagerCodeAction", "Install With Package Manager" }, { "Microsoft.CodeAnalysis.AddMissingReference.AddMissingReferenceCodeAction", "Add Missing Reference" }, - { "Microsoft.CodeAnalysis.UpdateLegacySuppressions.UpdateLegacySuppressionsCodeFixProvider+MyCodeAction", "Update Legacy Suppressions" }, - { "Microsoft.CodeAnalysis.UseThrowExpression.UseThrowExpressionCodeFixProvider+MyCodeAction", "Use Throw Expression" }, - { "Microsoft.CodeAnalysis.UseSystemHashCode.UseSystemHashCodeCodeFixProvider+MyCodeAction", "Use System.HashCode" }, - { "Microsoft.CodeAnalysis.UseObjectInitializer.AbstractUseObjectInitializerCodeFixProvider`7+MyCodeAction", "Use Object Initializer" }, - { "Microsoft.CodeAnalysis.UseNullPropagation.AbstractUseNullPropagationCodeFixProvider`10+MyCodeAction", "Use Null Propagation" }, - { "Microsoft.CodeAnalysis.UseExplicitTupleName.UseExplicitTupleNameCodeFixProvider+MyCodeAction", "Use Explicit Tuple Name" }, - { "Microsoft.CodeAnalysis.UseIsNullCheck.AbstractUseIsNullCheckForReferenceEqualsCodeFixProvider`1+MyCodeAction", "Use 'Is Null' Check" }, - { "Microsoft.CodeAnalysis.UseInferredMemberName.AbstractUseInferredMemberNameCodeFixProvider+MyCodeAction", "Use Inferred Member Name" }, - { "Microsoft.CodeAnalysis.UseConditionalExpression.AbstractUseConditionalExpressionForAssignmentCodeFixProvider`6+MyCodeAction", "Use Conditional Expression For Assignment" }, - { "Microsoft.CodeAnalysis.UseConditionalExpression.AbstractUseConditionalExpressionForReturnCodeFixProvider`4+MyCodeAction", "Use Conditional Expression For Return" }, - { "Microsoft.CodeAnalysis.UseCompoundAssignment.AbstractUseCompoundAssignmentCodeFixProvider`3+MyCodeAction", "Use Compound Assignment" }, - { "Microsoft.CodeAnalysis.UseCollectionInitializer.AbstractUseCollectionInitializerCodeFixProvider`8+MyCodeAction", "Use Collection Initializer" }, - { "Microsoft.CodeAnalysis.UseCoalesceExpression.UseCoalesceExpressionCodeFixProvider+MyCodeAction", "Use Coalesce Expression" }, - { "Microsoft.CodeAnalysis.UseCoalesceExpression.UseCoalesceExpressionForNullableCodeFixProvider+MyCodeAction", "Use Coalesce Expression For Nullable" }, - { "Microsoft.CodeAnalysis.SimplifyLinqExpression.AbstractSimplifyLinqExpressionCodeFixProvider`3+MyCodeAction", "Simplify Linq Expression" }, - { "Microsoft.CodeAnalysis.SimplifyInterpolation.AbstractSimplifyInterpolationCodeFixProvider`7+MyCodeAction", "Simplify Interpolation" }, - { "Microsoft.CodeAnalysis.SimplifyBooleanExpression.SimplifyConditionalCodeFixProvider+MyCodeAction", "Simplify Boolean Expression" }, - { "Microsoft.CodeAnalysis.RemoveUnusedParametersAndValues.AbstractRemoveUnusedValuesCodeFixProvider`11+MyCodeAction", "Remove Unused Parameters And Values" }, - { "Microsoft.CodeAnalysis.RemoveUnusedMembers.AbstractRemoveUnusedMembersCodeFixProvider`1+MyCodeAction", "Remove Unused Members" }, - { "Microsoft.CodeAnalysis.RemoveUnnecessaryImports.AbstractRemoveUnnecessaryImportsCodeFixProvider+MyCodeAction", "Remove Unnecessary Imports" }, - { "Microsoft.CodeAnalysis.QualifyMemberAccess.AbstractQualifyMemberAccessCodeFixprovider`2+MyCodeAction", "Qualify Member Access" }, - { "Microsoft.CodeAnalysis.PopulateSwitch.AbstractPopulateSwitchCodeFixProvider`4+MyCodeAction", "Populate Switch" }, - { "Microsoft.CodeAnalysis.OrderModifiers.AbstractOrderModifiersCodeFixProvider+MyCodeAction", "Order Modifiers" }, - { "Microsoft.CodeAnalysis.MakeFieldReadonly.AbstractMakeFieldReadonlyCodeFixProvider`2+MyCodeAction", "Make Field Readonly" }, - { "Microsoft.CodeAnalysis.RemoveUnnecessarySuppressions.RemoveUnnecessaryInlineSuppressionsCodeFixProvider+MyCodeAction", "Remove Unnecessary Inline Suppressions" }, - { "Microsoft.CodeAnalysis.RemoveUnnecessarySuppressions.RemoveUnnecessaryAttributeSuppressionsCodeFixProvider+MyCodeAction", "Remove Unnecessary Attribute Suppressions" }, - { "Microsoft.CodeAnalysis.RemoveRedundantEquality.RemoveRedundantEqualityCodeFixProvider+MyCodeAction", "Remove Redundant Equality" }, - { "Microsoft.CodeAnalysis.NewLines.MultipleBlankLines.MultipleBlankLinesCodeFixProvider+MyCodeAction", "New Lines: Multiple Blank Lines" }, - { "Microsoft.CodeAnalysis.NewLines.ConsecutiveStatementPlacement.ConsecutiveStatementPlacementCodeFixProvider+MyCodeAction", "New Lines: Consecutive Statement Placement" }, - { "Microsoft.CodeAnalysis.FileHeaders.AbstractFileHeaderCodeFixProvider+MyCodeAction", "File Headers" }, - { "Microsoft.CodeAnalysis.ConvertTypeOfToNameOf.AbstractConvertTypeOfToNameOfCodeFixProvider+MyCodeAction", "Convert TypeOf To NameOf" }, - { "Microsoft.CodeAnalysis.ConvertAnonymousTypeToTuple.AbstractConvertAnonymousTypeToTupleCodeFixProvider`3+MyCodeAction", "Convert Anonymous Type To Tuple" }, - { "Microsoft.CodeAnalysis.AddRequiredParentheses.AddRequiredParenthesesCodeFixProvider+MyCodeAction", "Add Required Parentheses" }, - { "Microsoft.CodeAnalysis.AddAccessibilityModifiers.AbstractAddAccessibilityModifiersCodeFixProvider+MyCodeAction", "Add Accessibility Modifiers" }, - { "Microsoft.CodeAnalysis.RemoveUnnecessaryParentheses.AbstractRemoveUnnecessaryParenthesesCodeFixProvider`1+MyCodeAction", "Remove Unnecessary Parentheses" }, - { "Microsoft.CodeAnalysis.UseNamedArguments.AbstractUseNamedArgumentsCodeRefactoringProvider+MyCodeAction", "Use Named Arguments" }, + { "Microsoft.CodeAnalysis.UpdateLegacySuppressions.UpdateLegacySuppressionsCodeFixProvider", "Update Legacy Suppressions" }, + { "Microsoft.CodeAnalysis.UseThrowExpression.UseThrowExpressionCodeFixProvider", "Use Throw Expression" }, + { "Microsoft.CodeAnalysis.UseSystemHashCode.UseSystemHashCodeCodeFixProvider", "Use System.HashCode" }, + { "Microsoft.CodeAnalysis.UseObjectInitializer.AbstractUseObjectInitializerCodeFixProvider`7", "Use Object Initializer" }, + { "Microsoft.CodeAnalysis.UseNullPropagation.AbstractUseNullPropagationCodeFixProvider`10", "Use Null Propagation" }, + { "Microsoft.CodeAnalysis.UseExplicitTupleName.UseExplicitTupleNameCodeFixProvider", "Use Explicit Tuple Name" }, + { "Microsoft.CodeAnalysis.UseIsNullCheck.AbstractUseIsNullCheckForReferenceEqualsCodeFixProvider`1", "Use 'Is Null' Check" }, + { "Microsoft.CodeAnalysis.UseInferredMemberName.AbstractUseInferredMemberNameCodeFixProvider", "Use Inferred Member Name" }, + { "Microsoft.CodeAnalysis.UseConditionalExpression.AbstractUseConditionalExpressionForAssignmentCodeFixProvider`6", "Use Conditional Expression For Assignment" }, + { "Microsoft.CodeAnalysis.UseConditionalExpression.AbstractUseConditionalExpressionForReturnCodeFixProvider`4", "Use Conditional Expression For Return" }, + { "Microsoft.CodeAnalysis.UseCompoundAssignment.AbstractUseCompoundAssignmentCodeFixProvider`3", "Use Compound Assignment" }, + { "Microsoft.CodeAnalysis.UseCollectionInitializer.AbstractUseCollectionInitializerCodeFixProvider`8", "Use Collection Initializer" }, + { "Microsoft.CodeAnalysis.UseCoalesceExpression.UseCoalesceExpressionCodeFixProvider", "Use Coalesce Expression" }, + { "Microsoft.CodeAnalysis.UseCoalesceExpression.UseCoalesceExpressionForNullableCodeFixProvider", "Use Coalesce Expression For Nullable" }, + { "Microsoft.CodeAnalysis.SimplifyLinqExpression.AbstractSimplifyLinqExpressionCodeFixProvider`3", "Simplify Linq Expression" }, + { "Microsoft.CodeAnalysis.SimplifyInterpolation.AbstractSimplifyInterpolationCodeFixProvider`7", "Simplify Interpolation" }, + { "Microsoft.CodeAnalysis.SimplifyBooleanExpression.SimplifyConditionalCodeFixProvider", "Simplify Boolean Expression" }, + { "Microsoft.CodeAnalysis.RemoveUnusedParametersAndValues.AbstractRemoveUnusedValuesCodeFixProvider`11", "Remove Unused Parameters And Values" }, + { "Microsoft.CodeAnalysis.RemoveUnusedMembers.AbstractRemoveUnusedMembersCodeFixProvider`1", "Remove Unused Members" }, + { "Microsoft.CodeAnalysis.RemoveUnnecessaryImports.AbstractRemoveUnnecessaryImportsCodeFixProvider", "Remove Unnecessary Imports" }, + { "Microsoft.CodeAnalysis.QualifyMemberAccess.AbstractQualifyMemberAccessCodeFixprovider`2", "Qualify Member Access" }, + { "Microsoft.CodeAnalysis.PopulateSwitch.AbstractPopulateSwitchCodeFixProvider`4", "Populate Switch" }, + { "Microsoft.CodeAnalysis.OrderModifiers.AbstractOrderModifiersCodeFixProvider", "Order Modifiers" }, + { "Microsoft.CodeAnalysis.MakeFieldReadonly.AbstractMakeFieldReadonlyCodeFixProvider`2", "Make Field Readonly" }, + { "Microsoft.CodeAnalysis.RemoveUnnecessarySuppressions.RemoveUnnecessaryInlineSuppressionsCodeFixProvider", "Remove Unnecessary Inline Suppressions" }, + { "Microsoft.CodeAnalysis.RemoveUnnecessarySuppressions.RemoveUnnecessaryAttributeSuppressionsCodeFixProvider", "Remove Unnecessary Attribute Suppressions" }, + { "Microsoft.CodeAnalysis.RemoveRedundantEquality.RemoveRedundantEqualityCodeFixProvider", "Remove Redundant Equality" }, + { "Microsoft.CodeAnalysis.NewLines.MultipleBlankLines.MultipleBlankLinesCodeFixProvider", "New Lines: Multiple Blank Lines" }, + { "Microsoft.CodeAnalysis.NewLines.ConsecutiveStatementPlacement.ConsecutiveStatementPlacementCodeFixProvider", "New Lines: Consecutive Statement Placement" }, + { "Microsoft.CodeAnalysis.FileHeaders.AbstractFileHeaderCodeFixProvider", "File Headers" }, + { "Microsoft.CodeAnalysis.ConvertTypeOfToNameOf.AbstractConvertTypeOfToNameOfCodeFixProvider", "Convert TypeOf To NameOf" }, + { "Microsoft.CodeAnalysis.ConvertAnonymousTypeToTuple.AbstractConvertAnonymousTypeToTupleCodeFixProvider`3", "Convert Anonymous Type To Tuple" }, + { "Microsoft.CodeAnalysis.AddRequiredParentheses.AddRequiredParenthesesCodeFixProvider", "Add Required Parentheses" }, + { "Microsoft.CodeAnalysis.AddAccessibilityModifiers.AbstractAddAccessibilityModifiersCodeFixProvider", "Add Accessibility Modifiers" }, + { "Microsoft.CodeAnalysis.RemoveUnnecessaryParentheses.AbstractRemoveUnnecessaryParenthesesCodeFixProvider`1", "Remove Unnecessary Parentheses" }, + { "Microsoft.CodeAnalysis.UseNamedArguments.AbstractUseNamedArgumentsCodeRefactoringProvider", "Use Named Arguments" }, { "Microsoft.CodeAnalysis.UseAutoProperty.AbstractUseAutoPropertyCodeFixProvider`5+UseAutoPropertyCodeAction", "Use Auto Property" }, - { "Microsoft.CodeAnalysis.UnsealClass.AbstractUnsealClassCodeFixProvider+MyCodeAction", "Unseal Class" }, - { "Microsoft.CodeAnalysis.SplitOrMergeIfStatements.AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider+MyCodeAction", "Merge Consecutive If Statements" }, - { "Microsoft.CodeAnalysis.SplitOrMergeIfStatements.AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider+MyCodeAction", "Split Into Consecutive If Statements" }, - { "Microsoft.CodeAnalysis.SplitOrMergeIfStatements.AbstractMergeNestedIfStatementsCodeRefactoringProvider+MyCodeAction", "Merge Nested If Statements" }, - { "Microsoft.CodeAnalysis.SplitOrMergeIfStatements.AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider+MyCodeAction", "Split Into Nested If Statements" }, + { "Microsoft.CodeAnalysis.UnsealClass.AbstractUnsealClassCodeFixProvider", "Unseal Class" }, + { "Microsoft.CodeAnalysis.SplitOrMergeIfStatements.AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider", "Merge Consecutive If Statements" }, + { "Microsoft.CodeAnalysis.SplitOrMergeIfStatements.AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider", "Split Into Consecutive If Statements" }, + { "Microsoft.CodeAnalysis.SplitOrMergeIfStatements.AbstractMergeNestedIfStatementsCodeRefactoringProvider", "Merge Nested If Statements" }, + { "Microsoft.CodeAnalysis.SplitOrMergeIfStatements.AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider", "Split Into Nested If Statements" }, { "Microsoft.CodeAnalysis.SpellCheck.AbstractSpellCheckCodeFixProvider`1+SpellCheckCodeAction", "Spell Check" }, - { "Microsoft.CodeAnalysis.SpellCheck.AbstractSpellCheckCodeFixProvider`1+MyCodeAction", "Spell Check" }, - { "Microsoft.CodeAnalysis.SimplifyTypeNames.AbstractSimplifyTypeNamesCodeFixProvider`1+MyCodeAction", "Simplify Type Names" }, - { "Microsoft.CodeAnalysis.SimplifyThisOrMe.AbstractSimplifyThisOrMeCodeFixProvider`1+MyCodeAction", "Simplify This Or Me" }, + { "Microsoft.CodeAnalysis.SpellCheck.AbstractSpellCheckCodeFixProvider`1", "Spell Check" }, + { "Microsoft.CodeAnalysis.SimplifyTypeNames.AbstractSimplifyTypeNamesCodeFixProvider`1", "Simplify Type Names" }, + { "Microsoft.CodeAnalysis.SimplifyThisOrMe.AbstractSimplifyThisOrMeCodeFixProvider`1", "Simplify This Or Me" }, { "Microsoft.CodeAnalysis.ReplacePropertyWithMethods.ReplacePropertyWithMethodsCodeRefactoringProvider+ReplacePropertyWithMethodsCodeAction", "Replace Property With Methods" }, { "Microsoft.CodeAnalysis.ReplaceMethodWithProperty.ReplaceMethodWithPropertyCodeRefactoringProvider+ReplaceMethodWithPropertyCodeAction", "Replace Method With Property" }, - { "Microsoft.CodeAnalysis.ReplaceDocCommentTextWithTag.AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider+MyCodeAction", "Replace Doc Comment Text With Tag" }, - { "Microsoft.CodeAnalysis.RemoveUnusedVariable.AbstractRemoveUnusedVariableCodeFixProvider`3+MyCodeAction", "Remove Unused Variable" }, - { "Microsoft.CodeAnalysis.RemoveAsyncModifier.AbstractRemoveAsyncModifierCodeFixProvider`2+MyCodeAction", "Remove Async Modifier" }, + { "Microsoft.CodeAnalysis.ReplaceDocCommentTextWithTag.AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider", "Replace Doc Comment Text With Tag" }, + { "Microsoft.CodeAnalysis.RemoveUnusedVariable.AbstractRemoveUnusedVariableCodeFixProvider`3", "Remove Unused Variable" }, + { "Microsoft.CodeAnalysis.RemoveAsyncModifier.AbstractRemoveAsyncModifierCodeFixProvider`2", "Remove Async Modifier" }, { "Microsoft.CodeAnalysis.PreferFrameworkType.PreferFrameworkTypeCodeFixProvider+PreferFrameworkTypeCodeAction", "Prefer Framework Type" }, - { "Microsoft.CodeAnalysis.NameTupleElement.AbstractNameTupleElementCodeRefactoringProvider`2+MyCodeAction", "Name Tuple Element" }, + { "Microsoft.CodeAnalysis.NameTupleElement.AbstractNameTupleElementCodeRefactoringProvider`2", "Name Tuple Element" }, { "Microsoft.CodeAnalysis.MoveToNamespace.AbstractMoveToNamespaceCodeAction+MoveItemsToNamespaceCodeAction", "Move Items To Namespace" }, { "Microsoft.CodeAnalysis.MoveToNamespace.AbstractMoveToNamespaceCodeAction+MoveTypeToNamespaceCodeAction", "Move Type To Namespace" }, - { "Microsoft.CodeAnalysis.MoveDeclarationNearReference.AbstractMoveDeclarationNearReferenceCodeRefactoringProvider`1+MyCodeAction", "Move Declaration Near Reference" }, - { "Microsoft.CodeAnalysis.MakeMethodSynchronous.AbstractMakeMethodSynchronousCodeFixProvider+MyCodeAction", "Make Method Synchronous" }, - { "Microsoft.CodeAnalysis.MakeMethodAsynchronous.AbstractMakeMethodAsynchronousCodeFixProvider+MyCodeAction", "Make Method Asynchronous" }, - { "Microsoft.CodeAnalysis.MakeMemberStatic.AbstractMakeMemberStaticCodeFixProvider+MyCodeAction", "Make Member Static" }, - { "Microsoft.CodeAnalysis.MakeTypeAbstract.AbstractMakeTypeAbstractCodeFixProvider`1+MyCodeAction", "Make Type Abstract" }, - { "Microsoft.CodeAnalysis.InvertLogical.AbstractInvertLogicalCodeRefactoringProvider`3+MyCodeAction", "Invert Logical" }, - { "Microsoft.CodeAnalysis.InvertIf.AbstractInvertIfCodeRefactoringProvider`3+MyCodeAction", "Invert If" }, - { "Microsoft.CodeAnalysis.InvertConditional.AbstractInvertConditionalCodeRefactoringProvider`1+MyCodeAction", "Invert Conditional (Refactoring)" }, + { "Microsoft.CodeAnalysis.MoveDeclarationNearReference.AbstractMoveDeclarationNearReferenceCodeRefactoringProvider`1", "Move Declaration Near Reference" }, + { "Microsoft.CodeAnalysis.MakeMethodSynchronous.AbstractMakeMethodSynchronousCodeFixProvider", "Make Method Synchronous" }, + { "Microsoft.CodeAnalysis.MakeMethodAsynchronous.AbstractMakeMethodAsynchronousCodeFixProvider", "Make Method Asynchronous" }, + { "Microsoft.CodeAnalysis.MakeMemberStatic.AbstractMakeMemberStaticCodeFixProvider", "Make Member Static" }, + { "Microsoft.CodeAnalysis.MakeTypeAbstract.AbstractMakeTypeAbstractCodeFixProvider`1", "Make Type Abstract" }, + { "Microsoft.CodeAnalysis.InvertLogical.AbstractInvertLogicalCodeRefactoringProvider`3", "Invert Logical" }, + { "Microsoft.CodeAnalysis.InvertIf.AbstractInvertIfCodeRefactoringProvider`3", "Invert If" }, + { "Microsoft.CodeAnalysis.InvertConditional.AbstractInvertConditionalCodeRefactoringProvider`1", "Invert Conditional (Refactoring)" }, { "Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceVariableService`6+IntroduceVariableCodeAction", "Introduce Variable" }, { "Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceVariableService`6+IntroduceVariableAllOccurrenceCodeAction", "Introduce Variable All Occurrence" }, - { "Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceLocalForExpressionCodeRefactoringProvider`4+MyCodeAction", "Introduce Variable For Expression" }, - { "Microsoft.CodeAnalysis.IntroduceUsingStatement.AbstractIntroduceUsingStatementCodeRefactoringProvider`2+MyCodeAction", "Introduce Using Statement" }, + { "Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceLocalForExpressionCodeRefactoringProvider`4", "Introduce Variable For Expression" }, + { "Microsoft.CodeAnalysis.IntroduceUsingStatement.AbstractIntroduceUsingStatementCodeRefactoringProvider`2", "Introduce Using Statement" }, { "Microsoft.CodeAnalysis.InlineMethod.AbstractInlineMethodRefactoringProvider`4+MySolutionChangeAction", "Inline Method (Refactoring)" }, - { "Microsoft.CodeAnalysis.InitializeParameter.AbstractInitializeParameterCodeRefactoringProvider`4+MyCodeAction", "Initialize Parameter" }, + { "Microsoft.CodeAnalysis.InitializeParameter.AbstractInitializeParameterCodeRefactoringProvider`4", "Initialize Parameter" }, { "Microsoft.CodeAnalysis.ImplementInterface.AbstractImplementInterfaceService+ImplementInterfaceCodeAction", "Implement Interface" }, { "Microsoft.CodeAnalysis.ImplementInterface.AbstractImplementInterfaceService+ImplementInterfaceWithDisposePatternCodeAction", "Implement Interface With Dispose Pattern" }, - { "Microsoft.CodeAnalysis.ImplementAbstractClass.AbstractImplementAbstractClassCodeFixProvider`1+MyCodeAction", "Implement Abstract Class" }, + { "Microsoft.CodeAnalysis.ImplementAbstractClass.AbstractImplementAbstractClassCodeFixProvider`1", "Implement Abstract Class" }, { "Microsoft.CodeAnalysis.GenerateType.AbstractGenerateTypeService`6+GenerateTypeCodeAction", "Generate Type" }, { "Microsoft.CodeAnalysis.GenerateType.AbstractGenerateTypeService`6+GenerateTypeCodeActionWithOption", "Generate Type With Option" }, - { "Microsoft.CodeAnalysis.GenerateType.AbstractGenerateTypeService`6+MyCodeAction", "Generate Type" }, + { "Microsoft.CodeAnalysis.GenerateType.AbstractGenerateTypeService`6", "Generate Type" }, { "Microsoft.CodeAnalysis.GenerateOverrides.GenerateOverridesCodeRefactoringProvider+GenerateOverridesWithDialogCodeAction", "Generate Overrides With Dialog" }, { "Microsoft.CodeAnalysis.GenerateMember.GenerateVariable.AbstractGenerateVariableService`3+GenerateVariableCodeAction", "Generate Variable" }, - { "Microsoft.CodeAnalysis.GenerateMember.GenerateVariable.AbstractGenerateVariableService`3+MyCodeAction", "Generate Variable" }, + { "Microsoft.CodeAnalysis.GenerateMember.GenerateVariable.AbstractGenerateVariableService`3", "Generate Variable" }, { "Microsoft.CodeAnalysis.GenerateMember.GenerateVariable.AbstractGenerateVariableService`3+GenerateLocalCodeAction", "Generate Local" }, { "Microsoft.CodeAnalysis.GenerateMember.GenerateVariable.AbstractGenerateVariableService`3+GenerateParameterCodeAction", "Generate Parameter" }, { "Microsoft.CodeAnalysis.GenerateMember.GenerateParameterizedMember.AbstractGenerateParameterizedMemberService`4+GenerateParameterizedMemberCodeAction", "Generate Parameterized Member" }, { "Microsoft.CodeAnalysis.GenerateMember.GenerateEnumMember.AbstractGenerateEnumMemberService`3+GenerateEnumMemberCodeAction", "Generate Enum Member" }, { "Microsoft.CodeAnalysis.GenerateMember.GenerateDefaultConstructors.AbstractGenerateDefaultConstructorsService`1+GenerateDefaultConstructorCodeAction", "Generate Default Constructors" }, { "Microsoft.CodeAnalysis.GenerateMember.GenerateDefaultConstructors.AbstractGenerateDefaultConstructorsService`1+CodeActionAll", "Generate Default Constructors All" }, - { "Microsoft.CodeAnalysis.GenerateMember.GenerateConstructor.AbstractGenerateConstructorService`2+MyCodeAction", "Generate Constructor" }, + { "Microsoft.CodeAnalysis.GenerateMember.GenerateConstructor.AbstractGenerateConstructorService`2", "Generate Constructor" }, { "Microsoft.CodeAnalysis.GenerateEqualsAndGetHashCodeFromMembers.GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider+GenerateEqualsAndGetHashCodeAction", "Generate Equals And Get Hash Code From Members" }, { "Microsoft.CodeAnalysis.GenerateEqualsAndGetHashCodeFromMembers.GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider+GenerateEqualsAndGetHashCodeWithDialogCodeAction", "Generate Equals And Get Hash Code From Members With Dialog" }, { "Microsoft.CodeAnalysis.GenerateConstructorFromMembers.AbstractGenerateConstructorFromMembersCodeRefactoringProvider+ConstructorDelegatingCodeAction", "Generate Constructor From Members (Constructor Delegating)" }, { "Microsoft.CodeAnalysis.GenerateConstructorFromMembers.AbstractGenerateConstructorFromMembersCodeRefactoringProvider+FieldDelegatingCodeAction", "Generate Constructor From Members (Field Delegating)" }, { "Microsoft.CodeAnalysis.GenerateConstructorFromMembers.AbstractGenerateConstructorFromMembersCodeRefactoringProvider+GenerateConstructorWithDialogCodeAction", "Generate Constructor From Members With Dialog" }, - { "Microsoft.CodeAnalysis.GenerateComparisonOperators.GenerateComparisonOperatorsCodeRefactoringProvider+MyCodeAction", "Generate Comparison Operators" }, - { "Microsoft.CodeAnalysis.Formatting.FormattingCodeFixProvider+MyCodeAction", "Fix Formatting" }, - { "Microsoft.CodeAnalysis.EncapsulateField.AbstractEncapsulateFieldService+MyCodeAction", "Encapsulate Field" }, - { "Microsoft.CodeAnalysis.DiagnosticComments.CodeFixes.AbstractAddDocCommentNodesCodeFixProvider`4+MyCodeAction", "Diagnostic Comments: Add DocComment Nodes" }, - { "Microsoft.CodeAnalysis.DiagnosticComments.CodeFixes.AbstractRemoveDocCommentNodeCodeFixProvider`2+MyCodeAction", "Diagnostic Comments: Remove DocComment Node" }, - { "Microsoft.CodeAnalysis.ConvertTupleToStruct.AbstractConvertTupleToStructCodeRefactoringProvider`10+MyCodeAction", "Convert Tuple To Struct" }, - { "Microsoft.CodeAnalysis.ConvertToInterpolatedString.AbstractConvertConcatenationToInterpolatedStringRefactoringProvider`1+MyCodeAction", "Convert Concatenation To Interpolated String" }, + { "Microsoft.CodeAnalysis.GenerateComparisonOperators.GenerateComparisonOperatorsCodeRefactoringProvider", "Generate Comparison Operators" }, + { "Microsoft.CodeAnalysis.Formatting.FormattingCodeFixProvider", "Fix Formatting" }, + { "Microsoft.CodeAnalysis.EncapsulateField.AbstractEncapsulateFieldService", "Encapsulate Field" }, + { "Microsoft.CodeAnalysis.DiagnosticComments.CodeFixes.AbstractAddDocCommentNodesCodeFixProvider`4", "Diagnostic Comments: Add DocComment Nodes" }, + { "Microsoft.CodeAnalysis.DiagnosticComments.CodeFixes.AbstractRemoveDocCommentNodeCodeFixProvider`2", "Diagnostic Comments: Remove DocComment Node" }, + { "Microsoft.CodeAnalysis.ConvertTupleToStruct.AbstractConvertTupleToStructCodeRefactoringProvider`10", "Convert Tuple To Struct" }, + { "Microsoft.CodeAnalysis.ConvertToInterpolatedString.AbstractConvertConcatenationToInterpolatedStringRefactoringProvider`1", "Convert Concatenation To Interpolated String" }, { "Microsoft.CodeAnalysis.ConvertToInterpolatedString.AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider`5+ConvertToInterpolatedStringCodeAction", "Convert Placeholder To Interpolated String" }, - { "Microsoft.CodeAnalysis.ConvertToInterpolatedString.ConvertRegularStringToInterpolatedStringRefactoringProvider+MyCodeAction", "Convert Regular String To Interpolated String" }, - { "Microsoft.CodeAnalysis.ConvertNumericLiteral.AbstractConvertNumericLiteralCodeRefactoringProvider`1+MyCodeAction", "Convert Numeric Literal" }, - { "Microsoft.CodeAnalysis.ConvertLinq.AbstractConvertLinqQueryToForEachProvider`2+MyCodeAction", "Convert Linq Query To ForEach" }, + { "Microsoft.CodeAnalysis.ConvertToInterpolatedString.ConvertRegularStringToInterpolatedStringRefactoringProvider", "Convert Regular String To Interpolated String" }, + { "Microsoft.CodeAnalysis.ConvertNumericLiteral.AbstractConvertNumericLiteralCodeRefactoringProvider`1", "Convert Numeric Literal" }, + { "Microsoft.CodeAnalysis.ConvertLinq.AbstractConvertLinqQueryToForEachProvider`2", "Convert Linq Query To ForEach" }, { "Microsoft.CodeAnalysis.ConvertLinq.ConvertForEachToLinqQuery.AbstractConvertForEachToLinqQueryProvider`2+ForEachToLinqQueryCodeAction", "Convert ForEach To Linq Query" }, - { "Microsoft.CodeAnalysis.ConvertIfToSwitch.AbstractConvertIfToSwitchCodeRefactoringProvider`4+MyCodeAction", "Convert If To Switch" }, - { "Microsoft.CodeAnalysis.ConvertForToForEach.AbstractConvertForToForEachCodeRefactoringProvider`6+MyCodeAction", "Convert For To ForEach" }, + { "Microsoft.CodeAnalysis.ConvertIfToSwitch.AbstractConvertIfToSwitchCodeRefactoringProvider`4", "Convert If To Switch" }, + { "Microsoft.CodeAnalysis.ConvertForToForEach.AbstractConvertForToForEachCodeRefactoringProvider`6", "Convert For To ForEach" }, { "Microsoft.CodeAnalysis.ConvertForEachToFor.AbstractConvertForEachToForCodeRefactoringProvider`2+ForEachToForCodeAction", "Convert ForEach To For" }, - { "Microsoft.CodeAnalysis.ConvertCast.AbstractConvertCastCodeRefactoringProvider`3+MyCodeAction", "Convert Cast" }, - { "Microsoft.CodeAnalysis.ConvertAutoPropertyToFullProperty.AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider`2+ConvertAutoPropertyToFullPropertyCodeAction", "Convert AutoProperty To Full Property" }, - { "Microsoft.CodeAnalysis.ConflictMarkerResolution.AbstractResolveConflictMarkerCodeFixProvider+MyCodeAction", "Resolve Conflict Marker" }, - { "Microsoft.CodeAnalysis.CSharp.ConvertAnonymousTypeToClass.AbstractConvertAnonymousTypeToClassCodeRefactoringProvider`6+MyCodeAction", "Convert Anonymous Type To Class" }, + { "Microsoft.CodeAnalysis.ConvertCast.AbstractConvertCastCodeRefactoringProvider`3", "Convert Cast" }, + { "Microsoft.CodeAnalysis.ConvertAutoPropertyToFullProperty.AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider`3+ConvertAutoPropertyToFullPropertyCodeAction", "Convert AutoProperty To Full Property" }, + { "Microsoft.CodeAnalysis.ConflictMarkerResolution.AbstractResolveConflictMarkerCodeFixProvider", "Resolve Conflict Marker" }, + { "Microsoft.CodeAnalysis.CSharp.ConvertAnonymousTypeToClass.AbstractConvertAnonymousTypeToClassCodeRefactoringProvider`6", "Convert Anonymous Type To Class" }, { "Microsoft.CodeAnalysis.AddMissingImports.AbstractAddMissingImportsRefactoringProvider+AddMissingImportsCodeAction", "Add Missing Imports (Paste)" }, { "Microsoft.CodeAnalysis.CodeRefactorings.PullMemberUp.AbstractPullMemberUpRefactoringProvider+PullMemberUpWithDialogCodeAction", "Pull Member Up" }, { "Microsoft.CodeAnalysis.CodeRefactorings.SyncNamespace.AbstractSyncNamespaceCodeRefactoringProvider`3+ChangeNamespaceCodeAction", "Sync Namespace: Change Namespace" }, { "Microsoft.CodeAnalysis.CodeRefactorings.SyncNamespace.AbstractSyncNamespaceCodeRefactoringProvider`3+MoveFileCodeAction", "Sync Namespace: Move File" }, { "Microsoft.CodeAnalysis.CodeRefactorings.MoveType.AbstractMoveTypeService`5+MoveTypeCodeAction", "Move Type" }, - { "Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider+MyCodeAction", "Extract Method" }, - { "Microsoft.CodeAnalysis.CodeRefactorings.AddAwait.AbstractAddAwaitCodeRefactoringProvider`1+MyCodeAction", "Add Await" }, + { "Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider", "Extract Method" }, + { "Microsoft.CodeAnalysis.CodeRefactorings.AddAwait.AbstractAddAwaitCodeRefactoringProvider`1", "Add Await" }, { "Microsoft.CodeAnalysis.CodeFixes.NamingStyles.NamingStyleCodeFixProvider+FixNameCodeAction", "Fix Naming Style" }, - { "Microsoft.CodeAnalysis.CodeFixes.MatchFolderAndNamespace.AbstractChangeNamespaceToMatchFolderCodeFixProvider+MyCodeAction", "Change Namespace To Match Folder" }, - { "Microsoft.CodeAnalysis.CodeFixes.FullyQualify.AbstractFullyQualifyCodeFixProvider+MyCodeAction", "Fully Qualify" }, + { "Microsoft.CodeAnalysis.CodeFixes.MatchFolderAndNamespace.AbstractChangeNamespaceToMatchFolderCodeFixProvider", "Change Namespace To Match Folder" }, + { "Microsoft.CodeAnalysis.CodeFixes.FullyQualify.AbstractFullyQualifyCodeFixProvider", "Fully Qualify" }, { "Microsoft.CodeAnalysis.CodeFixes.FullyQualify.AbstractFullyQualifyCodeFixProvider+GroupingCodeAction", "Fully Qualify (Grouping)" }, { "Microsoft.CodeAnalysis.CodeFixes.Suppression.AbstractSuppressionCodeFixProvider+GlobalSuppressMessageCodeAction", "Suppression.: Global Suppress Message" }, { "Microsoft.CodeAnalysis.CodeFixes.Suppression.AbstractSuppressionCodeFixProvider+GlobalSuppressMessageFixAllCodeAction", "Suppression: Global Suppress Message (FixAll)" }, @@ -230,58 +232,63 @@ public class Program { "Microsoft.CodeAnalysis.CodeFixes.Configuration.ConfigureSeverity.ConfigureSeverityLevelCodeFixProvider+TopLevelBulkConfigureSeverityCodeAction", "Configure Severity: TopLevel Bulk Configure Severity" }, { "Microsoft.CodeAnalysis.CodeFixes.Configuration.ConfigureSeverity.ConfigureSeverityLevelCodeFixProvider+TopLevelConfigureSeverityCodeAction", "Configure Severity: TopLevel Configure Severity" }, { "Microsoft.CodeAnalysis.CodeFixes.Configuration.ConfigureCodeStyle.ConfigureCodeStyleOptionCodeFixProvider+TopLevelConfigureCodeStyleOptionCodeAction", "Configure CodeStyle Option: TopLevel Configure CodeStyle Option" }, - { "Microsoft.CodeAnalysis.CodeFixes.Async.AbstractConvertToAsyncCodeFixProvider+MyCodeAction", "Convert To Async" }, - { "Microsoft.CodeAnalysis.CodeFixes.AddExplicitCast.AbstractAddExplicitCastCodeFixProvider`1+MyCodeAction", "Add Explicit Cast" }, - { "Microsoft.CodeAnalysis.AliasAmbiguousType.AbstractAliasAmbiguousTypeCodeFixProvider+MyCodeAction", "Alias Ambiguous Type" }, - { "Microsoft.CodeAnalysis.AddParameter.AbstractAddParameterCodeFixProvider`6+MyCodeAction", "Add Parameter" }, - { "Microsoft.CodeAnalysis.AddObsoleteAttribute.AbstractAddObsoleteAttributeCodeFixProvider+MyCodeAction", "Add Obsolete Attribute" }, + { "Microsoft.CodeAnalysis.CodeFixes.Async.AbstractConvertToAsyncCodeFixProvider", "Convert To Async" }, + { "Microsoft.CodeAnalysis.CodeFixes.AddExplicitCast.AbstractAddExplicitCastCodeFixProvider`1", "Add Explicit Cast" }, + { "Microsoft.CodeAnalysis.AliasAmbiguousType.AbstractAliasAmbiguousTypeCodeFixProvider", "Alias Ambiguous Type" }, + { "Microsoft.CodeAnalysis.AddParameter.AbstractAddParameterCodeFixProvider`6", "Add Parameter" }, + { "Microsoft.CodeAnalysis.AddObsoleteAttribute.AbstractAddObsoleteAttributeCodeFixProvider", "Add Obsolete Attribute" }, { "Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`1+AssemblyReferenceCodeAction", "AddImport (Assembly Reference)" }, { "Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`1+InstallPackageAndAddImportCodeAction", "AddImport (Install Package And Add Import)" }, { "Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`1+InstallWithPackageManagerCodeAction", "AddImport (Install With PackageManager)" }, { "Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`1+MetadataSymbolReferenceCodeAction", "AddImport (Metadata Symbol Reference)" }, { "Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`1+ParentInstallPackageCodeAction", "Add Import (Install Nuget Package)" }, { "Microsoft.CodeAnalysis.AddImport.AbstractAddImportFeatureService`1+ProjectSymbolReferenceCodeAction", "Add Import (Project Symbol Reference)" }, - { "Microsoft.CodeAnalysis.AddFileBanner.AbstractAddFileBannerCodeRefactoringProvider+MyCodeAction", "Add File Banner" }, - { "Microsoft.CodeAnalysis.AddDebuggerDisplay.AbstractAddDebuggerDisplayCodeRefactoringProvider`2+MyCodeAction", "Add Debugger Display" }, + { "Microsoft.CodeAnalysis.AddFileBanner.AbstractAddFileBannerCodeRefactoringProvider", "Add File Banner" }, + { "Microsoft.CodeAnalysis.AddDebuggerDisplay.AbstractAddDebuggerDisplayCodeRefactoringProvider`2", "Add Debugger Display" }, { "Microsoft.CodeAnalysis.AddConstructorParametersFromMembers.AddConstructorParametersFromMembersCodeRefactoringProvider+AddConstructorParametersCodeAction", "Add Constructor Parameters From Members" }, - { "Microsoft.CodeAnalysis.AddAnonymousTypeMemberName.AbstractAddAnonymousTypeMemberNameCodeFixProvider`3+MyCodeAction", "Add Anonymous Type Member Name" }, + { "Microsoft.CodeAnalysis.AddAnonymousTypeMemberName.AbstractAddAnonymousTypeMemberNameCodeFixProvider`3", "Add Anonymous Type Member Name" }, { "Microsoft.CodeAnalysis.CodeFixes.Suppression.AbstractSuppressionCodeFixProvider+GlobalSuppressMessageFixAllCodeAction+GlobalSuppressionSolutionChangeAction", "Suppression: Global Suppress Message (FixAll)" }, { "Microsoft.CodeAnalysis.CodeFixes.Suppression.AbstractSuppressionCodeFixProvider+RemoveSuppressionCodeAction+AttributeRemoveAction", "Suppression: Remove Suppression (Attribute)" }, { "Microsoft.CodeAnalysis.CodeFixes.Suppression.AbstractSuppressionCodeFixProvider+RemoveSuppressionCodeAction+PragmaRemoveAction", "Suppression: Remove Suppression (Pragma)" }, { "Microsoft.CodeAnalysis.VisualBasic.CodeActions.RemoveStatementCodeAction", "Remove Statement" }, { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.CorrectNextControlVariable.CorrectNextControlVariableCodeFixProvider+CorrectNextControlVariableCodeAction", "Correct Next Control Variable" }, - { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.GenerateEndConstruct.GenerateEndConstructCodeFixProvider+MyCodeAction", "Generate End Construct" }, + { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.GenerateEndConstruct.GenerateEndConstructCodeFixProvider", "Generate End Construct" }, { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.GenerateEvent.GenerateEventCodeFixProvider+GenerateEventCodeAction", "Generate Event" }, { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.IncorrectExitContinue.IncorrectExitContinueCodeFixProvider+AddKeywordCodeAction", "Incorrect Exit Continue: Add Keyword" }, { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.IncorrectExitContinue.IncorrectExitContinueCodeFixProvider+ReplaceKeywordCodeAction", "Incorrect Exit Continue: Replace Keyword" }, { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.IncorrectExitContinue.IncorrectExitContinueCodeFixProvider+ReplaceTokenKeywordCodeAction", "Incorrect Exit Continue: Replace Token Keyword" }, - { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.IncorrectFunctionReturnType.IncorrectFunctionReturnTypeCodeFixProvider+MyCodeAction", "Incorrect Function Return Type" }, - { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Iterator.VisualBasicChangeToYieldCodeFixProvider+MyCodeAction", "Change To Yield" }, - { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Iterator.VisualBasicConvertToIteratorCodeFixProvider+MyCodeAction", "Convert To Iterator" }, + { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.IncorrectFunctionReturnType.IncorrectFunctionReturnTypeCodeFixProvider", "Incorrect Function Return Type" }, + { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Iterator.VisualBasicChangeToYieldCodeFixProvider", "Change To Yield" }, + { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Iterator.VisualBasicConvertToIteratorCodeFixProvider", "Convert To Iterator" }, { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.MoveToTopOfFile.MoveToTopOfFileCodeFixProvider+MoveToLineCodeAction", "Move To Top Of File" }, { "Microsoft.CodeAnalysis.VisualBasic.CodeFixes.OverloadBase.OverloadBaseCodeFixProvider+AddKeywordAction", "Overload Base: Add Keyword" }, - { "Microsoft.CodeAnalysis.VisualBasic.CodeRefactorings.InlineTemporary.VisualBasicInlineTemporaryCodeRefactoringProvider+MyCodeAction", "Inline Temporary" }, - { "Microsoft.CodeAnalysis.VisualBasic.RemoveSharedFromModuleMembers.VisualBasicRemoveSharedFromModuleMembersCodeFixProvider+MyCodeAction", "Remove Shared From Module Members" }, - { "Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryByVal.VisualBasicRemoveUnnecessaryByValCodeFixProvider+MyCodeAction", "Remove Unnecessary ByVal" }, - { "Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryCast.VisualBasicRemoveUnnecessaryCastCodeFixProvider+MyCodeAction", "Remove Unnecessary Cast" }, - { "Microsoft.CodeAnalysis.VisualBasic.UseIsNotExpression.VisualBasicUseIsNotExpressionCodeFixProvider+MyCodeAction", "Use IsNot Expression" }, - { "Microsoft.CodeAnalysis.CSharp.UseTupleSwap.CSharpUseTupleSwapCodeFixProvider+MyCodeAction", "Use Tuple Swap" }, - { "Microsoft.CodeAnalysis.CSharp.UseIsNullCheck.CSharpUseNullCheckOverTypeCheckCodeFixProvider+MyCodeAction", "Use Null Check Over Type Check" }, - { "Microsoft.CodeAnalysis.CSharp.SimplifyPropertyPattern.CSharpSimplifyPropertyPatternCodeFixProvider+MyCodeAction", "Simplify Property Pattern" }, - { "Microsoft.CodeAnalysis.CSharp.ConvertNamespace.ConvertNamespaceCodeRefactoringProvider+MyCodeAction", "Convert Namespace Refactoring (FileScope/BlockScope)" }, - { "Microsoft.CodeAnalysis.CSharp.ConvertNamespace.ConvertNamespaceCodeFixProvider+MyCodeAction", "Convert Namespace CodeFix (FileScope/BlockScope)" }, - { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.UseRecursivePatterns.UseRecursivePatternsCodeRefactoringProvider+MyCodeAction", "Use Recursive Patterns" }, + { "Microsoft.CodeAnalysis.VisualBasic.CodeRefactorings.InlineTemporary.VisualBasicInlineTemporaryCodeRefactoringProvider", "Inline Temporary" }, + { "Microsoft.CodeAnalysis.VisualBasic.RemoveSharedFromModuleMembers.VisualBasicRemoveSharedFromModuleMembersCodeFixProvider", "Remove Shared From Module Members" }, + { "Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryByVal.VisualBasicRemoveUnnecessaryByValCodeFixProvider", "Remove Unnecessary ByVal" }, + { "Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryCast.VisualBasicRemoveUnnecessaryCastCodeFixProvider", "Remove Unnecessary Cast" }, + { "Microsoft.CodeAnalysis.VisualBasic.UseIsNotExpression.VisualBasicUseIsNotExpressionCodeFixProvider", "Use IsNot Expression" }, + { "Microsoft.CodeAnalysis.CSharp.UseTupleSwap.CSharpUseTupleSwapCodeFixProvider", "Use Tuple Swap" }, + { "Microsoft.CodeAnalysis.CSharp.UseIsNullCheck.CSharpUseNullCheckOverTypeCheckCodeFixProvider", "Use Null Check Over Type Check" }, + { "Microsoft.CodeAnalysis.CSharp.SimplifyPropertyPattern.CSharpSimplifyPropertyPatternCodeFixProvider", "Simplify Property Pattern" }, + { "Microsoft.CodeAnalysis.CSharp.ConvertNamespace.ConvertNamespaceCodeRefactoringProvider", "Convert Namespace Refactoring (FileScope/BlockScope)" }, + { "Microsoft.CodeAnalysis.CSharp.ConvertNamespace.ConvertNamespaceCodeFixProvider", "Convert Namespace CodeFix (FileScope/BlockScope)" }, + { "Microsoft.CodeAnalysis.CSharp.CodeRefactorings.UseRecursivePatterns.UseRecursivePatternsCodeRefactoringProvider", "Use Recursive Patterns" }, { "Microsoft.CodeAnalysis.MoveStaticMembers.MoveStaticMembersWithDialogCodeAction", "Move Static Members" }, - { "Microsoft.CodeAnalysis.SimplifyInterpolation.AbstractSimplifyInterpolationCodeFixProvider`5+MyCodeAction", "Simplify Interpolation" }, - { "Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceParameterService`4+MyCodeAction", "Introduce Parameter" }, + { "Microsoft.CodeAnalysis.SimplifyInterpolation.AbstractSimplifyInterpolationCodeFixProvider`5", "Simplify Interpolation" }, + { "Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceParameterService`4", "Introduce Parameter" }, { "Microsoft.CodeAnalysis.GenerateDefaultConstructors.AbstractGenerateDefaultConstructorsService`1+GenerateDefaultConstructorCodeAction", "Generate Default Constructor" }, { "Microsoft.CodeAnalysis.GenerateDefaultConstructors.AbstractGenerateDefaultConstructorsService`1+CodeActionAll", "Generate Default Constructur (All)" }, { "Microsoft.CodeAnalysis.ConvertToInterpolatedString.AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider`6+ConvertToInterpolatedStringCodeAction", "Convert Placeholder To Interpolated String" }, - { "Microsoft.CodeAnalysis.ConvertAnonymousType.AbstractConvertAnonymousTypeToClassCodeRefactoringProvider`6+MyCodeAction", "Convert Anonymous Type To Class" }, - { "Microsoft.CodeAnalysis.ConvertAnonymousType.AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider`3+MyCodeAction", "Convert Anonymous Type To Tuple" }, - { "Microsoft.CodeAnalysis.VisualBasic.SimplifyObjectCreation.VisualBasicSimplifyObjectCreationCodeFixProvider+MyCodeAction", "Simplify Object Creation" }, + { "Microsoft.CodeAnalysis.ConvertAnonymousType.AbstractConvertAnonymousTypeToClassCodeRefactoringProvider`6", "Convert Anonymous Type To Class" }, + { "Microsoft.CodeAnalysis.ConvertAnonymousType.AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider`3", "Convert Anonymous Type To Tuple" }, + { "Microsoft.CodeAnalysis.VisualBasic.SimplifyObjectCreation.VisualBasicSimplifyObjectCreationCodeFixProvider", "Simplify Object Creation" }, { "Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider+RenameTrackingCodeAction", "Rename Tracking" }, - { "Microsoft.CodeAnalysis.CSharp.CodeFixes.AddInheritdoc.AddInheritdocCodeFixProvider+MyCodeAction", "Add Inheritdoc" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.AddInheritdoc.AddInheritdocCodeFixProvider", "Add Inheritdoc" }, + { "Microsoft.CodeAnalysis.CSharp.CodeFixes.TransposeRecordKeyword.CSharpTransposeRecordKeywordCodeFixProvider", "Fix record declaration" }, + { "Microsoft.CodeAnalysis.CSharp.ConvertToRawString.ConvertRegularStringToRawStringCodeRefactoringProvider", "Convert to raw string" }, + { "Microsoft.CodeAnalysis.CSharp.RemoveUnnecessaryLambdaExpression.CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider", "Remove Unnecessary Lambda Expression" }, + { "Microsoft.CodeAnalysis.CSharp.UseParameterNullChecking.CSharpUseParameterNullCheckingCodeFixProvider", "Use Parameter Null Checking" }, + { "Microsoft.CodeAnalysis.Features.EmbeddedLanguages.Json.LanguageServices.AbstractJsonDetectionCodeFixProvider", "Enable all JSON editor features" }, }.ToImmutableDictionary(); public static void Main(string[] args) @@ -289,11 +296,11 @@ public static void Main(string[] args) Console.WriteLine("Loading assemblies and finding CodeActions ..."); var assemblies = GetAssemblies(args); - var codeActionTypes = GetCodeActionTypes(assemblies); + var codeActionAndProviderTypes = GetCodeActionAndProviderTypes(assemblies); - Console.WriteLine($"Generating Kusto datatable of {codeActionTypes.Length} CodeAction hashes ..."); + Console.WriteLine($"Generating Kusto datatable of {codeActionAndProviderTypes.Length} CodeAction and provider hashes ..."); - var telemetryInfos = GetTelemetryInfos(codeActionTypes); + var telemetryInfos = GetTelemetryInfos(codeActionAndProviderTypes); var datatable = GenerateKustoDatatable(telemetryInfos); var filepath = Path.GetFullPath(".\\ActionTable.txt"); @@ -331,20 +338,25 @@ static string GetRelativePath(string path, Uri baseUri) } } - internal static ImmutableArray GetCodeActionTypes(IEnumerable assemblies) + internal static ImmutableArray GetCodeActionAndProviderTypes(IEnumerable assemblies) { var types = assemblies.SelectMany( assembly => assembly.GetTypes().Where( type => !type.GetTypeInfo().IsInterface && !type.GetTypeInfo().IsAbstract)); return types - .Where(t => typeof(CodeAction).IsAssignableFrom(t)) + .Where(t => isCodeActionType(t) || isCodeActionProviderType(t)) .ToImmutableArray(); + + static bool isCodeActionType(Type t) => typeof(CodeAction).IsAssignableFrom(t); + + static bool isCodeActionProviderType(Type t) => typeof(CodeFixProvider).IsAssignableFrom(t) + || typeof(CodeRefactoringProvider).IsAssignableFrom(t); } - internal static ImmutableArray GetTelemetryInfos(ImmutableArray codeActionTypes) + internal static ImmutableArray GetTelemetryInfos(ImmutableArray codeActionAndProviderTypes) { - return codeActionTypes + return codeActionAndProviderTypes .Distinct(FullNameTypeComparer.Instance) .Select(GetTelemetryInfo) .ToImmutableArray(); diff --git a/src/Tools/ExternalAccess/FSharp/Editor/AutoFormattingOptionsWrapper.cs b/src/Tools/ExternalAccess/FSharp/Editor/AutoFormattingOptionsWrapper.cs index 9e403a11b9eb1..3afa0f908f3be 100644 --- a/src/Tools/ExternalAccess/FSharp/Editor/AutoFormattingOptionsWrapper.cs +++ b/src/Tools/ExternalAccess/FSharp/Editor/AutoFormattingOptionsWrapper.cs @@ -9,11 +9,15 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor internal readonly struct AutoFormattingOptionsWrapper { internal readonly AutoFormattingOptions UnderlyingObject; + private readonly FormattingOptions2.IndentStyle _indentStyle; - public AutoFormattingOptionsWrapper(AutoFormattingOptions underlyingObject) - => UnderlyingObject = underlyingObject; + public AutoFormattingOptionsWrapper(AutoFormattingOptions underlyingObject, FormattingOptions2.IndentStyle indentStyle) + { + UnderlyingObject = underlyingObject; + _indentStyle = indentStyle; + } public FormattingOptions.IndentStyle IndentStyle - => UnderlyingObject.IndentStyle; + => (FormattingOptions.IndentStyle)_indentStyle; } } diff --git a/src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpEditorFormattingService.cs b/src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpEditorFormattingService.cs index cdbd528c71867..a99c28f201ddc 100644 --- a/src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpEditorFormattingService.cs +++ b/src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpEditorFormattingService.cs @@ -57,10 +57,10 @@ public Task> GetFormattingChangesOnPasteAsync(Document documen return _service.GetFormattingChangesOnReturnAsync(document, position, cancellationToken); } - public bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptions options, char ch) + public bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptions options, FormattingOptions2.IndentStyle indentStyle, char ch) { return _service is IFSharpEditorFormattingServiceWithOptions serviceWithOptions ? - serviceWithOptions.SupportsFormattingOnTypedCharacter(document, new AutoFormattingOptionsWrapper(options), ch) : + serviceWithOptions.SupportsFormattingOnTypedCharacter(document, new AutoFormattingOptionsWrapper(options, indentStyle), ch) : _service.SupportsFormattingOnTypedCharacter(document, ch); } diff --git a/src/Tools/ExternalAccess/Razor/RazorCSharpFormattingInteractionService.cs b/src/Tools/ExternalAccess/Razor/RazorCSharpFormattingInteractionService.cs index 164758b6f3031..39c9b125d5752 100644 --- a/src/Tools/ExternalAccess/Razor/RazorCSharpFormattingInteractionService.cs +++ b/src/Tools/ExternalAccess/Razor/RazorCSharpFormattingInteractionService.cs @@ -27,7 +27,8 @@ public static bool SupportsFormattingOnTypedCharacter(Document document, char ch Contract.ThrowIfFalse(document.Project.Language is LanguageNames.CSharp); var formattingService = document.GetRequiredLanguageService(); var options = AutoFormattingOptions.From(document.Project); - return formattingService.SupportsFormattingOnTypedCharacter(document, options, ch); + var indentStyle = document.Project.Solution.Options.GetOption(FormattingOptions2.SmartIndent, document.Project.Language); + return formattingService.SupportsFormattingOnTypedCharacter(document, options, indentStyle, ch); } /// diff --git a/src/Tools/IdeBenchmarks/StackTraceExplorer/StackTraceExplorerBenchmarks.cs b/src/Tools/IdeBenchmarks/StackTraceExplorer/StackTraceExplorerBenchmarks.cs new file mode 100644 index 0000000000000..15358560db92c --- /dev/null +++ b/src/Tools/IdeBenchmarks/StackTraceExplorer/StackTraceExplorerBenchmarks.cs @@ -0,0 +1,1770 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using BenchmarkDotNet.Attributes; + +namespace IdeBenchmarks.StackTraceExplorer +{ + [MemoryDiagnoser] + public class StackTraceExplorerBenchmarks + { + [Benchmark] + public async Task BenchmarkStackTraceParsing() + { + var result = await Microsoft.CodeAnalysis.StackTraceExplorer.StackTraceAnalyzer.AnalyzeAsync(Stack, CancellationToken.None); + Console.WriteLine($"Total {result.ParsedFrames.Length} items"); + } + + private const string Stack = @" +Stack overflow. + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelpOrErrorIfAppropriate(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.CommandBase.ShowHelpOrErrorIfAppropriate(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Tools.Tool.Run.ToolRunCommand..ctor(System.CommandLine.Parsing.ParseResult, Microsoft.DotNet.CommandFactory.LocalToolsCommandResolver) + at Microsoft.DotNet.Cli.ToolRunCommandParser+<>c.b__3_0(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.ParseResultCommandHandler.InvokeAsync(System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_2.b__3(System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass13_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass13_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass13_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass13_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_2.b__3(System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c+<b__19_0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c+<b__19_0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__19_0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c+<b__19_0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__19_0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c.b__19_0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_2.b__3(System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass17_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass17_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass17_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass17_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_2.b__3(System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.ParseResultExtensions.ShowHelp(System.CommandLine.Parsing.ParseResult) + at Microsoft.DotNet.Cli.Parser.ExceptionHandler(System.Exception, System.CommandLine.Invocation.InvocationContext) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d.MoveNext() + at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0+<b__0>d, System.CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<b__0>d ByRef) + at System.CommandLine.Builder.CommandLineBuilderExtensions+<>c__DisplayClass9_0.b__0(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline+<>c__DisplayClass4_1.b__2(System.CommandLine.Invocation.InvocationContext, System.Func`2) + at System.CommandLine.Invocation.InvocationPipeline.Invoke(System.CommandLine.IConsole) + at System.CommandLine.Parsing.ParseResultExtensions.Invoke(System.CommandLine.Parsing.ParseResult, System.CommandLine.IConsole) + at Microsoft.DotNet.Cli.Program.ProcessArgs(System.String[], System.TimeSpan, Microsoft.DotNet.Cli.Telemetry.ITelemetry) + at Microsoft.DotNet.Cli.Program.Main(System.String[])"; + + } +} diff --git a/src/VisualStudio/CSharp/Impl/Interactive/CSharpInteractiveWindowCommandCompletionProvider.cs b/src/VisualStudio/CSharp/Impl/Interactive/CSharpInteractiveWindowCommandCompletionProvider.cs index 7aee63e03175c..e0aa34baa6633 100644 --- a/src/VisualStudio/CSharp/Impl/Interactive/CSharpInteractiveWindowCommandCompletionProvider.cs +++ b/src/VisualStudio/CSharp/Impl/Interactive/CSharpInteractiveWindowCommandCompletionProvider.cs @@ -7,7 +7,7 @@ using System.ComponentModel.Composition; using System.Threading; using Microsoft.CodeAnalysis.Completion; -using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery; +using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Interactive; diff --git a/src/VisualStudio/CSharp/Test/EditorConfigSettings/DataProvider/DataProviderTests.cs b/src/VisualStudio/CSharp/Test/EditorConfigSettings/DataProvider/DataProviderTests.cs index d468a1beb38d1..5268426144b73 100644 --- a/src/VisualStudio/CSharp/Test/EditorConfigSettings/DataProvider/DataProviderTests.cs +++ b/src/VisualStudio/CSharp/Test/EditorConfigSettings/DataProvider/DataProviderTests.cs @@ -169,8 +169,6 @@ public void TestGettingWhitespaceSettingProviderWorkspaceServiceAsync() settingsProvider.RegisterViewModel(model); var dataSnapShot = settingsProvider.GetCurrentDataSnapshot(); var optionsCount = FormattingOptions2.Options.Length; - // we also include CodeStyleOptions2.OperatorPlacementWhenWrapping so we need to add one - optionsCount += 1; Assert.Equal(optionsCount, dataSnapShot.Length); } diff --git a/src/VisualStudio/Core/Def/Diagnostics/DiagnosticProgressReporter.cs b/src/VisualStudio/Core/Def/Diagnostics/DiagnosticProgressReporter.cs index 0e53c1bd6904d..668e1c63e7e01 100644 --- a/src/VisualStudio/Core/Def/Diagnostics/DiagnosticProgressReporter.cs +++ b/src/VisualStudio/Core/Def/Diagnostics/DiagnosticProgressReporter.cs @@ -6,9 +6,10 @@ using System.ComponentModel.Composition; using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.SolutionCrawler; +using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.TaskStatusCenter; using Roslyn.Utilities; @@ -18,9 +19,13 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.Diagnostics internal sealed class TaskCenterSolutionAnalysisProgressReporter { private static readonly TimeSpan s_minimumInterval = TimeSpan.FromMilliseconds(200); + private static readonly TaskHandlerOptions _options = new() + { + Title = ServicesVSResources.Running_low_priority_background_processes, + ActionsAfterCompletion = CompletionActions.None + }; - private readonly IVsTaskStatusCenterService _taskCenterService; - private readonly TaskHandlerOptions _options; + private IVsTaskStatusCenterService? _taskCenterService; #region Fields protected by _lock @@ -29,6 +34,8 @@ internal sealed class TaskCenterSolutionAnalysisProgressReporter /// report UI changes concurrently. /// private readonly object _lock = new(); + private readonly IThreadingContext _threadingContext; + private readonly VisualStudioWorkspace _workspace; /// /// Task used to trigger throttled UI updates in an interval @@ -80,19 +87,19 @@ internal sealed class TaskCenterSolutionAnalysisProgressReporter [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public TaskCenterSolutionAnalysisProgressReporter( - SVsTaskStatusCenterService taskStatusCenterService, - IDiagnosticService diagnosticService, + IThreadingContext threadingContext, VisualStudioWorkspace workspace) { - _taskCenterService = (IVsTaskStatusCenterService)taskStatusCenterService; - _options = new TaskHandlerOptions() - { - Title = ServicesVSResources.Running_low_priority_background_processes, - ActionsAfterCompletion = CompletionActions.None - }; + _threadingContext = threadingContext; + _workspace = workspace; + } - var crawlerService = workspace.Services.GetRequiredService(); - var reporter = crawlerService.GetProgressReporter(workspace); + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider) + { + _taskCenterService = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); + + var crawlerService = _workspace.Services.GetRequiredService(); + var reporter = crawlerService.GetProgressReporter(_workspace); if (reporter.InProgress) { @@ -157,6 +164,8 @@ private void UpdateUI(ProgressData progressData) // Start the task center task if not already running. if (_taskHandler == null) { + Contract.ThrowIfNull(_taskCenterService); + // Register a new task handler to handle a new task center task. // Each task handler can only register one task, so we must create a new one each time we start. _taskHandler = _taskCenterService.PreRegister(_options, data: default); diff --git a/src/VisualStudio/Core/Def/Diagnostics/IVisualStudioDiagnosticAnalyzerService.cs b/src/VisualStudio/Core/Def/Diagnostics/IVisualStudioDiagnosticAnalyzerService.cs index cde726c388d86..14912beeb9c16 100644 --- a/src/VisualStudio/Core/Def/Diagnostics/IVisualStudioDiagnosticAnalyzerService.cs +++ b/src/VisualStudio/Core/Def/Diagnostics/IVisualStudioDiagnosticAnalyzerService.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; using Microsoft.CodeAnalysis; +using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; namespace Microsoft.VisualStudio.LanguageServices.Implementation.Diagnostics @@ -34,6 +36,6 @@ internal interface IVisualStudioDiagnosticAnalyzerService /// /// Initializes the service. /// - void Initialize(IServiceProvider serviceProvider); + Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken); } } diff --git a/src/VisualStudio/Core/Def/Diagnostics/VisualStudioDiagnosticAnalyzerService.cs b/src/VisualStudio/Core/Def/Diagnostics/VisualStudioDiagnosticAnalyzerService.cs index 2177c9e290d3f..900ee36be1bd1 100644 --- a/src/VisualStudio/Core/Def/Diagnostics/VisualStudioDiagnosticAnalyzerService.cs +++ b/src/VisualStudio/Core/Def/Diagnostics/VisualStudioDiagnosticAnalyzerService.cs @@ -65,14 +65,15 @@ public VisualStudioDiagnosticAnalyzerService( _globalOptions = globalOptions; } - public void Initialize(IServiceProvider serviceProvider) + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) { - _serviceProvider = serviceProvider; + _serviceProvider = (IServiceProvider)serviceProvider; // Hook up the "Run Code Analysis" menu command for CPS based managed projects. - var menuCommandService = (IMenuCommandService)_serviceProvider.GetService(typeof(IMenuCommandService)); + var menuCommandService = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false); if (menuCommandService != null) { + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); VisualStudioCommandHandlerHelpers.AddCommand(menuCommandService, RunCodeAnalysisForSelectedProjectCommandId, VSConstants.VSStd2K, OnRunCodeAnalysisForSelectedProject, OnRunCodeAnalysisForSelectedProjectStatus); VisualStudioCommandHandlerHelpers.AddCommand(menuCommandService, ID.RoslynCommands.RunCodeAnalysisForProject, Guids.RoslynGroupId, OnRunCodeAnalysisForSelectedProject, OnRunCodeAnalysisForSelectedProjectStatus); VisualStudioCommandHandlerHelpers.AddCommand(menuCommandService, ID.RoslynCommands.AnalysisScopeDefault, Guids.RoslynGroupId, OnSetAnalysisScopeDefault, OnSetAnalysisScopeDefaultStatus); diff --git a/src/VisualStudio/Core/Def/ExternalAccess/LegacyCodeAnalysis/LegacyCodeAnalysisVisualStudioDiagnosticListSuppressionStateServiceAccessor.cs b/src/VisualStudio/Core/Def/ExternalAccess/LegacyCodeAnalysis/LegacyCodeAnalysisVisualStudioDiagnosticListSuppressionStateServiceAccessor.cs index 934560687eed9..05378f08b14f1 100644 --- a/src/VisualStudio/Core/Def/ExternalAccess/LegacyCodeAnalysis/LegacyCodeAnalysisVisualStudioDiagnosticListSuppressionStateServiceAccessor.cs +++ b/src/VisualStudio/Core/Def/ExternalAccess/LegacyCodeAnalysis/LegacyCodeAnalysisVisualStudioDiagnosticListSuppressionStateServiceAccessor.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable disable - using System; using System.Composition; using Microsoft.CodeAnalysis.ExternalAccess.LegacyCodeAnalysis.Api; diff --git a/src/VisualStudio/Core/Def/IAnalyzerNodeSetup.cs b/src/VisualStudio/Core/Def/IAnalyzerNodeSetup.cs index 773de549137f4..8dbac5b13a673 100644 --- a/src/VisualStudio/Core/Def/IAnalyzerNodeSetup.cs +++ b/src/VisualStudio/Core/Def/IAnalyzerNodeSetup.cs @@ -4,7 +4,9 @@ #nullable disable -using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.Shell; namespace Microsoft.VisualStudio.LanguageServices { @@ -13,7 +15,7 @@ namespace Microsoft.VisualStudio.LanguageServices /// internal interface IAnalyzerNodeSetup { - void Initialize(IServiceProvider serviceProvider); + Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken); void Unregister(); } } diff --git a/src/VisualStudio/Core/Def/Implementation/AbstractEditorFactory.cs b/src/VisualStudio/Core/Def/Implementation/AbstractEditorFactory.cs index bd1c626108500..79b29f4671d77 100644 --- a/src/VisualStudio/Core/Def/Implementation/AbstractEditorFactory.cs +++ b/src/VisualStudio/Core/Def/Implementation/AbstractEditorFactory.cs @@ -309,6 +309,10 @@ private async Task FormatDocumentCreatedFromTemplateAsync(IVsHierarchy hierarchy name: nameof(FormatDocumentCreatedFromTemplate), assemblyName: nameof(FormatDocumentCreatedFromTemplate), language: LanguageName); + + // We have to discover .editorconfig files ourselves to ensure that code style rules are followed. + // Normally the project system would tell us about these. + projectToAddTo = AddEditorConfigFiles(projectToAddTo, Path.GetDirectoryName(filePath)); } // We need to ensure that decisions made during new document formatting are based on the right language @@ -361,5 +365,41 @@ private async Task FormatDocumentCreatedFromTemplateAsync(IVsHierarchy hierarchy formattedText.Write(textWriter, cancellationToken: CancellationToken.None); }); } + + private static Project AddEditorConfigFiles(Project projectToAddTo, string projectFolder) + { + do + { + projectToAddTo = AddEditorConfigFile(projectToAddTo, projectFolder, out var foundRoot); + + if (foundRoot) + break; + + projectFolder = Path.GetDirectoryName(projectFolder); + } + while (projectFolder is not null); + + return projectToAddTo; + + static Project AddEditorConfigFile(Project project, string folder, out bool foundRoot) + { + const string EditorConfigFileName = ".editorconfig"; + + foundRoot = false; + + var editorConfigFile = Path.Combine(folder, EditorConfigFileName); + + var text = IOUtilities.PerformIO(() => + { + using var stream = File.OpenRead(editorConfigFile); + return SourceText.From(stream); + }); + + if (text is null) + return project; + + return project.AddAnalyzerConfigDocument(EditorConfigFileName, text, filePath: editorConfigFile).Project; + } + } } } diff --git a/src/VisualStudio/Core/Def/Implementation/VisualStudioMetadataAsSourceFileSupportService.cs b/src/VisualStudio/Core/Def/Implementation/VisualStudioMetadataAsSourceFileSupportService.cs index fb0c644ca17c1..73e6586c4d365 100644 --- a/src/VisualStudio/Core/Def/Implementation/VisualStudioMetadataAsSourceFileSupportService.cs +++ b/src/VisualStudio/Core/Def/Implementation/VisualStudioMetadataAsSourceFileSupportService.cs @@ -6,6 +6,9 @@ using System; using System.ComponentModel.Composition; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.MetadataAsSource; using Microsoft.VisualStudio.Shell; @@ -16,20 +19,25 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation [Export(typeof(VisualStudioMetadataAsSourceFileSupportService))] internal sealed class VisualStudioMetadataAsSourceFileSupportService : IVsSolutionEvents { + private readonly IThreadingContext _threadingContext; private readonly IMetadataAsSourceFileService _metadataAsSourceFileService; -#pragma warning disable IDE0052 // Remove unread private members - Used to store the AdviseSolutionEvents cookie. - private readonly uint _eventCookie; -#pragma warning restore IDE0052 // Remove unread private members - [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public VisualStudioMetadataAsSourceFileSupportService(SVsServiceProvider serviceProvider, IMetadataAsSourceFileService metadataAsSourceFileService) + public VisualStudioMetadataAsSourceFileSupportService( + IThreadingContext threadingContext, + IMetadataAsSourceFileService metadataAsSourceFileService) { + _threadingContext = threadingContext; _metadataAsSourceFileService = metadataAsSourceFileService; + } - var solution = (IVsSolution)serviceProvider.GetService(typeof(SVsSolution)); - ErrorHandler.ThrowOnFailure(solution.AdviseSolutionEvents(this, out _eventCookie)); + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) + { + var solution = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + // Intentionally ignore the event-cookie we get back out. We never stop listening to solution events. + ErrorHandler.ThrowOnFailure(solution.AdviseSolutionEvents(this, out _)); } public int OnAfterCloseSolution(object pUnkReserved) diff --git a/src/VisualStudio/Core/Def/InheritanceMargin/InheritanceMarginLogger.cs b/src/VisualStudio/Core/Def/InheritanceMargin/InheritanceMarginLogger.cs new file mode 100644 index 0000000000000..253e1dc07c4a9 --- /dev/null +++ b/src/VisualStudio/Core/Def/InheritanceMargin/InheritanceMarginLogger.cs @@ -0,0 +1,46 @@ +// 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. + +using System; +using Microsoft.CodeAnalysis.Internal.Log; + +namespace Microsoft.VisualStudio.LanguageServices.InheritanceMargin +{ + internal static class InheritanceMarginLogger + { + // 1 sec per bucket, and if it takes more than 1 min, then this log is considered as time-out in the last bucket. + private static readonly HistogramLogAggregator s_histogramLogAggregator = new(1000, 60000); + + private enum ActionInfo + { + GetInheritanceMarginMembers, + } + + public static void LogGenerateBackgroundInheritanceInfo(TimeSpan elapsedTime) + => s_histogramLogAggregator.IncreaseCount( + ActionInfo.GetInheritanceMarginMembers, Convert.ToDecimal(elapsedTime.TotalMilliseconds)); + + public static void LogInheritanceTargetsMenuOpen() + => Logger.Log(FunctionId.InheritanceMargin_TargetsMenuOpen, KeyValueLogMessage.Create(LogType.UserAction)); + + public static void LogNavigateToTarget() + => Logger.Log(FunctionId.InheritanceMargin_NavigateToTarget, KeyValueLogMessage.Create(LogType.UserAction)); + + public static void ReportTelemetry() + { + Logger.Log(FunctionId.InheritanceMargin_GetInheritanceMemberItems, + KeyValueLogMessage.Create( + m => + { + var histogramLogAggragator = s_histogramLogAggregator.GetValue(ActionInfo.GetInheritanceMarginMembers); + if (histogramLogAggragator != null) + { + m[$"{ActionInfo.GetInheritanceMarginMembers}.BucketSize"] = histogramLogAggragator.BucketSize; + m[$"{ActionInfo.GetInheritanceMarginMembers}.BucketCount"] = histogramLogAggragator.BucketCount; + m[$"{ActionInfo.GetInheritanceMarginMembers}.Bucket"] = histogramLogAggragator.GetBucketsAsString(); + } + })); + } + } +} diff --git a/src/VisualStudio/Core/Def/InheritanceMargin/InheritanceMarginTaggerProvider.cs b/src/VisualStudio/Core/Def/InheritanceMargin/InheritanceMarginTaggerProvider.cs index 6aef7dbc06c96..4ff5dade292f2 100644 --- a/src/VisualStudio/Core/Def/InheritanceMargin/InheritanceMarginTaggerProvider.cs +++ b/src/VisualStudio/Core/Def/InheritanceMargin/InheritanceMarginTaggerProvider.cs @@ -10,7 +10,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Editor; -using Microsoft.CodeAnalysis.Editor.Implementation.Classification; using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Editor.Shared.Options; using Microsoft.CodeAnalysis.Editor.Shared.Tagging; @@ -18,10 +17,10 @@ using Microsoft.CodeAnalysis.Editor.Tagging; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.InheritanceMargin; -using Microsoft.CodeAnalysis.Internal.Log; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.TestHooks; +using Microsoft.VisualStudio.LanguageServices.InheritanceMargin; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Tagging; @@ -105,20 +104,21 @@ protected override async Task ProduceTagsAsync( return; } - var inheritanceMemberItems = ImmutableArray.Empty; - using (Logger.LogBlock(FunctionId.InheritanceMargin_GetInheritanceMemberItems, cancellationToken, LogLevel.Information)) - { - inheritanceMemberItems = await inheritanceMarginInfoService.GetInheritanceMemberItemsAsync( - document, - spanToTag.SnapshotSpan.Span.ToTextSpan(), - cancellationToken).ConfigureAwait(false); - } + var spanToSearch = spanToTag.SnapshotSpan.Span.ToTextSpan(); + var stopwatch = SharedStopwatch.StartNew(); + var inheritanceMemberItems = await inheritanceMarginInfoService.GetInheritanceMemberItemsAsync( + document, + spanToSearch, + cancellationToken).ConfigureAwait(false); + var elapsed = stopwatch.Elapsed; if (inheritanceMemberItems.IsEmpty) { return; } + InheritanceMarginLogger.LogGenerateBackgroundInheritanceInfo(elapsed); + // One line might have multiple members to show, so group them. // For example: // interface IBar { void Foo1(); void Foo2(); } diff --git a/src/VisualStudio/Core/Def/InheritanceMargin/MarginGlyph/InheritanceMarginContextMenu.xaml.cs b/src/VisualStudio/Core/Def/InheritanceMargin/MarginGlyph/InheritanceMarginContextMenu.xaml.cs index 1ea77074d85b6..94bb125878b0b 100644 --- a/src/VisualStudio/Core/Def/InheritanceMargin/MarginGlyph/InheritanceMarginContextMenu.xaml.cs +++ b/src/VisualStudio/Core/Def/InheritanceMargin/MarginGlyph/InheritanceMarginContextMenu.xaml.cs @@ -8,13 +8,11 @@ using System.Windows; using System.Windows.Controls; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Editor.Host; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.FindUsages; -using Microsoft.CodeAnalysis.Internal.Log; using Microsoft.CodeAnalysis.Shared.TestHooks; -using Microsoft.VisualStudio.Text.Editor; +using Microsoft.VisualStudio.LanguageServices.InheritanceMargin; using Microsoft.VisualStudio.Utilities; namespace Microsoft.VisualStudio.LanguageServices.Implementation.InheritanceMargin.MarginGlyph @@ -49,7 +47,7 @@ private void TargetMenuItem_OnClick(object sender, RoutedEventArgs e) { if (e.OriginalSource is MenuItem { DataContext: TargetMenuItemViewModel viewModel }) { - Logger.Log(FunctionId.InheritanceMargin_NavigateToTarget, KeyValueLogMessage.Create(LogType.UserAction)); + InheritanceMarginLogger.LogNavigateToTarget(); var token = _listener.BeginAsyncOperation(nameof(TargetMenuItem_OnClick)); TargetMenuItem_OnClickAsync(viewModel).CompletesAsyncOperation(token); @@ -79,7 +77,7 @@ private async Task TargetMenuItem_OnClickAsync(TargetMenuItemViewModel viewModel private void TargetsSubmenu_OnOpen(object sender, RoutedEventArgs e) { - Logger.Log(FunctionId.InheritanceMargin_TargetsMenuOpen, KeyValueLogMessage.Create(LogType.UserAction)); + InheritanceMarginLogger.LogInheritanceTargetsMenuOpen(); } } } diff --git a/src/VisualStudio/Core/Def/InheritanceMargin/MarginGlyph/InheritanceMarginGlyph.cs b/src/VisualStudio/Core/Def/InheritanceMargin/MarginGlyph/InheritanceMarginGlyph.cs index 6e511c8d749a6..9f3adb12ca9d4 100644 --- a/src/VisualStudio/Core/Def/InheritanceMargin/MarginGlyph/InheritanceMarginGlyph.cs +++ b/src/VisualStudio/Core/Def/InheritanceMargin/MarginGlyph/InheritanceMarginGlyph.cs @@ -11,9 +11,9 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Editor.Host; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; -using Microsoft.CodeAnalysis.Internal.Log; using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.VisualStudio.Imaging; +using Microsoft.VisualStudio.LanguageServices.InheritanceMargin; using Microsoft.VisualStudio.PlatformUI; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Text.Classification; @@ -179,7 +179,7 @@ private void ContextMenu_OnOpen(object sender, RoutedEventArgs e) // -> Target4 // If the first level of the context menu contains a TargetMenuItemViewModel, it means here it is case 1, // user is viewing the targets menu. - Logger.Log(FunctionId.InheritanceMargin_TargetsMenuOpen, KeyValueLogMessage.Create(LogType.UserAction)); + InheritanceMarginLogger.LogInheritanceTargetsMenuOpen(); } } diff --git a/src/VisualStudio/Core/Def/LanguageClient/VisualStudioLogHubLoggerFactory.cs b/src/VisualStudio/Core/Def/LanguageClient/VisualStudioLogHubLoggerFactory.cs index 39b56b26546f8..721b71e1500c4 100644 --- a/src/VisualStudio/Core/Def/LanguageClient/VisualStudioLogHubLoggerFactory.cs +++ b/src/VisualStudio/Core/Def/LanguageClient/VisualStudioLogHubLoggerFactory.cs @@ -42,9 +42,9 @@ public VisualStudioLogHubLoggerFactory( _threadingContext = threadingContext; } - public async Task CreateLoggerAsync(string serverTypeName, string? clientName, JsonRpc jsonRpc, CancellationToken cancellationToken) + public async Task CreateLoggerAsync(string serverTypeName, JsonRpc jsonRpc, CancellationToken cancellationToken) { - var logName = $"Roslyn.{serverTypeName}.{clientName ?? "Default"}.{Interlocked.Increment(ref s_logHubSessionId)}"; + var logName = $"Roslyn.{serverTypeName}.{Interlocked.Increment(ref s_logHubSessionId)}"; var logId = new LogId(logName, new ServiceMoniker(typeof(LanguageServerTarget).FullName)); var serviceContainer = await _asyncServiceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); diff --git a/src/VisualStudio/Core/Def/ProjectSystem/MiscellaneousFilesWorkspace.cs b/src/VisualStudio/Core/Def/ProjectSystem/MiscellaneousFilesWorkspace.cs index c4a3abf31ebce..981767452bd41 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/MiscellaneousFilesWorkspace.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/MiscellaneousFilesWorkspace.cs @@ -12,6 +12,8 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Features.Workspaces; @@ -26,6 +28,7 @@ using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.TextManager.Interop; +using Microsoft.VisualStudio.Threading; using Roslyn.Utilities; namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem @@ -33,10 +36,9 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem [Export(typeof(MiscellaneousFilesWorkspace))] internal sealed partial class MiscellaneousFilesWorkspace : Workspace, IRunningDocumentTableEventListener { + private readonly IThreadingContext _threadingContext; + private readonly IVsEditorAdaptersFactoryService _editorAdaptersFactoryService; private readonly IMetadataAsSourceFileService _fileTrackingMetadataAsSourceService; - private readonly Lazy _lazyTextManager; - - private readonly RunningDocumentTableEventTracker _runningDocumentTableEventTracker; private readonly Dictionary _languageInformationByLanguageGuid = new(); @@ -56,31 +58,37 @@ internal sealed partial class MiscellaneousFilesWorkspace : Workspace, IRunningD private readonly ForegroundThreadAffinitizedObject _foregroundThreadAffinitization; + private IVsTextManager _textManager; + private RunningDocumentTableEventTracker _runningDocumentTableEventTracker; + [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public MiscellaneousFilesWorkspace( IThreadingContext threadingContext, IVsEditorAdaptersFactoryService editorAdaptersFactoryService, IMetadataAsSourceFileService fileTrackingMetadataAsSourceService, - VisualStudioWorkspace visualStudioWorkspace, - SVsServiceProvider serviceProvider) + VisualStudioWorkspace visualStudioWorkspace) : base(visualStudioWorkspace.Services.HostServices, WorkspaceKind.MiscellaneousFiles) { _foregroundThreadAffinitization = new ForegroundThreadAffinitizedObject(threadingContext, assertIsForeground: false); + _threadingContext = threadingContext; + _editorAdaptersFactoryService = editorAdaptersFactoryService; _fileTrackingMetadataAsSourceService = fileTrackingMetadataAsSourceService; - _lazyTextManager = new Lazy(() => - { - _foregroundThreadAffinitization.AssertIsForeground(); - return (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager)); - }); - - var runningDocumentTable = (IVsRunningDocumentTable)serviceProvider.GetService(typeof(SVsRunningDocumentTable)); - _runningDocumentTableEventTracker = new RunningDocumentTableEventTracker(threadingContext, editorAdaptersFactoryService, runningDocumentTable, this); _metadataReferences = ImmutableArray.CreateRange(CreateMetadataReferences()); } + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider) + { + await TaskScheduler.Default; + _textManager = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); + var runningDocumentTable = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); + + _runningDocumentTableEventTracker = new RunningDocumentTableEventTracker( + _threadingContext, _editorAdaptersFactoryService, runningDocumentTable, this); + } + void IRunningDocumentTableEventListener.OnOpenDocument(string moniker, ITextBuffer textBuffer, IVsHierarchy _, IVsWindowFrame __) => TrackOpenedDocument(moniker, textBuffer); void IRunningDocumentTableEventListener.OnCloseDocument(string moniker) => TryUntrackClosingDocument(moniker); @@ -113,7 +121,7 @@ private LanguageInformation TryGetLanguageInformation(string filename) { LanguageInformation languageInformation = null; - if (ErrorHandler.Succeeded(_lazyTextManager.Value.MapFilenameToLanguageSID(filename, out var fileLanguageGuid))) + if (ErrorHandler.Succeeded(_textManager.MapFilenameToLanguageSID(filename, out var fileLanguageGuid))) { _languageInformationByLanguageGuid.TryGetValue(fileLanguageGuid, out languageInformation); } diff --git a/src/VisualStudio/Core/Def/ProjectSystem/RuleSets/RuleSetEventHandler.cs b/src/VisualStudio/Core/Def/ProjectSystem/RuleSets/RuleSetEventHandler.cs index aa3a08a88213c..8799a4bfae112 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/RuleSets/RuleSetEventHandler.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/RuleSets/RuleSetEventHandler.cs @@ -10,7 +10,9 @@ using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; @@ -22,6 +24,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.R [Export(typeof(RuleSetEventHandler))] internal sealed class RuleSetEventHandler : IVsTrackProjectDocumentsEvents2, IVsTrackProjectDocumentsEvents3, IVsTrackProjectDocumentsEvents4 { + private readonly IThreadingContext _threadingContext; private readonly IServiceProvider _serviceProvider; private bool _eventsHookedUp = false; private uint _cookie = 0; @@ -29,20 +32,24 @@ internal sealed class RuleSetEventHandler : IVsTrackProjectDocumentsEvents2, IVs [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public RuleSetEventHandler( + IThreadingContext threadingContext, [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider) { + _threadingContext = threadingContext; _serviceProvider = serviceProvider; } - public void Register() + public async Task RegisterAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) { if (!_eventsHookedUp) { - var trackProjectDocuments = (IVsTrackProjectDocuments2)_serviceProvider.GetService(typeof(SVsTrackProjectDocuments)); + var trackProjectDocuments = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); - if (ErrorHandler.Succeeded(trackProjectDocuments.AdviseTrackProjectDocumentsEvents(this, out _cookie))) + if (!_eventsHookedUp) { - _eventsHookedUp = true; + if (ErrorHandler.Succeeded(trackProjectDocuments.AdviseTrackProjectDocumentsEvents(this, out _cookie))) + _eventsHookedUp = true; } } } diff --git a/src/VisualStudio/Core/Def/ProjectSystem/RunningDocumentTableEventTracker.cs b/src/VisualStudio/Core/Def/ProjectSystem/RunningDocumentTableEventTracker.cs index 6a5472bbc838e..3b869fe35f369 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/RunningDocumentTableEventTracker.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/RunningDocumentTableEventTracker.cs @@ -29,6 +29,9 @@ internal sealed class RunningDocumentTableEventTracker : IVsRunningDocTableEvent private readonly IRunningDocumentTableEventListener _listener; private uint _runningDocumentTableEventsCookie; + /// + /// This constructor can be called on any thread. + /// public RunningDocumentTableEventTracker(IThreadingContext threadingContext, IVsEditorAdaptersFactoryService editorAdaptersFactoryService, IVsRunningDocumentTable runningDocumentTable, IRunningDocumentTableEventListener listener) { @@ -38,12 +41,13 @@ public RunningDocumentTableEventTracker(IThreadingContext threadingContext, IVsE Contract.ThrowIfNull(listener); _foregroundAffinitization = new ForegroundThreadAffinitizedObject(threadingContext, assertIsForeground: false); + // casting is free threaded past 16.0 _runningDocumentTable = (IVsRunningDocumentTable4)runningDocumentTable; _editorAdaptersFactoryService = editorAdaptersFactoryService; _listener = listener; // Advise / Unadvise for the RDT is free threaded past 16.0 - ((IVsRunningDocumentTable)_runningDocumentTable).AdviseRunningDocTableEvents(this, out _runningDocumentTableEventsCookie); + runningDocumentTable.AdviseRunningDocTableEvents(this, out _runningDocumentTableEventsCookie); } public int OnAfterFirstDocumentLock(uint docCookie, uint dwRDTLockType, uint dwReadLocksRemaining, uint dwEditLocksRemaining) diff --git a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioAddSolutionItemService.cs b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioAddSolutionItemService.cs index 4f4b86b9a9e43..89959bb687a0b 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioAddSolutionItemService.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioAddSolutionItemService.cs @@ -41,10 +41,10 @@ public VisualStudioAddSolutionItemService( _fileChangeTrackers = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); } - public void Initialize(IServiceProvider serviceProvider) + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider) { - _dte = (DTE)serviceProvider.GetService(typeof(DTE)); - _fileChangeService = (IVsFileChangeEx)serviceProvider.GetService(typeof(SVsFileChangeEx)); + _dte = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); + _fileChangeService = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); } public void TrackFilePathAndAddSolutionItemWhenFileCreated(string filePath) diff --git a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProject.cs b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProject.cs index 7beec9db272fe..e7474a7aa84fb 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProject.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProject.cs @@ -29,8 +29,6 @@ internal sealed partial class VisualStudioProject private readonly VisualStudioWorkspaceImpl _workspace; private readonly HostDiagnosticUpdateSource _hostDiagnosticUpdateSource; - private readonly IWorkspaceTelemetryService? _telemetryService; - private readonly IWorkspaceStatusService? _workspaceStatusService; /// /// Provides dynamic source files for files added through . @@ -158,9 +156,6 @@ internal VisualStudioProject( _dynamicFileInfoProviders = dynamicFileInfoProviders; _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource; - _telemetryService = _workspace.Services.GetService(); - _workspaceStatusService = _workspace.Services.GetService(); - Id = id; Language = language; _displayName = displayName; @@ -239,18 +234,29 @@ private void ChangeProjectProperty(ref T field, T newValue, Action(); + + if (telemetryService?.HasActiveSession == true) + { + var workspaceStatusService = _workspace.Services.GetService(); + + // We only log telemetry during solution open + + // Importantly, we do not await/wait on the fullyLoadedStateTask. We do not want to ever be waiting on work + // that may end up touching the UI thread (As we can deadlock if GetTagsSynchronous waits on us). Instead, + // we only check if the Task is completed. Prior to that we will assume we are still loading. Once this + // task is completed, we know that the WaitUntilFullyLoadedAsync call will have actually finished and we're + // fully loaded. + var isFullyLoadedTask = workspaceStatusService?.IsFullyLoadedAsync(CancellationToken.None); + var isFullyLoaded = isFullyLoadedTask is { IsCompleted: true } && isFullyLoadedTask.GetAwaiter().GetResult(); + + if (!isFullyLoaded) + { + TryReportCompilationThrownAway(_workspace.CurrentSolution.State, Id); + } + } } if (_activeBatchScopes > 0) diff --git a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectFactory.cs b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectFactory.cs index e5eee81510868..5590cb6405044 100644 --- a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectFactory.cs +++ b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioProjectFactory.cs @@ -74,7 +74,10 @@ public async Task CreateAndAddToWorkspaceAsync( ? filePath : null; - await _visualStudioWorkspaceImpl.EnsureDocumentOptionProvidersInitializedAsync(cancellationToken).ConfigureAwait(true); + // After the call to EnsureDocumentOptionProvidersInitializedAsync, everything can be off the UI thread. + // Thus, we have a ConfigureAwait(false) on the call and switch explicitly after. + await _visualStudioWorkspaceImpl.EnsureDocumentOptionProvidersInitializedAsync(cancellationToken).ConfigureAwait(false); + await TaskScheduler.Default; // From this point on, we start mutating the solution. So make us non cancellable. cancellationToken = CancellationToken.None; diff --git a/src/VisualStudio/Core/Def/RoslynPackage.cs b/src/VisualStudio/Core/Def/RoslynPackage.cs index 6f3b764c47124..6c26cdd5ed64d 100644 --- a/src/VisualStudio/Core/Def/RoslynPackage.cs +++ b/src/VisualStudio/Core/Def/RoslynPackage.cs @@ -28,9 +28,11 @@ using Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService; using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem; using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.RuleSets; +using Microsoft.VisualStudio.LanguageServices.Implementation.Suppression; using Microsoft.VisualStudio.LanguageServices.Implementation.SyncNamespaces; using Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource; using Microsoft.VisualStudio.LanguageServices.Implementation.UnusedReferences; +using Microsoft.VisualStudio.LanguageServices.InheritanceMargin; using Microsoft.VisualStudio.LanguageServices.StackTraceExplorer; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; @@ -163,6 +165,11 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke var settingsEditorFactory = this.ComponentModel.GetService(); RegisterEditorFactory(settingsEditorFactory); + + // Misc workspace has to be up and running by the time our package is usable so that it can track running + // doc events and appropriately map files to/from it and other relevant workspaces (like the + // metadata-as-source workspace). + await this.ComponentModel.GetService().InitializeAsync(this).ConfigureAwait(false); } private async Task LoadOptionPersistersAsync(IComponentModel componentModel, CancellationToken cancellationToken) @@ -191,34 +198,32 @@ private async Task InitializeColorsAsync(CancellationToken cancellationToken) protected override async Task LoadComponentsAsync(CancellationToken cancellationToken) { - await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + await TaskScheduler.Default; - await GetServiceAsync(typeof(SVsTaskStatusCenterService)).ConfigureAwait(true); - await GetServiceAsync(typeof(SVsErrorList)).ConfigureAwait(true); - await GetServiceAsync(typeof(SVsSolution)).ConfigureAwait(true); - await GetServiceAsync(typeof(SVsShell)).ConfigureAwait(true); - await GetServiceAsync(typeof(SVsRunningDocumentTable)).ConfigureAwait(true); - await GetServiceAsync(typeof(SVsTextManager)).ConfigureAwait(true); + await GetServiceAsync(typeof(SVsTaskStatusCenterService)).ConfigureAwait(false); + await GetServiceAsync(typeof(SVsErrorList)).ConfigureAwait(false); + await GetServiceAsync(typeof(SVsSolution)).ConfigureAwait(false); + await GetServiceAsync(typeof(SVsShell)).ConfigureAwait(false); + await GetServiceAsync(typeof(SVsRunningDocumentTable)).ConfigureAwait(false); + await GetServiceAsync(typeof(SVsTextManager)).ConfigureAwait(false); // we need to load it as early as possible since we can have errors from // package from each language very early - this.ComponentModel.GetService(); - this.ComponentModel.GetService().Initialize(this); + await this.ComponentModel.GetService().InitializeAsync(this).ConfigureAwait(false); + await this.ComponentModel.GetService().InitializeAsync(this).ConfigureAwait(false); + await this.ComponentModel.GetService().InitializeAsync(this, cancellationToken).ConfigureAwait(false); + await this.ComponentModel.GetService().InitializeAsync(this, cancellationToken).ConfigureAwait(false); - this.ComponentModel.GetService(); - - // The misc files workspace needs to be loaded on the UI thread. This way it will have - // the appropriate task scheduler to report events on. - this.ComponentModel.GetService(); + await this.ComponentModel.GetService().InitializeAsync(this, cancellationToken).ConfigureAwait(false); // Load and initialize the add solution item service so ConfigurationUpdater can use it to create editorconfig files. - this.ComponentModel.GetService().Initialize(this); + await this.ComponentModel.GetService().InitializeAsync(this).ConfigureAwait(false); - this.ComponentModel.GetService().Initialize(this); - this.ComponentModel.GetService().Initialize(this); - this.ComponentModel.GetService().Initialize(this); + await this.ComponentModel.GetService().InitializeAsync(this, cancellationToken).ConfigureAwait(false); + await this.ComponentModel.GetService().InitializeAsync(this, cancellationToken).ConfigureAwait(false); + await this.ComponentModel.GetService().InitializeAsync(this, cancellationToken).ConfigureAwait(false); - LoadAnalyzerNodeComponents(); + await LoadAnalyzerNodeComponentsAsync(cancellationToken).ConfigureAwait(false); LoadComponentsBackgroundAsync(cancellationToken).Forget(); } @@ -312,6 +317,7 @@ private static void ReportSessionWideTelemetry() AsyncCompletionLogger.ReportTelemetry(); CompletionProvidersLogger.ReportTelemetry(); ChangeSignatureLogger.ReportTelemetry(); + InheritanceMarginLogger.ReportTelemetry(); } private void DisposeVisualStudioServices() @@ -322,15 +328,13 @@ private void DisposeVisualStudioServices() } } - private void LoadAnalyzerNodeComponents() + private async Task LoadAnalyzerNodeComponentsAsync(CancellationToken cancellationToken) { - this.ComponentModel.GetService().Initialize(this); + await this.ComponentModel.GetService().InitializeAsync(this, cancellationToken).ConfigureAwait(false); _ruleSetEventHandler = this.ComponentModel.GetService(); if (_ruleSetEventHandler != null) - { - _ruleSetEventHandler.Register(); - } + await _ruleSetEventHandler.RegisterAsync(this, cancellationToken).ConfigureAwait(false); } private void UnregisterAnalyzerTracker() diff --git a/src/VisualStudio/Core/Def/SyncNamespaces/SyncNamespacesCommandHandler.cs b/src/VisualStudio/Core/Def/SyncNamespaces/SyncNamespacesCommandHandler.cs index 3f8505d17061b..b5b17572123e8 100644 --- a/src/VisualStudio/Core/Def/SyncNamespaces/SyncNamespacesCommandHandler.cs +++ b/src/VisualStudio/Core/Def/SyncNamespaces/SyncNamespacesCommandHandler.cs @@ -7,6 +7,8 @@ using System.ComponentModel.Design; using System.Composition; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; @@ -46,16 +48,17 @@ public SyncNamespacesCommandHandler( _threadingContext = threadingContext; } - public void Initialize(IServiceProvider serviceProvider) + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) { Contract.ThrowIfNull(serviceProvider); - _serviceProvider = serviceProvider; + _serviceProvider = (IServiceProvider)serviceProvider; // Hook up the "Remove Unused References" menu command for CPS based managed projects. - var menuCommandService = (IMenuCommandService)_serviceProvider.GetService(typeof(IMenuCommandService)); + var menuCommandService = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false); if (menuCommandService != null) { + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); VisualStudioCommandHandlerHelpers.AddCommand(menuCommandService, ID.RoslynCommands.SyncNamespaces, Guids.RoslynGroupId, OnSyncNamespacesForSelectedProject, OnSyncNamespacesForSelectedProjectStatus); } } diff --git a/src/VisualStudio/Core/Def/TableDataSource/DiagnosticTableControlEventProcessorProvider.cs b/src/VisualStudio/Core/Def/TableDataSource/DiagnosticTableControlEventProcessorProvider.cs index 6d3ebbe4577c9..9e00dbbe68ad9 100644 --- a/src/VisualStudio/Core/Def/TableDataSource/DiagnosticTableControlEventProcessorProvider.cs +++ b/src/VisualStudio/Core/Def/TableDataSource/DiagnosticTableControlEventProcessorProvider.cs @@ -24,9 +24,9 @@ internal partial class DiagnosticTableControlEventProcessorProvider : AbstractTa [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public DiagnosticTableControlEventProcessorProvider( - IVisualStudioDiagnosticListSuppressionStateService suppressionStateService) + VisualStudioDiagnosticListSuppressionStateService suppressionStateService) { - _suppressionStateService = (VisualStudioDiagnosticListSuppressionStateService)suppressionStateService; + _suppressionStateService = suppressionStateService; } protected override EventProcessor CreateEventProcessor() diff --git a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListSuppressionStateService.cs b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListSuppressionStateService.cs index e34b66bd51341..d7bf1e20f3912 100644 --- a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListSuppressionStateService.cs +++ b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListSuppressionStateService.cs @@ -13,6 +13,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeFixes.Suppression; using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; @@ -29,11 +30,14 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource /// Service to maintain information about the suppression state of specific set of items in the error list. /// [Export(typeof(IVisualStudioDiagnosticListSuppressionStateService))] + [Export(typeof(VisualStudioDiagnosticListSuppressionStateService))] internal class VisualStudioDiagnosticListSuppressionStateService : IVisualStudioDiagnosticListSuppressionStateService { + private readonly IThreadingContext _threadingContext; private readonly VisualStudioWorkspace _workspace; - private readonly IVsUIShell _shellService; - private readonly IWpfTableControl? _tableControl; + + private IVsUIShell? _shellService; + private IWpfTableControl? _tableControl; private int _selectedActiveItems; private int _selectedSuppressedItems; @@ -45,14 +49,21 @@ internal class VisualStudioDiagnosticListSuppressionStateService : IVisualStudio [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public VisualStudioDiagnosticListSuppressionStateService( - SVsServiceProvider serviceProvider, + IThreadingContext threadingContext, VisualStudioWorkspace workspace) { + _threadingContext = threadingContext; _workspace = workspace; - _shellService = (IVsUIShell)serviceProvider.GetService(typeof(SVsUIShell)); - var errorList = serviceProvider.GetService(typeof(SVsErrorList)) as IErrorList; + } + + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) + { + _shellService = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory).ConfigureAwait(false); + var errorList = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false); _tableControl = errorList?.TableControl; + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + ClearState(); InitializeFromTableControlIfNeeded(); } diff --git a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListTableCommandHandler.cs b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListTableCommandHandler.cs index 722578c8fa93a..7d0b1ee59b307 100644 --- a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListTableCommandHandler.cs +++ b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioDiagnosticListTableCommandHandler.cs @@ -15,6 +15,7 @@ using Microsoft.CodeAnalysis.CodeFixes.Suppression; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Editor.Implementation; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Shared.Extensions; @@ -32,45 +33,50 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource [Export(typeof(VisualStudioDiagnosticListTableCommandHandler))] internal partial class VisualStudioDiagnosticListTableCommandHandler { + private readonly IThreadingContext _threadingContext; private readonly VisualStudioWorkspace _workspace; private readonly VisualStudioSuppressionFixService _suppressionFixService; private readonly VisualStudioDiagnosticListSuppressionStateService _suppressionStateService; private readonly IUIThreadOperationExecutor _uiThreadOperationExecutor; private readonly IDiagnosticAnalyzerService _diagnosticService; private readonly ICodeActionEditHandlerService _editHandlerService; - private readonly IWpfTableControl? _tableControl; private readonly IAsynchronousOperationListener _listener; + private IWpfTableControl? _tableControl; + [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public VisualStudioDiagnosticListTableCommandHandler( + IThreadingContext threadingContext, SVsServiceProvider serviceProvider, VisualStudioWorkspace workspace, IVisualStudioSuppressionFixService suppressionFixService, - IVisualStudioDiagnosticListSuppressionStateService suppressionStateService, + VisualStudioDiagnosticListSuppressionStateService suppressionStateService, IUIThreadOperationExecutor uiThreadOperationExecutor, IDiagnosticAnalyzerService diagnosticService, ICodeActionEditHandlerService editHandlerService, IAsynchronousOperationListenerProvider listenerProvider) { + _threadingContext = threadingContext; _workspace = workspace; _suppressionFixService = (VisualStudioSuppressionFixService)suppressionFixService; - _suppressionStateService = (VisualStudioDiagnosticListSuppressionStateService)suppressionStateService; + _suppressionStateService = suppressionStateService; _uiThreadOperationExecutor = uiThreadOperationExecutor; _diagnosticService = diagnosticService; _editHandlerService = editHandlerService; - - var errorList = serviceProvider.GetService(typeof(SVsErrorList)) as IErrorList; - _tableControl = errorList?.TableControl; _listener = listenerProvider.GetListener(FeatureAttribute.ErrorList); } - public void Initialize(IServiceProvider serviceProvider) + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) { + var errorList = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false); + _tableControl = errorList?.TableControl; + // Add command handlers for bulk suppression commands. - var menuCommandService = (IMenuCommandService)serviceProvider.GetService(typeof(IMenuCommandService)); + var menuCommandService = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false); if (menuCommandService != null) { + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); AddErrorListSetSeverityMenuHandlers(menuCommandService); // The Add/Remove suppression(s) have been moved to the VS code analysis layer, so we don't add the commands here. @@ -84,6 +90,8 @@ public void Initialize(IServiceProvider serviceProvider) private void AddErrorListSetSeverityMenuHandlers(IMenuCommandService menuCommandService) { + Contract.ThrowIfFalse(_threadingContext.HasMainThread); + AddCommand(menuCommandService, ID.RoslynCommands.ErrorListSetSeveritySubMenu, delegate { }, OnErrorListSetSeveritySubMenuStatus); // Severity menu items diff --git a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs index c0603edd00fbe..d835b1f65e8d9 100644 --- a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs +++ b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs @@ -16,6 +16,7 @@ using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Editor.Implementation; using Microsoft.CodeAnalysis.Editor.Implementation.Suggestions; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Options; @@ -38,10 +39,11 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.Suppression /// Service to compute and apply bulk suppression fixes. /// [Export(typeof(IVisualStudioSuppressionFixService))] + [Export(typeof(VisualStudioSuppressionFixService))] internal sealed class VisualStudioSuppressionFixService : IVisualStudioSuppressionFixService { + private readonly IThreadingContext _threadingContext; private readonly VisualStudioWorkspaceImpl _workspace; - private readonly IWpfTableControl? _tableControl; private readonly IAsynchronousOperationListener _listener; private readonly IDiagnosticAnalyzerService _diagnosticService; private readonly ExternalErrorDiagnosticUpdateSource _buildErrorDiagnosticService; @@ -54,37 +56,44 @@ internal sealed class VisualStudioSuppressionFixService : IVisualStudioSuppressi private readonly IHierarchyItemToProjectIdMap _projectMap; private readonly IGlobalOptionService _globalOptions; + private IWpfTableControl? _tableControl; + [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public VisualStudioSuppressionFixService( + IThreadingContext threadingContext, SVsServiceProvider serviceProvider, VisualStudioWorkspaceImpl workspace, IDiagnosticAnalyzerService diagnosticService, ICodeFixService codeFixService, ICodeActionEditHandlerService editHandlerService, - IVisualStudioDiagnosticListSuppressionStateService suppressionStateService, + VisualStudioDiagnosticListSuppressionStateService suppressionStateService, IUIThreadOperationExecutor uiThreadOperationExecutor, IVsHierarchyItemManager vsHierarchyItemManager, IAsynchronousOperationListenerProvider listenerProvider, IGlobalOptionService globalOptions) { + _threadingContext = threadingContext; _workspace = workspace; _diagnosticService = diagnosticService; _buildErrorDiagnosticService = workspace.ExternalErrorDiagnosticUpdateSource; _codeFixService = codeFixService; - _suppressionStateService = (VisualStudioDiagnosticListSuppressionStateService)suppressionStateService; + _suppressionStateService = suppressionStateService; _editHandlerService = editHandlerService; _uiThreadOperationExecutor = uiThreadOperationExecutor; _vsHierarchyItemManager = vsHierarchyItemManager; _fixMultipleOccurencesService = workspace.Services.GetRequiredService(); _projectMap = workspace.Services.GetRequiredService(); - - var errorList = serviceProvider.GetService(typeof(SVsErrorList)) as IErrorList; - _tableControl = errorList?.TableControl; _listener = listenerProvider.GetListener(FeatureAttribute.ErrorList); _globalOptions = globalOptions; } + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider) + { + var errorList = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false); + _tableControl = errorList?.TableControl; + } + public bool AddSuppressions(IVsHierarchy? projectHierarchy) { if (_tableControl == null) diff --git a/src/VisualStudio/Core/Def/UnusedReferences/RemoveUnusedReferencesCommandHandler.cs b/src/VisualStudio/Core/Def/UnusedReferences/RemoveUnusedReferencesCommandHandler.cs index eae78c525c944..0423ee6898abf 100644 --- a/src/VisualStudio/Core/Def/UnusedReferences/RemoveUnusedReferencesCommandHandler.cs +++ b/src/VisualStudio/Core/Def/UnusedReferences/RemoveUnusedReferencesCommandHandler.cs @@ -9,6 +9,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; +using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Editor.Shared.Options; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; @@ -31,43 +32,43 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.UnusedReference internal sealed class RemoveUnusedReferencesCommandHandler { private const string ProjectAssetsFilePropertyName = "ProjectAssetsFile"; - - private readonly Lazy _lazyReferenceCleanupService; + private readonly IThreadingContext _threadingContext; private readonly RemoveUnusedReferencesDialogProvider _unusedReferenceDialogProvider; private readonly VisualStudioWorkspace _workspace; private readonly IGlobalOptionService _globalOptions; - private readonly IThreadingContext _threadingContext; private readonly IUIThreadOperationExecutor _threadOperationExecutor; private IServiceProvider? _serviceProvider; + private IReferenceCleanupService ReferenceCleanupService + => _workspace.Services.GetRequiredService(); + [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public RemoveUnusedReferencesCommandHandler( + IThreadingContext threadingContext, RemoveUnusedReferencesDialogProvider unusedReferenceDialogProvider, IUIThreadOperationExecutor threadOperationExecutor, VisualStudioWorkspace workspace, - IGlobalOptionService globalOptions, - IThreadingContext threadingContext) + IGlobalOptionService globalOptions) { + _threadingContext = threadingContext; _unusedReferenceDialogProvider = unusedReferenceDialogProvider; _threadOperationExecutor = threadOperationExecutor; _workspace = workspace; _globalOptions = globalOptions; - _threadingContext = threadingContext; - - _lazyReferenceCleanupService = new(() => workspace.Services.GetRequiredService()); } - public void Initialize(IServiceProvider serviceProvider) + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) { Contract.ThrowIfNull(serviceProvider); - _serviceProvider = serviceProvider; + _serviceProvider = (IServiceProvider)serviceProvider; // Hook up the "Remove Unused References" menu command for CPS based managed projects. - var menuCommandService = (IMenuCommandService)_serviceProvider.GetService(typeof(IMenuCommandService)); + var menuCommandService = await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false); if (menuCommandService != null) { + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); VisualStudioCommandHandlerHelpers.AddCommand(menuCommandService, ID.RoslynCommands.RemoveUnusedReferences, Guids.RoslynGroupId, OnRemoveUnusedReferencesForSelectedProject, OnRemoveUnusedReferencesForSelectedProjectStatus); } } @@ -189,7 +190,7 @@ private ImmutableArray GetUnusedReferencesForProject(Solution s { var unusedReferences = _threadingContext.JoinableTaskFactory.Run(async () => { - var projectReferences = await _lazyReferenceCleanupService.Value.GetProjectReferencesAsync(projectFilePath, cancellationToken).ConfigureAwait(true); + var projectReferences = await this.ReferenceCleanupService.GetProjectReferencesAsync(projectFilePath, cancellationToken).ConfigureAwait(true); var unusedReferenceAnalysisService = solution.Workspace.Services.GetRequiredService(); return await unusedReferenceAnalysisService.GetUnusedReferencesAsync(solution, projectFilePath, projectAssetsFile, projectReferences, cancellationToken).ConfigureAwait(true); }); diff --git a/src/VisualStudio/Core/Impl/CodeModel/AbstractCodeModelService.cs b/src/VisualStudio/Core/Impl/CodeModel/AbstractCodeModelService.cs index 150320fd42f9b..e841628c3c4b9 100644 --- a/src/VisualStudio/Core/Impl/CodeModel/AbstractCodeModelService.cs +++ b/src/VisualStudio/Core/Impl/CodeModel/AbstractCodeModelService.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -1033,7 +1034,7 @@ private Document FormatAnnotatedNode(Document document, SyntaxAnnotation annotat var formattingRules = Formatter.GetDefaultFormattingRules(document); if (additionalRules != null) { - formattingRules = additionalRules.Concat(formattingRules); + formattingRules = additionalRules.Concat(formattingRules).ToImmutableArray(); } return _threadingContext.JoinableTaskFactory.Run(async () => diff --git a/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzerItemTracker.cs b/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzerItemTracker.cs index d786d06ae5491..b1ff07aae803e 100644 --- a/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzerItemTracker.cs +++ b/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzerItemTracker.cs @@ -6,6 +6,9 @@ using System.Collections.Immutable; using System.ComponentModel.Composition; using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; @@ -20,7 +23,8 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.SolutionExplore [Export] internal class AnalyzerItemsTracker : IVsSelectionEvents { - private readonly IServiceProvider _serviceProvider; + private readonly IThreadingContext _threadingContext; + private IVsMonitorSelection? _vsMonitorSelection = null; private uint _selectionEventsCookie = 0; @@ -28,30 +32,21 @@ internal class AnalyzerItemsTracker : IVsSelectionEvents [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public AnalyzerItemsTracker( - [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider) + public AnalyzerItemsTracker(IThreadingContext threadingContext) { - _serviceProvider = serviceProvider; + _threadingContext = threadingContext; } - public void Register() + public async Task RegisterAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) { - var vsMonitorSelection = GetMonitorSelection(); - - if (vsMonitorSelection != null) - { - vsMonitorSelection.AdviseSelectionEvents(this, out _selectionEventsCookie); - } + _vsMonitorSelection ??= await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false); + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + _vsMonitorSelection?.AdviseSelectionEvents(this, out _selectionEventsCookie); } public void Unregister() { - var vsMonitorSelection = GetMonitorSelection(); - - if (vsMonitorSelection != null) - { - vsMonitorSelection.UnadviseSelectionEvents(_selectionEventsCookie); - } + _vsMonitorSelection?.UnadviseSelectionEvents(_selectionEventsCookie); } public IVsHierarchy? SelectedHierarchy { get; private set; } @@ -132,15 +127,5 @@ private static object[] GetSelectedObjects(ISelectionContainer? selectionContain return selectedObjects; } - - private IVsMonitorSelection? GetMonitorSelection() - { - if (_vsMonitorSelection == null) - { - _vsMonitorSelection = _serviceProvider.GetService(typeof(SVsShellMonitorSelection)) as IVsMonitorSelection; - } - - return _vsMonitorSelection; - } } } diff --git a/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzerNodeSetup.cs b/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzerNodeSetup.cs index fb752c36ba7ae..76729d0e538b5 100644 --- a/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzerNodeSetup.cs +++ b/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzerNodeSetup.cs @@ -5,28 +5,39 @@ using System; using System.ComponentModel.Composition; using System.ComponentModel.Design; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.VisualStudio.Shell; namespace Microsoft.VisualStudio.LanguageServices.Implementation.SolutionExplorer { [Export(typeof(IAnalyzerNodeSetup))] internal sealed class AnalyzerNodeSetup : IAnalyzerNodeSetup { + private readonly IThreadingContext _threadingContext; private readonly AnalyzerItemsTracker _analyzerTracker; private readonly AnalyzersCommandHandler _analyzerCommandHandler; [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public AnalyzerNodeSetup(AnalyzerItemsTracker analyzerTracker, AnalyzersCommandHandler analyzerCommandHandler) + public AnalyzerNodeSetup( + IThreadingContext threadingContext, + AnalyzerItemsTracker analyzerTracker, + AnalyzersCommandHandler analyzerCommandHandler) { + _threadingContext = threadingContext; _analyzerTracker = analyzerTracker; _analyzerCommandHandler = analyzerCommandHandler; } - public void Initialize(IServiceProvider serviceProvider) + public async Task InitializeAsync(IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken) { - _analyzerTracker.Register(); - _analyzerCommandHandler.Initialize((IMenuCommandService)serviceProvider.GetService(typeof(IMenuCommandService))); + await _analyzerTracker.RegisterAsync(serviceProvider, cancellationToken).ConfigureAwait(false); + await _analyzerCommandHandler.InitializeAsync( + await serviceProvider.GetServiceAsync(_threadingContext.JoinableTaskFactory, throwOnFailure: false).ConfigureAwait(false), + cancellationToken).ConfigureAwait(false); } public void Unregister() diff --git a/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzersCommandHandler.cs b/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzersCommandHandler.cs index 9bb3f34a2df6b..a2f36a1e8df05 100644 --- a/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzersCommandHandler.cs +++ b/src/VisualStudio/Core/Impl/SolutionExplorer/AnalyzersCommandHandler.cs @@ -13,6 +13,7 @@ using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; +using System.Threading; using System.Threading.Tasks; using EnvDTE; using Microsoft.CodeAnalysis; @@ -94,10 +95,12 @@ public AnalyzersCommandHandler( /// /// Hook up the context menu handlers. /// - public void Initialize(IMenuCommandService menuCommandService) + public async Task InitializeAsync(IMenuCommandService menuCommandService, CancellationToken cancellationToken) { if (menuCommandService != null) { + await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + // Analyzers folder context menu items _addMenuItem = AddCommandHandler(menuCommandService, ID.RoslynCommands.AddAnalyzer, AddAnalyzerHandler); _ = AddCommandHandler(menuCommandService, ID.RoslynCommands.OpenRuleSet, OpenRuleSetHandler); diff --git a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpNewDocumentFormatting.cs b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpNewDocumentFormatting.cs index 91ebe5c608dad..a79917c082a92 100644 --- a/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpNewDocumentFormatting.cs +++ b/src/VisualStudio/IntegrationTest/IntegrationTests/CSharp/CSharpNewDocumentFormatting.cs @@ -4,6 +4,7 @@ #nullable disable +using System.IO; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.VisualStudio.IntegrationTest.Utilities; @@ -54,5 +55,85 @@ public void CreateSDKProjectWithFileScopedNamespaces() VisualStudio.ErrorList.ShowErrorList(); VisualStudio.ErrorList.Verify.NoErrors(); } + + [WpfFact] + [WorkItem(60449, "https://github.com/dotnet/roslyn/issues/60449")] + public void CreateSDKProjectWithBlockScopedNamespacesFromEditorConfig() + { + var project = new ProjectUtils.Project("TestProj"); + + VisualStudio.Workspace.SetFileScopedNamespaces(true); + + var editorConfigFilePath = Path.Combine(VisualStudio.SolutionExplorer.DirectoryName, ".editorconfig"); + File.WriteAllText(editorConfigFilePath, +@" +root = true + +[*.cs] +csharp_style_namespace_declarations = block_scoped +"); + + VisualStudio.SolutionExplorer.AddProject(project, WellKnownProjectTemplates.CSharpNetCoreClassLibrary, LanguageNames.CSharp); + + VisualStudio.ErrorList.ShowErrorList(); + VisualStudio.ErrorList.Verify.NoErrors(); + + VisualStudio.Editor.Verify.TextContains("namespace TestProj\r\n{"); + } + + [WpfFact] + [WorkItem(60449, "https://github.com/dotnet/roslyn/issues/60449")] + public void CreateSDKProjectWithBlockScopedNamespacesFromIrrelevantEditorConfigH() + { + var project = new ProjectUtils.Project("TestProj"); + + VisualStudio.Workspace.SetFileScopedNamespaces(true); + + var editorConfigFilePath = Path.Combine(VisualStudio.SolutionExplorer.DirectoryName, ".editorconfig"); + File.WriteAllText(editorConfigFilePath, +@" +root = true +"); + + // This editor config file should be ignored + editorConfigFilePath = Path.Combine(VisualStudio.SolutionExplorer.DirectoryName, "..", ".editorconfig"); + File.WriteAllText(editorConfigFilePath, +@" +[*.cs] +csharp_style_namespace_declarations = block_scoped +"); + + VisualStudio.SolutionExplorer.AddProject(project, WellKnownProjectTemplates.CSharpNetCoreClassLibrary, LanguageNames.CSharp); + + VisualStudio.ErrorList.ShowErrorList(); + VisualStudio.ErrorList.Verify.NoErrors(); + + VisualStudio.Editor.Verify.TextContains("namespace TestProj;"); + } + + [WpfFact] + [WorkItem(60449, "https://github.com/dotnet/roslyn/issues/60449")] + public void CreateSDKProjectWithFileScopedNamespacesFromEditorConfig() + { + var project = new ProjectUtils.Project("TestProj"); + + VisualStudio.Workspace.SetFileScopedNamespaces(false); + + var editorConfigFilePath = Path.Combine(VisualStudio.SolutionExplorer.DirectoryName, ".editorconfig"); + File.WriteAllText(editorConfigFilePath, +@" +root = true + +[*.cs] +csharp_style_namespace_declarations = file_scoped +"); + + VisualStudio.SolutionExplorer.AddProject(project, WellKnownProjectTemplates.CSharpNetCoreClassLibrary, LanguageNames.CSharp); + + VisualStudio.ErrorList.ShowErrorList(); + VisualStudio.ErrorList.Verify.NoErrors(); + + VisualStudio.Editor.Verify.TextContains("namespace TestProj;"); + } } } diff --git a/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpGoToBase.cs b/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpGoToBase.cs index eae77392406b8..3deb794a56dc9 100644 --- a/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpGoToBase.cs +++ b/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpGoToBase.cs @@ -20,7 +20,7 @@ public CSharpGoToBase() { } - [IdeFact(Skip = "https://github.com/dotnet/roslyn/issues/60386")] + [IdeFact] public async Task GoToBaseFromMetadataAsSource() { await TestServices.SolutionExplorer.AddFileAsync(ProjectName, "C.cs", cancellationToken: HangMitigatingCancellationToken); diff --git a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/LightBulbHelper.cs b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/LightBulbHelper.cs index 5a8bd2eb3b1d7..956ef4c93cb75 100644 --- a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/LightBulbHelper.cs +++ b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/LightBulbHelper.cs @@ -61,6 +61,8 @@ public static async Task> WaitForItemsAsync(Test if (e.Status == QuerySuggestedActionCompletionStatus.Completed) tcs.SetResult(e.ActionSets.ToList()); + else if (e.Status == QuerySuggestedActionCompletionStatus.CompletedWithoutData) + tcs.SetResult(new List()); else if (e.Status == QuerySuggestedActionCompletionStatus.Canceled) tcs.TrySetCanceled(); else @@ -88,7 +90,7 @@ public static async Task> WaitForItemsAsync(Test catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) { var version = await testServices.Shell.GetVersionAsync(cancellationToken); - if (Version.Parse("17.2.32210.308") >= version) + if (Version.Parse("17.2.32314.265") >= version) { // Unexpected cancellation can occur when the editor dismisses the light bulb without request return null; diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/LightBulbHelper.cs b/src/VisualStudio/IntegrationTest/TestUtilities/LightBulbHelper.cs index 549b9d6ec950e..b4adb603a73d0 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/LightBulbHelper.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/LightBulbHelper.cs @@ -65,6 +65,8 @@ public static async Task> WaitForItemsAsync(ILig if (e.Status == QuerySuggestedActionCompletionStatus.Completed) tcs.SetResult(e.ActionSets.ToList()); + else if (e.Status == QuerySuggestedActionCompletionStatus.CompletedWithoutData) + tcs.SetResult(new List()); else tcs.SetException(new InvalidOperationException($"Light bulb transitioned to non-complete state: {e.Status}")); diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs b/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs index a2efc52edb35d..848134059696f 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/OutOfProcess/SolutionExplorer_OutOfProc.cs @@ -21,6 +21,9 @@ public SolutionExplorer_OutOfProc(VisualStudioInstance visualStudioInstance) _inProc = CreateInProcComponent(visualStudioInstance); } + public string DirectoryName + => _inProc.DirectoryName; + public void CloseSolution(bool saveFirst = false) => _inProc.CloseSolution(saveFirst); diff --git a/src/VisualStudio/VisualStudioDiagnosticsToolWindow/Panels/TelemetryPanel.xaml.cs b/src/VisualStudio/VisualStudioDiagnosticsToolWindow/Panels/TelemetryPanel.xaml.cs index 0ec1eeaefc8b4..f5dad88cc0616 100644 --- a/src/VisualStudio/VisualStudioDiagnosticsToolWindow/Panels/TelemetryPanel.xaml.cs +++ b/src/VisualStudio/VisualStudioDiagnosticsToolWindow/Panels/TelemetryPanel.xaml.cs @@ -13,7 +13,7 @@ using System.Windows.Controls; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.Editor.Shared.Extensions; +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Roslyn.VisualStudio.DiagnosticsWindow { diff --git a/src/VisualStudio/VisualStudioDiagnosticsToolWindow/Roslyn.VisualStudio.DiagnosticsWindow.csproj b/src/VisualStudio/VisualStudioDiagnosticsToolWindow/Roslyn.VisualStudio.DiagnosticsWindow.csproj index cebb96ce6e283..df7379a87d59a 100644 --- a/src/VisualStudio/VisualStudioDiagnosticsToolWindow/Roslyn.VisualStudio.DiagnosticsWindow.csproj +++ b/src/VisualStudio/VisualStudioDiagnosticsToolWindow/Roslyn.VisualStudio.DiagnosticsWindow.csproj @@ -22,10 +22,6 @@ AllowsBackgroundLoad="true"/> - - - - false @@ -72,4 +68,4 @@ Designer - \ No newline at end of file + diff --git a/src/VisualStudio/Xaml/Impl/Implementation/LanguageClient/XamlInProcLanguageClient.cs b/src/VisualStudio/Xaml/Impl/Implementation/LanguageClient/XamlInProcLanguageClient.cs index a9361d44b877e..1078566ab1676 100644 --- a/src/VisualStudio/Xaml/Impl/Implementation/LanguageClient/XamlInProcLanguageClient.cs +++ b/src/VisualStudio/Xaml/Impl/Implementation/LanguageClient/XamlInProcLanguageClient.cs @@ -38,7 +38,7 @@ public XamlInProcLanguageClient( LspWorkspaceRegistrationService lspWorkspaceRegistrationService, ILspLoggerFactory lspLoggerFactory, IThreadingContext threadingContext) - : base(xamlDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext, diagnosticsClientName: null) + : base(xamlDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext) { } diff --git a/src/VisualStudio/Xaml/Impl/Implementation/LanguageClient/XamlInProcLanguageClientDisableUX.cs b/src/VisualStudio/Xaml/Impl/Implementation/LanguageClient/XamlInProcLanguageClientDisableUX.cs index 74d1feb458e20..bcdba101eca9f 100644 --- a/src/VisualStudio/Xaml/Impl/Implementation/LanguageClient/XamlInProcLanguageClientDisableUX.cs +++ b/src/VisualStudio/Xaml/Impl/Implementation/LanguageClient/XamlInProcLanguageClientDisableUX.cs @@ -41,7 +41,7 @@ public XamlInProcLanguageClientDisableUX( LspWorkspaceRegistrationService lspWorkspaceRegistrationService, ILspLoggerFactory lspLoggerFactory, IThreadingContext threadingContext) - : base(xamlDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext, diagnosticsClientName: null) + : base(xamlDispatcherFactory, globalOptions, listenerProvider, lspWorkspaceRegistrationService, lspLoggerFactory, threadingContext) { } diff --git a/src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs b/src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs index e51a125c65858..c830018864bbb 100644 --- a/src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs +++ b/src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/Handler/Diagnostics/AbstractPullDiagnosticHandler.cs @@ -76,7 +76,7 @@ protected AbstractPullDiagnosticHandler(IXamlPullDiagnosticService xamlDiagnosti { if (previousResult.TextDocument != null) { - var document = context.Solution.GetDocument(previousResult.TextDocument, context.ClientName); + var document = context.Solution.GetDocument(previousResult.TextDocument); if (document == null) { // We can no longer get this document, return null for both diagnostics and resultId diff --git a/src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/XamlRequestDispatcherFactory.cs b/src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/XamlRequestDispatcherFactory.cs index 1d3a3b4e67ef6..b9a08c4312801 100644 --- a/src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/XamlRequestDispatcherFactory.cs +++ b/src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/XamlRequestDispatcherFactory.cs @@ -61,7 +61,7 @@ public XamlRequestDispatcher( } protected override async Task ExecuteRequestAsync( - RequestExecutionQueue queue, bool mutatesSolutionState, bool requiresLSPSolution, IRequestHandler handler, TRequestType request, ClientCapabilities clientCapabilities, string? clientName, string methodName, CancellationToken cancellationToken) + RequestExecutionQueue queue, bool mutatesSolutionState, bool requiresLSPSolution, IRequestHandler handler, TRequestType request, ClientCapabilities clientCapabilities, string methodName, CancellationToken cancellationToken) where TRequestType : class where TResponseType : default { @@ -77,7 +77,7 @@ public XamlRequestDispatcher( { try { - return await base.ExecuteRequestAsync(queue, mutatesSolutionState, requiresLSPSolution, handler, request, clientCapabilities, clientName, methodName, cancellationToken).ConfigureAwait(false); + return await base.ExecuteRequestAsync(queue, mutatesSolutionState, requiresLSPSolution, handler, request, clientCapabilities, methodName, cancellationToken).ConfigureAwait(false); } catch (Exception e) when (e is not OperationCanceledException) { diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs index 662815b7b6333..66876defa2e0d 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs @@ -998,11 +998,11 @@ private SyntaxNode InsertAttributesInternal(SyntaxNode declaration, int index, I var existingAttributes = this.GetAttributes(declaration); if (index >= 0 && index < existingAttributes.Count) { - return this.InsertNodesBefore(declaration, existingAttributes[index], newAttributes); + return this.InsertNodesBefore(declaration, existingAttributes[index], WithRequiredTargetSpecifier(newAttributes, declaration)); } else if (existingAttributes.Count > 0) { - return this.InsertNodesAfter(declaration, existingAttributes[existingAttributes.Count - 1], newAttributes); + return this.InsertNodesAfter(declaration, existingAttributes[existingAttributes.Count - 1], WithRequiredTargetSpecifier(newAttributes, declaration)); } else { @@ -1059,6 +1059,16 @@ private static SyntaxList AsAssemblyAttributes(IEnumerable< attributes.Select(list => list.WithTarget(SyntaxFactory.AttributeTargetSpecifier(SyntaxFactory.Token(SyntaxKind.AssemblyKeyword))))); } + private static SyntaxList WithRequiredTargetSpecifier(SyntaxList attributes, SyntaxNode declaration) + { + if (!declaration.IsKind(SyntaxKind.CompilationUnit)) + { + return attributes; + } + + return AsAssemblyAttributes(attributes); + } + public override IReadOnlyList GetAttributeArguments(SyntaxNode attributeDeclaration) { switch (attributeDeclaration.Kind()) diff --git a/src/Workspaces/CSharp/Portable/Formatting/CSharpSyntaxFormattingService.cs b/src/Workspaces/CSharp/Portable/Formatting/CSharpSyntaxFormattingService.cs new file mode 100644 index 0000000000000..fe0a926fce18a --- /dev/null +++ b/src/Workspaces/CSharp/Portable/Formatting/CSharpSyntaxFormattingService.cs @@ -0,0 +1,21 @@ +// 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. + +using System; +using System.Composition; +using Microsoft.CodeAnalysis.Formatting; +using Microsoft.CodeAnalysis.Host.Mef; + +namespace Microsoft.CodeAnalysis.CSharp.Formatting +{ + [ExportLanguageService(typeof(ISyntaxFormattingService), LanguageNames.CSharp), Shared] + internal class CSharpSyntaxFormattingService : CSharpSyntaxFormatting, ISyntaxFormattingService + { + [ImportingConstructor] + [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] + public CSharpSyntaxFormattingService() + { + } + } +} diff --git a/src/Workspaces/CSharpTest/CodeGeneration/SyntaxGeneratorTests.cs b/src/Workspaces/CSharpTest/CodeGeneration/SyntaxGeneratorTests.cs index c3d3e7912249a..5b60a15647e83 100644 --- a/src/Workspaces/CSharpTest/CodeGeneration/SyntaxGeneratorTests.cs +++ b/src/Workspaces/CSharpTest/CodeGeneration/SyntaxGeneratorTests.cs @@ -1588,6 +1588,14 @@ public void TestAddAttributes() Generator.CompilationUnit(Generator.NamespaceDeclaration("n")), Generator.Attribute("a")), "[assembly: a]\r\nnamespace n\r\n{\r\n}"); + + VerifySyntax( + Generator.AddAttributes( + Generator.AddAttributes( + Generator.CompilationUnit(Generator.NamespaceDeclaration("n")), + Generator.Attribute("a")), + Generator.Attribute("b")), + "[assembly: a]\r\n[assembly: b]\r\nnamespace n\r\n{\r\n}"); } [Fact] diff --git a/src/Workspaces/CSharpTest/Formatting/FormattingTests.cs b/src/Workspaces/CSharpTest/Formatting/FormattingTests.cs index 6477395bd6c3f..e1a6380f4b1dd 100644 --- a/src/Workspaces/CSharpTest/Formatting/FormattingTests.cs +++ b/src/Workspaces/CSharpTest/Formatting/FormattingTests.cs @@ -10351,6 +10351,62 @@ void M() }"); } + [Fact] + [Trait(Traits.Feature, Traits.Features.Formatting)] + public async Task FormatListPattern_Parentheses() + { + var code = @" +class C +{ + void M((int[], int[]) a) { +_ = a is([1,2,>=3],[1,2]); +} +}"; + await AssertFormatAsync(code: code, expected: @" +class C +{ + void M((int[], int[]) a) + { + _ = a is ([1, 2, >= 3], [1, 2]); + } +}"); + + var options = new OptionsCollection(LanguageNames.CSharp) + { + { SpaceBetweenEmptySquareBrackets, false }, + { SpaceWithinSquareBrackets, false }, + { SpaceBeforeComma, false }, + { SpaceAfterComma, false }, + }; + + await AssertFormatAsync(code: code, changedOptionSet: options, expected: @" +class C +{ + void M((int[], int[]) a) + { + _ = a is ([1,2,>= 3],[1,2]); + } +}"); + + options = new OptionsCollection(LanguageNames.CSharp) + { + { SpaceBeforeOpenSquareBracket, false }, // ignored + { SpaceBetweenEmptySquareBrackets, true }, + { SpaceWithinSquareBrackets, true }, + { SpaceBeforeComma, true }, + { SpaceAfterComma, true }, + }; + + await AssertFormatAsync(code: code, changedOptionSet: options, expected: @" +class C +{ + void M((int[ ], int[ ]) a) + { + _ = a is ([ 1 , 2 , >= 3 ], [ 1 , 2 ]); + } +}"); + } + [Fact] [Trait(Traits.Feature, Traits.Features.Formatting)] public async Task FormatListPattern_TrailingComma() diff --git a/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs b/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs index 507618035aba8..c3eb84d293a67 100644 --- a/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs +++ b/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs @@ -16,6 +16,7 @@ using Microsoft.CodeAnalysis.CodeRefactorings; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Formatting; +using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.Utilities; @@ -69,14 +70,47 @@ internal virtual ImmutableArray NestedCodeActions /// /// Gets custom tags for the CodeAction. /// - internal ImmutableArray CustomTags { get; set; } = ImmutableArray.Empty; + internal ImmutableArray CustomTags { get; private set; } = ImmutableArray.Empty; + + /// + /// Lazily set provider type that registered this code action. + /// Used for telemetry purposes only. + /// + private Type? _providerTypeForTelemetry; /// /// Used by the CodeFixService and CodeRefactoringService to add the Provider Name as a CustomTag. /// - internal void AddCustomTag(string tag) + internal void AddCustomTagAndTelemetryInfo(CodeChangeProviderMetadata? providerMetadata, object provider) { + Contract.ThrowIfFalse(provider is CodeFixProvider or CodeRefactoringProvider); + + // Add the provider name to the parent CodeAction's CustomTags. + // Always add a name even in cases of 3rd party fixers/refactorings that do not export + // name metadata. + var tag = providerMetadata?.Name ?? provider.GetTypeDisplayName(); CustomTags = CustomTags.Add(tag); + + // Set the provider type to use for logging telemetry. + _providerTypeForTelemetry = provider.GetType(); + } + + internal Guid GetTelemetryId(FixAllScope? fixAllScope = null) + { + // We need to identify the type name to use for CodeAction's telemetry ID. + // For code actions created from 'CodeAction.Create' factory methods, + // we use the provider type for telemetry. For the rest of the code actions + // created by sub-typing CodeAction type, we use the code action type for telemetry. + // For the former case, if the provider type is not set, we fallback to the CodeAction type instead. + var isFactoryGenerated = this is SimpleCodeAction { CreatedFromFactoryMethod: true }; + var type = isFactoryGenerated && _providerTypeForTelemetry != null + ? _providerTypeForTelemetry + : this.GetType(); + + // Additionally, we also add the equivalence key and fixAllScope ID (if non-null) + // to the telemetry ID. + var scope = fixAllScope?.GetScopeIdForTelemetry() ?? 0; + return type.GetTelemetryId(scope, EquivalenceKey); } /// @@ -324,7 +358,7 @@ public static CodeAction Create(string title, Func @@ -347,7 +381,7 @@ public static CodeAction Create(string title, Func @@ -369,31 +403,41 @@ public static CodeAction Create(string title, ImmutableArray nestedA throw new ArgumentNullException(nameof(nestedActions)); } - return new CodeActionWithNestedActions(title, nestedActions, isInlinable); + return CodeActionWithNestedActions.Create(title, nestedActions, isInlinable); } internal abstract class SimpleCodeAction : CodeAction { - public SimpleCodeAction( + protected SimpleCodeAction( string title, - string? equivalenceKey) + string? equivalenceKey, + bool createdFromFactoryMethod) { Title = title; EquivalenceKey = equivalenceKey; + CreatedFromFactoryMethod = createdFromFactoryMethod; } public sealed override string Title { get; } public sealed override string? EquivalenceKey { get; } + + /// + /// Indicates if this CodeAction was created using one of the 'CodeAction.Create' factory methods. + /// This is used in to determine the appropriate type + /// name to log in the CodeAction telemetry. + /// + public bool CreatedFromFactoryMethod { get; } } internal class CodeActionWithNestedActions : SimpleCodeAction { - public CodeActionWithNestedActions( + private CodeActionWithNestedActions( string title, ImmutableArray nestedActions, bool isInlinable, - CodeActionPriority priority = CodeActionPriority.Medium) - : base(title, ComputeEquivalenceKey(nestedActions)) + CodeActionPriority priority, + bool createdFromFactoryMethod) + : base(title, ComputeEquivalenceKey(nestedActions), createdFromFactoryMethod) { Debug.Assert(nestedActions.Length > 0); NestedCodeActions = nestedActions; @@ -401,6 +445,22 @@ public CodeActionWithNestedActions( Priority = priority; } + protected CodeActionWithNestedActions( + string title, + ImmutableArray nestedActions, + bool isInlinable, + CodeActionPriority priority = CodeActionPriority.Medium) + : this(title, nestedActions, isInlinable, priority, createdFromFactoryMethod: false) + { + } + + public static CodeActionWithNestedActions Create( + string title, + ImmutableArray nestedActions, + bool isInlinable, + CodeActionPriority priority = CodeActionPriority.Medium) + => new(title, nestedActions, isInlinable, priority, createdFromFactoryMethod: true); + internal override CodeActionPriority Priority { get; } internal sealed override bool IsInlinable { get; } @@ -430,15 +490,30 @@ internal class DocumentChangeAction : SimpleCodeAction { private readonly Func> _createChangedDocument; - public DocumentChangeAction( + private DocumentChangeAction( string title, Func> createChangedDocument, - string? equivalenceKey) - : base(title, equivalenceKey) + string? equivalenceKey, + bool createdFromFactoryMethod) + : base(title, equivalenceKey, createdFromFactoryMethod) { _createChangedDocument = createChangedDocument; } + protected DocumentChangeAction( + string title, + Func> createChangedDocument, + string? equivalenceKey) + : this(title, createChangedDocument, equivalenceKey, createdFromFactoryMethod: false) + { + } + + public static new DocumentChangeAction Create( + string title, + Func> createChangedDocument, + string? equivalenceKey) + => new(title, createChangedDocument, equivalenceKey, createdFromFactoryMethod: true); + protected sealed override Task GetChangedDocumentAsync(CancellationToken cancellationToken) => _createChangedDocument(cancellationToken); } @@ -447,28 +522,49 @@ internal class SolutionChangeAction : SimpleCodeAction { private readonly Func> _createChangedSolution; - public SolutionChangeAction( + private SolutionChangeAction( string title, Func> createChangedSolution, - string? equivalenceKey) - : base(title, equivalenceKey) + string? equivalenceKey, + bool createdFromFactoryMethod) + : base(title, equivalenceKey, createdFromFactoryMethod) { _createChangedSolution = createChangedSolution; } + protected SolutionChangeAction( + string title, + Func> createChangedSolution, + string? equivalenceKey) + : this(title, createChangedSolution, equivalenceKey, createdFromFactoryMethod: false) + { + } + + public static new SolutionChangeAction Create( + string title, + Func> createChangedSolution, + string? equivalenceKey) + => new(title, createChangedSolution, equivalenceKey, createdFromFactoryMethod: true); + protected sealed override Task GetChangedSolutionAsync(CancellationToken cancellationToken) => _createChangedSolution(cancellationToken).AsNullable(); } - internal class NoChangeAction : SimpleCodeAction + internal sealed class NoChangeAction : SimpleCodeAction { - public NoChangeAction( + private NoChangeAction( string title, - string? equivalenceKey) - : base(title, equivalenceKey) + string? equivalenceKey, + bool createdFromFactoryMethod) + : base(title, equivalenceKey, createdFromFactoryMethod) { } + public static NoChangeAction Create( + string title, + string? equivalenceKey) + => new(title, equivalenceKey, createdFromFactoryMethod: true); + protected sealed override Task GetChangedSolutionAsync(CancellationToken cancellationToken) => SpecializedTasks.Null(); } diff --git a/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/DefaultFixAllProviderHelpers.cs b/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/DefaultFixAllProviderHelpers.cs index 04d8e28ab02bd..243b569b7fa7f 100644 --- a/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/DefaultFixAllProviderHelpers.cs +++ b/src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/DefaultFixAllProviderHelpers.cs @@ -36,12 +36,8 @@ internal static class DefaultFixAllProviderHelpers if (solution == null) return null; -#pragma warning disable RS0005 // Do not use generic 'CodeAction.Create' to create 'CodeAction' - return CodeAction.Create( title, c => Task.FromResult(solution)); - -#pragma warning disable RS0005 // Do not use generic 'CodeAction.Create' to create 'CodeAction' } private static Task GetDocumentFixesAsync(FixAllContext fixAllContext, FixAllContexts fixAllContextsAsync) diff --git a/src/Workspaces/Core/Portable/Formatting/AutoFormattingOptions.cs b/src/Workspaces/Core/Portable/Formatting/AutoFormattingOptions.cs index edc1df9610d0e..125d5cafa75c1 100644 --- a/src/Workspaces/Core/Portable/Formatting/AutoFormattingOptions.cs +++ b/src/Workspaces/Core/Portable/Formatting/AutoFormattingOptions.cs @@ -14,19 +14,13 @@ namespace Microsoft.CodeAnalysis.Formatting /// /// Solution-wide formatting options. /// - internal readonly record struct AutoFormattingOptions( - FormattingOptions.IndentStyle IndentStyle, - bool FormatOnReturn, - bool FormatOnTyping, - bool FormatOnSemicolon, - bool FormatOnCloseBrace) + internal readonly partial record struct AutoFormattingOptions { public static AutoFormattingOptions From(Project project) => From(project.Solution.Options, project.Language); public static AutoFormattingOptions From(OptionSet options, string language) => new( - IndentStyle: options.GetOption(Metadata.SmartIndent, language), FormatOnReturn: options.GetOption(Metadata.AutoFormattingOnReturn, language), FormatOnTyping: options.GetOption(Metadata.AutoFormattingOnTyping, language), FormatOnSemicolon: options.GetOption(Metadata.AutoFormattingOnSemicolon, language), @@ -42,7 +36,6 @@ public Metadata() } public ImmutableArray Options { get; } = ImmutableArray.Create( - SmartIndent, AutoFormattingOnReturn, AutoFormattingOnTyping, AutoFormattingOnSemicolon, @@ -50,10 +43,6 @@ public Metadata() private const string FeatureName = "FormattingOptions"; - // This is also serialized by the Visual Studio-specific LanguageSettingsPersister - public static PerLanguageOption2 SmartIndent { get; } = - new(FeatureName, FormattingOptionGroups.IndentationAndSpacing, nameof(SmartIndent), defaultValue: FormattingOptions.IndentStyle.Smart); - internal static readonly PerLanguageOption2 AutoFormattingOnReturn = new(FeatureName, OptionGroup.Default, nameof(AutoFormattingOnReturn), defaultValue: true, storageLocation: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.Auto Formatting On Return")); diff --git a/src/Workspaces/Core/Portable/Formatting/Formatter.cs b/src/Workspaces/Core/Portable/Formatting/Formatter.cs index 5574dc9dd9fb9..1d13f8101bc65 100644 --- a/src/Workspaces/Core/Portable/Formatting/Formatter.cs +++ b/src/Workspaces/Core/Portable/Formatting/Formatter.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Diagnostics; @@ -31,7 +32,7 @@ public static class Formatter /// /// Gets the formatting rules that would be applied if left unspecified. /// - internal static IEnumerable GetDefaultFormattingRules(Document document) + internal static ImmutableArray GetDefaultFormattingRules(Document document) { if (document == null) { @@ -45,7 +46,7 @@ internal static IEnumerable GetDefaultFormattingRules(Do } else { - return SpecializedCollections.EmptyEnumerable(); + return ImmutableArray.Empty; } } diff --git a/src/Workspaces/Core/Portable/Formatting/FormattingOptions.cs b/src/Workspaces/Core/Portable/Formatting/FormattingOptions.cs index 25ddf34780753..38f229c535bd2 100644 --- a/src/Workspaces/Core/Portable/Formatting/FormattingOptions.cs +++ b/src/Workspaces/Core/Portable/Formatting/FormattingOptions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Collections.Immutable; using Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.Formatting @@ -11,22 +12,24 @@ public static partial class FormattingOptions { /// // Suppression due to https://github.com/dotnet/roslyn/issues/42614 - public static PerLanguageOption UseTabs { get; } = ((PerLanguageOption)FormattingOptions2.UseTabs)!; + public static PerLanguageOption UseTabs { get; } = (PerLanguageOption)FormattingOptions2.UseTabs; /// // Suppression due to https://github.com/dotnet/roslyn/issues/42614 - public static PerLanguageOption TabSize { get; } = ((PerLanguageOption)FormattingOptions2.TabSize)!; + public static PerLanguageOption TabSize { get; } = (PerLanguageOption)FormattingOptions2.TabSize; /// // Suppression due to https://github.com/dotnet/roslyn/issues/42614 - public static PerLanguageOption IndentationSize { get; } = ((PerLanguageOption)FormattingOptions2.IndentationSize)!; + public static PerLanguageOption IndentationSize { get; } = (PerLanguageOption)FormattingOptions2.IndentationSize; - /// + /// // Suppression due to https://github.com/dotnet/roslyn/issues/42614 - public static PerLanguageOption SmartIndent { get; } = ((PerLanguageOption)AutoFormattingOptions.Metadata.SmartIndent)!; + public static PerLanguageOption SmartIndent { get; } = new( + FormattingOptions2.SmartIndent.OptionDefinition, + FormattingOptions2.SmartIndent.StorageLocations.As()); /// // Suppression due to https://github.com/dotnet/roslyn/issues/42614 - public static PerLanguageOption NewLine { get; } = ((PerLanguageOption)FormattingOptions2.NewLine)!; + public static PerLanguageOption NewLine { get; } = (PerLanguageOption)FormattingOptions2.NewLine; } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/ISyntaxFormattingService.cs b/src/Workspaces/Core/Portable/Formatting/ISyntaxFormattingService.cs similarity index 54% rename from src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/ISyntaxFormattingService.cs rename to src/Workspaces/Core/Portable/Formatting/ISyntaxFormattingService.cs index c83b980861bbe..f9ab1ef71030d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/ISyntaxFormattingService.cs +++ b/src/Workspaces/Core/Portable/Formatting/ISyntaxFormattingService.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Formatting.Rules; @@ -10,47 +11,16 @@ using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Options; - -#if !CODE_STYLE using Microsoft.CodeAnalysis.Host; -#endif namespace Microsoft.CodeAnalysis.Formatting { - internal interface ISyntaxFormattingService -#if !CODE_STYLE - : ILanguageService -#endif + internal interface ISyntaxFormattingService : ISyntaxFormatting, ILanguageService { - SyntaxFormattingOptions GetFormattingOptions(AnalyzerConfigOptions options); - IEnumerable GetDefaultFormattingRules(); - IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable? spans, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken); } - internal abstract class SyntaxFormattingOptions + internal abstract partial class SyntaxFormattingOptions { - public readonly bool UseTabs; - public readonly int TabSize; - public readonly int IndentationSize; - public readonly string NewLine; - - public readonly bool SeparateImportDirectiveGroups; - - protected SyntaxFormattingOptions( - bool useTabs, - int tabSize, - int indentationSize, - string newLine, - bool separateImportDirectiveGroups) - { - UseTabs = useTabs; - TabSize = tabSize; - IndentationSize = indentationSize; - NewLine = newLine; - SeparateImportDirectiveGroups = separateImportDirectiveGroups; - } - -#if !CODE_STYLE public static SyntaxFormattingOptions Create(OptionSet options, HostWorkspaceServices services, string language) { var formattingService = services.GetRequiredLanguageService(language); @@ -63,6 +33,5 @@ public static async Task FromDocumentAsync(Document doc var documentOptions = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); return Create(documentOptions, document.Project.Solution.Workspace.Services, document.Project.Language); } -#endif } } diff --git a/src/Workspaces/Core/Portable/Indentation/AbstractIndentationService.cs b/src/Workspaces/Core/Portable/Indentation/AbstractIndentationService.cs deleted file mode 100644 index 3c6655866c34f..0000000000000 --- a/src/Workspaces/Core/Portable/Indentation/AbstractIndentationService.cs +++ /dev/null @@ -1,79 +0,0 @@ -// 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. - -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Formatting; -using Microsoft.CodeAnalysis.Formatting.Rules; -using Microsoft.CodeAnalysis.Host; -using Microsoft.CodeAnalysis.Options; -using Roslyn.Utilities; - -namespace Microsoft.CodeAnalysis.Indentation -{ - internal abstract partial class AbstractIndentationService : IIndentationService - where TSyntaxRoot : SyntaxNode, ICompilationUnitSyntax - { - protected abstract AbstractFormattingRule GetSpecializedIndentationFormattingRule(FormattingOptions.IndentStyle indentStyle); - - private IEnumerable GetFormattingRules(Document document, int position, FormattingOptions.IndentStyle indentStyle) - { - var workspace = document.Project.Solution.Workspace; - var formattingRuleFactory = workspace.Services.GetRequiredService(); - var baseIndentationRule = formattingRuleFactory.CreateRule(document, position); - - var formattingRules = new[] { baseIndentationRule, this.GetSpecializedIndentationFormattingRule(indentStyle) }.Concat(Formatter.GetDefaultFormattingRules(document)); - return formattingRules; - } - - public IndentationResult GetIndentation( - Document document, int lineNumber, - FormattingOptions.IndentStyle indentStyle, CancellationToken cancellationToken) - { - var indenter = GetIndenter(document, lineNumber, indentStyle, cancellationToken); - - if (indentStyle == FormattingOptions.IndentStyle.None) - { - // If there is no indent style, then do nothing. - return new IndentationResult(basePosition: 0, offset: 0); - } - - if (indentStyle == FormattingOptions.IndentStyle.Smart && - indenter.TryGetSmartTokenIndentation(out var indentationResult)) - { - return indentationResult; - } - - // If the indenter can't produce a valid result, just default to 0 as our indentation. - return indenter.GetDesiredIndentation(indentStyle) ?? default; - } - - private Indenter GetIndenter(Document document, int lineNumber, FormattingOptions.IndentStyle indentStyle, CancellationToken cancellationToken) - { - var options = IndentationOptions.FromDocumentAsync(document, cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); - var syntacticDoc = SyntacticDocument.CreateAsync(document, cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); - - var sourceText = syntacticDoc.Root.SyntaxTree.GetText(cancellationToken); - var lineToBeIndented = sourceText.Lines[lineNumber]; - - var formattingRules = GetFormattingRules(document, lineToBeIndented.Start, indentStyle); - - return new Indenter(this, syntacticDoc, formattingRules, options, lineToBeIndented, cancellationToken); - } - - /// - /// Returns if the language specific should be deferred to figure out indentation. If so, it - /// will be asked to the resultant - /// provided by this method. - /// - protected abstract bool ShouldUseTokenIndenter(Indenter indenter, out SyntaxToken token); - protected abstract ISmartTokenFormatter CreateSmartTokenFormatter(Indenter indenter); - - protected abstract IndentationResult? GetDesiredIndentationWorker( - Indenter indenter, SyntaxToken? token, SyntaxTrivia? trivia); - } -} diff --git a/src/Workspaces/Core/Portable/Formatting/FormattingOptions.IndentStyle.cs b/src/Workspaces/Core/Portable/Indentation/FormattingOptions.IndentStyle.cs similarity index 78% rename from src/Workspaces/Core/Portable/Formatting/FormattingOptions.IndentStyle.cs rename to src/Workspaces/Core/Portable/Indentation/FormattingOptions.IndentStyle.cs index 110cf8f24dcf8..52d15fbca2218 100644 --- a/src/Workspaces/Core/Portable/Formatting/FormattingOptions.IndentStyle.cs +++ b/src/Workspaces/Core/Portable/Indentation/FormattingOptions.IndentStyle.cs @@ -6,6 +6,7 @@ namespace Microsoft.CodeAnalysis.Formatting { public static partial class FormattingOptions { + // Publicly exposed. Keep in sync with in the CodeStyle layer. public enum IndentStyle { None = 0, diff --git a/src/EditorFeatures/Core/Shared/Extensions/TelemetryExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/TelemetryExtensions.cs similarity index 83% rename from src/EditorFeatures/Core/Shared/Extensions/TelemetryExtensions.cs rename to src/Workspaces/Core/Portable/Shared/Extensions/TelemetryExtensions.cs index c9ca4ce684aa9..e49e2aef8547e 100644 --- a/src/EditorFeatures/Core/Shared/Extensions/TelemetryExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/TelemetryExtensions.cs @@ -6,14 +6,13 @@ using System.Globalization; using System.Linq; using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; -namespace Microsoft.CodeAnalysis.Editor.Shared.Extensions +namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static class TelemetryExtensions { - public static Guid GetTelemetryId(this Type type, short scope = 0) + public static Guid GetTelemetryId(this Type type, short scope = 0, string? additionalSuffixString = null) { type = GetTypeForTelemetry(type); Contract.ThrowIfNull(type.FullName); @@ -28,7 +27,12 @@ public static Guid GetTelemetryId(this Type type, short scope = 0) // the remainder with an empty byte array var suffixBytes = BitConverter.GetBytes(suffix).Concat(new byte[4]).ToArray(); - return new Guid(0, scope, 0, suffixBytes); + // Generate additional suffix to add to the Guid. + var additionalSuffix = (short)(additionalSuffixString != null + ? Hash.GetFNVHashCode(additionalSuffixString) + : 0); + + return new Guid(0, scope, additionalSuffix, suffixBytes); } public static Type GetTypeForTelemetry(this Type type) diff --git a/src/Workspaces/CoreTest/FormattingTests.cs b/src/Workspaces/CoreTest/FormattingTests.cs index af95f7954ce33..12239b4f0a759 100644 --- a/src/Workspaces/CoreTest/FormattingTests.cs +++ b/src/Workspaces/CoreTest/FormattingTests.cs @@ -37,7 +37,6 @@ public void TestCSharpDefaultRules() var service = workspace.Services.GetLanguageServices(LanguageNames.CSharp).GetService(); var rules = service.GetDefaultFormattingRules(); - Assert.NotNull(rules); Assert.NotEmpty(rules); } @@ -65,7 +64,6 @@ public void TestVisualBasicDefaultFormattingRules() var service = workspace.Services.GetLanguageServices(LanguageNames.VisualBasic).GetService(); var rules = service.GetDefaultFormattingRules(); - Assert.NotNull(rules); Assert.NotEmpty(rules); } diff --git a/src/EditorFeatures/CSharpTest/Extensions/TelemetryExtensionTests.cs b/src/Workspaces/CoreTest/Shared/Extensions/TelemetryExtensions/TelemetryExtensionTests.cs similarity index 73% rename from src/EditorFeatures/CSharpTest/Extensions/TelemetryExtensionTests.cs rename to src/Workspaces/CoreTest/Shared/Extensions/TelemetryExtensions/TelemetryExtensionTests.cs index 1225c64fd1c12..2dcc610ce941b 100644 --- a/src/EditorFeatures/CSharpTest/Extensions/TelemetryExtensionTests.cs +++ b/src/Workspaces/CoreTest/Shared/Extensions/TelemetryExtensions/TelemetryExtensionTests.cs @@ -5,24 +5,24 @@ #nullable disable using System; -using Microsoft.CodeAnalysis.Editor.Shared.Extensions; +using Microsoft.CodeAnalysis.Shared.Extensions; using Xunit; -namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Extensions +namespace Microsoft.CodeAnalysis.UnitTests.Extensions { public class TelemetryExtensionTests { [Fact] public void TestConstantTelemetryId() { - var expected = Guid.Parse("00000000-0000-0000-c4c5-914100000000"); + var expected = Guid.Parse("00000000-0000-0000-54ad-749900000000"); var actual = typeof(TelemetryExtensionTests).GetTelemetryId(); var actualBytes = actual.ToByteArray(); // If the assertion fails then telemetry ids could be changing // making them hard to track. It's important to not regress // the ability to track telemetry across versions of Roslyn. - Assert.Equal(new Guid(actualBytes), expected); + Assert.Equal(expected, new Guid(actualBytes)); } } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems index 9dc3b28f94a90..f310c42bc7760 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems @@ -57,7 +57,7 @@ - + @@ -87,6 +87,7 @@ + diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs index 01d10b131eafe..f871109bd3457 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxNodeExtensions.cs @@ -626,6 +626,9 @@ public static bool IsReturnableConstruct(this SyntaxNode node) return false; } + public static bool IsReturnableConstructOrTopLevelCompilationUnit(this SyntaxNode node) + => node.IsReturnableConstruct() || (node is CompilationUnitSyntax compilationUnit && compilationUnit.Members.Any(SyntaxKind.GlobalStatement)); + public static bool SpansPreprocessorDirective(this IEnumerable list) where TSyntaxNode : SyntaxNode => CSharpSyntaxFacts.Instance.SpansPreprocessorDirective(list); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxTreeExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxTreeExtensions.cs index 7ec246fc8062e..0c1615e89cc9a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxTreeExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Extensions/SyntaxTreeExtensions.cs @@ -469,5 +469,97 @@ public static bool IsEntirelyWithinCharLiteral( return false; } + + public static bool IsInInactiveRegion( + this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) + { + Contract.ThrowIfNull(syntaxTree); + + // cases: + // $ is EOF + + // #if false + // | + + // #if false + // |$ + + // #if false + // | + + // #if false + // |$ + + if (syntaxTree.IsPreProcessorKeywordContext(position, cancellationToken)) + { + return false; + } + + // The latter two are the hard cases we don't actually have an + // DisabledTextTrivia yet. + var trivia = syntaxTree.GetRoot(cancellationToken).FindTrivia(position, findInsideTrivia: false); + if (trivia.Kind() == SyntaxKind.DisabledTextTrivia) + { + return true; + } + + var token = syntaxTree.FindTokenOrEndToken(position, cancellationToken); + if (token.Kind() == SyntaxKind.EndOfFileToken) + { + var triviaList = token.LeadingTrivia; + foreach (var triviaTok in triviaList.Reverse()) + { + if (triviaTok.Span.Contains(position)) + { + return false; + } + + if (triviaTok.Span.End < position) + { + if (!triviaTok.HasStructure) + { + return false; + } + + var structure = triviaTok.GetStructure(); + if (structure is BranchingDirectiveTriviaSyntax branch) + { + return !branch.IsActive || !branch.BranchTaken; + } + } + } + } + + return false; + } + + public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) + { + return IsPreProcessorKeywordContext( + syntaxTree, position, + syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken, includeDirectives: true)); + } + +#pragma warning disable IDE0060 // Remove unused parameter + public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition) +#pragma warning restore IDE0060 // Remove unused parameter + { + // cases: + // #| + // #d| + // # | + // # d| + + // note: comments are not allowed between the # and item. + var token = preProcessorTokenOnLeftOfPosition; + token = token.GetPreviousTokenIfTouchingWord(position); + + if (token.IsKind(SyntaxKind.HashToken)) + { + return true; + } + + return false; + } } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/CSharpSyntaxFormatting.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/CSharpSyntaxFormatting.cs new file mode 100644 index 0000000000000..974186ddbd5c5 --- /dev/null +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/CSharpSyntaxFormatting.cs @@ -0,0 +1,47 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading; +using Microsoft.CodeAnalysis.Formatting; +using Microsoft.CodeAnalysis.Formatting.Rules; +using Microsoft.CodeAnalysis.Shared.Collections; +using Microsoft.CodeAnalysis.Text; +using Microsoft.CodeAnalysis.Diagnostics; + +namespace Microsoft.CodeAnalysis.CSharp.Formatting +{ + internal class CSharpSyntaxFormatting : AbstractSyntaxFormatting + { + public static readonly CSharpSyntaxFormatting Instance = new(); + + private readonly ImmutableArray _rules = ImmutableArray.Create( + new WrappingFormattingRule(), + new SpacingFormattingRule(), + new NewLineUserSettingFormattingRule(), + new IndentUserSettingsFormattingRule(), + new ElasticTriviaFormattingRule(), + new EndOfFileTokenFormattingRule(), + new StructuredTriviaFormattingRule(), + new IndentBlockFormattingRule(), + new SuppressFormattingRule(), + new AnchorIndentationFormattingRule(), + new QueryExpressionFormattingRule(), + new TokenBasedFormattingRule(), + DefaultOperationProvider.Instance); + + public override ImmutableArray GetDefaultFormattingRules() + => _rules; + + public override SyntaxFormattingOptions GetFormattingOptions(AnalyzerConfigOptions options) + => CSharpSyntaxFormattingOptions.Create(options); + + protected override IFormattingResult CreateAggregatedFormattingResult(SyntaxNode node, IList results, SimpleIntervalTree? formattingSpans = null) + => new AggregatedFormattingResult(node, results, formattingSpans); + + protected override AbstractFormattingResult Format(SyntaxNode node, SyntaxFormattingOptions options, IEnumerable formattingRules, SyntaxToken startToken, SyntaxToken endToken, CancellationToken cancellationToken) + => new CSharpFormatEngine(node, options, formattingRules, startToken, endToken).Format(cancellationToken); + } +} diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/CSharpSyntaxFormattingService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/CSharpSyntaxFormattingService.cs deleted file mode 100644 index c077466ebb0fc..0000000000000 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/CSharpSyntaxFormattingService.cs +++ /dev/null @@ -1,66 +0,0 @@ -// 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. - -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Threading; -using Microsoft.CodeAnalysis.Formatting; -using Microsoft.CodeAnalysis.Formatting.Rules; -using Microsoft.CodeAnalysis.Shared.Collections; -using Microsoft.CodeAnalysis.Text; -using Microsoft.CodeAnalysis.Diagnostics; - -#if !CODE_STYLE -using System; -using System.Composition; -using Microsoft.CodeAnalysis.Host.Mef; -#endif - -namespace Microsoft.CodeAnalysis.CSharp.Formatting -{ -#if !CODE_STYLE - [ExportLanguageService(typeof(ISyntaxFormattingService), LanguageNames.CSharp), Shared] -#endif - internal class CSharpSyntaxFormattingService : AbstractSyntaxFormattingService - { - private readonly ImmutableList _rules; - -#if CODE_STYLE - public static readonly CSharpSyntaxFormattingService Instance = new(); - -#else - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] -#endif - public CSharpSyntaxFormattingService() - { - _rules = ImmutableList.Create( - new WrappingFormattingRule(), - new SpacingFormattingRule(), - new NewLineUserSettingFormattingRule(), - new IndentUserSettingsFormattingRule(), - new ElasticTriviaFormattingRule(), - new EndOfFileTokenFormattingRule(), - new StructuredTriviaFormattingRule(), - new IndentBlockFormattingRule(), - new SuppressFormattingRule(), - new AnchorIndentationFormattingRule(), - new QueryExpressionFormattingRule(), - new TokenBasedFormattingRule(), - DefaultOperationProvider.Instance); - } - - public override IEnumerable GetDefaultFormattingRules() - => _rules; - - public override SyntaxFormattingOptions GetFormattingOptions(AnalyzerConfigOptions options) - => CSharpSyntaxFormattingOptions.Create(options); - - protected override IFormattingResult CreateAggregatedFormattingResult(SyntaxNode node, IList results, SimpleIntervalTree? formattingSpans = null) - => new AggregatedFormattingResult(node, results, formattingSpans); - - protected override AbstractFormattingResult Format(SyntaxNode node, SyntaxFormattingOptions options, IEnumerable formattingRules, SyntaxToken startToken, SyntaxToken endToken, CancellationToken cancellationToken) - => new CSharpFormatEngine(node, options, formattingRules, startToken, endToken).Format(cancellationToken); - } -} diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/SpacingFormattingRule.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/SpacingFormattingRule.cs index a338189998706..3649581db15e0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/SpacingFormattingRule.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/SpacingFormattingRule.cs @@ -206,11 +206,20 @@ public override AbstractFormattingRule WithOptions(SyntaxFormattingOptions optio return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(SpacePlacement.AfterCast)); } + // List patterns if (currentKind == SyntaxKind.OpenBracketToken && currentToken.Parent.IsKind(SyntaxKind.ListPattern)) { - // is [ - // and [ - return CreateAdjustSpacesOperation(1, AdjustSpacesOption.ForceSpacesIfOnSingleLine); + // For the space after the middle comma in ([1, 2], [1, 2]) + if (previousKind == SyntaxKind.CommaToken) + { + return AdjustSpacesOperationZeroOrOne(_options.Spacing.HasFlag(SpacePlacement.AfterComma)); + } + + // For "is [", "and [", but not "([" + if (previousKind != SyntaxKind.OpenParenToken) + { + return CreateAdjustSpacesOperation(1, AdjustSpacesOption.ForceSpacesIfOnSingleLine); + } } // For spacing Before Square Braces diff --git a/src/Workspaces/CSharp/Portable/Indentation/CSharpSmartTokenFormatter.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Indentation/CSharpSmartTokenFormatter.cs similarity index 84% rename from src/Workspaces/CSharp/Portable/Indentation/CSharpSmartTokenFormatter.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Indentation/CSharpSmartTokenFormatter.cs index d5c16d911287a..e3ea707a9dede 100644 --- a/src/Workspaces/CSharp/Portable/Indentation/CSharpSmartTokenFormatter.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Indentation/CSharpSmartTokenFormatter.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; @@ -11,9 +12,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Formatting; using Microsoft.CodeAnalysis.Formatting.Rules; -using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Indentation; -using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; @@ -23,16 +22,15 @@ namespace Microsoft.CodeAnalysis.CSharp.Indentation internal class CSharpSmartTokenFormatter : ISmartTokenFormatter { private readonly IndentationOptions _options; - private readonly IEnumerable _formattingRules; + private readonly ImmutableArray _formattingRules; private readonly CompilationUnitSyntax _root; public CSharpSmartTokenFormatter( IndentationOptions options, - IEnumerable formattingRules, + ImmutableArray formattingRules, CompilationUnitSyntax root) { - Contract.ThrowIfNull(formattingRules); Contract.ThrowIfNull(root); _options = options; @@ -42,7 +40,7 @@ public CSharpSmartTokenFormatter( } public IList FormatRange( - HostWorkspaceServices services, SyntaxToken startToken, SyntaxToken endToken, CancellationToken cancellationToken) + SyntaxToken startToken, SyntaxToken endToken, CancellationToken cancellationToken) { Contract.ThrowIfTrue(startToken.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken); Contract.ThrowIfTrue(endToken.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken); @@ -57,10 +55,14 @@ public IList FormatRange( // Exception 2: Similar behavior for do-while if (common.ContainsDiagnostics && !CloseBraceOfTryOrDoBlock(endToken)) { - smartTokenformattingRules = (new NoLineChangeFormattingRule()).Concat(_formattingRules); + smartTokenformattingRules = ImmutableArray.Empty.Add( + new NoLineChangeFormattingRule()).AddRange(_formattingRules); } - return Formatter.GetFormattedTextChanges(_root, new[] { TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End) }, services, _options.FormattingOptions, smartTokenformattingRules, cancellationToken); + var formatter = CSharpSyntaxFormatting.Instance; + var result = formatter.GetFormattingResult( + _root, new[] { TextSpan.FromBounds(startToken.SpanStart, endToken.Span.End) }, _options.FormattingOptions, smartTokenformattingRules, cancellationToken); + return result.GetTextChanges(cancellationToken); } private static bool CloseBraceOfTryOrDoBlock(SyntaxToken endToken) @@ -71,7 +73,7 @@ private static bool CloseBraceOfTryOrDoBlock(SyntaxToken endToken) } public async Task> FormatTokenAsync( - HostWorkspaceServices services, SyntaxToken token, CancellationToken cancellationToken) + SyntaxToken token, CancellationToken cancellationToken) { Contract.ThrowIfTrue(token.Kind() is SyntaxKind.None or SyntaxKind.EndOfFileToken); @@ -103,7 +105,7 @@ public async Task> FormatTokenAsync( var smartTokenformattingRules = new SmartTokenFormattingRule().Concat(_formattingRules); var adjustedStartPosition = previousToken.SpanStart; if (token.IsKind(SyntaxKind.OpenBraceToken) && - _options.AutoFormattingOptions.IndentStyle != FormattingOptions.IndentStyle.Smart) + _options.IndentStyle != FormattingOptions2.IndentStyle.Smart) { RoslynDebug.AssertNotNull(token.SyntaxTree); var text = await token.SyntaxTree.GetTextAsync(cancellationToken).ConfigureAwait(false); @@ -113,7 +115,10 @@ public async Task> FormatTokenAsync( } } - return Formatter.GetFormattedTextChanges(_root, new[] { TextSpan.FromBounds(adjustedStartPosition, adjustedEndPosition) }, services, _options.FormattingOptions, smartTokenformattingRules, cancellationToken); + var formatter = CSharpSyntaxFormatting.Instance; + var result = formatter.GetFormattingResult( + _root, new[] { TextSpan.FromBounds(adjustedStartPosition, adjustedEndPosition) }, _options.FormattingOptions, smartTokenformattingRules, cancellationToken); + return result.GetTextChanges(cancellationToken); } private class NoLineChangeFormattingRule : AbstractFormattingRule diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs index c4932eb2c2e4c..fb05e36cc9259 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Services/SyntaxFacts/CSharpSyntaxFacts.cs @@ -1596,6 +1596,16 @@ public bool IsVerbatimInterpolatedStringExpression(SyntaxNode node) => node is InterpolatedStringExpressionSyntax interpolatedString && interpolatedString.StringStartToken.IsKind(SyntaxKind.InterpolatedVerbatimStringStartToken); + public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) + { + if (syntaxTree == null) + { + return false; + } + + return syntaxTree.IsInInactiveRegion(position, cancellationToken); + } + #region IsXXX members public bool IsAnonymousFunctionExpression([NotNullWhen(true)] SyntaxNode? node) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems index 6fb74a6ed131d..3369d0ccfa4a0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems @@ -229,6 +229,13 @@ + + + + + + + @@ -302,7 +309,7 @@ - + diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/AbstractSyntaxFormattingService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/AbstractSyntaxFormattingService.cs index 58d86aa33cacf..887b5b23f345e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/AbstractSyntaxFormattingService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/AbstractSyntaxFormattingService.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; using System.Threading; using Microsoft.CodeAnalysis.Diagnostics; @@ -16,17 +17,17 @@ namespace Microsoft.CodeAnalysis.Formatting { - internal abstract class AbstractSyntaxFormattingService : ISyntaxFormattingService + internal abstract class AbstractSyntaxFormatting : ISyntaxFormatting { private static readonly Func s_notEmpty = s => !s.IsEmpty; - protected AbstractSyntaxFormattingService() + protected AbstractSyntaxFormatting() { } public abstract SyntaxFormattingOptions GetFormattingOptions(AnalyzerConfigOptions options); - public abstract IEnumerable GetDefaultFormattingRules(); + public abstract ImmutableArray GetDefaultFormattingRules(); protected abstract IFormattingResult CreateAggregatedFormattingResult(SyntaxNode node, IList results, SimpleIntervalTree? formattingSpans = null); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/AutoFormattingOptions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/AutoFormattingOptions.cs new file mode 100644 index 0000000000000..58fa0642ea5d4 --- /dev/null +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/AutoFormattingOptions.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Immutable; +using Microsoft.CodeAnalysis.Options; + +namespace Microsoft.CodeAnalysis.Formatting +{ + /// + /// Solution-wide format-on-type options. + /// + internal readonly partial record struct AutoFormattingOptions( + bool FormatOnReturn, + bool FormatOnTyping, + bool FormatOnSemicolon, + bool FormatOnCloseBrace); +} diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.IndentStyle.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.IndentStyle.cs new file mode 100644 index 0000000000000..cd4d18d9fd715 --- /dev/null +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.IndentStyle.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CodeAnalysis.Formatting +{ + internal partial class FormattingOptions2 + { + /// + /// For use in the shared CodeStyle layer. Keep in syntax with FormattingOptions.IndentStyle. + /// + internal enum IndentStyle + { + None = 0, + Block = 1, + Smart = 2 + } + } +} diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.cs index 13282f2a3e29b..cc2c4b25b791e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/FormattingOptions2.cs @@ -19,7 +19,7 @@ namespace Microsoft.CodeAnalysis.Formatting /// /// Formatting options stored in editorconfig. /// - internal sealed class FormattingOptions2 + internal sealed partial class FormattingOptions2 { #if !CODE_STYLE [ExportSolutionOptionProvider, Shared] @@ -76,13 +76,18 @@ public Provider() new(FeatureName, FormattingOptionGroups.NewLine, nameof(InsertFinalNewLine), defaultValue: false, storageLocation: EditorConfigStorageLocation.ForBoolOption("insert_final_newline")); + // Suppression due to https://github.com/dotnet/roslyn/issues/42614 + public static PerLanguageOption2 SmartIndent { get; } = + new(FeatureName, FormattingOptionGroups.IndentationAndSpacing, nameof(SmartIndent), defaultValue: IndentStyle.Smart); + #if !CODE_STYLE internal static readonly ImmutableArray Options = ImmutableArray.Create( UseTabs, TabSize, IndentationSize, NewLine, - InsertFinalNewLine); + InsertFinalNewLine, + SmartIndent); #endif } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/ISyntaxFormatting.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/ISyntaxFormatting.cs new file mode 100644 index 0000000000000..052544b5df051 --- /dev/null +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Formatting/ISyntaxFormatting.cs @@ -0,0 +1,44 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.Formatting.Rules; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.CodeAnalysis.Formatting +{ + internal interface ISyntaxFormatting + { + SyntaxFormattingOptions GetFormattingOptions(AnalyzerConfigOptions options); + ImmutableArray GetDefaultFormattingRules(); + IFormattingResult GetFormattingResult(SyntaxNode node, IEnumerable? spans, SyntaxFormattingOptions options, IEnumerable? rules, CancellationToken cancellationToken); + } + + internal abstract partial class SyntaxFormattingOptions + { + public readonly bool UseTabs; + public readonly int TabSize; + public readonly int IndentationSize; + public readonly string NewLine; + + public readonly bool SeparateImportDirectiveGroups; + + protected SyntaxFormattingOptions( + bool useTabs, + int tabSize, + int indentationSize, + string newLine, + bool separateImportDirectiveGroups) + { + UseTabs = useTabs; + TabSize = tabSize; + IndentationSize = indentationSize; + NewLine = newLine; + SeparateImportDirectiveGroups = separateImportDirectiveGroups; + } + } +} diff --git a/src/Workspaces/Core/Portable/Indentation/AbstractIndentationService.Indenter.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/AbstractIndentation.Indenter.cs similarity index 86% rename from src/Workspaces/Core/Portable/Indentation/AbstractIndentationService.Indenter.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/AbstractIndentation.Indenter.cs index 2930aad0f7637..d6d5b54765976 100644 --- a/src/Workspaces/Core/Portable/Indentation/AbstractIndentationService.Indenter.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/AbstractIndentation.Indenter.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics; using System.Threading; using Microsoft.CodeAnalysis.Formatting; @@ -15,43 +16,46 @@ namespace Microsoft.CodeAnalysis.Indentation { - internal abstract partial class AbstractIndentationService + internal abstract partial class AbstractIndentation { protected struct Indenter { - private readonly AbstractIndentationService _service; + private readonly AbstractIndentation _service; public readonly IndentationOptions Options; public readonly TextLine LineToBeIndented; public readonly CancellationToken CancellationToken; - public readonly SyntacticDocument Document; - public readonly TSyntaxRoot Root; public readonly IEnumerable Rules; public readonly BottomUpBaseIndentationFinder Finder; - private readonly ISyntaxFactsService _syntaxFacts; + private readonly ISyntaxFacts _syntaxFacts; private readonly int _tabSize; - public readonly SyntaxTree Tree => Document.SyntaxTree; - public readonly SourceText Text => Document.Text; + public readonly SyntaxTree Tree; + public readonly SourceText Text; + public readonly TSyntaxRoot Root; + + public readonly ISmartTokenFormatter SmartTokenFormatter; public Indenter( - AbstractIndentationService service, - SyntacticDocument document, - IEnumerable rules, + AbstractIndentation service, + SyntaxTree tree, + ImmutableArray rules, IndentationOptions options, TextLine lineToBeIndented, + ISmartTokenFormatter smartTokenFormatter, CancellationToken cancellationToken) { - Document = document; - _service = service; - _syntaxFacts = document.Document.GetRequiredLanguageService(); + _syntaxFacts = service.SyntaxFacts; Options = options; - Root = (TSyntaxRoot)document.Root; + Tree = tree; + Text = tree.GetText(cancellationToken); + Root = (TSyntaxRoot)tree.GetRoot(cancellationToken); LineToBeIndented = lineToBeIndented; _tabSize = options.FormattingOptions.TabSize; + SmartTokenFormatter = smartTokenFormatter; CancellationToken = cancellationToken; Rules = rules; @@ -60,24 +64,24 @@ public Indenter( _tabSize, options.FormattingOptions.IndentationSize, tokenStream: null, - document.Document.GetRequiredLanguageService()); + service.HeaderFacts); } - public IndentationResult? GetDesiredIndentation(FormattingOptions.IndentStyle indentStyle) + public IndentationResult? GetDesiredIndentation(FormattingOptions2.IndentStyle indentStyle) { // If the caller wants no indent, then we'll return an effective '0' indent. - if (indentStyle == FormattingOptions.IndentStyle.None) + if (indentStyle == FormattingOptions2.IndentStyle.None) return null; // If the user has explicitly set 'block' indentation, or they're in an inactive preprocessor region, // then just do simple block indentation. - if (indentStyle == FormattingOptions.IndentStyle.Block || - _syntaxFacts.IsInInactiveRegion(Document.SyntaxTree, LineToBeIndented.Start, this.CancellationToken)) + if (indentStyle == FormattingOptions2.IndentStyle.Block || + _syntaxFacts.IsInInactiveRegion(this.Tree, LineToBeIndented.Start, this.CancellationToken)) { return GetDesiredBlockIndentation(); } - Debug.Assert(indentStyle == FormattingOptions.IndentStyle.Smart); + Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart); return GetDesiredSmartIndentation(); } @@ -146,7 +150,7 @@ public Indenter( // text on it. We then set our indentation to whatever the indentation of that line was. for (var currentLine = this.LineToBeIndented.LineNumber - 1; currentLine >= 0; currentLine--) { - var line = this.Document.Text.Lines[currentLine]; + var line = this.Text.Lines[currentLine]; var offset = line.GetFirstNonWhitespaceOffset(); if (offset == null) continue; @@ -166,9 +170,9 @@ public bool TryGetSmartTokenIndentation(out IndentationResult indentationResult) // var root = document.GetSyntaxRootSynchronously(cancellationToken); var sourceText = Tree.GetText(CancellationToken); - var formatter = _service.CreateSmartTokenFormatter(this); - var changes = formatter.FormatTokenAsync(Document.Project.Solution.Workspace.Services, token, CancellationToken) - .WaitAndGetResult_CanCallOnBackground(CancellationToken); + var changes = this.SmartTokenFormatter + .FormatTokenAsync(token, CancellationToken) + .WaitAndGetResult_CanCallOnBackground(CancellationToken); var updatedSourceText = sourceText.WithChanges(changes); if (LineToBeIndented.LineNumber < updatedSourceText.Lines.Count) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/AbstractIndentation.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/AbstractIndentation.cs new file mode 100644 index 0000000000000..6e22615ad945a --- /dev/null +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/AbstractIndentation.cs @@ -0,0 +1,34 @@ +// 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. + +using Microsoft.CodeAnalysis.Formatting; +using Microsoft.CodeAnalysis.Formatting.Rules; +using Microsoft.CodeAnalysis.LanguageServices; +using Microsoft.CodeAnalysis.Text; + +namespace Microsoft.CodeAnalysis.Indentation +{ + internal abstract partial class AbstractIndentation + where TSyntaxRoot : SyntaxNode, ICompilationUnitSyntax + { + protected abstract ISyntaxFacts SyntaxFacts { get; } + protected abstract IHeaderFacts HeaderFacts { get; } + protected abstract ISyntaxFormatting SyntaxFormatting { get; } + + protected abstract AbstractFormattingRule GetSpecializedIndentationFormattingRule(FormattingOptions2.IndentStyle indentStyle); + + /// + /// Returns if the language specific should be deferred to figure out indentation. If so, it + /// will be asked to the resultant + /// provided by this method. + /// + protected abstract bool ShouldUseTokenIndenter(Indenter indenter, out SyntaxToken token); + protected abstract ISmartTokenFormatter CreateSmartTokenFormatter( + TSyntaxRoot root, TextLine lineToBeIndented, IndentationOptions options, AbstractFormattingRule baseFormattingRule); + + protected abstract IndentationResult? GetDesiredIndentationWorker( + Indenter indenter, SyntaxToken? token, SyntaxTrivia? trivia); + } +} diff --git a/src/Workspaces/Core/Portable/Indentation/ISmartTokenFormatter.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/ISmartTokenFormatter.cs similarity index 71% rename from src/Workspaces/Core/Portable/Indentation/ISmartTokenFormatter.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/ISmartTokenFormatter.cs index 2cab6570ce4c6..7b5e1dc398d5c 100644 --- a/src/Workspaces/Core/Portable/Indentation/ISmartTokenFormatter.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/ISmartTokenFormatter.cs @@ -5,13 +5,12 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.Indentation { internal interface ISmartTokenFormatter { - Task> FormatTokenAsync(HostWorkspaceServices services, SyntaxToken token, CancellationToken cancellationToken); + Task> FormatTokenAsync(SyntaxToken token, CancellationToken cancellationToken); } } diff --git a/src/Workspaces/Core/Portable/Indentation/IndentationOptions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/IndentationOptions.cs similarity index 80% rename from src/Workspaces/Core/Portable/Indentation/IndentationOptions.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/IndentationOptions.cs index b60fa4f7bc537..57818437a102a 100644 --- a/src/Workspaces/Core/Portable/Indentation/IndentationOptions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/IndentationOptions.cs @@ -12,8 +12,10 @@ namespace Microsoft.CodeAnalysis.Indentation { internal readonly record struct IndentationOptions( SyntaxFormattingOptions FormattingOptions, - AutoFormattingOptions AutoFormattingOptions) + AutoFormattingOptions AutoFormattingOptions, + FormattingOptions2.IndentStyle IndentStyle) { +#if !CODE_STYLE public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) { var documentOptions = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); @@ -23,6 +25,8 @@ public static async Task FromDocumentAsync(Document document public static IndentationOptions From(OptionSet options, HostWorkspaceServices services, string language) => new( SyntaxFormattingOptions.Create(options, services, language), - AutoFormattingOptions.From(options, language)); + AutoFormattingOptions.From(options, language), + options.GetOption(FormattingOptions2.SmartIndent, language)); +#endif } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/IndentationResult.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/IndentationResult.cs new file mode 100644 index 0000000000000..3f7597824088e --- /dev/null +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Indentation/IndentationResult.cs @@ -0,0 +1,38 @@ +// 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. + +namespace Microsoft.CodeAnalysis.Indentation +{ + /// + /// An indentation result represents where the indent should be placed. It conveys this through + /// a pair of values. A position in the existing document where the indent should be relative, + /// and the number of columns after that the indent should be placed at. + /// + /// This pairing provides flexibility to the implementor to compute the indentation results in + /// a variety of ways. For example, one implementation may wish to express indentation of a + /// newline as being four columns past the start of the first token on a previous line. Another + /// may wish to simply express the indentation as an absolute amount from the start of the + /// current line. With this tuple, both forms can be expressed, and the implementor does not + /// have to convert from one to the other. + /// + internal readonly struct IndentationResult + { + /// + /// The base position in the document that the indent should be relative to. This position + /// can occur on any line (including the current line, or a previous line). + /// + public int BasePosition { get; } + + /// + /// The number of columns the indent should be at relative to the BasePosition's column. + /// + public int Offset { get; } + + public IndentationResult(int basePosition, int offset) : this() + { + this.BasePosition = basePosition; + this.Offset = offset; + } + } +} diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs index 5f1470e61148e..6898364da087a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Services/SyntaxFacts/ISyntaxFacts.cs @@ -535,6 +535,8 @@ void GetPartsOfInterpolationExpression(SyntaxNode node, SyntaxList GetContentFromDocumentationCommentTriviaSyntax(SyntaxTrivia trivia); + bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); + #region IsXXX members bool IsAnonymousFunctionExpression([NotNullWhen(true)] SyntaxNode? node); diff --git a/src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicSmartTokenFormatter.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Indentation/VisualBasicSmartTokenFormatter.vb similarity index 67% rename from src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicSmartTokenFormatter.vb rename to src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Indentation/VisualBasicSmartTokenFormatter.vb index c6df0a006973d..79ab32b27a872 100644 --- a/src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicSmartTokenFormatter.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Indentation/VisualBasicSmartTokenFormatter.vb @@ -10,20 +10,21 @@ Imports Microsoft.CodeAnalysis.Options Imports Microsoft.CodeAnalysis.Host Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Syntax +Imports Microsoft.CodeAnalysis.VisualBasic.Formatting +Imports System.Collections.Immutable Namespace Microsoft.CodeAnalysis.VisualBasic.Indentation Friend Class VisualBasicSmartTokenFormatter Implements ISmartTokenFormatter Private ReadOnly _options As SyntaxFormattingOptions - Private ReadOnly _formattingRules As IEnumerable(Of AbstractFormattingRule) + Private ReadOnly _formattingRules As ImmutableArray(Of AbstractFormattingRule) Private ReadOnly _root As CompilationUnitSyntax Public Sub New(options As SyntaxFormattingOptions, - formattingRules As IEnumerable(Of AbstractFormattingRule), + formattingRules As ImmutableArray(Of AbstractFormattingRule), root As CompilationUnitSyntax) - Contract.ThrowIfNull(formattingRules) Contract.ThrowIfNull(root) Me._options = options @@ -32,14 +33,16 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Indentation Me._root = root End Sub - Public Function FormatTokenAsync(services As HostWorkspaceServices, token As SyntaxToken, cancellationToken As CancellationToken) As Tasks.Task(Of IList(Of TextChange)) Implements ISmartTokenFormatter.FormatTokenAsync + Public Function FormatTokenAsync(token As SyntaxToken, cancellationToken As CancellationToken) As Tasks.Task(Of IList(Of TextChange)) Implements ISmartTokenFormatter.FormatTokenAsync Contract.ThrowIfTrue(token.Kind = SyntaxKind.None OrElse token.Kind = SyntaxKind.EndOfFileToken) ' get previous token Dim previousToken = token.GetPreviousToken() Dim spans = SpecializedCollections.SingletonEnumerable(TextSpan.FromBounds(previousToken.SpanStart, token.Span.End)) - Return Task.FromResult(Formatter.GetFormattedTextChanges(_root, spans, services, _options, _formattingRules, cancellationToken)) + Dim formatter = VisualBasicSyntaxFormatting.Instance + Dim result = formatter.GetFormattingResult(_root, spans, _options, _formattingRules, cancellationToken) + Return Task.FromResult(result.GetTextChanges(cancellationToken)) End Function End Class End Namespace diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb index 3a5f365b83d0c..f229b1dc67032 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/Services/SyntaxFacts/VisualBasicSyntaxFacts.vb @@ -1808,6 +1808,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices Return False End Function + Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFacts.IsInInactiveRegion + If syntaxTree Is Nothing Then + Return False + End If + + Return syntaxTree.IsInInactiveRegion(position, cancellationToken) + End Function + #Region "IsXXX members" Public Function IsAnonymousFunctionExpression(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsAnonymousFunctionExpression diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/VisualBasicCompilerExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/VisualBasicCompilerExtensions.projitems index 123c5b5574bde..ce33db593dc13 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/VisualBasicCompilerExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/VisualBasicCompilerExtensions.projitems @@ -27,6 +27,7 @@ + diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems index 731120e62cb66..f4ccbf505feb8 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems @@ -37,6 +37,8 @@ + + diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/ContextQuery/SyntaxTreeExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/ContextQuery/SyntaxTreeExtensions.cs index 5094e36e17573..f765d3f284a83 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/ContextQuery/SyntaxTreeExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/ContextQuery/SyntaxTreeExtensions.cs @@ -1883,33 +1883,6 @@ public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, in return syntaxTree.IsPreProcessorDirectiveContext(position, leftToken, cancellationToken); } - public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) - { - return IsPreProcessorKeywordContext( - syntaxTree, position, - syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken, includeDirectives: true)); - } - - public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition) - { - // cases: - // #| - // #d| - // # | - // # d| - - // note: comments are not allowed between the # and item. - var token = preProcessorTokenOnLeftOfPosition; - token = token.GetPreviousTokenIfTouchingWord(position); - - if (token.IsKind(SyntaxKind.HashToken)) - { - return true; - } - - return false; - } - public static bool IsStatementContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken) { #if false diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/SyntaxTreeExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/SyntaxTreeExtensions.cs index 535f3f93d8284..5c93146b44baa 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/SyntaxTreeExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Extensions/SyntaxTreeExtensions.cs @@ -29,69 +29,6 @@ public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, Can syntaxTree.IsInInactiveRegion(position, cancellationToken); } - public static bool IsInInactiveRegion( - this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) - { - Contract.ThrowIfNull(syntaxTree); - - // cases: - // $ is EOF - - // #if false - // | - - // #if false - // |$ - - // #if false - // | - - // #if false - // |$ - - if (syntaxTree.IsPreProcessorKeywordContext(position, cancellationToken)) - { - return false; - } - - // The latter two are the hard cases we don't actually have an - // DisabledTextTrivia yet. - var trivia = syntaxTree.GetRoot(cancellationToken).FindTrivia(position, findInsideTrivia: false); - if (trivia.Kind() == SyntaxKind.DisabledTextTrivia) - { - return true; - } - - var token = syntaxTree.FindTokenOrEndToken(position, cancellationToken); - if (token.Kind() == SyntaxKind.EndOfFileToken) - { - var triviaList = token.LeadingTrivia; - foreach (var triviaTok in triviaList.Reverse()) - { - if (triviaTok.Span.Contains(position)) - { - return false; - } - - if (triviaTok.Span.End < position) - { - if (!triviaTok.HasStructure) - { - return false; - } - - var structure = triviaTok.GetStructure(); - if (structure is BranchingDirectiveTriviaSyntax branch) - { - return !branch.IsActive || !branch.BranchTaken; - } - } - } - } - - return false; - } - public static bool IsInPartiallyWrittenGeneric( this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) { diff --git a/src/Workspaces/CSharp/Portable/Indentation/CSharpIndentationService.Indenter.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Indentation/CSharpIndentationService.Indenter.cs similarity index 97% rename from src/Workspaces/CSharp/Portable/Indentation/CSharpIndentationService.Indenter.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Indentation/CSharpIndentationService.Indenter.cs index 34921a5b63d7f..3c43d15ef8380 100644 --- a/src/Workspaces/CSharp/Portable/Indentation/CSharpIndentationService.Indenter.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Indentation/CSharpIndentationService.Indenter.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Collections.Immutable; using System.Diagnostics; using System.Linq; using Microsoft.CodeAnalysis; @@ -13,6 +14,7 @@ using Microsoft.CodeAnalysis.Formatting.Rules; using Microsoft.CodeAnalysis.Indentation; using Microsoft.CodeAnalysis.Shared.Extensions; +using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.Indentation @@ -23,12 +25,12 @@ protected override bool ShouldUseTokenIndenter(Indenter indenter, out SyntaxToke => ShouldUseSmartTokenFormatterInsteadOfIndenter( indenter.Rules, indenter.Root, indenter.LineToBeIndented, indenter.Options, out syntaxToken); - protected override ISmartTokenFormatter CreateSmartTokenFormatter(Indenter indenter) + protected override ISmartTokenFormatter CreateSmartTokenFormatter( + CompilationUnitSyntax root, TextLine lineToBeIndented, + IndentationOptions options, AbstractFormattingRule baseIndentationRule) { - var services = indenter.Document.Project.Solution.Workspace.Services; - var formattingRuleFactory = services.GetRequiredService(); - var rules = formattingRuleFactory.CreateRule(indenter.Document.Document, indenter.LineToBeIndented.Start).Concat(Formatter.GetDefaultFormattingRules(indenter.Document.Document)); - return new CSharpSmartTokenFormatter(indenter.Options, rules, indenter.Root); + var rules = ImmutableArray.Create(baseIndentationRule).AddRange(CSharpSyntaxFormatting.Instance.GetDefaultFormattingRules()); + return new CSharpSmartTokenFormatter(options, rules, root); } protected override IndentationResult? GetDesiredIndentationWorker(Indenter indenter, SyntaxToken? tokenOpt, SyntaxTrivia? triviaOpt) @@ -156,7 +158,7 @@ private static IndentationResult GetIndentationBasedOnToken(Indenter indenter, S if (token.IsSemicolonOfEmbeddedStatement() || token.IsCloseBraceOfEmbeddedBlock()) { - Debug.Assert( + RoslynDebug.Assert( token.Parent != null && (token.Parent.Parent is StatementSyntax || token.Parent.Parent is ElseClauseSyntax)); diff --git a/src/Workspaces/CSharp/Portable/Indentation/CSharpIndentationService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Indentation/CSharpIndentationService.cs similarity index 90% rename from src/Workspaces/CSharp/Portable/Indentation/CSharpIndentationService.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Indentation/CSharpIndentationService.cs index 0352f8b050d7c..4a398d04a8323 100644 --- a/src/Workspaces/CSharp/Portable/Indentation/CSharpIndentationService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/Indentation/CSharpIndentationService.cs @@ -3,16 +3,18 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; +using System.Collections.Immutable; using System.Composition; -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Extensions; +using Microsoft.CodeAnalysis.CSharp.Formatting; +using Microsoft.CodeAnalysis.CSharp.LanguageServices; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Formatting; using Microsoft.CodeAnalysis.Formatting.Rules; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Indentation; -using Microsoft.CodeAnalysis.Options; +using Microsoft.CodeAnalysis.LanguageServices; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; @@ -24,16 +26,23 @@ internal sealed partial class CSharpIndentationService : AbstractIndentationServ { public static readonly CSharpIndentationService Instance = new(); - private static readonly AbstractFormattingRule s_instance = new FormattingRule(); - [ImportingConstructor] [SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Incorrectly used in production code: https://github.com/dotnet/roslyn/issues/42839")] public CSharpIndentationService() { } - protected override AbstractFormattingRule GetSpecializedIndentationFormattingRule(FormattingOptions.IndentStyle indentStyle) - => s_instance; + protected override ISyntaxFacts SyntaxFacts + => CSharpSyntaxFacts.Instance; + + protected override IHeaderFacts HeaderFacts + => CSharpHeaderFacts.Instance; + + protected override ISyntaxFormatting SyntaxFormatting + => CSharpSyntaxFormatting.Instance; + + protected override AbstractFormattingRule GetSpecializedIndentationFormattingRule(FormattingOptions2.IndentStyle indentStyle) + => CSharpIndentationFormattingRule.Instance; public static bool ShouldUseSmartTokenFormatterInsteadOfIndenter( IEnumerable formattingRules, @@ -51,7 +60,7 @@ public static bool ShouldUseSmartTokenFormatterInsteadOfIndenter( return false; } - if (options.AutoFormattingOptions.IndentStyle != FormattingOptions.IndentStyle.Smart) + if (options.IndentStyle != FormattingOptions2.IndentStyle.Smart) { return false; } @@ -103,14 +112,12 @@ private static bool IsInvalidToken(SyntaxToken token) token.IsKind(SyntaxKind.EndOfFileToken); } - private class FormattingRule : AbstractFormattingRule + private class CSharpIndentationFormattingRule : AbstractFormattingRule { + public static readonly AbstractFormattingRule Instance = new CSharpIndentationFormattingRule(); + public override void AddIndentBlockOperations(List list, SyntaxNode node, in NextIndentBlockOperationAction nextOperation) { - // these nodes should be from syntax tree from ITextSnapshot. - Debug.Assert(node.SyntaxTree != null); - Debug.Assert(node.SyntaxTree.GetText() != null); - nextOperation.Invoke(); ReplaceCaseIndentationRules(list, node); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpRemoveUnnecessaryImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpRemoveUnnecessaryImportsService.cs index 5591f9ac9bb57..b64807c7c73d4 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpRemoveUnnecessaryImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpRemoveUnnecessaryImportsService.cs @@ -39,8 +39,8 @@ public CSharpRemoveUnnecessaryImportsService() } #if CODE_STYLE - private static ISyntaxFormattingService GetSyntaxFormattingService() - => CSharpSyntaxFormattingService.Instance; + private static ISyntaxFormatting GetSyntaxFormatting() + => CSharpSyntaxFormatting.Instance; #endif protected override IUnnecessaryImportsProvider UnnecessaryImportsProvider @@ -68,7 +68,7 @@ public override async Task RemoveUnnecessaryImportsAsync( cancellationToken.ThrowIfCancellationRequested(); #if CODE_STYLE - var provider = GetSyntaxFormattingService(); + var provider = GetSyntaxFormatting(); var options = provider.GetFormattingOptions(document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(oldRoot.SyntaxTree)); #else var provider = document.Project.Solution.Workspace.Services; diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxFactsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxFactsService.cs index dc5923a01e984..f2bd55d10c9c0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxFactsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxFactsService.cs @@ -25,16 +25,6 @@ private sealed class CSharpSyntaxFactsService : CSharpSyntaxFacts, ISyntaxFactsS { internal static new readonly CSharpSyntaxFactsService Instance = new(); - public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) - { - if (syntaxTree == null) - { - return false; - } - - return syntaxTree.IsInInactiveRegion(position, cancellationToken); - } - public bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) { if (syntaxTree == null) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeFixes/CodeFixCategory.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeFixes/CodeFixCategory.cs deleted file mode 100644 index 84b76a37b0474..0000000000000 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeFixes/CodeFixCategory.cs +++ /dev/null @@ -1,32 +0,0 @@ -// 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. - -namespace Microsoft.CodeAnalysis.CodeFixes -{ - /// - /// Code fix category for code fixes provided by a . - /// - internal enum CodeFixCategory - { - /// - /// Fixes code to adhere to code style. - /// - CodeStyle, - - /// - /// Fixes code to improve code quality. - /// - CodeQuality, - - /// - /// Fixes code to fix compiler diagnostics. - /// - Compile, - - /// - /// Custom category for fix. - /// - Custom - } -} diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeFixes/SyntaxEditorBasedCodeFixProvider.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeFixes/SyntaxEditorBasedCodeFixProvider.cs index e8871f733f605..b5e299c2e5830 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeFixes/SyntaxEditorBasedCodeFixProvider.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeFixes/SyntaxEditorBasedCodeFixProvider.cs @@ -72,8 +72,6 @@ internal static async Task FixAllWithEditorAsync( return document.WithSyntaxRoot(newRoot); } - internal abstract CodeFixCategory CodeFixCategory { get; } - protected abstract Task FixAllAsync( Document document, ImmutableArray diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Indentation/AbstractIndentationService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Indentation/AbstractIndentationService.cs new file mode 100644 index 0000000000000..ce982906c36cc --- /dev/null +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Indentation/AbstractIndentationService.cs @@ -0,0 +1,80 @@ +// 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. + +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading; +using Microsoft.CodeAnalysis.Formatting; +using Microsoft.CodeAnalysis.Formatting.Rules; +using Microsoft.CodeAnalysis.Shared.Extensions; +using Roslyn.Utilities; + +namespace Microsoft.CodeAnalysis.Indentation +{ + internal abstract partial class AbstractIndentationService + : AbstractIndentation, IIndentationService + where TSyntaxRoot : SyntaxNode, ICompilationUnitSyntax + { + public IndentationResult GetIndentation( + Document document, int lineNumber, + FormattingOptions.IndentStyle indentStyle, CancellationToken cancellationToken) + { + if (indentStyle == FormattingOptions.IndentStyle.None) + { + // If there is no indent style, then do nothing. + return new IndentationResult(basePosition: 0, offset: 0); + } + + var indenter = GetIndenter(document, lineNumber, (FormattingOptions2.IndentStyle)indentStyle, cancellationToken); + + if (indentStyle == FormattingOptions.IndentStyle.Smart && + indenter.TryGetSmartTokenIndentation(out var indentationResult)) + { + return indentationResult; + } + + // If the indenter can't produce a valid result, just default to 0 as our indentation. + return indenter.GetDesiredIndentation((FormattingOptions2.IndentStyle)indentStyle) ?? default; + } + + private Indenter GetIndenter(Document document, int lineNumber, FormattingOptions2.IndentStyle indentStyle, CancellationToken cancellationToken) + { + var syntaxFormatting = this.SyntaxFormatting; + +#if CODE_STYLE + var tree = document.GetSyntaxTreeAsync(cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); + Contract.ThrowIfNull(tree); + + var options = document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(tree); + var indentationOptions = new IndentationOptions( + syntaxFormatting.GetFormattingOptions(options), + new AutoFormattingOptions(FormatOnReturn: true, FormatOnTyping: true, FormatOnSemicolon: true, FormatOnCloseBrace: true), + indentStyle); +#else + var indentationOptions = IndentationOptions.FromDocumentAsync(document, cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); + var tree = document.GetRequiredSyntaxTreeSynchronously(cancellationToken); +#endif + + var sourceText = tree.GetText(cancellationToken); + var lineToBeIndented = sourceText.Lines[lineNumber]; + +#if CODE_STYLE + var baseIndentationRule = NoOpFormattingRule.Instance; +#else + var workspace = document.Project.Solution.Workspace; + var formattingRuleFactory = workspace.Services.GetRequiredService(); + var baseIndentationRule = formattingRuleFactory.CreateRule(document, lineToBeIndented.Start); +#endif + + var formattingRules = ImmutableArray.Create( + baseIndentationRule, + this.GetSpecializedIndentationFormattingRule(indentStyle)).AddRange( + syntaxFormatting.GetDefaultFormattingRules()); + + var smartTokenFormatter = CreateSmartTokenFormatter( + (TSyntaxRoot)tree.GetRoot(cancellationToken), lineToBeIndented, indentationOptions, baseIndentationRule); + return new Indenter(this, tree, formattingRules, indentationOptions, lineToBeIndented, smartTokenFormatter, cancellationToken); + } + } +} diff --git a/src/Workspaces/Core/Portable/Indentation/IIndentationService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Indentation/IIndentationService.cs similarity index 66% rename from src/Workspaces/Core/Portable/Indentation/IIndentationService.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Indentation/IIndentationService.cs index bded4bc6cc168..7fc9ac86ef19a 100644 --- a/src/Workspaces/Core/Portable/Indentation/IIndentationService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Indentation/IIndentationService.cs @@ -11,40 +11,14 @@ using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using Microsoft.CodeAnalysis.Options; +#endif + namespace Microsoft.CodeAnalysis.Indentation { - /// - /// An indentation result represents where the indent should be placed. It conveys this through - /// a pair of values. A position in the existing document where the indent should be relative, - /// and the number of columns after that the indent should be placed at. - /// - /// This pairing provides flexibility to the implementor to compute the indentation results in - /// a variety of ways. For example, one implementation may wish to express indentation of a - /// newline as being four columns past the start of the first token on a previous line. Another - /// may wish to simply express the indentation as an absolute amount from the start of the - /// current line. With this tuple, both forms can be expressed, and the implementor does not - /// have to convert from one to the other. - /// - internal struct IndentationResult - { - /// - /// The base position in the document that the indent should be relative to. This position - /// can occur on any line (including the current line, or a previous line). - /// - public int BasePosition { get; } - - /// - /// The number of columns the indent should be at relative to the BasePosition's column. - /// - public int Offset { get; } - - public IndentationResult(int basePosition, int offset) : this() - { - this.BasePosition = basePosition; - this.Offset = offset; - } - } - internal interface IIndentationService : ILanguageService { /// @@ -61,10 +35,16 @@ public static IndentationResult GetIndentation( this IIndentationService service, Document document, int lineNumber, CancellationToken cancellationToken) { +#if CODE_STYLE + var tree = document.GetSyntaxTreeAsync(cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); + var options = document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(tree!); +#else var options = document.GetOptionsAsync(cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); - var style = options.GetOption(FormattingOptions.SmartIndent, document.Project.Language); +#endif - return service.GetIndentation(document, lineNumber, style, cancellationToken); + var style = options.GetOption(FormattingOptions2.SmartIndent, document.Project.Language); + + return service.GetIndentation(document, lineNumber, (FormattingOptions.IndentStyle)style, cancellationToken); } /// @@ -73,7 +53,11 @@ public static IndentationResult GetIndentation( /// public static string GetPreferredIndentation(this SyntaxToken token, Document document, CancellationToken cancellationToken) { +#if CODE_STYLE + var sourceText = document.GetTextAsync(cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); +#else var sourceText = document.GetTextSynchronously(cancellationToken); +#endif var tokenLine = sourceText.Lines.GetLineFromPosition(token.SpanStart); var firstNonWhitespacePos = tokenLine.GetFirstNonWhitespacePosition(); Contract.ThrowIfNull(firstNonWhitespacePos); @@ -86,9 +70,14 @@ public static string GetPreferredIndentation(this SyntaxToken token, Document do // Token was on a line with something else. Determine where we would indent the token if it was on the next // line and use that to determine the indentation of the final line. +#if CODE_STYLE + var options = document.Project.AnalyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(token.SyntaxTree!); +#else var options = document.Project.Solution.Options; +#endif + var languageName = document.Project.Language; - var newLine = options.GetOption(FormattingOptions.NewLine, languageName); + var newLine = options.GetOption(FormattingOptions2.NewLine, languageName); var annotation = new SyntaxAnnotation(); var newToken = token.WithAdditionalAnnotations(annotation); @@ -96,22 +85,33 @@ public static string GetPreferredIndentation(this SyntaxToken token, Document do var syntaxGenerator = document.GetRequiredLanguageService(); newToken = newToken.WithLeadingTrivia(newToken.LeadingTrivia.Add(syntaxGenerator.EndOfLine(newLine))); +#if CODE_STYLE + var root = document.GetSyntaxRootAsync(cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); +#else var root = document.GetRequiredSyntaxRootSynchronously(cancellationToken); +#endif + Contract.ThrowIfNull(root); var newRoot = root.ReplaceToken(token, newToken); var newDocument = document.WithSyntaxRoot(newRoot); + +#if CODE_STYLE + var newText = newDocument.GetTextAsync(cancellationToken).WaitAndGetResult_CanCallOnBackground(cancellationToken); +#else var newText = newDocument.GetTextSynchronously(cancellationToken); +#endif var newTokenLine = newText.Lines.GetLineFromPosition(newRoot.GetAnnotatedTokens(annotation).Single().SpanStart); - var indentStyle = document.Project.Solution.Options.GetOption(FormattingOptions.SmartIndent, languageName); + var indentStyle = options.GetOption(FormattingOptions2.SmartIndent, languageName); var indenter = document.GetRequiredLanguageService(); - var indentation = indenter.GetIndentation(newDocument, newTokenLine.LineNumber, indentStyle, cancellationToken); + var indentation = indenter.GetIndentation( + newDocument, newTokenLine.LineNumber, (FormattingOptions.IndentStyle)indentStyle, cancellationToken); return indentation.GetIndentationString( newText, - options.GetOption(FormattingOptions.UseTabs, languageName), - options.GetOption(FormattingOptions.TabSize, languageName)); + options.GetOption(FormattingOptions2.UseTabs, languageName), + options.GetOption(FormattingOptions2.TabSize, languageName)); } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs index 6c04babf1e2b3..07fa90679c793 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/SyntaxFactsService/ISyntaxFactsService.cs @@ -14,8 +14,6 @@ namespace Microsoft.CodeAnalysis.LanguageServices { internal interface ISyntaxFactsService : ISyntaxFacts, ILanguageService { - bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); - bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken); // Violation. This is feature level code. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems index dbc41c00a72b1..37665675673e7 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems @@ -20,10 +20,11 @@ + + - @@ -96,4 +97,4 @@ - \ No newline at end of file + diff --git a/src/Workspaces/VisualBasic/Portable/Indentation/SpecialFormattingOperation.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/SpecialFormattingOperation.vb similarity index 98% rename from src/Workspaces/VisualBasic/Portable/Indentation/SpecialFormattingOperation.vb rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/SpecialFormattingOperation.vb index e5274b39d6be0..23b611272d235 100644 --- a/src/Workspaces/VisualBasic/Portable/Indentation/SpecialFormattingOperation.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/SpecialFormattingOperation.vb @@ -12,9 +12,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Indentation Friend Class SpecialFormattingRule Inherits CompatAbstractFormattingRule - Private ReadOnly _indentStyle As FormattingOptions.IndentStyle + Private ReadOnly _indentStyle As FormattingOptions2.IndentStyle - Public Sub New(indentStyle As FormattingOptions.IndentStyle) + Public Sub New(indentStyle As FormattingOptions2.IndentStyle) _indentStyle = indentStyle End Sub diff --git a/src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicIndentationService.Indenter.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/VisualBasicIndentationService.Indenter.vb similarity index 92% rename from src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicIndentationService.Indenter.vb rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/VisualBasicIndentationService.Indenter.vb index 969341de6fa91..becb8781c9775 100644 --- a/src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicIndentationService.Indenter.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/VisualBasicIndentationService.Indenter.vb @@ -2,25 +2,49 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. +Imports System.Collections.Immutable Imports Microsoft.CodeAnalysis.Formatting Imports Microsoft.CodeAnalysis.Formatting.Rules Imports Microsoft.CodeAnalysis.Indentation +Imports Microsoft.CodeAnalysis.LanguageServices Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Formatting +Imports Microsoft.CodeAnalysis.VisualBasic.LanguageServices Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.Indentation Partial Friend Class VisualBasicIndentationService + Protected Overrides ReadOnly Property SyntaxFacts As ISyntaxFacts + Get + Return VisualBasicSyntaxFacts.Instance + End Get + End Property + + Protected Overrides ReadOnly Property HeaderFacts As IHeaderFacts + Get + Return VisualBasicHeaderFacts.Instance + End Get + End Property + + Protected Overrides ReadOnly Property SyntaxFormatting As ISyntaxFormatting + Get + Return VisualBasicSyntaxFormatting.Instance + End Get + End Property + Protected Overrides Function ShouldUseTokenIndenter(indenter As Indenter, ByRef token As SyntaxToken) As Boolean Return ShouldUseSmartTokenFormatterInsteadOfIndenter( indenter.Rules, indenter.Root, indenter.LineToBeIndented, indenter.Options.FormattingOptions, token) End Function - Protected Overrides Function CreateSmartTokenFormatter(indenter As Indenter) As ISmartTokenFormatter - Dim services = indenter.Document.Project.Solution.Workspace.Services - Dim formattingRuleFactory = services.GetService(Of IHostDependentFormattingRuleFactoryService)() - Dim rules = {New SpecialFormattingRule(indenter.Options.AutoFormattingOptions.IndentStyle), formattingRuleFactory.CreateRule(indenter.Document.Document, indenter.LineToBeIndented.Start)}.Concat(Formatter.GetDefaultFormattingRules(indenter.Document.Document)) - Return New VisualBasicSmartTokenFormatter(indenter.Options.FormattingOptions, rules, indenter.Root) + Protected Overrides Function CreateSmartTokenFormatter( + root As CompilationUnitSyntax, + lineToBeIndented As TextLine, + options As IndentationOptions, + baseIndentationRule As AbstractFormattingRule) As ISmartTokenFormatter + Dim rules = ImmutableArray.Create(New SpecialFormattingRule(options.IndentStyle), baseIndentationRule). + AddRange(VisualBasicSyntaxFormatting.Instance.GetDefaultFormattingRules()) + Return New VisualBasicSmartTokenFormatter(options.FormattingOptions, rules, root) End Function Protected Overrides Function GetDesiredIndentationWorker( diff --git a/src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicIndentationService.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/VisualBasicIndentationService.vb similarity index 98% rename from src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicIndentationService.vb rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/VisualBasicIndentationService.vb index 99d57b198ddf9..a34c8cba6f539 100644 --- a/src/Workspaces/VisualBasic/Portable/Indentation/VisualBasicIndentationService.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/Indentation/VisualBasicIndentationService.vb @@ -32,7 +32,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Indentation _specializedIndentationRule = specializedIndentationRule End Sub - Protected Overrides Function GetSpecializedIndentationFormattingRule(indentStyle As FormattingOptions.IndentStyle) As AbstractFormattingRule + Protected Overrides Function GetSpecializedIndentationFormattingRule(indentStyle As FormattingOptions2.IndentStyle) As AbstractFormattingRule Return If(_specializedIndentationRule, New SpecialFormattingRule(indentStyle)) End Function diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicSyntaxFactsService.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicSyntaxFactsService.vb index 870af74af9cf9..b600e5b9d7e1b 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicSyntaxFactsService.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicSyntaxFactsService.vb @@ -20,14 +20,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Private Sub New() End Sub - Public Function IsInInactiveRegion(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFactsService.IsInInactiveRegion - If syntaxTree Is Nothing Then - Return False - End If - - Return syntaxTree.IsInInactiveRegion(position, cancellationToken) - End Function - Public Function IsInNonUserCode(syntaxTree As SyntaxTree, position As Integer, cancellationToken As CancellationToken) As Boolean Implements ISyntaxFactsService.IsInNonUserCode If syntaxTree Is Nothing Then Return False diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/VisualBasicWorkspaceExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/VisualBasicWorkspaceExtensions.projitems index 0258117d7bbd6..c7627b848f56c 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/VisualBasicWorkspaceExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/VisualBasicWorkspaceExtensions.projitems @@ -38,6 +38,9 @@ + + + diff --git a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb index c168e150cb122..4420d40bbad44 100644 --- a/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb +++ b/src/Workspaces/VisualBasic/Portable/CodeGeneration/VisualBasicSyntaxGenerator.vb @@ -1637,6 +1637,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration End Function Public Overrides Function GetAttributes(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) + If declaration.IsKind(SyntaxKind.CompilationUnit) Then + ' CompilationUnit syntaxes represent attribute lists in a way that we can't get a single AttributeList for all of the attributes in all cases. + ' However, some consumers of this API assume that all returned values are children of "declaration", so if there's one attribute list, we'll use + ' that value directly if possible. + Dim compilationUnit = DirectCast(declaration, CompilationUnitSyntax) + If compilationUnit.Attributes.Count = 1 Then + Return compilationUnit.Attributes(0).AttributeLists + End If + End If Return Me.Flatten(declaration.GetAttributeLists()) End Function @@ -1649,9 +1658,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration Dim existingAttributes = Me.GetAttributes(declaration) If index >= 0 AndAlso index < existingAttributes.Count Then - Return Me.InsertNodesBefore(declaration, existingAttributes(index), newAttributes) + Return Me.InsertNodesBefore(declaration, existingAttributes(index), WithRequiredTargetSpecifier(newAttributes, declaration)) ElseIf existingAttributes.Count > 0 Then - Return Me.InsertNodesAfter(declaration, existingAttributes(existingAttributes.Count - 1), newAttributes) + Return Me.InsertNodesAfter(declaration, existingAttributes(existingAttributes.Count - 1), WithRequiredTargetSpecifier(newAttributes, declaration)) Else Dim lists = GetAttributeLists(declaration) Return Me.WithAttributeLists(declaration, lists.AddRange(AsAttributeLists(attributes))) @@ -1678,6 +1687,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration End If End Function + Private Function WithRequiredTargetSpecifier(attributes As SyntaxList(Of AttributeListSyntax), declaration As SyntaxNode) As SyntaxList(Of AttributeListSyntax) + If Not declaration.IsKind(SyntaxKind.CompilationUnit) Then + Return attributes + End If + Return SyntaxFactory.List(attributes.Select(AddressOf WithAssemblyTargets)) + End Function + Public Overrides Function GetReturnAttributes(declaration As SyntaxNode) As IReadOnlyList(Of SyntaxNode) Return Me.Flatten(GetReturnAttributeLists(declaration)) End Function diff --git a/src/Workspaces/VisualBasic/Portable/Formatting/VisualBasicSyntaxFormatting.vb b/src/Workspaces/VisualBasic/Portable/Formatting/VisualBasicSyntaxFormatting.vb new file mode 100644 index 0000000000000..4e0a60a5a3e25 --- /dev/null +++ b/src/Workspaces/VisualBasic/Portable/Formatting/VisualBasicSyntaxFormatting.vb @@ -0,0 +1,43 @@ +' 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. + +Imports System.Collections.Immutable +Imports System.Threading +Imports Microsoft.CodeAnalysis.Diagnostics +Imports Microsoft.CodeAnalysis.Formatting +Imports Microsoft.CodeAnalysis.Formatting.Rules +Imports Microsoft.CodeAnalysis.Shared.Collections +Imports Microsoft.CodeAnalysis.Text + +Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting + Friend Class VisualBasicSyntaxFormatting + Inherits AbstractSyntaxFormatting + + Public Shared ReadOnly Instance As New VisualBasicSyntaxFormatting + + Private ReadOnly _rules As ImmutableArray(Of AbstractFormattingRule) = ImmutableArray.Create(Of AbstractFormattingRule)( + New StructuredTriviaFormattingRule(), + New ElasticTriviaFormattingRule(), + New AdjustSpaceFormattingRule(), + New AlignTokensFormattingRule(), + New NodeBasedFormattingRule(), + DefaultOperationProvider.Instance) + + Public Overrides Function GetDefaultFormattingRules() As ImmutableArray(Of AbstractFormattingRule) + Return _rules + End Function + + Public Overrides Function GetFormattingOptions(options As AnalyzerConfigOptions) As SyntaxFormattingOptions + Return VisualBasicSyntaxFormattingOptions.Create(options) + End Function + + Protected Overrides Function CreateAggregatedFormattingResult(node As SyntaxNode, results As IList(Of AbstractFormattingResult), Optional formattingSpans As SimpleIntervalTree(Of TextSpan, TextSpanIntervalIntrospector) = Nothing) As IFormattingResult + Return New AggregatedFormattingResult(node, results, formattingSpans) + End Function + + Protected Overrides Function Format(root As SyntaxNode, options As SyntaxFormattingOptions, formattingRules As IEnumerable(Of AbstractFormattingRule), startToken As SyntaxToken, endToken As SyntaxToken, cancellationToken As CancellationToken) As AbstractFormattingResult + Return New VisualBasicFormatEngine(root, options, formattingRules, startToken, endToken).Format(cancellationToken) + End Function + End Class +End Namespace diff --git a/src/Workspaces/VisualBasic/Portable/Formatting/VisualBasicSyntaxFormattingService.vb b/src/Workspaces/VisualBasic/Portable/Formatting/VisualBasicSyntaxFormattingService.vb index 250f610fb7f43..1bb32f2a16542 100644 --- a/src/Workspaces/VisualBasic/Portable/Formatting/VisualBasicSyntaxFormattingService.vb +++ b/src/Workspaces/VisualBasic/Portable/Formatting/VisualBasicSyntaxFormattingService.vb @@ -9,57 +9,18 @@ Imports Microsoft.CodeAnalysis.Formatting.Rules Imports Microsoft.CodeAnalysis.Shared.Collections Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.Diagnostics - -#If Not CODE_STYLE Then Imports System.Composition Imports Microsoft.CodeAnalysis.Host.Mef -#End If Namespace Microsoft.CodeAnalysis.VisualBasic.Formatting -#If Not CODE_STYLE Then Friend Class VisualBasicSyntaxFormattingService -#Else - Friend Class VisualBasicSyntaxFormattingService -#End If - Inherits AbstractSyntaxFormattingService - - Private ReadOnly _rules As ImmutableList(Of AbstractFormattingRule) + Inherits VisualBasicSyntaxFormatting + Implements ISyntaxFormattingService -#If CODE_STYLE Then - Public Shared ReadOnly Instance As New VisualBasicSyntaxFormattingService -#End If - -#If Not CODE_STYLE Then Public Sub New() -#Else - Public Sub New() -#End If - _rules = ImmutableList.Create(Of AbstractFormattingRule)( - New StructuredTriviaFormattingRule(), - New ElasticTriviaFormattingRule(), - New AdjustSpaceFormattingRule(), - New AlignTokensFormattingRule(), - New NodeBasedFormattingRule(), - DefaultOperationProvider.Instance) End Sub - - Public Overrides Function GetDefaultFormattingRules() As IEnumerable(Of AbstractFormattingRule) - Return _rules - End Function - - Public Overrides Function GetFormattingOptions(options As AnalyzerConfigOptions) As SyntaxFormattingOptions - Return VisualBasicSyntaxFormattingOptions.Create(options) - End Function - - Protected Overrides Function CreateAggregatedFormattingResult(node As SyntaxNode, results As IList(Of AbstractFormattingResult), Optional formattingSpans As SimpleIntervalTree(Of TextSpan, TextSpanIntervalIntrospector) = Nothing) As IFormattingResult - Return New AggregatedFormattingResult(node, results, formattingSpans) - End Function - - Protected Overrides Function Format(root As SyntaxNode, options As SyntaxFormattingOptions, formattingRules As IEnumerable(Of AbstractFormattingRule), startToken As SyntaxToken, endToken As SyntaxToken, cancellationToken As CancellationToken) As AbstractFormattingResult - Return New VisualBasicFormatEngine(root, options, formattingRules, startToken, endToken).Format(cancellationToken) - End Function End Class End Namespace diff --git a/src/Workspaces/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj b/src/Workspaces/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj index de4b677c26798..74e8a9851cabc 100644 --- a/src/Workspaces/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj +++ b/src/Workspaces/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj @@ -13,6 +13,10 @@ .NET Compiler Platform ("Roslyn") support for analyzing Visual Basic projects and solutions. + + + + @@ -50,7 +54,6 @@ - diff --git a/src/Workspaces/VisualBasicTest/CodeGeneration/SyntaxGeneratorTests.vb b/src/Workspaces/VisualBasicTest/CodeGeneration/SyntaxGeneratorTests.vb index 4c2f1c33d4d64..36328d79373d0 100644 --- a/src/Workspaces/VisualBasicTest/CodeGeneration/SyntaxGeneratorTests.vb +++ b/src/Workspaces/VisualBasicTest/CodeGeneration/SyntaxGeneratorTests.vb @@ -2181,6 +2181,18 @@ End Class") " Namespace n End Namespace +") + + VerifySyntax(Of CompilationUnitSyntax)( + Generator.AddAttributes( + Generator.AddAttributes( + Generator.CompilationUnit(Generator.NamespaceDeclaration("n")), + Generator.Attribute("a")), + Generator.Attribute("b")), +" + +Namespace n +End Namespace ") VerifySyntax(Of DelegateStatementSyntax)(