diff --git a/Compilers.slnf b/Compilers.slnf
index 04cb2b44c4da1..fbb18d1909e48 100644
--- a/Compilers.slnf
+++ b/Compilers.slnf
@@ -46,6 +46,9 @@
"src\\Dependencies\\CodeAnalysis.Debugging\\Microsoft.CodeAnalysis.Debugging.shproj",
"src\\Dependencies\\Collections\\Microsoft.CodeAnalysis.Collections.shproj",
"src\\Dependencies\\PooledObjects\\Microsoft.CodeAnalysis.PooledObjects.shproj",
+ "src\\ExpressionEvaluator\\CSharp\\Source\\ExpressionCompiler\\Microsoft.CodeAnalysis.CSharp.ExpressionCompiler.csproj",
+ "src\\ExpressionEvaluator\\Core\\Source\\ExpressionCompiler\\Microsoft.CodeAnalysis.ExpressionCompiler.csproj",
+ "src\\ExpressionEvaluator\\VisualBasic\\Source\\ExpressionCompiler\\Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler.vbproj",
"src\\Interactive\\csi\\csi.csproj",
"src\\NuGet\\Microsoft.CodeAnalysis.Compilers.Package.csproj",
"src\\NuGet\\Microsoft.CodeAnalysis.Package.csproj",
diff --git a/NuGet.config b/NuGet.config
index 1aafa4f960290..ee07d5df4b030 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -7,12 +7,15 @@
-
+
+
+
+
diff --git a/Roslyn.sln b/Roslyn.sln
index 643bd9aa04dfc..b246545c4df10 100644
--- a/Roslyn.sln
+++ b/Roslyn.sln
@@ -529,6 +529,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Net.Compilers.Too
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LanguageServer", "LanguageServer", "{D449D505-CC6A-4E0B-AF1B-976E2D0AE67A}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.Features.UnitTests", "src\Features\CSharpTest\Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj", "{E645B517-5766-46FB-AA4A-D4D30C9E3BE6}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Features.UnitTests", "src\Features\Test\Microsoft.CodeAnalysis.Features.UnitTests.csproj", "{9296F799-5DE4-4E12-A68E-AAC39B0EB90A}"
+EndProject
+Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests", "src\Features\VisualBasicTest\Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests.vbproj", "{57B7C0AA-E14A-41F6-AD06-FB3937F66FC2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1291,6 +1297,18 @@ Global
{521ADC3E-CC15-414B-9356-D87C5BCF3A24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{521ADC3E-CC15-414B-9356-D87C5BCF3A24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{521ADC3E-CC15-414B-9356-D87C5BCF3A24}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E645B517-5766-46FB-AA4A-D4D30C9E3BE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E645B517-5766-46FB-AA4A-D4D30C9E3BE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E645B517-5766-46FB-AA4A-D4D30C9E3BE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E645B517-5766-46FB-AA4A-D4D30C9E3BE6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9296F799-5DE4-4E12-A68E-AAC39B0EB90A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9296F799-5DE4-4E12-A68E-AAC39B0EB90A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9296F799-5DE4-4E12-A68E-AAC39B0EB90A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9296F799-5DE4-4E12-A68E-AAC39B0EB90A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {57B7C0AA-E14A-41F6-AD06-FB3937F66FC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {57B7C0AA-E14A-41F6-AD06-FB3937F66FC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {57B7C0AA-E14A-41F6-AD06-FB3937F66FC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {57B7C0AA-E14A-41F6-AD06-FB3937F66FC2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1531,6 +1549,9 @@ Global
{E5E0BF73-95F7-4BC3-8443-2336C4FF4297} = {8977A560-45C2-4EC2-A849-97335B382C74}
{828FD0DB-9927-42AC-B6C2-D1514965D6C3} = {8977A560-45C2-4EC2-A849-97335B382C74}
{521ADC3E-CC15-414B-9356-D87C5BCF3A24} = {C52D8057-43AF-40E6-A01B-6CDBB7301985}
+ {E645B517-5766-46FB-AA4A-D4D30C9E3BE6} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
+ {9296F799-5DE4-4E12-A68E-AAC39B0EB90A} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
+ {57B7C0AA-E14A-41F6-AD06-FB3937F66FC2} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29}
@@ -1539,7 +1560,6 @@ Global
src\Analyzers\VisualBasic\CodeFixes\VisualBasicCodeFixes.projitems*{0141285d-8f6c-42c7-baf3-3c0ccd61c716}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\VisualBasicWorkspaceExtensions.projitems*{0141285d-8f6c-42c7-baf3-3c0ccd61c716}*SharedItemsImports = 5
src\Compilers\CSharp\csc\CscCommandLine.projitems*{0161e25c-918a-4dc8-9648-30fdcc8e31e9}*SharedItemsImports = 5
- src\Analyzers\VisualBasic\Tests\VisualBasicAnalyzers.UnitTests.projitems*{0be66736-cdaa-4989-88b1-b3f46ebdca4a}*SharedItemsImports = 5
src\Analyzers\Core\CodeFixes\CodeFixes.projitems*{1b6c4a1a-413b-41fb-9f85-5c09118e541b}*SharedItemsImports = 13
src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 5
src\Dependencies\CodeAnalysis.Debugging\Microsoft.CodeAnalysis.Debugging.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 5
@@ -1563,6 +1583,7 @@ Global
src\Compilers\CSharp\csc\CscCommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 5
src\Analyzers\CSharp\Tests\CSharpAnalyzers.UnitTests.projitems*{5018d049-5870-465a-889b-c742ce1e31cb}*SharedItemsImports = 5
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{54e08bf5-f819-404f-a18d-0ab9ea81ea04}*SharedItemsImports = 13
+ src\Analyzers\VisualBasic\Tests\VisualBasicAnalyzers.UnitTests.projitems*{57b7c0aa-e14a-41f6-ad06-fb3937f66fc2}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\VisualBasicCompilerExtensions.projitems*{57ca988d-f010-4bf2-9a2e-07d6dcd2ff2c}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\VisualBasicWorkspaceExtensions.projitems*{57ca988d-f010-4bf2-9a2e-07d6dcd2ff2c}*SharedItemsImports = 5
src\Analyzers\CSharp\Tests\CSharpAnalyzers.UnitTests.projitems*{58969243-7f59-4236-93d0-c93b81f569b3}*SharedItemsImports = 13
@@ -1591,7 +1612,6 @@ Global
src\Analyzers\CSharp\Analyzers\CSharpAnalyzers.projitems*{aa87bfed-089a-4096-b8d5-690bdc7d5b24}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CSharpCompilerExtensions.projitems*{aa87bfed-089a-4096-b8d5-690bdc7d5b24}*SharedItemsImports = 5
src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{abdbac1e-350e-4dc3-bb45-3504404545ee}*SharedItemsImports = 5
- src\Analyzers\CSharp\Tests\CSharpAnalyzers.UnitTests.projitems*{ac2bcefb-9298-4621-ac48-1ff5e639e48d}*SharedItemsImports = 5
src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{ace53515-482c-4c6a-e2d2-4242a687dfee}*SharedItemsImports = 5
src\Compilers\CSharp\csc\CscCommandLine.projitems*{b021ccbc-b2af-4560-af28-ed055f0ed696}*SharedItemsImports = 13
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 5
@@ -1606,6 +1626,7 @@ Global
src\Compilers\Server\VBCSCompiler\VBCSCompilerCommandLine.projitems*{dc8c78cc-b6fe-47bf-93b1-b65a1c67c08d}*SharedItemsImports = 5
src\Analyzers\VisualBasic\Tests\VisualBasicAnalyzers.UnitTests.projitems*{e512c6c1-f085-4ad7-b0d9-e8f1a0a2a510}*SharedItemsImports = 5
src\Compilers\VisualBasic\vbc\VbcCommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 5
+ src\Analyzers\CSharp\Tests\CSharpAnalyzers.UnitTests.projitems*{e645b517-5766-46fb-aa4a-d4d30c9e3be6}*SharedItemsImports = 5
src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{e8f0baa5-7327-43d1-9a51-644e81ae55f1}*SharedItemsImports = 13
src\Dependencies\Collections\Microsoft.CodeAnalysis.Collections.projitems*{e919dd77-34f8-4f57-8058-4d3ff4c2b241}*SharedItemsImports = 13
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\VisualBasicWorkspaceExtensions.projitems*{e9dbfa41-7a9c-49be-bd36-fd71b31aa9fe}*SharedItemsImports = 13
diff --git a/azure-pipelines-pr-validation.yml b/azure-pipelines-pr-validation.yml
index e53b7f62f4397..5c7a9f7dd7f4b 100644
--- a/azure-pipelines-pr-validation.yml
+++ b/azure-pipelines-pr-validation.yml
@@ -152,7 +152,7 @@ stages:
displayName: Publish Assets
inputs:
filePath: 'eng\publish-assets.ps1'
- arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)"'
+ arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)" -prValidation'
condition: succeeded()
# Publish OptProf generated JSON files as a build artifact. This allows for easy inspection from
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 806cac131a1a5..805b05793cfc6 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -389,3 +389,8 @@ stages:
- script: ./eng/build.sh --solution Roslyn.sln --restore --build --configuration Debug --prepareMachine --ci --binaryLog --runanalyzers --warnaserror /p:RoslynEnforceCodeStyle=true
displayName: Build with analyzers
+
+ - template: eng/pipelines/publish-logs.yml
+ parameters:
+ jobName: Correctness_Analyzers
+ configuration: Debug
diff --git a/docs/Language Feature Status.md b/docs/Language Feature Status.md
index 361f44b3e96c0..13b8c37e9cf41 100644
--- a/docs/Language Feature Status.md
+++ b/docs/Language Feature Status.md
@@ -10,17 +10,18 @@ efforts behind them.
| Feature | Branch | State | Developer | Reviewer | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- |
+| [nameof accessing instance members](https://github.com/dotnet/csharplang/issues/4037) | main | [Merged into 17.7p1](https://github.com/dotnet/roslyn/issues/67565) | [YairHalberstadt](https://github.com/YairHalberstadt), [jjonescz](https://github.com/jjonescz) | [333fred](https://github.com/333fred), [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred) |
| [Using aliases for any type](https://github.com/dotnet/csharplang/issues/4284) | [UsingAliasTypes](https://github.com/dotnet/roslyn/tree/features/UsingAliasTypes) | [Merged into 17.6.P3](https://github.com/dotnet/roslyn/issues/56323) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) [cston](https://github.com/cston) | |
| [Primary Constructors](https://github.com/dotnet/csharplang/issues/2691) | [PrimaryConstructors](https://github.com/dotnet/roslyn/tree/features/PrimaryConstructors) | [Merged into 17.6.P2](https://github.com/dotnet/roslyn/issues/65697) | [AlekseyTs](https://github.com/AlekseyTs) | [cston](https://github.com/cston), [jjonescz](https://github.com/jjonescz) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Semi-auto-properties](https://github.com/dotnet/csharplang/issues/140) | [semi-auto-props](https://github.com/dotnet/roslyn/tree/features/semi-auto-props) | [In Progress](https://github.com/dotnet/roslyn/issues/57012) | [Youssef1313](https://github.com/Youssef1313) | [333fred](https://github.com/333fred), [RikkiGibson](https://github.com/RikkiGibson) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Params Span\ + Stackalloc any array type](https://github.com/dotnet/csharplang/issues/1757) | [params-span](https://github.com/dotnet/roslyn/tree/features/params-span) | [In Progress](https://github.com/dotnet/roslyn/issues/57049) | [cston](https://github.com/cston) | TBD | [jaredpar](https://github.com/jaredpar) |
-| [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) |
| [Lambda default parameters](https://github.com/dotnet/csharplang/issues/6051) | [lambda-default-parameters](https://github.com/dotnet/roslyn/tree/features/lambda-default-parameters) | [Merged into 17.5p2](https://github.com/dotnet/roslyn/issues/62485) | [adamperlin](https://github.com/adamperlin), [jjonescz](https://github.com/jjonescz) | [333fred](https://github.com/333fred), [cston](https://github.com/cston) | [captainsafia](https://github.com/captainsafia) |
| [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [In Progress](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [Collection Literals](https://github.com/dotnet/csharplang/issues/5354) | [CollectionLiterals](https://github.com/dotnet/roslyn/tree/features/CollectionLiterals) | [In Progress](https://github.com/dotnet/roslyn/issues/66418) | [cston](https://github.com/cston) | [333fred](https://github.com/333fred), [RikkiGibson](https://github.com/RikkiGibson) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Roles/Extensions](https://github.com/dotnet/csharplang/issues/5497) | [roles](https://github.com/dotnet/roslyn/tree/features/roles) | [In Progress](https://github.com/dotnet/roslyn/issues/66722) | [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [jjonescz](https://github.com/jjonescz) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Interceptors](https://github.com/dotnet/csharplang/issues/7009) | [interceptors](https://github.com/dotnet/roslyn/tree/features/interceptors) | [In Progress](https://github.com/dotnet/roslyn/issues/67421) | [RikkiGibson](https://github.com/RikkiGibson) | [cston](https://github.com/cston), [jcouv](https://github.com/jcouv) | [RikkiGibson](https://github.com/RikkiGibson) |
-
+| [Inline Arrays](https://github.com/dotnet/csharplang/blob/main/proposals/inline-arrays.md) | [InlineArrays](https://github.com/dotnet/roslyn/tree/features/InlineArrays) | [In Progress](https://github.com/dotnet/roslyn/issues/67826) | [AlekseyTs](https://github.com/AlekseyTs) | [cston](https://github.com/cston), [jjonescz](https://github.com/jjonescz) | |
+
# C# 11.0
| Feature | Branch | State | Developer | Reviewer | LDM Champ |
diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml
index c1b6dfbf05381..fe8201be8392c 100644
--- a/eng/SourceBuildPrebuiltBaseline.xml
+++ b/eng/SourceBuildPrebuiltBaseline.xml
@@ -1,5 +1,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 72caae2cec902..b5765e26d49a1 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -1,16 +1,16 @@
-
- https://github.com/dotnet/xliff-tasks
- 7e80445ee82adbf9a8e6ae601ac5e239d982afaa
-
-
-
+
https://github.com/dotnet/source-build-externals
- ee790b0477953dd30ea83e0e47af909a04fd0ca3
+ 33edde07d61cf7606d76ada765335fb81f1cbb71
+
+ https://github.com/dotnet/source-build-reference-packages
+ 01850f2b7bff23e118d1faecb941d770c8e626f2
+
+
@@ -18,6 +18,20 @@
b12f035e893c34ec2c965d75f6e21b7a2667e98d
+
+ https://github.com/dotnet/xliff-tasks
+ b7fb98b199d0b1b6188da4f4bf4f5accddac98d4
+
+
+
+ https://github.com/dotnet/sourcelink
+ 3f43bf1b2dead2cb51f20dc47f6dfd7981248820
+
+
+
+ https://github.com/dotnet/symreader
+ 636a10b9d0aa317736c57d95f80e1c0849450715
+
https://github.com/dotnet/roslyn
5d10d428050c0d6afef30a072c4ae68776621877
@@ -26,9 +40,9 @@
https://github.com/dotnet/arcade
b12f035e893c34ec2c965d75f6e21b7a2667e98d
-
+
https://github.com/dotnet/roslyn-analyzers
- 5cd64de1a3319d7f15380b843352a2b963e59b57
+ 19fb5cab215d2fe5d6c895d5f26c61dc1bdc0543
diff --git a/eng/Versions.props b/eng/Versions.props
index 867ec06641f7c..1ceac561bd177 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -6,21 +6,21 @@
-->
4
- 6
+ 7
0
- 3
+ 1
$(MajorVersion).$(MinorVersion).$(PatchVersion)
$(MajorVersion).$(MinorVersion).0.0
- 4.4.0-2.final
+ 4.5.0
- 3.3.4-beta1.22579.2
- 8.0.0-preview1.23111.1
+ 3.3.5-beta1.23204.1
+ 8.0.0-preview.23221.1
1.1.2-beta1.23163.2
0.1.149-beta
@@ -107,8 +107,8 @@
1.1.0-beta2-22302-02
17.0.0-beta1.21524.1
1.7.0-beta-21528-01
- 5.0.0
- 5.0.0
+ 6.0.0
+ 6.0.0
3.13.8
15.8.27812-alpha
$(MicrosoftVisualStudioShellPackagesVersion)
@@ -116,8 +116,7 @@
12.3.300-rc.3.83
1.0.0-beta3.21075.2
2.2.101
- 2.1.2
- 5.0.0
+ 5.0.0
1.0.0
1.0.0
1.0.0
@@ -243,7 +242,7 @@
4.3.0
5.0.0
7.0.0
- 5.0.0-preview.8.20407.11
+ 7.0.0
4.5.5
7.0.0
6.0.0
diff --git a/eng/config/PublishData.json b/eng/config/PublishData.json
index 16518f188d560..e76daaa5ad04e 100644
--- a/eng/config/PublishData.json
+++ b/eng/config/PublishData.json
@@ -1,7 +1,8 @@
{
"feeds": {
"vssdk": "https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json",
- "vs-impl": "https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json"
+ "vs-impl": "https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json",
+ "vs": "https://pkgs.dev.azure.com/DevDiv/_packaging/VS/nuget/v3/index.json"
},
"packages": {
"default": {
@@ -143,9 +144,8 @@
"Shipping",
"NonShipping"
],
- "vsBranch": "main",
+ "vsBranch": "rel/d17.6",
"vsMajorVersion": 17,
- "insertionCreateDraftPR": false,
"insertionTitlePrefix": "[d17.6P3]"
},
"main": {
@@ -155,18 +155,8 @@
],
"vsBranch": "main",
"vsMajorVersion": 17,
- "insertionCreateDraftPR": true,
- "insertionTitlePrefix": "[Validation]"
- },
- "main-vs-deps": {
- "nugetKind": [
- "Shipping",
- "NonShipping"
- ],
- "vsBranch": "main",
- "vsMajorVersion": 17,
- "insertionCreateDraftPR": true,
- "insertionTitlePrefix": "[17.6P3]"
+ "insertionCreateDraftPR": false,
+ "insertionTitlePrefix": "[d17.7P1]"
},
"dev/jorobich/fix-pr-val": {
"nugetKind": [
diff --git a/eng/generate-compiler-code.ps1 b/eng/generate-compiler-code.ps1
index 3e31dd0a9c31d..3981e6f7afdec 100644
--- a/eng/generate-compiler-code.ps1
+++ b/eng/generate-compiler-code.ps1
@@ -22,7 +22,7 @@ function Run-LanguageCore($language, $languageSuffix, $languageDir, $syntaxProje
$errorFileName = if ($language -eq "CSharp") { "ErrorCode.cs" } else { "Errors.vb" }
$errorFilePath = Join-Path $languageDir "Errors\$errorFileName"
$errorGeneratedFilePath = Join-Path $generatedDir "ErrorFacts.Generated.$($languageSuffix)"
- $targetFramework = "net7.0"
+ $targetFramework = "net8.0"
Create-Directory $generatedDir
Create-Directory $generatedTestDir
@@ -91,7 +91,7 @@ function Run-GetTextCore($generatedDir) {
$syntaxTextFilePath = Join-Path $generatedDir "Syntax.xml.GetText.Generated.vb"
Create-Directory $generatedDir
- Run-Tool $basicSyntaxProject "`"$syntaxFilePath`" `"$syntaxTextFilePath`" /gettext" "net7.0"
+ Run-Tool $basicSyntaxProject "`"$syntaxFilePath`" `"$syntaxTextFilePath`" /gettext" "net8.0"
}
function Run-GetText() {
diff --git a/eng/publish-assets.ps1 b/eng/publish-assets.ps1
index b81ee6b7ded1a..a3d2dfaa4fd61 100644
--- a/eng/publish-assets.ps1
+++ b/eng/publish-assets.ps1
@@ -13,6 +13,7 @@ Param(
[string]$branchName = "",
[string]$releaseName = "",
[switch]$test,
+ [switch]$prValidation,
# Credentials
[string]$nugetApiKey = ""
@@ -44,7 +45,7 @@ function Publish-Nuget($publishData, [string]$packageDir) {
}
# If the configured packageFeeds is arcade, then skip publishing here. Arcade will handle publishing packages to their feeds.
- if ($packageFeeds.equals("arcade")) {
+ if ($packageFeeds.equals("arcade") -and -not $prValidation) {
Write-Host " Skipping publishing for all packages as they will be published by arcade"
continue
}
@@ -55,12 +56,6 @@ function Publish-Nuget($publishData, [string]$packageDir) {
$packageFeeds = $publishData.packageFeeds
}
- # If the configured packageFeeds is arcade, then skip publishing here. Arcade will handle publishing packages to their feeds.
- if ($packageFeeds.equals("arcade")) {
- Write-Host " Skipping publishing for all packages as they will be published by arcade"
- continue
- }
-
# Each branch stores the name of the package to feed map it should use.
# Retrieve the correct map for this particular branch.
$packagesData = GetPackagesPublishData $packageFeeds
@@ -87,6 +82,10 @@ function Publish-Nuget($publishData, [string]$packageDir) {
$feedName = $packagesData.$nupkgWithoutVersion
+ if ($prValidation) {
+ $feedName = "vs"
+ }
+
# If the configured feed is arcade, then skip publishing here. Arcade will handle publishing to their feeds.
if ($feedName.equals("arcade")) {
Write-Host "Skipping publishing for $nupkg as it is published by arcade"
diff --git a/eng/targets/Imports.BeforeArcade.targets b/eng/targets/Imports.BeforeArcade.targets
index aeb820317be69..968ecd42a6ee8 100644
--- a/eng/targets/Imports.BeforeArcade.targets
+++ b/eng/targets/Imports.BeforeArcade.targets
@@ -17,9 +17,11 @@
6.0.0
+ 8.0.0-preview.3.23165.3
6.0.0
+ 8.0.0-preview.3.23164.14
diff --git a/eng/targets/Imports.targets b/eng/targets/Imports.targets
index 377a4315a1bd0..53eca693cbd1e 100644
--- a/eng/targets/Imports.targets
+++ b/eng/targets/Imports.targets
@@ -364,5 +364,12 @@
Condition="'@(ReferencesCopiedInThisBuild)' != ''"/>
+
+
+
+
+
+
+
diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props
index 948df0e3d49b5..f00c32423d9f3 100644
--- a/eng/targets/Settings.props
+++ b/eng/targets/Settings.props
@@ -53,6 +53,64 @@
true
+
+
+
+
+
+ $(NetPrevious)
+ $(SourceBuildToolsetTargetFramework)
+ $(NetCurrent);$(NetPrevious)
+
+
+
+
+
+
+ $(NetCurrent)
+ $(SourceBuildToolsetTargetFramework)
+ $(NetCurrent)
+
+
+
+
+
+
+ net6.0
+ $(NetCurrent);$(NetPrevious);$(SourceBuildToolsetTargetFramework)
+ $(SourceBuildToolsetTargetFrameworks)
+
+
+
+
+
+
+ net6.0
+ $(SourceBuildToolsetTargetFramework);net7.0
+ $(SourceBuildToolsetTargetFrameworks)
+
+
+
+
@@ -38,12 +38,13 @@
+
+
-
diff --git a/src/Features/CSharp/Portable/StringIndentation/CSharpStringIndentationService.cs b/src/Features/CSharp/Portable/StringIndentation/CSharpStringIndentationService.cs
index 9390ffcb7c1da..b7a4218b102c0 100644
--- a/src/Features/CSharp/Portable/StringIndentation/CSharpStringIndentationService.cs
+++ b/src/Features/CSharp/Portable/StringIndentation/CSharpStringIndentationService.cs
@@ -54,7 +54,7 @@ public CSharpStringIndentationService()
while (nodeStack.TryPop(out var node))
{
- // Dont' bother recursing into nodes that don't hit the requested span, they can never contribute
+ // DoNot' bother recursing into nodes that don't hit the requested span, they can never contribute
// regions of interest.
if (!node.Span.IntersectsWith(textSpan))
continue;
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/AddAwait/AddAwaitTests.cs b/src/Features/CSharpTest/AddAwait/AddAwaitTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/AddAwait/AddAwaitTests.cs
rename to src/Features/CSharpTest/AddAwait/AddAwaitTests.cs
diff --git a/src/EditorFeatures/CSharpTest/AddDebuggerDisplay/AddDebuggerDisplayTests.cs b/src/Features/CSharpTest/AddDebuggerDisplay/AddDebuggerDisplayTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddDebuggerDisplay/AddDebuggerDisplayTests.cs
rename to src/Features/CSharpTest/AddDebuggerDisplay/AddDebuggerDisplayTests.cs
diff --git a/src/EditorFeatures/CSharpTest/AddFileBanner/AddFileBannerTests.cs b/src/Features/CSharpTest/AddFileBanner/AddFileBannerTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddFileBanner/AddFileBannerTests.cs
rename to src/Features/CSharpTest/AddFileBanner/AddFileBannerTests.cs
diff --git a/src/EditorFeatures/CSharpTest/AddFileBanner/AddFileBannerTests_FixAll.cs b/src/Features/CSharpTest/AddFileBanner/AddFileBannerTests_FixAll.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddFileBanner/AddFileBannerTests_FixAll.cs
rename to src/Features/CSharpTest/AddFileBanner/AddFileBannerTests_FixAll.cs
diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AbstractAddUsingTests.cs b/src/Features/CSharpTest/AddUsing/AbstractAddUsingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddUsing/AbstractAddUsingTests.cs
rename to src/Features/CSharpTest/AddUsing/AbstractAddUsingTests.cs
diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingNuGetTests.cs b/src/Features/CSharpTest/AddUsing/AddUsingNuGetTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddUsing/AddUsingNuGetTests.cs
rename to src/Features/CSharpTest/AddUsing/AddUsingNuGetTests.cs
diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests.cs b/src/Features/CSharpTest/AddUsing/AddUsingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests.cs
rename to src/Features/CSharpTest/AddUsing/AddUsingTests.cs
diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTestsWithAddImportDiagnosticProvider.cs b/src/Features/CSharpTest/AddUsing/AddUsingTestsWithAddImportDiagnosticProvider.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddUsing/AddUsingTestsWithAddImportDiagnosticProvider.cs
rename to src/Features/CSharpTest/AddUsing/AddUsingTestsWithAddImportDiagnosticProvider.cs
diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_ExtensionMethods.cs b/src/Features/CSharpTest/AddUsing/AddUsingTests_ExtensionMethods.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_ExtensionMethods.cs
rename to src/Features/CSharpTest/AddUsing/AddUsingTests_ExtensionMethods.cs
diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_Queries.cs b/src/Features/CSharpTest/AddUsing/AddUsingTests_Queries.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_Queries.cs
rename to src/Features/CSharpTest/AddUsing/AddUsingTests_Queries.cs
diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_Razor.cs b/src/Features/CSharpTest/AddUsing/AddUsingTests_Razor.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests_Razor.cs
rename to src/Features/CSharpTest/AddUsing/AddUsingTests_Razor.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/AbstractCSharpCodeActionTest.cs b/src/Features/CSharpTest/CodeActions/AbstractCSharpCodeActionTest.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/AbstractCSharpCodeActionTest.cs
rename to src/Features/CSharpTest/CodeActions/AbstractCSharpCodeActionTest.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ApplyChangesOperationTests.cs b/src/Features/CSharpTest/CodeActions/ApplyChangesOperationTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ApplyChangesOperationTests.cs
rename to src/Features/CSharpTest/CodeActions/ApplyChangesOperationTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/Preview/ErrorCases/ExceptionInCodeAction.cs b/src/Features/CSharpTest/CodeActions/Preview/ErrorCases/ExceptionInCodeAction.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/Preview/ErrorCases/ExceptionInCodeAction.cs
rename to src/Features/CSharpTest/CodeActions/Preview/ErrorCases/ExceptionInCodeAction.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertAnonymousType/ConvertAnonymousTypeToClassTests.cs b/src/Features/CSharpTest/ConvertAnonymousType/ConvertAnonymousTypeToClassTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertAnonymousType/ConvertAnonymousTypeToClassTests.cs
rename to src/Features/CSharpTest/ConvertAnonymousType/ConvertAnonymousTypeToClassTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertAnonymousType/ConvertAnonymousTypeToTupleTests.cs b/src/Features/CSharpTest/ConvertAnonymousType/ConvertAnonymousTypeToTupleTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertAnonymousType/ConvertAnonymousTypeToTupleTests.cs
rename to src/Features/CSharpTest/ConvertAnonymousType/ConvertAnonymousTypeToTupleTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests.cs b/src/Features/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests.cs
rename to src/Features/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests_OptionSets.cs b/src/Features/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests_OptionSets.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests_OptionSets.cs
rename to src/Features/CSharpTest/ConvertAutoPropertyToFullProperty/ConvertAutoPropertyToFullPropertyTests_OptionSets.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertBetweenRegularAndVerbatimString/ConvertBetweenRegularAndVerbatimInterpolatedStringTests.cs b/src/Features/CSharpTest/ConvertBetweenRegularAndVerbatimString/ConvertBetweenRegularAndVerbatimInterpolatedStringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertBetweenRegularAndVerbatimString/ConvertBetweenRegularAndVerbatimInterpolatedStringTests.cs
rename to src/Features/CSharpTest/ConvertBetweenRegularAndVerbatimString/ConvertBetweenRegularAndVerbatimInterpolatedStringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertBetweenRegularAndVerbatimString/ConvertBetweenRegularAndVerbatimStringTests.cs b/src/Features/CSharpTest/ConvertBetweenRegularAndVerbatimString/ConvertBetweenRegularAndVerbatimStringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertBetweenRegularAndVerbatimString/ConvertBetweenRegularAndVerbatimStringTests.cs
rename to src/Features/CSharpTest/ConvertBetweenRegularAndVerbatimString/ConvertBetweenRegularAndVerbatimStringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertCast/ConvertDirectCastToTryCastTests.cs b/src/Features/CSharpTest/ConvertCast/ConvertDirectCastToTryCastTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertCast/ConvertDirectCastToTryCastTests.cs
rename to src/Features/CSharpTest/ConvertCast/ConvertDirectCastToTryCastTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertCast/ConvertTryCastToDirectCastTests.cs b/src/Features/CSharpTest/ConvertCast/ConvertTryCastToDirectCastTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertCast/ConvertTryCastToDirectCastTests.cs
rename to src/Features/CSharpTest/ConvertCast/ConvertTryCastToDirectCastTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertForEachToFor/ConvertForEachToForTests.cs b/src/Features/CSharpTest/ConvertForEachToFor/ConvertForEachToForTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertForEachToFor/ConvertForEachToForTests.cs
rename to src/Features/CSharpTest/ConvertForEachToFor/ConvertForEachToForTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertForToForEach/ConvertForToForEachTests.cs b/src/Features/CSharpTest/ConvertForToForEach/ConvertForToForEachTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertForToForEach/ConvertForToForEachTests.cs
rename to src/Features/CSharpTest/ConvertForToForEach/ConvertForToForEachTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ConvertIfToSwitch/ConvertIfToSwitchFixAllTests.cs b/src/Features/CSharpTest/ConvertIfToSwitch/ConvertIfToSwitchFixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ConvertIfToSwitch/ConvertIfToSwitchFixAllTests.cs
rename to src/Features/CSharpTest/ConvertIfToSwitch/ConvertIfToSwitchFixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ConvertIfToSwitch/ConvertIfToSwitchTests.cs b/src/Features/CSharpTest/ConvertIfToSwitch/ConvertIfToSwitchTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ConvertIfToSwitch/ConvertIfToSwitchTests.cs
rename to src/Features/CSharpTest/ConvertIfToSwitch/ConvertIfToSwitchTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ConvertLinq/ConvertForEachToLinqQueryTests.cs b/src/Features/CSharpTest/ConvertLinq/ConvertForEachToLinqQueryTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ConvertLinq/ConvertForEachToLinqQueryTests.cs
rename to src/Features/CSharpTest/ConvertLinq/ConvertForEachToLinqQueryTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ConvertLinq/ConvertLinqQueryToForEachTests.cs b/src/Features/CSharpTest/ConvertLinq/ConvertLinqQueryToForEachTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ConvertLinq/ConvertLinqQueryToForEachTests.cs
rename to src/Features/CSharpTest/ConvertLinq/ConvertLinqQueryToForEachTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ConvertLocalFunctionToMethod/ConvertLocalFunctionToMethodTests.cs b/src/Features/CSharpTest/ConvertLocalFunctionToMethod/ConvertLocalFunctionToMethodTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ConvertLocalFunctionToMethod/ConvertLocalFunctionToMethodTests.cs
rename to src/Features/CSharpTest/ConvertLocalFunctionToMethod/ConvertLocalFunctionToMethodTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertNamespace/ConvertNamespaceRefactoringFixAllTests.cs b/src/Features/CSharpTest/ConvertNamespace/ConvertNamespaceRefactoringFixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertNamespace/ConvertNamespaceRefactoringFixAllTests.cs
rename to src/Features/CSharpTest/ConvertNamespace/ConvertNamespaceRefactoringFixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertNamespace/ConvertNamespaceRefactoringTests.cs b/src/Features/CSharpTest/ConvertNamespace/ConvertNamespaceRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertNamespace/ConvertNamespaceRefactoringTests.cs
rename to src/Features/CSharpTest/ConvertNamespace/ConvertNamespaceRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ConvertNumericLiteral/ConvertNumericLiteralTests.cs b/src/Features/CSharpTest/ConvertNumericLiteral/ConvertNumericLiteralTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ConvertNumericLiteral/ConvertNumericLiteralTests.cs
rename to src/Features/CSharpTest/ConvertNumericLiteral/ConvertNumericLiteralTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertProgram/ConvertToProgramMainAnalyzerTests.cs b/src/Features/CSharpTest/ConvertProgram/ConvertToProgramMainAnalyzerTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertProgram/ConvertToProgramMainAnalyzerTests.cs
rename to src/Features/CSharpTest/ConvertProgram/ConvertToProgramMainAnalyzerTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertProgram/ConvertToProgramMainRefactoringTests.cs b/src/Features/CSharpTest/ConvertProgram/ConvertToProgramMainRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertProgram/ConvertToProgramMainRefactoringTests.cs
rename to src/Features/CSharpTest/ConvertProgram/ConvertToProgramMainRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertProgram/ConvertToTopLevelStatementsAnalyzerTests.cs b/src/Features/CSharpTest/ConvertProgram/ConvertToTopLevelStatementsAnalyzerTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertProgram/ConvertToTopLevelStatementsAnalyzerTests.cs
rename to src/Features/CSharpTest/ConvertProgram/ConvertToTopLevelStatementsAnalyzerTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertProgram/ConvertToTopLevelStatementsRefactoringTests.cs b/src/Features/CSharpTest/ConvertProgram/ConvertToTopLevelStatementsRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertProgram/ConvertToTopLevelStatementsRefactoringTests.cs
rename to src/Features/CSharpTest/ConvertProgram/ConvertToTopLevelStatementsRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertConcatenationToInterpolatedStringTests.cs b/src/Features/CSharpTest/ConvertToInterpolatedString/ConvertConcatenationToInterpolatedStringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertConcatenationToInterpolatedStringTests.cs
rename to src/Features/CSharpTest/ConvertToInterpolatedString/ConvertConcatenationToInterpolatedStringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs b/src/Features/CSharpTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs
rename to src/Features/CSharpTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertRegularStringToInterpolatedStringTests.cs b/src/Features/CSharpTest/ConvertToInterpolatedString/ConvertRegularStringToInterpolatedStringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertRegularStringToInterpolatedStringTests.cs
rename to src/Features/CSharpTest/ConvertToInterpolatedString/ConvertRegularStringToInterpolatedStringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertToRawString/ConvertRegularStringToRawStringTests.cs b/src/Features/CSharpTest/ConvertToRawString/ConvertRegularStringToRawStringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertToRawString/ConvertRegularStringToRawStringTests.cs
rename to src/Features/CSharpTest/ConvertToRawString/ConvertRegularStringToRawStringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertToRawString/ConvertRegularStringToRawString_FixAllTests.cs b/src/Features/CSharpTest/ConvertToRawString/ConvertRegularStringToRawString_FixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertToRawString/ConvertRegularStringToRawString_FixAllTests.cs
rename to src/Features/CSharpTest/ConvertToRawString/ConvertRegularStringToRawString_FixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertToRecord/ConvertToRecordCodeRefactoringTests.cs b/src/Features/CSharpTest/ConvertToRecord/ConvertToRecordCodeRefactoringTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/ConvertToRecord/ConvertToRecordCodeRefactoringTests.cs
rename to src/Features/CSharpTest/ConvertToRecord/ConvertToRecordCodeRefactoringTests.cs
index f46430139eb49..c2ca67d47ceb4 100644
--- a/src/EditorFeatures/CSharpTest/ConvertToRecord/ConvertToRecordCodeRefactoringTests.cs
+++ b/src/Features/CSharpTest/ConvertToRecord/ConvertToRecordCodeRefactoringTests.cs
@@ -4278,7 +4278,7 @@ public static C GetC()
}
[Fact]
- public async Task TestMovePropertiesAndDontRefactorInitializerWithExistingConstructor()
+ public async Task TestMovePropertiesAndDoNotRefactorInitializerWithExistingConstructor()
{
var initialMarkup = @"
namespace N
diff --git a/src/EditorFeatures/CSharpTest/ConvertTupleToStruct/ConvertTupleToStructTests.cs b/src/Features/CSharpTest/ConvertTupleToStruct/ConvertTupleToStructTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertTupleToStruct/ConvertTupleToStructTests.cs
rename to src/Features/CSharpTest/ConvertTupleToStruct/ConvertTupleToStructTests.cs
diff --git a/src/EditorFeatures/CSharpTest/EmbeddedLanguages/JsonStringDetectorTests.cs b/src/Features/CSharpTest/EmbeddedLanguages/JsonStringDetectorTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/EmbeddedLanguages/JsonStringDetectorTests.cs
rename to src/Features/CSharpTest/EmbeddedLanguages/JsonStringDetectorTests.cs
diff --git a/src/EditorFeatures/CSharpTest/EmbeddedLanguages/ValidateJsonStringTests.cs b/src/Features/CSharpTest/EmbeddedLanguages/ValidateJsonStringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/EmbeddedLanguages/ValidateJsonStringTests.cs
rename to src/Features/CSharpTest/EmbeddedLanguages/ValidateJsonStringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/EmbeddedLanguages/ValidateRegexStringTests.cs b/src/Features/CSharpTest/EmbeddedLanguages/ValidateRegexStringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/EmbeddedLanguages/ValidateRegexStringTests.cs
rename to src/Features/CSharpTest/EmbeddedLanguages/ValidateRegexStringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/EnableNullable/EnableNullableFixAllTests.cs b/src/Features/CSharpTest/EnableNullable/EnableNullableFixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/EnableNullable/EnableNullableFixAllTests.cs
rename to src/Features/CSharpTest/EnableNullable/EnableNullableFixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/EnableNullable/EnableNullableTests.cs b/src/Features/CSharpTest/EnableNullable/EnableNullableTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/EnableNullable/EnableNullableTests.cs
rename to src/Features/CSharpTest/EnableNullable/EnableNullableTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/EncapsulateField/EncapsulateFieldTests.cs b/src/Features/CSharpTest/EncapsulateField/EncapsulateFieldTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/EncapsulateField/EncapsulateFieldTests.cs
rename to src/Features/CSharpTest/EncapsulateField/EncapsulateFieldTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ExtractClass/ExtractClassTests.cs b/src/Features/CSharpTest/ExtractClass/ExtractClassTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ExtractClass/ExtractClassTests.cs
rename to src/Features/CSharpTest/ExtractClass/ExtractClassTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ExtractMethod/ExtractLocalFunctionTests.cs b/src/Features/CSharpTest/ExtractMethod/ExtractLocalFunctionTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/CodeActions/ExtractMethod/ExtractLocalFunctionTests.cs
rename to src/Features/CSharpTest/ExtractMethod/ExtractLocalFunctionTests.cs
index f0f0483847c06..eeeeacc635dda 100644
--- a/src/EditorFeatures/CSharpTest/CodeActions/ExtractMethod/ExtractLocalFunctionTests.cs
+++ b/src/Features/CSharpTest/ExtractMethod/ExtractLocalFunctionTests.cs
@@ -647,7 +647,7 @@ static void Main()
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsExtractLocalFunction)]
- public async Task DontOverparenthesize()
+ public async Task DoNotOverparenthesize()
{
await TestAsync(
"""
@@ -752,7 +752,7 @@ public static void Ex(this int x)
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsExtractLocalFunction)]
- public async Task DontOverparenthesizeGenerics()
+ public async Task DoNotOverparenthesizeGenerics()
{
await TestAsync(
"""
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ExtractMethod/ExtractMethodTests.cs b/src/Features/CSharpTest/ExtractMethod/ExtractMethodTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/CodeActions/ExtractMethod/ExtractMethodTests.cs
rename to src/Features/CSharpTest/ExtractMethod/ExtractMethodTests.cs
index 75bdfc9ab8b8f..11f0714e1f0d2 100644
--- a/src/EditorFeatures/CSharpTest/CodeActions/ExtractMethod/ExtractMethodTests.cs
+++ b/src/Features/CSharpTest/ExtractMethod/ExtractMethodTests.cs
@@ -877,7 +877,7 @@ static void Main()
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530709")]
[WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/632182")]
- public async Task DontOverparenthesize()
+ public async Task DoNotOverparenthesize()
{
await TestAsync(
"""
@@ -979,7 +979,7 @@ public static void Ex(this int x)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/632182")]
- public async Task DontOverparenthesizeGenerics()
+ public async Task DoNotOverparenthesizeGenerics()
{
await TestAsync(
"""
@@ -4365,7 +4365,7 @@ private static bool NewMethod()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/40209")]
- public async Task TestNaming_CamelCase_VerifyLocalFunctionSettingsDontApply()
+ public async Task TestNaming_CamelCase_VerifyLocalFunctionSettingsDoNotApply()
{
var input = """
@@ -4416,7 +4416,7 @@ private static bool NewMethod()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/40209")]
- public async Task TestNaming_CamelCase_VerifyLocalFunctionSettingsDontApply_GetName()
+ public async Task TestNaming_CamelCase_VerifyLocalFunctionSettingsDoNotApply_GetName()
{
var input = """
diff --git a/src/EditorFeatures/CSharpTest/FullyQualify/FullyQualifyTests.cs b/src/Features/CSharpTest/FullyQualify/FullyQualifyTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/FullyQualify/FullyQualifyTests.cs
rename to src/Features/CSharpTest/FullyQualify/FullyQualifyTests.cs
diff --git a/src/EditorFeatures/CSharpTest/FullyQualify/FullyQualifyUnboundIdentifierTests.cs b/src/Features/CSharpTest/FullyQualify/FullyQualifyUnboundIdentifierTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/FullyQualify/FullyQualifyUnboundIdentifierTests.cs
rename to src/Features/CSharpTest/FullyQualify/FullyQualifyUnboundIdentifierTests.cs
diff --git a/src/EditorFeatures/CSharpTest/GenerateComparisonOperators/GenerateComparisonOperatorsTests.cs b/src/Features/CSharpTest/GenerateComparisonOperators/GenerateComparisonOperatorsTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/GenerateComparisonOperators/GenerateComparisonOperatorsTests.cs
rename to src/Features/CSharpTest/GenerateComparisonOperators/GenerateComparisonOperatorsTests.cs
diff --git a/src/EditorFeatures/CSharpTest/GenerateConstructor/GenerateConstructorTests.cs b/src/Features/CSharpTest/GenerateConstructor/GenerateConstructorTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/GenerateConstructor/GenerateConstructorTests.cs
rename to src/Features/CSharpTest/GenerateConstructor/GenerateConstructorTests.cs
diff --git a/src/EditorFeatures/CSharpTest/GenerateDefaultConstructors/GenerateDefaultConstructorsTests.cs b/src/Features/CSharpTest/GenerateDefaultConstructors/GenerateDefaultConstructorsTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/GenerateDefaultConstructors/GenerateDefaultConstructorsTests.cs
rename to src/Features/CSharpTest/GenerateDefaultConstructors/GenerateDefaultConstructorsTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateEnumMember/GenerateEnumMemberTests.cs b/src/Features/CSharpTest/GenerateEnumMember/GenerateEnumMemberTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/GenerateEnumMember/GenerateEnumMemberTests.cs
rename to src/Features/CSharpTest/GenerateEnumMember/GenerateEnumMemberTests.cs
diff --git a/src/EditorFeatures/CSharpTest/GenerateFromMembers/AddConstructorParametersFromMembers/AddConstructorParametersFromMembersTests.cs b/src/Features/CSharpTest/GenerateFromMembers/AddConstructorParametersFromMembers/AddConstructorParametersFromMembersTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/GenerateFromMembers/AddConstructorParametersFromMembers/AddConstructorParametersFromMembersTests.cs
rename to src/Features/CSharpTest/GenerateFromMembers/AddConstructorParametersFromMembers/AddConstructorParametersFromMembersTests.cs
diff --git a/src/EditorFeatures/CSharpTest/GenerateFromMembers/GenerateConstructorFromMembers/GenerateConstructorFromMembersTests.cs b/src/Features/CSharpTest/GenerateFromMembers/GenerateConstructorFromMembers/GenerateConstructorFromMembersTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/GenerateFromMembers/GenerateConstructorFromMembers/GenerateConstructorFromMembersTests.cs
rename to src/Features/CSharpTest/GenerateFromMembers/GenerateConstructorFromMembers/GenerateConstructorFromMembersTests.cs
diff --git a/src/EditorFeatures/CSharpTest/GenerateFromMembers/GenerateEqualsAndGetHashCodeFromMembers/GenerateEqualsAndGetHashCodeFromMembersTests.cs b/src/Features/CSharpTest/GenerateFromMembers/GenerateEqualsAndGetHashCodeFromMembers/GenerateEqualsAndGetHashCodeFromMembersTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/GenerateFromMembers/GenerateEqualsAndGetHashCodeFromMembers/GenerateEqualsAndGetHashCodeFromMembersTests.cs
rename to src/Features/CSharpTest/GenerateFromMembers/GenerateEqualsAndGetHashCodeFromMembers/GenerateEqualsAndGetHashCodeFromMembersTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateMethod/GenerateConversionTests.cs b/src/Features/CSharpTest/GenerateMethod/GenerateConversionTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/GenerateMethod/GenerateConversionTests.cs
rename to src/Features/CSharpTest/GenerateMethod/GenerateConversionTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateMethod/GenerateDeconstructMethodTests.cs b/src/Features/CSharpTest/GenerateMethod/GenerateDeconstructMethodTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/GenerateMethod/GenerateDeconstructMethodTests.cs
rename to src/Features/CSharpTest/GenerateMethod/GenerateDeconstructMethodTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateMethod/GenerateMethodTests.cs b/src/Features/CSharpTest/GenerateMethod/GenerateMethodTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/GenerateMethod/GenerateMethodTests.cs
rename to src/Features/CSharpTest/GenerateMethod/GenerateMethodTests.cs
diff --git a/src/EditorFeatures/CSharpTest/GenerateOverrides/GenerateOverridesTests.cs b/src/Features/CSharpTest/GenerateOverrides/GenerateOverridesTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/GenerateOverrides/GenerateOverridesTests.cs
rename to src/Features/CSharpTest/GenerateOverrides/GenerateOverridesTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeTests.cs b/src/Features/CSharpTest/GenerateType/GenerateTypeTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeTests.cs
rename to src/Features/CSharpTest/GenerateType/GenerateTypeTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeTests_Dialog.cs b/src/Features/CSharpTest/GenerateType/GenerateTypeTests_Dialog.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeTests_Dialog.cs
rename to src/Features/CSharpTest/GenerateType/GenerateTypeTests_Dialog.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeWithUnboundAnalyzerTests.cs b/src/Features/CSharpTest/GenerateType/GenerateTypeWithUnboundAnalyzerTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/GenerateType/GenerateTypeWithUnboundAnalyzerTests.cs
rename to src/Features/CSharpTest/GenerateType/GenerateTypeWithUnboundAnalyzerTests.cs
diff --git a/src/EditorFeatures/CSharpTest/GenerateVariable/GenerateVariableTests.cs b/src/Features/CSharpTest/GenerateVariable/GenerateVariableTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/GenerateVariable/GenerateVariableTests.cs
rename to src/Features/CSharpTest/GenerateVariable/GenerateVariableTests.cs
index 448ced797f5fb..9d5b656ce90e5 100644
--- a/src/EditorFeatures/CSharpTest/GenerateVariable/GenerateVariableTests.cs
+++ b/src/Features/CSharpTest/GenerateVariable/GenerateVariableTests.cs
@@ -3029,7 +3029,7 @@ static void Main(string[] args)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543813")]
- public async Task DontAddBlankLineBetweenFields()
+ public async Task DoNotAddBlankLineBetweenFields()
{
await TestInRegularAndScriptAsync(
"""
@@ -3061,7 +3061,7 @@ static void Main(string[] args)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543813")]
- public async Task DontAddBlankLineBetweenAutoProperties()
+ public async Task DoNotAddBlankLineBetweenAutoProperties()
{
await TestInRegularAndScriptAsync(
"""
@@ -10583,7 +10583,7 @@ void Goo()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/45367")]
- public async Task DontOfferPropertyOrFieldInNamespace()
+ public async Task DoNotOfferPropertyOrFieldInNamespace()
{
await TestExactActionSetOfferedAsync(
"""
diff --git a/src/EditorFeatures/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests.cs b/src/Features/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests.cs
rename to src/Features/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests_FixAllTests.cs b/src/Features/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests_FixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests_FixAllTests.cs
rename to src/Features/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests_FixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests_ThroughMember.cs b/src/Features/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests_ThroughMember.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests_ThroughMember.cs
rename to src/Features/CSharpTest/ImplementAbstractClass/ImplementAbstractClassTests_ThroughMember.cs
diff --git a/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementExplicitlyTests.cs b/src/Features/CSharpTest/ImplementInterface/ImplementExplicitlyTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ImplementInterface/ImplementExplicitlyTests.cs
rename to src/Features/CSharpTest/ImplementInterface/ImplementExplicitlyTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementImplicitlyTests.cs b/src/Features/CSharpTest/ImplementInterface/ImplementImplicitlyTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ImplementInterface/ImplementImplicitlyTests.cs
rename to src/Features/CSharpTest/ImplementInterface/ImplementImplicitlyTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs b/src/Features/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs
rename to src/Features/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs
index dc3aa905a2d29..36c3f6b6be276 100644
--- a/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs
+++ b/src/Features/CSharpTest/ImplementInterface/ImplementInterfaceTests.cs
@@ -6279,7 +6279,7 @@ void I.F()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/941469")]
- public async Task TestDontImplementDisposePatternForLocallyDefinedIDisposable()
+ public async Task TestDoNotImplementDisposePatternForLocallyDefinedIDisposable()
{
await TestWithAllCodeStyleOptionsOffAsync(
"""
@@ -6313,7 +6313,7 @@ void IDisposable.Dispose()
}
[Fact]
- public async Task TestDontImplementDisposePatternForStructures1()
+ public async Task TestDoNotImplementDisposePatternForStructures1()
{
await TestWithAllCodeStyleOptionsOffAsync(
"""
@@ -6334,7 +6334,7 @@ public void Dispose()
}
[Fact]
- public async Task TestDontImplementDisposePatternForStructures2()
+ public async Task TestDoNotImplementDisposePatternForStructures2()
{
await TestWithAllCodeStyleOptionsOffAsync(
"""
diff --git a/src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests_FixAllTests.cs b/src/Features/CSharpTest/ImplementInterface/ImplementInterfaceTests_FixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ImplementInterface/ImplementInterfaceTests_FixAllTests.cs
rename to src/Features/CSharpTest/ImplementInterface/ImplementInterfaceTests_FixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/InitializeParameter/AddParameterCheckTests.cs b/src/Features/CSharpTest/InitializeParameter/AddParameterCheckTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/InitializeParameter/AddParameterCheckTests.cs
rename to src/Features/CSharpTest/InitializeParameter/AddParameterCheckTests.cs
diff --git a/src/EditorFeatures/CSharpTest/InitializeParameter/InitializeMemberFromParameterTests.cs b/src/Features/CSharpTest/InitializeParameter/InitializeMemberFromParameterTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/InitializeParameter/InitializeMemberFromParameterTests.cs
rename to src/Features/CSharpTest/InitializeParameter/InitializeMemberFromParameterTests.cs
diff --git a/src/EditorFeatures/CSharpTest/InlineMethod/CSharpInlineMethodTests.cs b/src/Features/CSharpTest/InlineMethod/CSharpInlineMethodTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/InlineMethod/CSharpInlineMethodTests.cs
rename to src/Features/CSharpTest/InlineMethod/CSharpInlineMethodTests.cs
diff --git a/src/EditorFeatures/CSharpTest/InlineMethod/CSharpInlineMethodTests_CrossLanguage.cs b/src/Features/CSharpTest/InlineMethod/CSharpInlineMethodTests_CrossLanguage.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/InlineMethod/CSharpInlineMethodTests_CrossLanguage.cs
rename to src/Features/CSharpTest/InlineMethod/CSharpInlineMethodTests_CrossLanguage.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/InlineTemporary/InlineTemporaryTests.cs b/src/Features/CSharpTest/InlineTemporary/InlineTemporaryTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/CodeActions/InlineTemporary/InlineTemporaryTests.cs
rename to src/Features/CSharpTest/InlineTemporary/InlineTemporaryTests.cs
index 47216586eecee..a53ead378e4d1 100644
--- a/src/EditorFeatures/CSharpTest/CodeActions/InlineTemporary/InlineTemporaryTests.cs
+++ b/src/Features/CSharpTest/InlineTemporary/InlineTemporaryTests.cs
@@ -488,7 +488,7 @@ public async Task TestParenthesizedAtReference_Case3()
}
[Fact]
- public async Task DontBreakOverloadResolution_Case5()
+ public async Task DoNotBreakOverloadResolution_Case5()
{
var code = """
class C
@@ -521,7 +521,7 @@ void M()
}
[Fact]
- public async Task DontTouchUnrelatedBlocks()
+ public async Task DoNotTouchUnrelatedBlocks()
{
var code = """
class C
@@ -2440,7 +2440,7 @@ static void M()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544563")]
- public async Task DontInlineStackAlloc()
+ public async Task DoNotInlineStackAlloc()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2733,7 +2733,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545103")]
- public async Task DontInsertCastForTypeThatNoLongerBindsToTheSameType()
+ public async Task DoNotInsertCastForTypeThatNoLongerBindsToTheSameType()
{
await TestAsync(
"""
@@ -2799,7 +2799,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545523")]
- public async Task DontInsertCastForObjectCreationIfUnneeded()
+ public async Task DoNotInsertCastForObjectCreationIfUnneeded()
{
await TestInRegularAndScriptAsync(
"""
@@ -2827,7 +2827,7 @@ static void Main()
}
[Fact]
- public async Task DontInsertCastInForeachIfUnneeded01()
+ public async Task DoNotInsertCastInForeachIfUnneeded01()
{
await TestInRegularAndScriptAsync(
"""
@@ -4009,7 +4009,7 @@ public static void M(string s)
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/4583")]
- public async Task DontParenthesizeInterpolatedStringWithNoInterpolation_CSharp7()
+ public async Task DoNotParenthesizeInterpolatedStringWithNoInterpolation_CSharp7()
{
await TestInRegularAndScriptAsync(
"""
@@ -4090,7 +4090,7 @@ public void M()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/4583")]
- public async Task DontParenthesizeInterpolatedStringWithInterpolation_CSharp7()
+ public async Task DoNotParenthesizeInterpolatedStringWithInterpolation_CSharp7()
{
await TestInRegularAndScriptAsync(
"""
@@ -4116,7 +4116,7 @@ public void M(int x)
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/33108")]
[WorkItem("https://github.com/dotnet/roslyn/issues/4583")]
- public async Task DontParenthesizeInterpolatedStringWithInterpolation()
+ public async Task DoNotParenthesizeInterpolatedStringWithInterpolation()
{
await TestInRegularAndScriptAsync(
"""
diff --git a/src/EditorFeatures/CSharpTest/IntroduceParameter/IntroduceParameterTests.cs b/src/Features/CSharpTest/IntroduceParameter/IntroduceParameterTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/IntroduceParameter/IntroduceParameterTests.cs
rename to src/Features/CSharpTest/IntroduceParameter/IntroduceParameterTests.cs
diff --git a/src/EditorFeatures/CSharpTest/IntroduceUsingStatement/IntroduceUsingStatementTests.cs b/src/Features/CSharpTest/IntroduceUsingStatement/IntroduceUsingStatementTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/IntroduceUsingStatement/IntroduceUsingStatementTests.cs
rename to src/Features/CSharpTest/IntroduceUsingStatement/IntroduceUsingStatementTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Interactive/CodeActions/InteractiveIntroduceVariableTests.cs b/src/Features/CSharpTest/IntroduceVariable/InteractiveIntroduceVariableTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Interactive/CodeActions/InteractiveIntroduceVariableTests.cs
rename to src/Features/CSharpTest/IntroduceVariable/InteractiveIntroduceVariableTests.cs
diff --git a/src/EditorFeatures/CSharpTest/IntroduceVariable/IntroduceLocalForExpressionTests.cs b/src/Features/CSharpTest/IntroduceVariable/IntroduceLocalForExpressionTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/IntroduceVariable/IntroduceLocalForExpressionTests.cs
rename to src/Features/CSharpTest/IntroduceVariable/IntroduceLocalForExpressionTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs b/src/Features/CSharpTest/IntroduceVariable/IntroduceVariableTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs
rename to src/Features/CSharpTest/IntroduceVariable/IntroduceVariableTests.cs
index 49ec75daa941d..a10dacf61f5ed 100644
--- a/src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs
+++ b/src/Features/CSharpTest/IntroduceVariable/IntroduceVariableTests.cs
@@ -3074,7 +3074,7 @@ void Goo()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/682683")]
- public async Task DontRemoveParenthesesIfOperatorPrecedenceWouldBeBroken()
+ public async Task DoNotRemoveParenthesesIfOperatorPrecedenceWouldBeBroken()
{
await TestInRegularAndScriptAsync(
"""
@@ -8056,7 +8056,7 @@ class C
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/40381")]
- public async Task TestIntroduceFromMethod_AllOccurences_DontIncludeStaticLocalFunctionReferences()
+ public async Task TestIntroduceFromMethod_AllOccurences_DoNotIncludeStaticLocalFunctionReferences()
{
await TestInRegularAndScriptAsync(
"""
@@ -8105,7 +8105,7 @@ private static object Foo()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/40381")]
- public async Task TestIntroduceFromMethod_AllOccurences_DontIncludeStaticLocalFunctionReferences2()
+ public async Task TestIntroduceFromMethod_AllOccurences_DoNotIncludeStaticLocalFunctionReferences2()
{
await TestInRegularAndScriptAsync(
"""
diff --git a/src/EditorFeatures/CSharpTest/InvertConditional/InvertConditionalTests.cs b/src/Features/CSharpTest/InvertConditional/InvertConditionalTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/InvertConditional/InvertConditionalTests.cs
rename to src/Features/CSharpTest/InvertConditional/InvertConditionalTests.cs
diff --git a/src/EditorFeatures/CSharpTest/InvertIf/InvertIfTests.Elseless.cs b/src/Features/CSharpTest/InvertIf/InvertIfTests.Elseless.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/InvertIf/InvertIfTests.Elseless.cs
rename to src/Features/CSharpTest/InvertIf/InvertIfTests.Elseless.cs
diff --git a/src/EditorFeatures/CSharpTest/InvertIf/InvertIfTests.cs b/src/Features/CSharpTest/InvertIf/InvertIfTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/InvertIf/InvertIfTests.cs
rename to src/Features/CSharpTest/InvertIf/InvertIfTests.cs
diff --git a/src/EditorFeatures/CSharpTest/InvertLogical/InvertLogicalTests.cs b/src/Features/CSharpTest/InvertLogical/InvertLogicalTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/InvertLogical/InvertLogicalTests.cs
rename to src/Features/CSharpTest/InvertLogical/InvertLogicalTests.cs
diff --git a/src/EditorFeatures/CSharpTest/MakeLocalFunctionStatic/MakeLocalFunctionStaticRefactoringTests.cs b/src/Features/CSharpTest/MakeLocalFunctionStatic/MakeLocalFunctionStaticRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/MakeLocalFunctionStatic/MakeLocalFunctionStaticRefactoringTests.cs
rename to src/Features/CSharpTest/MakeLocalFunctionStatic/MakeLocalFunctionStaticRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs b/src/Features/CSharpTest/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs
rename to src/Features/CSharpTest/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs
diff --git a/src/Features/CSharpTest/Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj b/src/Features/CSharpTest/Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj
new file mode 100644
index 0000000000000..b6570c7a73640
--- /dev/null
+++ b/src/Features/CSharpTest/Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj
@@ -0,0 +1,54 @@
+
+
+
+
+ Library
+ net472
+ true
+ Microsoft.CodeAnalysis.Editor.CSharp.UnitTests
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/EditorFeatures/CSharpTest/MoveDeclarationNearReference/MoveDeclarationNearReferenceTests.cs b/src/Features/CSharpTest/MoveDeclarationNearReference/MoveDeclarationNearReferenceTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/MoveDeclarationNearReference/MoveDeclarationNearReferenceTests.cs
rename to src/Features/CSharpTest/MoveDeclarationNearReference/MoveDeclarationNearReferenceTests.cs
diff --git a/src/EditorFeatures/CSharpTest/MoveStaticMembers/CSharpMoveStaticMembersTests.cs b/src/Features/CSharpTest/MoveStaticMembers/CSharpMoveStaticMembersTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/MoveStaticMembers/CSharpMoveStaticMembersTests.cs
rename to src/Features/CSharpTest/MoveStaticMembers/CSharpMoveStaticMembersTests.cs
index 26366864031cb..c3fc3b44e03d6 100644
--- a/src/EditorFeatures/CSharpTest/MoveStaticMembers/CSharpMoveStaticMembersTests.cs
+++ b/src/Features/CSharpTest/MoveStaticMembers/CSharpMoveStaticMembersTests.cs
@@ -1849,7 +1849,7 @@ public static int TestMethod()
}
[Fact]
- public async Task TestMoveExtensionMethodDontRefactor()
+ public async Task TestMoveExtensionMethodDoNotRefactor()
{
var initialMarkup = @"
namespace TestNs1
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/CSharpMoveTypeTestsBase.cs b/src/Features/CSharpTest/MoveType/CSharpMoveTypeTestsBase.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/MoveType/CSharpMoveTypeTestsBase.cs
rename to src/Features/CSharpTest/MoveType/CSharpMoveTypeTestsBase.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.ActionCountTests.cs b/src/Features/CSharpTest/MoveType/MoveTypeTests.ActionCountTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.ActionCountTests.cs
rename to src/Features/CSharpTest/MoveType/MoveTypeTests.ActionCountTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveScope.cs b/src/Features/CSharpTest/MoveType/MoveTypeTests.MoveScope.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveScope.cs
rename to src/Features/CSharpTest/MoveType/MoveTypeTests.MoveScope.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs b/src/Features/CSharpTest/MoveType/MoveTypeTests.MoveToNewFile.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.MoveToNewFile.cs
rename to src/Features/CSharpTest/MoveType/MoveTypeTests.MoveToNewFile.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.RenameFile.cs b/src/Features/CSharpTest/MoveType/MoveTypeTests.RenameFile.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.RenameFile.cs
rename to src/Features/CSharpTest/MoveType/MoveTypeTests.RenameFile.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.RenameType.cs b/src/Features/CSharpTest/MoveType/MoveTypeTests.RenameType.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/MoveType/MoveTypeTests.RenameType.cs
rename to src/Features/CSharpTest/MoveType/MoveTypeTests.RenameType.cs
diff --git a/src/EditorFeatures/CSharpTest/NameTupleElement/NameTupleElementTests.cs b/src/Features/CSharpTest/NameTupleElement/NameTupleElementTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/NameTupleElement/NameTupleElementTests.cs
rename to src/Features/CSharpTest/NameTupleElement/NameTupleElementTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/PreferFrameworkType/PreferFrameworkTypeTests.cs b/src/Features/CSharpTest/PreferFrameworkType/PreferFrameworkTypeTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/PreferFrameworkType/PreferFrameworkTypeTests.cs
rename to src/Features/CSharpTest/PreferFrameworkType/PreferFrameworkTypeTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/PreferFrameworkType/PreferFrameworkTypeTests_FixAllTests.cs b/src/Features/CSharpTest/PreferFrameworkType/PreferFrameworkTypeTests_FixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/PreferFrameworkType/PreferFrameworkTypeTests_FixAllTests.cs
rename to src/Features/CSharpTest/PreferFrameworkType/PreferFrameworkTypeTests_FixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/PullMemberUp/CSharpPullMemberUpTests.cs b/src/Features/CSharpTest/PullMemberUp/CSharpPullMemberUpTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/PullMemberUp/CSharpPullMemberUpTests.cs
rename to src/Features/CSharpTest/PullMemberUp/CSharpPullMemberUpTests.cs
diff --git a/src/EditorFeatures/CSharpTest/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_AsTests.cs b/src/Features/CSharpTest/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_AsTests.cs
similarity index 94%
rename from src/EditorFeatures/CSharpTest/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_AsTests.cs
rename to src/Features/CSharpTest/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_AsTests.cs
index e19377947c6c4..44f89c8f4d145 100644
--- a/src/EditorFeatures/CSharpTest/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_AsTests.cs
+++ b/src/Features/CSharpTest/RemoveUnnecessaryCast/RemoveUnnecessaryCastTests_AsTests.cs
@@ -29,7 +29,7 @@ internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProvider
=> (new CSharpRemoveUnnecessaryCastDiagnosticAnalyzer(), new CSharpRemoveUnnecessaryCastCodeFixProvider());
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545979")]
- public async Task DontRemoveCastToErrorType()
+ public async Task DoNotRemoveCastToErrorType()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -78,7 +78,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545138")]
- public async Task DontRemoveTypeParameterCastToObject()
+ public async Task DoNotRemoveTypeParameterCastToObject()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -93,7 +93,7 @@ void Goo(T obj)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545139")]
- public async Task DontRemoveCastInIsTest()
+ public async Task DoNotRemoveCastInIsTest()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -112,7 +112,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545142")]
- public async Task DontRemoveCastNeedForUserDefinedOperator()
+ public async Task DoNotRemoveCastNeedForUserDefinedOperator()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -135,7 +135,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545143")]
- public async Task DontRemovePointerCast1()
+ public async Task DoNotRemovePointerCast1()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -150,7 +150,7 @@ static unsafe void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545144")]
- public async Task DontRemoveCastToObjectFromDelegateComparison()
+ public async Task DoNotRemoveCastToObjectFromDelegateComparison()
{
// The cast below can't be removed because it would result in the Delegate
// op_Equality operator overload being used over reference equality.
@@ -172,7 +172,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545145")]
- public async Task DontRemoveCastToAnonymousMethodWhenOnLeftOfAsCast()
+ public async Task DoNotRemoveCastToAnonymousMethodWhenOnLeftOfAsCast()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -192,7 +192,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545157")]
- public async Task DontRemoveIdentityCastWhichAffectsOverloadResolution1()
+ public async Task DoNotRemoveIdentityCastWhichAffectsOverloadResolution1()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -217,7 +217,7 @@ static void Goo(Func x)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545158")]
- public async Task DontRemoveIdentityCastWhichAffectsOverloadResolution2()
+ public async Task DoNotRemoveIdentityCastWhichAffectsOverloadResolution2()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -243,7 +243,7 @@ static void Goo(int x)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545158")]
- public async Task DontRemoveIdentityCastWhichAffectsOverloadResolution3()
+ public async Task DoNotRemoveIdentityCastWhichAffectsOverloadResolution3()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -270,7 +270,7 @@ static void Goo(int x)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545747")]
- public async Task DontRemoveCastWhichChangesTypeOfInferredLocal()
+ public async Task DoNotRemoveCastWhichChangesTypeOfInferredLocal()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -285,7 +285,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545159")]
- public async Task DontRemoveNeededCastToIListOfObject()
+ public async Task DoNotRemoveNeededCastToIListOfObject()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -525,7 +525,7 @@ public static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545291")]
- public async Task DontRemoveNeededCastInConditionalExpression()
+ public async Task DoNotRemoveNeededCastInConditionalExpression()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -625,7 +625,7 @@ static void Main()
[WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529787")]
[WpfFact(Skip = "529787")]
- public async Task DontRemoveNecessaryCastWhichInCollectionInitializer1()
+ public async Task DoNotRemoveNecessaryCastWhichInCollectionInitializer1()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -654,7 +654,7 @@ static void Main()
[WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529787")]
[WpfFact(Skip = "529787")]
- public async Task DontRemoveNecessaryCastWhichInCollectionInitializer2()
+ public async Task DoNotRemoveNecessaryCastWhichInCollectionInitializer2()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -709,7 +709,7 @@ static void Goo()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545608")]
- public async Task DontRemoveNecessaryCastWithImplicitUserDefinedConversion()
+ public async Task DoNotRemoveNecessaryCastWithImplicitUserDefinedConversion()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -730,7 +730,7 @@ static void Goo()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545941")]
- public async Task DontRemoveNecessaryCastWithImplicitConversionInThrow()
+ public async Task DoNotRemoveNecessaryCastWithImplicitConversionInThrow()
{
// The cast below can't be removed because the throw statement expects
// an expression of type Exception -- not an expression convertible to
@@ -756,7 +756,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545981")]
- public async Task DontRemoveNecessaryCastInThrow()
+ public async Task DoNotRemoveNecessaryCastInThrow()
{
// The cast below can't be removed because the throw statement expects
// an expression of type Exception -- not an expression convertible to
@@ -807,7 +807,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545945")]
- public async Task DontRemoveNecessaryDowncast()
+ public async Task DoNotRemoveNecessaryDowncast()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -822,7 +822,7 @@ void Goo(object y)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545606")]
- public async Task DontRemoveNecessaryCastFromNullToTypeParameter()
+ public async Task DoNotRemoveNecessaryCastFromNullToTypeParameter()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -837,7 +837,7 @@ class X
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545744")]
- public async Task DontRemoveNecessaryCastInImplicitlyTypedArray()
+ public async Task DoNotRemoveNecessaryCastInImplicitlyTypedArray()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -952,7 +952,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529816")]
- public async Task DontRemoveNecessaryCastInQueryExpression()
+ public async Task DoNotRemoveNecessaryCastInQueryExpression()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -980,7 +980,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529831")]
- public async Task DontRemoveNecessaryCastFromTypeParameterToInterface()
+ public async Task DoNotRemoveNecessaryCastFromTypeParameterToInterface()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -1121,7 +1121,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545877")]
- public async Task DontCrashOnIncompleteMethodDeclaration()
+ public async Task DoNotCrashOnIncompleteMethodDeclaration()
{
await TestInRegularAndScriptAsync(
"""
@@ -1213,7 +1213,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529846")]
- public async Task DontRemoveNecessaryCastFromTypeParameterToObject()
+ public async Task DoNotRemoveNecessaryCastFromTypeParameterToObject()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -1230,7 +1230,7 @@ static void Goo(T x, object y)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545858")]
- public async Task DontRemoveNecessaryCastFromDelegateTypeToMulticastDelegate()
+ public async Task DoNotRemoveNecessaryCastFromDelegateTypeToMulticastDelegate()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -1249,7 +1249,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529842")]
- public async Task DontRemoveNecessaryCastInTernaryExpression()
+ public async Task DoNotRemoveNecessaryCastInTernaryExpression()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -1321,7 +1321,7 @@ class C
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545957")]
- public async Task DontRemoveCastInConstructorInitializer3()
+ public async Task DoNotRemoveCastInConstructorInitializer3()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -1386,7 +1386,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545962")]
- public async Task DontRemoveCastWhenExpressionDoesntBind()
+ public async Task DoNotRemoveCastWhenExpressionDoesntBind()
{
// Note: The cast below can't be removed because its expression doesn't bind.
@@ -1405,7 +1405,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545944")]
- public async Task DontRemoveNecessaryCastBeforePointerDereference1()
+ public async Task DoNotRemoveNecessaryCastBeforePointerDereference1()
{
// Note: The cast below can't be removed because it would result in *null,
// which is illegal.
@@ -1420,7 +1420,7 @@ unsafe class C
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545978")]
- public async Task DontRemoveNecessaryCastBeforePointerDereference2()
+ public async Task DoNotRemoveNecessaryCastBeforePointerDereference2()
{
// Note: The cast below can't be removed because it would result in dereferencing
// void*, which is illegal.
@@ -1439,7 +1439,7 @@ static void Main()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/26640")]
- public async Task DontRemoveCastToByteFromIntInConditionalExpression_CSharp8()
+ public async Task DoNotRemoveCastToByteFromIntInConditionalExpression_CSharp8()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -1454,7 +1454,7 @@ object M1(bool b)
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/26640")]
- public async Task DontRemoveCastToByteFromIntInConditionalExpression_CSharp9()
+ public async Task DoNotRemoveCastToByteFromIntInConditionalExpression_CSharp9()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -1471,7 +1471,7 @@ object M1(bool b)
#region Interface Casts
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545889")]
- public async Task DontRemoveCastToInterfaceForUnsealedType()
+ public async Task DoNotRemoveCastToInterfaceForUnsealedType()
{
// Note: The cast below can't be removed because X is not sealed.
@@ -1638,7 +1638,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545890")]
- public async Task DontRemoveCastToInterfaceForSealedType4()
+ public async Task DoNotRemoveCastToInterfaceForSealedType4()
{
// Note: The cast below can't be removed (even though C is sealed)
// because the unspecified optional parameter default values differ.
@@ -1716,7 +1716,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545888")]
- public async Task DontRemoveCastToInterfaceForSealedType6()
+ public async Task DoNotRemoveCastToInterfaceForSealedType6()
{
// Note: The cast below can't be removed (even though C is sealed)
// because the specified named arguments refer to parameters that
@@ -1777,7 +1777,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545888")]
- public async Task DontRemoveCastToInterfaceForSealedType8()
+ public async Task DoNotRemoveCastToInterfaceForSealedType8()
{
// Note: The cast below can't be removed (even though C is sealed)
// because the specified named arguments refer to parameters that
@@ -1811,7 +1811,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545883")]
- public async Task DontRemoveCastToInterfaceForSealedType9()
+ public async Task DoNotRemoveCastToInterfaceForSealedType9()
{
// Note: The cast below can't be removed (even though C is sealed)
// because it would result in binding to a Dispose method that doesn't
@@ -1839,7 +1839,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545887")]
- public async Task DontRemoveCastToInterfaceForStruct1()
+ public async Task DoNotRemoveCastToInterfaceForStruct1()
{
// Note: The cast below can't be removed because the cast boxes 's' and
// unboxing would change program behavior.
@@ -2027,7 +2027,7 @@ static void Main()
#region ParamArray Parameter Casts
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545141")]
- public async Task DontRemoveCastToObjectInParamArrayArg1()
+ public async Task DoNotRemoveCastToObjectInParamArrayArg1()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2049,7 +2049,7 @@ static void Goo(params object[] x)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529911")]
- public async Task DontRemoveCastToIntArrayInParamArrayArg2()
+ public async Task DoNotRemoveCastToIntArrayInParamArrayArg2()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2071,7 +2071,7 @@ static void Goo(params object[] x)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529911")]
- public async Task DontRemoveCastToObjectArrayInParamArrayArg3()
+ public async Task DoNotRemoveCastToObjectArrayInParamArrayArg3()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2270,7 +2270,7 @@ static void Main()
#region ForEach Statements
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545961")]
- public async Task DontRemoveNecessaryCastInForEach1()
+ public async Task DoNotRemoveNecessaryCastInForEach1()
{
// The cast below can't be removed because it would result an error
// in the foreach statement.
@@ -2293,7 +2293,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545961")]
- public async Task DontRemoveNecessaryCastInForEach2()
+ public async Task DoNotRemoveNecessaryCastInForEach2()
{
// The cast below can't be removed because it would result an error
// in the foreach statement.
@@ -2316,7 +2316,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545961")]
- public async Task DontRemoveNecessaryCastInForEach3()
+ public async Task DoNotRemoveNecessaryCastInForEach3()
{
// The cast below can't be removed because it would result an error
// in the foreach statement since C doesn't contain a GetEnumerator()
@@ -2353,7 +2353,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545961")]
- public async Task DontRemoveNecessaryCastInForEach4()
+ public async Task DoNotRemoveNecessaryCastInForEach4()
{
// The cast below can't be removed because it would result in
// C.GetEnumerator() being called rather than D.GetEnumerator().
@@ -2396,7 +2396,7 @@ static void Main()
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545961")]
- public async Task DontRemoveNecessaryCastInForEach5()
+ public async Task DoNotRemoveNecessaryCastInForEach5()
{
// The cast below can't be removed because it would change the
// type of 'x'.
@@ -2425,7 +2425,7 @@ static void Main()
#endregion
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/545925")]
- public async Task DontRemoveCastIfOverriddenMethodHasIncompatibleParameterList()
+ public async Task DoNotRemoveCastIfOverriddenMethodHasIncompatibleParameterList()
{
// Note: The cast below can't be removed because the parameter list
// of Goo and its override have different default values.
@@ -2568,7 +2568,7 @@ static async Task Goo()
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/624252")]
[WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/608180")]
- public async Task DontRemoveCastIfArgumentIsRestricted_TypedReference()
+ public async Task DoNotRemoveCastIfArgumentIsRestricted_TypedReference()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2594,7 +2594,7 @@ static void dd(object obj, TypedReference d)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/627107")]
- public async Task DontRemoveCastOnArgumentsWithOtherDynamicArguments()
+ public async Task DoNotRemoveCastOnArgumentsWithOtherDynamicArguments()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2628,7 +2628,7 @@ static bool Goo(int x, object y, object z)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/627107")]
- public async Task DontRemoveCastOnArgumentsWithOtherDynamicArguments_Bracketed()
+ public async Task DoNotRemoveCastOnArgumentsWithOtherDynamicArguments_Bracketed()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2667,7 +2667,7 @@ void Goo(dynamic xx)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/627107")]
- public async Task DontRemoveCastOnArgumentsWithDynamicReceiverOpt()
+ public async Task DoNotRemoveCastOnArgumentsWithDynamicReceiverOpt()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2683,7 +2683,7 @@ static bool Goo(dynamic d)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/627107")]
- public async Task DontRemoveCastOnArgumentsWithDynamicReceiverOpt_1()
+ public async Task DoNotRemoveCastOnArgumentsWithDynamicReceiverOpt_1()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2699,7 +2699,7 @@ static bool Goo(dynamic d)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/627107")]
- public async Task DontRemoveCastOnArgumentsWithDynamicReceiverOpt_2()
+ public async Task DoNotRemoveCastOnArgumentsWithDynamicReceiverOpt_2()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2715,7 +2715,7 @@ static bool Goo(dynamic d)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/627107")]
- public async Task DontRemoveCastOnArgumentsWithDynamicReceiverOpt_3()
+ public async Task DoNotRemoveCastOnArgumentsWithDynamicReceiverOpt_3()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2731,7 +2731,7 @@ static bool Goo(dynamic d)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/627107")]
- public async Task DontRemoveCastOnArgumentsWithOtherDynamicArguments_1()
+ public async Task DoNotRemoveCastOnArgumentsWithOtherDynamicArguments_1()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2765,7 +2765,7 @@ static bool Goo(object y, int x, object z)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/529846")]
- public async Task DontUnnecessaryCastFromTypeParameterToObject()
+ public async Task DoNotUnnecessaryCastFromTypeParameterToObject()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2813,7 +2813,7 @@ void Goo(Task x)
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/626026")]
- public async Task DontRemoveCastIfUserDefinedExplicitCast()
+ public async Task DoNotRemoveCastIfUserDefinedExplicitCast()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2841,7 +2841,7 @@ public struct B
}
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/770187")]
- public async Task DontRemoveNecessaryCastInSwitchExpression()
+ public async Task DoNotRemoveNecessaryCastInSwitchExpression()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2873,7 +2873,7 @@ enum E
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/2761")]
[WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/844482")]
- public async Task DontRemoveCastFromBaseToDerivedWithExplicitReference()
+ public async Task DoNotRemoveCastFromBaseToDerivedWithExplicitReference()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2898,7 +2898,7 @@ class D : C
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/3254")]
- public async Task DontRemoveCastToTypeParameterWithExceptionConstraint()
+ public async Task DoNotRemoveCastToTypeParameterWithExceptionConstraint()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2918,7 +2918,7 @@ class Program
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/3254")]
- public async Task DontRemoveCastToTypeParameterWithExceptionSubTypeConstraint()
+ public async Task DoNotRemoveCastToTypeParameterWithExceptionSubTypeConstraint()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2938,7 +2938,7 @@ class Program
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/8111")]
- public async Task DontRemoveCastThatChangesShapeOfAnonymousTypeObject()
+ public async Task DoNotRemoveCastThatChangesShapeOfAnonymousTypeObject()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -2978,7 +2978,7 @@ static void Main(string o)
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/18978")]
- public async Task DontRemoveCastOnCallToMethodWithParamsArgs()
+ public async Task DoNotRemoveCastOnCallToMethodWithParamsArgs()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3089,7 +3089,7 @@ private static void TakesParams(params object[] goo)
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/20630")]
- public async Task DontRemoveCastOnCallToAttributeWithParamsArgs()
+ public async Task DoNotRemoveCastOnCallToAttributeWithParamsArgs()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3154,7 +3154,7 @@ static void Main()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/20630")]
- public async Task DontRemoveCastOnCallToAttributeWithParamsArgsAndProperty()
+ public async Task DoNotRemoveCastOnCallToAttributeWithParamsArgsAndProperty()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3175,7 +3175,7 @@ static class Program
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/20630")]
- public async Task DontRemoveCastOnCallToAttributeWithParamsArgsPropertyAndOtherArg()
+ public async Task DoNotRemoveCastOnCallToAttributeWithParamsArgsPropertyAndOtherArg()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3196,7 +3196,7 @@ static class Program
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/20630")]
- public async Task DontRemoveCastOnCallToAttributeWithParamsArgsNamedArgsAndProperty()
+ public async Task DoNotRemoveCastOnCallToAttributeWithParamsArgsNamedArgsAndProperty()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3314,7 +3314,7 @@ static class Program
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/25456#issuecomment-373549735")]
- public async Task DontIntroduceDefaultLiteralInSwitchCase()
+ public async Task DoNotIntroduceDefaultLiteralInSwitchCase()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3333,7 +3333,7 @@ void M()
}
[Fact]
- public async Task DontIntroduceDefaultLiteralInSwitchCase_CastInsideParentheses()
+ public async Task DoNotIntroduceDefaultLiteralInSwitchCase_CastInsideParentheses()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3352,7 +3352,7 @@ void M()
}
[Fact]
- public async Task DontIntroduceDefaultLiteralInSwitchCase_DefaultInsideParentheses()
+ public async Task DoNotIntroduceDefaultLiteralInSwitchCase_DefaultInsideParentheses()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3371,7 +3371,7 @@ void M()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/27239")]
- public async Task DontOfferToRemoveCastWhereNoConversionExists()
+ public async Task DoNotOfferToRemoveCastWhereNoConversionExists()
{
await TestMissingInRegularAndScriptAsync(
"""
@@ -3389,7 +3389,7 @@ void M()
}
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/28412")]
- public async Task DontOfferToRemoveCastWhenAccessingHiddenProperty()
+ public async Task DoNotOfferToRemoveCastWhenAccessingHiddenProperty()
{
await TestMissingInRegularAndScriptAsync("""
using System.Collections.Generic;
diff --git a/src/EditorFeatures/CSharpTest/RemoveUnusedVariable/RemoveUnusedVariableTests.cs b/src/Features/CSharpTest/RemoveUnusedVariable/RemoveUnusedVariableTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/RemoveUnusedVariable/RemoveUnusedVariableTests.cs
rename to src/Features/CSharpTest/RemoveUnusedVariable/RemoveUnusedVariableTests.cs
index 028a3bb045f79..8175c6bdee163 100644
--- a/src/EditorFeatures/CSharpTest/RemoveUnusedVariable/RemoveUnusedVariableTests.cs
+++ b/src/Features/CSharpTest/RemoveUnusedVariable/RemoveUnusedVariableTests.cs
@@ -815,7 +815,7 @@ void Method()
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsRemoveUnusedVariable)]
[WorkItem("https://github.com/dotnet/roslyn/issues/49827")]
- public async Task DontCrashOnDeclarationInsideIfStatement()
+ public async Task DoNotCrashOnDeclarationInsideIfStatement()
{
await TestMissingInRegularAndScriptAsync(
"""
diff --git a/src/EditorFeatures/CSharpTest/ReplaceConditionalWithStatements/ReplaceConditionalWithStatementsTests.cs b/src/Features/CSharpTest/ReplaceConditionalWithStatements/ReplaceConditionalWithStatementsTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ReplaceConditionalWithStatements/ReplaceConditionalWithStatementsTests.cs
rename to src/Features/CSharpTest/ReplaceConditionalWithStatements/ReplaceConditionalWithStatementsTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ReplaceDocCommentTextWithTag/ReplaceDocCommentTextWithTagTests.cs b/src/Features/CSharpTest/ReplaceDocCommentTextWithTag/ReplaceDocCommentTextWithTagTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ReplaceDocCommentTextWithTag/ReplaceDocCommentTextWithTagTests.cs
rename to src/Features/CSharpTest/ReplaceDocCommentTextWithTag/ReplaceDocCommentTextWithTagTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ReplaceMethodWithProperty/ReplaceMethodWithPropertyTests.cs b/src/Features/CSharpTest/ReplaceMethodWithProperty/ReplaceMethodWithPropertyTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ReplaceMethodWithProperty/ReplaceMethodWithPropertyTests.cs
rename to src/Features/CSharpTest/ReplaceMethodWithProperty/ReplaceMethodWithPropertyTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ReplacePropertyWithMethods/ReplacePropertyWithMethodsTests.cs b/src/Features/CSharpTest/ReplacePropertyWithMethods/ReplacePropertyWithMethodsTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/ReplacePropertyWithMethods/ReplacePropertyWithMethodsTests.cs
rename to src/Features/CSharpTest/ReplacePropertyWithMethods/ReplacePropertyWithMethodsTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ReverseForStatement/ReverseForStatementTests.cs b/src/Features/CSharpTest/ReverseForStatement/ReverseForStatementTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ReverseForStatement/ReverseForStatementTests.cs
rename to src/Features/CSharpTest/ReverseForStatement/ReverseForStatementTests.cs
diff --git a/src/EditorFeatures/CSharpTest/SimplifyPropertyPattern/SimplifyPropertyPatternTests.cs b/src/Features/CSharpTest/SimplifyPropertyPattern/SimplifyPropertyPatternTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SimplifyPropertyPattern/SimplifyPropertyPatternTests.cs
rename to src/Features/CSharpTest/SimplifyPropertyPattern/SimplifyPropertyPatternTests.cs
diff --git a/src/EditorFeatures/CSharpTest/SimplifyThisOrMe/SimplifyThisOrMeTests.cs b/src/Features/CSharpTest/SimplifyThisOrMe/SimplifyThisOrMeTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SimplifyThisOrMe/SimplifyThisOrMeTests.cs
rename to src/Features/CSharpTest/SimplifyThisOrMe/SimplifyThisOrMeTests.cs
diff --git a/src/EditorFeatures/CSharpTest/SimplifyTypeNames/SimplifyTypeNamesTests.cs b/src/Features/CSharpTest/SimplifyTypeNames/SimplifyTypeNamesTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SimplifyTypeNames/SimplifyTypeNamesTests.cs
rename to src/Features/CSharpTest/SimplifyTypeNames/SimplifyTypeNamesTests.cs
diff --git a/src/EditorFeatures/CSharpTest/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.cs b/src/Features/CSharpTest/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.cs
rename to src/Features/CSharpTest/SimplifyTypeNames/SimplifyTypeNamesTests_FixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/SpellCheck/SpellCheckTests.cs b/src/Features/CSharpTest/SpellCheck/SpellCheckTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/SpellCheck/SpellCheckTests.cs
rename to src/Features/CSharpTest/SpellCheck/SpellCheckTests.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_Middle.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_Middle.cs
similarity index 95%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_Middle.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_Middle.cs
index 7d143f36ddf5b..2fb846cb8ca02 100644
--- a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_Middle.cs
+++ b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_Middle.cs
@@ -22,10 +22,10 @@ void M(bool a, bool b, bool c)
{
if (a)
System.Console.WriteLine(null);
- [||]else if (b)
+ [||]else {|applicableSpan:if (b)
System.Console.WriteLine();
else if (c)
- System.Console.WriteLine();
+ System.Console.WriteLine();|}
}
}
""";
@@ -45,6 +45,7 @@ void M(bool a, bool b, bool c)
await TestActionCountAsync(Initial, 1);
await TestInRegularAndScriptAsync(Initial, Expected);
+ await TestCodeRefactoringApplicableTextSpan(Initial, "applicableSpan");
}
[Fact]
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_WithNext.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_WithNext.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_WithNext.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_WithNext.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_WithPrevious.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_WithPrevious.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_WithPrevious.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_ElseIf_WithPrevious.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_Middle.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_Middle.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_Middle.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_Middle.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_WithNext.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_WithNext.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_WithNext.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_WithNext.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_WithPrevious.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_WithPrevious.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_WithPrevious.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/MergeConsecutiveIfStatementsTests_Statements_WithPrevious.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeNestedIfStatementsTests_WithNested.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeNestedIfStatementsTests_WithNested.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeNestedIfStatementsTests_WithNested.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/MergeNestedIfStatementsTests_WithNested.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeNestedIfStatementsTests_WithOuter.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/MergeNestedIfStatementsTests_WithOuter.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/MergeNestedIfStatementsTests_WithOuter.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/MergeNestedIfStatementsTests_WithOuter.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/SplitIntoConsecutiveIfStatementsTests.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/SplitIntoConsecutiveIfStatementsTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/SplitIntoConsecutiveIfStatementsTests.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/SplitIntoConsecutiveIfStatementsTests.cs
diff --git a/src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/SplitIntoNestedIfStatementsTests.cs b/src/Features/CSharpTest/SplitOrMergeIfStatements/SplitIntoNestedIfStatementsTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/SplitOrMergeIfStatements/SplitIntoNestedIfStatementsTests.cs
rename to src/Features/CSharpTest/SplitOrMergeIfStatements/SplitIntoNestedIfStatementsTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/SyncNamespace/CSharpSyncNamespaceTestsBase.cs b/src/Features/CSharpTest/SyncNamespace/CSharpSyncNamespaceTestsBase.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/SyncNamespace/CSharpSyncNamespaceTestsBase.cs
rename to src/Features/CSharpTest/SyncNamespace/CSharpSyncNamespaceTestsBase.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/SyncNamespace/SyncNamespaceTests_ChangeNamespace.cs b/src/Features/CSharpTest/SyncNamespace/SyncNamespaceTests_ChangeNamespace.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/SyncNamespace/SyncNamespaceTests_ChangeNamespace.cs
rename to src/Features/CSharpTest/SyncNamespace/SyncNamespaceTests_ChangeNamespace.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/SyncNamespace/SyncNamespaceTests_MoveFile.cs b/src/Features/CSharpTest/SyncNamespace/SyncNamespaceTests_MoveFile.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/SyncNamespace/SyncNamespaceTests_MoveFile.cs
rename to src/Features/CSharpTest/SyncNamespace/SyncNamespaceTests_MoveFile.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeActions/SyncNamespace/SyncNamespaceTests_NoAction.cs b/src/Features/CSharpTest/SyncNamespace/SyncNamespaceTests_NoAction.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeActions/SyncNamespace/SyncNamespaceTests_NoAction.cs
rename to src/Features/CSharpTest/SyncNamespace/SyncNamespaceTests_NoAction.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeRefactorings/UseExplicitOrImplicitType/UseExplicitTypeRefactoringTests.cs b/src/Features/CSharpTest/UseExplicitOrImplicitType/UseExplicitTypeRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeRefactorings/UseExplicitOrImplicitType/UseExplicitTypeRefactoringTests.cs
rename to src/Features/CSharpTest/UseExplicitOrImplicitType/UseExplicitTypeRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeRefactorings/UseExplicitOrImplicitType/UseImplicitTypeRefactoringTests.cs b/src/Features/CSharpTest/UseExplicitOrImplicitType/UseImplicitTypeRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeRefactorings/UseExplicitOrImplicitType/UseImplicitTypeRefactoringTests.cs
rename to src/Features/CSharpTest/UseExplicitOrImplicitType/UseImplicitTypeRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyFixAllTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyFixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyFixAllTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyFixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForAccessorsRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForAccessorsRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForAccessorsRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForAccessorsRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForConstructorsRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForConstructorsRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForConstructorsRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForConstructorsRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForConversionOperatorsRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForConversionOperatorsRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForConversionOperatorsRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForConversionOperatorsRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForIndexersRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForIndexersRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForIndexersRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForIndexersRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForLocalFunctionsRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForLocalFunctionsRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForLocalFunctionsRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForLocalFunctionsRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForMethodsRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForMethodsRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForMethodsRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForMethodsRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForOperatorsRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForOperatorsRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForOperatorsRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForOperatorsRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForPropertiesRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForPropertiesRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForPropertiesRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBody/Refactoring/UseExpressionBodyForPropertiesRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseExpressionBodyForLambda/UseExpressionBodyForLambdasRefactoringTests.cs b/src/Features/CSharpTest/UseExpressionBodyForLambda/UseExpressionBodyForLambdasRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseExpressionBodyForLambda/UseExpressionBodyForLambdasRefactoringTests.cs
rename to src/Features/CSharpTest/UseExpressionBodyForLambda/UseExpressionBodyForLambdasRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseNamedArguments/UseNamedArgumentsTests.cs b/src/Features/CSharpTest/UseNamedArguments/UseNamedArgumentsTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseNamedArguments/UseNamedArgumentsTests.cs
rename to src/Features/CSharpTest/UseNamedArguments/UseNamedArgumentsTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UseNameofInAttribute/UseNameofInAttributeTests.cs b/src/Features/CSharpTest/UseNameofInAttribute/UseNameofInAttributeTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UseNameofInAttribute/UseNameofInAttributeTests.cs
rename to src/Features/CSharpTest/UseNameofInAttribute/UseNameofInAttributeTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UsePatternCombinators/CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs b/src/Features/CSharpTest/UsePatternCombinators/CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UsePatternCombinators/CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs
rename to src/Features/CSharpTest/UsePatternCombinators/CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs
diff --git a/src/EditorFeatures/CSharpTest/UsePatternMatching/CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzerTests.cs b/src/Features/CSharpTest/UsePatternMatching/CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzerTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/UsePatternMatching/CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzerTests.cs
rename to src/Features/CSharpTest/UsePatternMatching/CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzerTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeRefactorings/UseRecursivePatterns/UseRecursivePatternsRefactoringFixAllTests.cs b/src/Features/CSharpTest/UseRecursivePatterns/UseRecursivePatternsRefactoringFixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeRefactorings/UseRecursivePatterns/UseRecursivePatternsRefactoringFixAllTests.cs
rename to src/Features/CSharpTest/UseRecursivePatterns/UseRecursivePatternsRefactoringFixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/CodeRefactorings/UseRecursivePatterns/UseRecursivePatternsRefactoringTests.cs b/src/Features/CSharpTest/UseRecursivePatterns/UseRecursivePatternsRefactoringTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/CodeRefactorings/UseRecursivePatterns/UseRecursivePatternsRefactoringTests.cs
rename to src/Features/CSharpTest/UseRecursivePatterns/UseRecursivePatternsRefactoringTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Utilities/CodeSnippets.cs b/src/Features/CSharpTest/Utilities/CodeSnippets.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Utilities/CodeSnippets.cs
rename to src/Features/CSharpTest/Utilities/CodeSnippets.cs
diff --git a/src/EditorFeatures/CSharpTest/Wrapping/AbstractWrappingTests.cs b/src/Features/CSharpTest/Wrapping/AbstractWrappingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Wrapping/AbstractWrappingTests.cs
rename to src/Features/CSharpTest/Wrapping/AbstractWrappingTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Wrapping/ArgumentWrappingTests.cs b/src/Features/CSharpTest/Wrapping/ArgumentWrappingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Wrapping/ArgumentWrappingTests.cs
rename to src/Features/CSharpTest/Wrapping/ArgumentWrappingTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Wrapping/BinaryExpressionWrappingTests.cs b/src/Features/CSharpTest/Wrapping/BinaryExpressionWrappingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Wrapping/BinaryExpressionWrappingTests.cs
rename to src/Features/CSharpTest/Wrapping/BinaryExpressionWrappingTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Wrapping/ChainedExpressionWrappingTests.cs b/src/Features/CSharpTest/Wrapping/ChainedExpressionWrappingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Wrapping/ChainedExpressionWrappingTests.cs
rename to src/Features/CSharpTest/Wrapping/ChainedExpressionWrappingTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Wrapping/InitializerExpressionWrappingTests.cs b/src/Features/CSharpTest/Wrapping/InitializerExpressionWrappingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Wrapping/InitializerExpressionWrappingTests.cs
rename to src/Features/CSharpTest/Wrapping/InitializerExpressionWrappingTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Wrapping/ParameterWrappingTests.cs b/src/Features/CSharpTest/Wrapping/ParameterWrappingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Wrapping/ParameterWrappingTests.cs
rename to src/Features/CSharpTest/Wrapping/ParameterWrappingTests.cs
diff --git a/src/EditorFeatures/CSharpTest/Wrapping/SortingTests.cs b/src/Features/CSharpTest/Wrapping/SortingTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Wrapping/SortingTests.cs
rename to src/Features/CSharpTest/Wrapping/SortingTests.cs
diff --git a/src/Features/Core/Portable/AddImport/AbstractAddImportFeatureService.cs b/src/Features/Core/Portable/AddImport/AbstractAddImportFeatureService.cs
index 3ac71423b81fc..b8b7fddb8782b 100644
--- a/src/Features/Core/Portable/AddImport/AbstractAddImportFeatureService.cs
+++ b/src/Features/Core/Portable/AddImport/AbstractAddImportFeatureService.cs
@@ -8,6 +8,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
+using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
@@ -16,14 +17,11 @@
using Microsoft.CodeAnalysis.LanguageService;
using Microsoft.CodeAnalysis.Packaging;
using Microsoft.CodeAnalysis.PooledObjects;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Remote;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.SymbolSearch;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
-using Microsoft.CodeAnalysis.CodeGeneration;
-using Microsoft.CodeAnalysis.CodeCleanup;
namespace Microsoft.CodeAnalysis.AddImport
{
@@ -31,6 +29,12 @@ internal abstract partial class AbstractAddImportFeatureService
where TSimpleNameSyntax : SyntaxNode
{
+ ///
+ /// Cache of information about whether a is likely contained within a
+ /// NuGet packages directory.
+ ///
+ private static readonly ConditionalWeakTable> s_isInPackagesDirectory = new();
+
protected abstract bool CanAddImport(SyntaxNode node, bool allowInHiddenRegions, CancellationToken cancellationToken);
protected abstract bool CanAddImportForMethod(string diagnosticId, ISyntaxFacts syntaxFacts, SyntaxNode node, out TSimpleNameSyntax nameNode);
protected abstract bool CanAddImportForNamespace(string diagnosticId, SyntaxNode node, out TSimpleNameSyntax nameNode);
@@ -90,7 +94,6 @@ internal abstract partial class AbstractAddImportFeatureService.GetInstance(out var result);
if (node != null)
{
-
using (Logger.LogBlock(FunctionId.Refactoring_AddImport, cancellationToken))
{
if (!cancellationToken.IsCancellationRequested)
@@ -102,13 +105,15 @@ internal abstract partial class AbstractAddImportFeatureService maxResults)
+ break;
}
}
}
@@ -135,9 +140,7 @@ internal abstract partial class AbstractAddImportFeatureService 0)
- {
return exactReferences;
- }
// No exact matches found. Fall back to fuzzy searching.
// Only bother doing this for host workspaces. We don't want this for
@@ -161,12 +164,12 @@ private static bool IsHostOrRemoteWorkspace(Project project)
ConcurrentDictionary referenceToCompilation,
Project project, int maxResults, SymbolReferenceFinder finder, bool exact, CancellationToken cancellationToken)
{
- using var _ = ArrayBuilder.GetInstance(out var allReferences);
+ var allReferences = new ConcurrentQueue();
// First search the current project to see if any symbols (source or metadata) match the
// search string.
await FindResultsInAllSymbolsInStartingProjectAsync(
- allReferences, maxResults, finder, exact, cancellationToken).ConfigureAwait(false);
+ allReferences, finder, exact, cancellationToken).ConfigureAwait(false);
// Only bother doing this for host workspaces. We don't want this for
// things like the Interactive workspace as we can't even add project
@@ -188,38 +191,35 @@ private static bool IsHostOrRemoteWorkspace(Project project)
}
}
- return allReferences.ToImmutable();
+ return allReferences.ToImmutableArray();
}
private static async Task FindResultsInAllSymbolsInStartingProjectAsync(
- ArrayBuilder allSymbolReferences, int maxResults, SymbolReferenceFinder finder,
- bool exact, CancellationToken cancellationToken)
+ ConcurrentQueue allSymbolReferences, SymbolReferenceFinder finder, bool exact, CancellationToken cancellationToken)
{
- var references = await finder.FindInAllSymbolsInStartingProjectAsync(exact, cancellationToken).ConfigureAwait(false);
- AddRange(allSymbolReferences, references, maxResults);
+ AddRange(
+ allSymbolReferences,
+ await finder.FindInAllSymbolsInStartingProjectAsync(exact, cancellationToken).ConfigureAwait(false));
}
private static async Task FindResultsInUnreferencedProjectSourceSymbolsAsync(
ConcurrentDictionary> projectToAssembly,
- Project project, ArrayBuilder allSymbolReferences, int maxResults,
+ Project project, ConcurrentQueue allSymbolReferences, int maxResults,
SymbolReferenceFinder finder, bool exact, CancellationToken cancellationToken)
{
// If we didn't find enough hits searching just in the project, then check
// in any unreferenced projects.
if (allSymbolReferences.Count >= maxResults)
- {
return;
- }
var viableUnreferencedProjects = GetViableUnreferencedProjects(project);
// Search all unreferenced projects in parallel.
- var findTasks = new HashSet>>();
+ using var _ = ArrayBuilder.GetInstance(out var findTasks);
// Create another cancellation token so we can both search all projects in parallel,
// but also stop any searches once we get enough results.
- using var nestedTokenSource = new CancellationTokenSource();
- using var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(nestedTokenSource.Token, cancellationToken);
+ using var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
foreach (var unreferencedProject in viableUnreferencedProjects)
{
@@ -230,24 +230,23 @@ private static bool IsHostOrRemoteWorkspace(Project project)
// direct references. i.e. we don't want to search in its metadata references
// or in the projects it references itself. We'll be searching those entities
// individually.
- findTasks.Add(finder.FindInSourceSymbolsInProjectAsync(
- projectToAssembly, unreferencedProject, exact, linkedTokenSource.Token));
+ findTasks.Add(ProcessReferencesAsync(
+ allSymbolReferences, maxResults, linkedTokenSource,
+ finder.FindInSourceSymbolsInProjectAsync(projectToAssembly, unreferencedProject, exact, linkedTokenSource.Token)));
}
- await WaitForTasksAsync(allSymbolReferences, maxResults, findTasks, nestedTokenSource, cancellationToken).ConfigureAwait(false);
+ await Task.WhenAll(findTasks).ConfigureAwait(false);
}
private async Task FindResultsInUnreferencedMetadataSymbolsAsync(
ConcurrentDictionary referenceToCompilation,
- Project project, ArrayBuilder allSymbolReferences, int maxResults, SymbolReferenceFinder finder,
+ Project project, ConcurrentQueue allSymbolReferences, int maxResults, SymbolReferenceFinder finder,
bool exact, CancellationToken cancellationToken)
{
+ // Only do this if none of the project searches produced any results. We may have a
+ // lot of metadata to search through, and it would be good to avoid that if we can.
if (allSymbolReferences.Count > 0)
- {
- // Only do this if none of the project searches produced any results. We may have a
- // lot of metadata to search through, and it would be good to avoid that if we can.
return;
- }
// Keep track of the references we've seen (so that we don't process them multiple times
// across many sibling projects). Prepopulate it with our own metadata references since
@@ -258,12 +257,11 @@ private static bool IsHostOrRemoteWorkspace(Project project)
var newReferences = GetUnreferencedMetadataReferences(project, seenReferences);
// Search all metadata references in parallel.
- var findTasks = new HashSet>>();
+ using var _ = ArrayBuilder.GetInstance(out var findTasks);
// Create another cancellation token so we can both search all projects in parallel,
// but also stop any searches once we get enough results.
- using var nestedTokenSource = new CancellationTokenSource();
- using var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(nestedTokenSource.Token, cancellationToken);
+ using var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
foreach (var (referenceProject, reference) in newReferences)
{
@@ -274,12 +272,13 @@ private static bool IsHostOrRemoteWorkspace(Project project)
// Second, the SymbolFinder API doesn't even support searching them.
if (compilation.GetAssemblyOrModuleSymbol(reference) is IAssemblySymbol assembly)
{
- findTasks.Add(finder.FindInMetadataSymbolsAsync(
- assembly, referenceProject, reference, exact, linkedTokenSource.Token));
+ findTasks.Add(ProcessReferencesAsync(
+ allSymbolReferences, maxResults, linkedTokenSource,
+ finder.FindInMetadataSymbolsAsync(assembly, referenceProject, reference, exact, linkedTokenSource.Token)));
}
}
- await WaitForTasksAsync(allSymbolReferences, maxResults, findTasks, nestedTokenSource, cancellationToken).ConfigureAwait(false);
+ await Task.WhenAll(findTasks).ConfigureAwait(false);
}
///
@@ -314,38 +313,25 @@ private static bool IsHostOrRemoteWorkspace(Project project)
return result.ToImmutableAndFree();
}
- private static async Task WaitForTasksAsync(
- ArrayBuilder allSymbolReferences,
+ private static async Task ProcessReferencesAsync(
+ ConcurrentQueue allSymbolReferences,
int maxResults,
- HashSet>> findTasks,
- CancellationTokenSource nestedTokenSource,
- CancellationToken cancellationToken)
+ CancellationTokenSource linkedTokenSource,
+ Task> task)
{
- try
+ AddRange(allSymbolReferences, await task.ConfigureAwait(false));
+
+ // If we've gone over the max amount of items we're looking for, attempt to cancel all existing work that is
+ // still searching.
+ if (allSymbolReferences.Count >= maxResults)
{
- while (findTasks.Count > 0)
+ try
+ {
+ linkedTokenSource.Cancel();
+ }
+ catch (ObjectDisposedException)
{
- // Keep on looping through the 'find' tasks, processing each when they finish.
- cancellationToken.ThrowIfCancellationRequested();
- var doneTask = await Task.WhenAny(findTasks).ConfigureAwait(false);
-
- // One of the tasks finished. Remove it from the list we're waiting on.
- findTasks.Remove(doneTask);
-
- // Add its results to the final result set we're keeping.
- AddRange(allSymbolReferences, await doneTask.ConfigureAwait(false), maxResults);
-
- // Once we get enough, just stop.
- if (allSymbolReferences.Count >= maxResults)
- {
- return;
- }
}
- }
- finally
- {
- // Cancel any nested work that's still happening.
- nestedTokenSource.Cancel();
}
}
@@ -376,10 +362,17 @@ private static bool IsHostOrRemoteWorkspace(Project project)
///
private static bool IsInPackagesDirectory(PortableExecutableReference reference)
{
- return ContainsPathComponent(reference, "packages")
- || ContainsPathComponent(reference, "packs")
- || ContainsPathComponent(reference, "NuGetFallbackFolder")
- || ContainsPathComponent(reference, "NuGetPackages");
+ return s_isInPackagesDirectory.GetValue(
+ reference,
+ static reference => new StrongBox(ComputeIsInPackagesDirectory(reference))).Value;
+
+ static bool ComputeIsInPackagesDirectory(PortableExecutableReference reference)
+ {
+ return ContainsPathComponent(reference, "packages")
+ || ContainsPathComponent(reference, "packs")
+ || ContainsPathComponent(reference, "NuGetFallbackFolder")
+ || ContainsPathComponent(reference, "NuGetPackages");
+ }
static bool ContainsPathComponent(PortableExecutableReference reference, string pathComponent)
{
@@ -442,10 +435,10 @@ private static HashSet GetViableUnreferencedProjects(Project project)
return viableProjects;
}
- private static void AddRange(ArrayBuilder allSymbolReferences, ImmutableArray proposedReferences, int maxResults)
- where TReference : Reference
+ private static void AddRange(ConcurrentQueue allSymbolReferences, ImmutableArray proposedReferences)
{
- allSymbolReferences.AddRange(proposedReferences.Take(maxResults - allSymbolReferences.Count));
+ foreach (var reference in proposedReferences)
+ allSymbolReferences.Enqueue(reference);
}
protected static bool IsViableExtensionMethod(IMethodSymbol method, ITypeSymbol receiver)
diff --git a/src/Features/Core/Portable/AddImport/SearchScopes/AllSymbolsProjectSearchScope.cs b/src/Features/Core/Portable/AddImport/SearchScopes/AllSymbolsProjectSearchScope.cs
index f17a00a205ede..19c8c01f38dc9 100644
--- a/src/Features/Core/Portable/AddImport/SearchScopes/AllSymbolsProjectSearchScope.cs
+++ b/src/Features/Core/Portable/AddImport/SearchScopes/AllSymbolsProjectSearchScope.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.Threading;
using System.Threading.Tasks;
@@ -23,17 +21,16 @@ private class AllSymbolsProjectSearchScope : ProjectSearchScope
public AllSymbolsProjectSearchScope(
AbstractAddImportFeatureService provider,
Project project,
- bool exact,
- CancellationToken cancellationToken)
- : base(provider, project, exact, cancellationToken)
+ bool exact)
+ : base(provider, project, exact)
{
}
protected override async Task> FindDeclarationsAsync(
- SymbolFilter filter, SearchQuery searchQuery)
+ SymbolFilter filter, SearchQuery searchQuery, CancellationToken cancellationToken)
{
var declarations = await DeclarationFinder.FindAllDeclarationsWithNormalQueryAsync(
- _project, searchQuery, filter, CancellationToken).ConfigureAwait(false);
+ _project, searchQuery, filter, cancellationToken).ConfigureAwait(false);
return declarations;
}
diff --git a/src/Features/Core/Portable/AddImport/SearchScopes/MetadataSymbolsSearchScope.cs b/src/Features/Core/Portable/AddImport/SearchScopes/MetadataSymbolsSearchScope.cs
index 769ae7b42d55d..ef0de1bbe662e 100644
--- a/src/Features/Core/Portable/AddImport/SearchScopes/MetadataSymbolsSearchScope.cs
+++ b/src/Features/Core/Portable/AddImport/SearchScopes/MetadataSymbolsSearchScope.cs
@@ -2,14 +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.
-#nullable disable
-
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.FindSymbols;
using Microsoft.CodeAnalysis.FindSymbols.SymbolTree;
-using Microsoft.CodeAnalysis.Shared.Extensions;
namespace Microsoft.CodeAnalysis.AddImport
{
@@ -26,9 +23,8 @@ private class MetadataSymbolsSearchScope : SearchScope
Project assemblyProject,
IAssemblySymbol assembly,
PortableExecutableReference metadataReference,
- bool exact,
- CancellationToken cancellationToken)
- : base(provider, exact, cancellationToken)
+ bool exact)
+ : base(provider, exact)
{
_assemblyProject = assemblyProject;
_assembly = assembly;
@@ -45,15 +41,15 @@ public override SymbolReference CreateReference(SymbolResult searchResult)
}
protected override async Task> FindDeclarationsAsync(
- SymbolFilter filter, SearchQuery searchQuery)
+ SymbolFilter filter, SearchQuery searchQuery, CancellationToken cancellationToken)
{
- var service = _assemblyProject.Solution.Services.GetService();
- var info = await service.TryGetPotentiallyStaleMetadataSymbolTreeInfoAsync(_assemblyProject, _metadataReference, CancellationToken).ConfigureAwait(false);
+ var service = _assemblyProject.Solution.Services.GetRequiredService();
+ var info = await service.TryGetPotentiallyStaleMetadataSymbolTreeInfoAsync(_assemblyProject, _metadataReference, cancellationToken).ConfigureAwait(false);
if (info == null)
return ImmutableArray.Empty;
var declarations = await info.FindAsync(
- searchQuery, _assembly, filter, CancellationToken).ConfigureAwait(false);
+ searchQuery, _assembly, filter, cancellationToken).ConfigureAwait(false);
return declarations;
}
diff --git a/src/Features/Core/Portable/AddImport/SearchScopes/ProjectSearchScope.cs b/src/Features/Core/Portable/AddImport/SearchScopes/ProjectSearchScope.cs
index 7f464fc831898..1011a9a00652e 100644
--- a/src/Features/Core/Portable/AddImport/SearchScopes/ProjectSearchScope.cs
+++ b/src/Features/Core/Portable/AddImport/SearchScopes/ProjectSearchScope.cs
@@ -2,9 +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.Threading;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.AddImport
@@ -18,9 +15,8 @@ private abstract class ProjectSearchScope : SearchScope
public ProjectSearchScope(
AbstractAddImportFeatureService provider,
Project project,
- bool exact,
- CancellationToken cancellationToken)
- : base(provider, exact, cancellationToken)
+ bool exact)
+ : base(provider, exact)
{
Contract.ThrowIfFalse(project.SupportsCompilation);
_project = project;
diff --git a/src/Features/Core/Portable/AddImport/SearchScopes/SearchScope.cs b/src/Features/Core/Portable/AddImport/SearchScopes/SearchScope.cs
index 7305640644ed7..334ff70c0e022 100644
--- a/src/Features/Core/Portable/AddImport/SearchScopes/SearchScope.cs
+++ b/src/Features/Core/Portable/AddImport/SearchScopes/SearchScope.cs
@@ -26,28 +26,28 @@ private abstract class SearchScope
{
public readonly bool Exact;
protected readonly AbstractAddImportFeatureService provider;
- public readonly CancellationToken CancellationToken;
- protected SearchScope(AbstractAddImportFeatureService provider, bool exact, CancellationToken cancellationToken)
+ protected SearchScope(AbstractAddImportFeatureService provider, bool exact)
{
this.provider = provider;
Exact = exact;
- CancellationToken = cancellationToken;
}
- protected abstract Task> FindDeclarationsAsync(SymbolFilter filter, SearchQuery query);
+ protected abstract Task> FindDeclarationsAsync(SymbolFilter filter, SearchQuery query, CancellationToken cancellationToken);
+
public abstract SymbolReference CreateReference(SymbolResult symbol) where T : INamespaceOrTypeSymbol;
public async Task>> FindDeclarationsAsync(
- string name, TSimpleNameSyntax nameNode, SymbolFilter filter)
+ string name, TSimpleNameSyntax nameNode, SymbolFilter filter, CancellationToken cancellationToken)
{
+ cancellationToken.ThrowIfCancellationRequested();
if (name != null && string.IsNullOrWhiteSpace(name))
{
return ImmutableArray>.Empty;
}
using var query = Exact ? SearchQuery.Create(name, ignoreCase: true) : SearchQuery.CreateFuzzy(name);
- var symbols = await FindDeclarationsAsync(filter, query).ConfigureAwait(false);
+ var symbols = await FindDeclarationsAsync(filter, query, cancellationToken).ConfigureAwait(false);
if (Exact)
{
diff --git a/src/Features/Core/Portable/AddImport/SearchScopes/SourceSymbolsProjectSearchScope.cs b/src/Features/Core/Portable/AddImport/SearchScopes/SourceSymbolsProjectSearchScope.cs
index 022ecd693b905..247639a34b401 100644
--- a/src/Features/Core/Portable/AddImport/SearchScopes/SourceSymbolsProjectSearchScope.cs
+++ b/src/Features/Core/Portable/AddImport/SearchScopes/SourceSymbolsProjectSearchScope.cs
@@ -26,17 +26,17 @@ private class SourceSymbolsProjectSearchScope : ProjectSearchScope
public SourceSymbolsProjectSearchScope(
AbstractAddImportFeatureService provider,
ConcurrentDictionary> projectToAssembly,
- Project project, bool ignoreCase, CancellationToken cancellationToken)
- : base(provider, project, ignoreCase, cancellationToken)
+ Project project, bool ignoreCase)
+ : base(provider, project, ignoreCase)
{
_projectToAssembly = projectToAssembly;
}
protected override async Task> FindDeclarationsAsync(
- SymbolFilter filter, SearchQuery searchQuery)
+ SymbolFilter filter, SearchQuery searchQuery, CancellationToken cancellationToken)
{
var service = _project.Solution.Services.GetRequiredService();
- var info = await service.TryGetPotentiallyStaleSourceSymbolTreeInfoAsync(_project, CancellationToken).ConfigureAwait(false);
+ var info = await service.TryGetPotentiallyStaleSourceSymbolTreeInfoAsync(_project, cancellationToken).ConfigureAwait(false);
if (info == null)
{
// Looks like there was nothing in the cache. Return no results for now.
@@ -49,7 +49,7 @@ private class SourceSymbolsProjectSearchScope : ProjectSearchScope
var lazyAssembly = _projectToAssembly.GetOrAdd(_project, CreateLazyAssembly);
var declarations = await info.FindAsync(
- searchQuery, lazyAssembly, filter, CancellationToken).ConfigureAwait(false);
+ searchQuery, lazyAssembly, filter, cancellationToken).ConfigureAwait(false);
return declarations;
@@ -58,7 +58,7 @@ private class SourceSymbolsProjectSearchScope : ProjectSearchScope
{
var compilation = await project.GetRequiredCompilationAsync(c).ConfigureAwait(false);
return compilation.Assembly;
- }, cacheResult: true);
+ });
}
}
}
diff --git a/src/Features/Core/Portable/AddImport/SymbolReferenceFinder.cs b/src/Features/Core/Portable/AddImport/SymbolReferenceFinder.cs
index 63f0d03d3f4f6..b2a07f25194ff 100644
--- a/src/Features/Core/Portable/AddImport/SymbolReferenceFinder.cs
+++ b/src/Features/Core/Portable/AddImport/SymbolReferenceFinder.cs
@@ -87,42 +87,25 @@ private ISet GetNamespacesInScope(CancellationToken cancellati
private INamespaceSymbol MapToCompilationNamespaceIfPossible(INamespaceSymbol containingNamespace)
=> _semanticModel.Compilation.GetCompilationNamespace(containingNamespace) ?? containingNamespace;
- internal Task> FindInAllSymbolsInStartingProjectAsync(
- bool exact, CancellationToken cancellationToken)
- {
- var searchScope = new AllSymbolsProjectSearchScope(
- _owner, _document.Project, exact, cancellationToken);
- return DoAsync(searchScope);
- }
+ internal Task> FindInAllSymbolsInStartingProjectAsync(bool exact, CancellationToken cancellationToken)
+ => DoAsync(new AllSymbolsProjectSearchScope(_owner, _document.Project, exact), cancellationToken);
- internal Task> FindInSourceSymbolsInProjectAsync(
- ConcurrentDictionary> projectToAssembly,
- Project project, bool exact, CancellationToken cancellationToken)
- {
- var searchScope = new SourceSymbolsProjectSearchScope(
- _owner, projectToAssembly, project, exact, cancellationToken);
- return DoAsync(searchScope);
- }
+ internal Task> FindInSourceSymbolsInProjectAsync(ConcurrentDictionary> projectToAssembly, Project project, bool exact, CancellationToken cancellationToken)
+ => DoAsync(new SourceSymbolsProjectSearchScope(_owner, projectToAssembly, project, exact), cancellationToken);
- internal Task> FindInMetadataSymbolsAsync(
- IAssemblySymbol assembly, Project assemblyProject, PortableExecutableReference metadataReference,
- bool exact, CancellationToken cancellationToken)
- {
- var searchScope = new MetadataSymbolsSearchScope(
- _owner, assemblyProject, assembly, metadataReference, exact, cancellationToken);
- return DoAsync(searchScope);
- }
+ internal Task> FindInMetadataSymbolsAsync(IAssemblySymbol assembly, Project assemblyProject, PortableExecutableReference metadataReference, bool exact, CancellationToken cancellationToken)
+ => DoAsync(new MetadataSymbolsSearchScope(_owner, assemblyProject, assembly, metadataReference, exact), cancellationToken);
- private async Task> DoAsync(SearchScope searchScope)
+ private async Task> DoAsync(SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
// Spin off tasks to do all our searching in parallel
using var _1 = ArrayBuilder>>.GetInstance(out var tasks);
- tasks.Add(GetReferencesForMatchingTypesAsync(searchScope));
- tasks.Add(GetReferencesForMatchingNamespacesAsync(searchScope));
- tasks.Add(GetReferencesForMatchingFieldsAndPropertiesAsync(searchScope));
- tasks.Add(GetReferencesForMatchingExtensionMethodsAsync(searchScope));
+ tasks.Add(GetReferencesForMatchingTypesAsync(searchScope, cancellationToken));
+ tasks.Add(GetReferencesForMatchingNamespacesAsync(searchScope, cancellationToken));
+ tasks.Add(GetReferencesForMatchingFieldsAndPropertiesAsync(searchScope, cancellationToken));
+ tasks.Add(GetReferencesForMatchingExtensionMethodsAsync(searchScope, cancellationToken));
// Searching for things like "Add" (for collection initializers) and "Select"
// (for extension methods) should only be done when doing an 'exact' search.
@@ -132,16 +115,16 @@ private async Task> DoAsync(SearchScope searchSc
// query expression valid.
if (searchScope.Exact)
{
- tasks.Add(GetReferencesForCollectionInitializerMethodsAsync(searchScope));
- tasks.Add(GetReferencesForQueryPatternsAsync(searchScope));
- tasks.Add(GetReferencesForDeconstructAsync(searchScope));
- tasks.Add(GetReferencesForGetAwaiterAsync(searchScope));
- tasks.Add(GetReferencesForGetEnumeratorAsync(searchScope));
- tasks.Add(GetReferencesForGetAsyncEnumeratorAsync(searchScope));
+ tasks.Add(GetReferencesForCollectionInitializerMethodsAsync(searchScope, cancellationToken));
+ tasks.Add(GetReferencesForQueryPatternsAsync(searchScope, cancellationToken));
+ tasks.Add(GetReferencesForDeconstructAsync(searchScope, cancellationToken));
+ tasks.Add(GetReferencesForGetAwaiterAsync(searchScope, cancellationToken));
+ tasks.Add(GetReferencesForGetEnumeratorAsync(searchScope, cancellationToken));
+ tasks.Add(GetReferencesForGetAsyncEnumeratorAsync(searchScope, cancellationToken));
}
await Task.WhenAll(tasks).ConfigureAwait(false);
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
using var _2 = ArrayBuilder.GetInstance(out var allReferences);
foreach (var task in tasks)
@@ -180,9 +163,10 @@ private ImmutableArray DeDupeAndSortReferences(ImmutableArrays or s those types are
/// contained in.
///
- private async Task> GetReferencesForMatchingTypesAsync(SearchScope searchScope)
+ private async Task> GetReferencesForMatchingTypesAsync(
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (!_owner.CanAddImportForType(_diagnosticId, _node, out var nameNode))
{
return ImmutableArray.Empty;
@@ -193,18 +177,19 @@ private async Task> GetReferencesForMatchingType
out var name, out var arity, out var inAttributeContext,
out var hasIncompleteParentMember, out var looksGeneric);
- if (ExpressionBinds(nameNode, checkForExtensionMethods: false, cancellationToken: searchScope.CancellationToken))
+ if (ExpressionBinds(nameNode, checkForExtensionMethods: false, cancellationToken: cancellationToken))
{
// If the expression bound, there's nothing to do.
return ImmutableArray.Empty;
}
- var symbols = await searchScope.FindDeclarationsAsync(name, nameNode, SymbolFilter.Type).ConfigureAwait(false);
+ var symbols = await searchScope.FindDeclarationsAsync(name, nameNode, SymbolFilter.Type, cancellationToken).ConfigureAwait(false);
// also lookup type symbols with the "Attribute" suffix if necessary.
if (inAttributeContext)
{
- var attributeSymbols = await searchScope.FindDeclarationsAsync(name + AttributeSuffix, nameNode, SymbolFilter.Type).ConfigureAwait(false);
+ var attributeSymbols = await searchScope.FindDeclarationsAsync(
+ name + AttributeSuffix, nameNode, SymbolFilter.Type, cancellationToken).ConfigureAwait(false);
symbols = symbols.AddRange(
attributeSymbols.Select(r => r.WithDesiredName(r.DesiredName.GetWithoutAttributeSuffix(isCaseSensitive: false))));
@@ -266,17 +251,17 @@ private async Task> GetReferencesForMatchingType
/// to the s those namespaces are contained in.
///
private async Task> GetReferencesForMatchingNamespacesAsync(
- SearchScope searchScope)
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForNamespace(_diagnosticId, _node, out var nameNode))
{
_syntaxFacts.GetNameAndArityOfSimpleName(nameNode, out var name, out var arity);
if (arity == 0 &&
- !ExpressionBinds(nameNode, checkForExtensionMethods: false, cancellationToken: searchScope.CancellationToken))
+ !ExpressionBinds(nameNode, checkForExtensionMethods: false, cancellationToken))
{
- var symbols = await searchScope.FindDeclarationsAsync(name, nameNode, SymbolFilter.Namespace).ConfigureAwait(false);
+ var symbols = await searchScope.FindDeclarationsAsync(name, nameNode, SymbolFilter.Namespace, cancellationToken).ConfigureAwait(false);
var namespaceSymbols = OfType(symbols);
var containingNamespaceSymbols = OfType(symbols).SelectAsArray(s => s.WithSymbol(s.Symbol.ContainingNamespace));
@@ -293,9 +278,9 @@ private async Task> GetReferencesForMatchingType
/// containing 'Color' as if we import them it can resolve this issue.
///
private async Task> GetReferencesForMatchingFieldsAndPropertiesAsync(
- SearchScope searchScope)
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForMethod(_diagnosticId, _syntaxFacts, _node, out var nameNode) &&
nameNode != null)
{
@@ -312,7 +297,7 @@ private async Task> GetReferencesForMatchingType
if (expression is TSimpleNameSyntax simpleName)
{
// Check if the expression before the dot binds to a property or field.
- var symbol = _semanticModel.GetSymbolInfo(expression, searchScope.CancellationToken).GetAnySymbol();
+ var symbol = _semanticModel.GetSymbolInfo(expression, cancellationToken).GetAnySymbol();
if (symbol?.Kind is SymbolKind.Property or SymbolKind.Field)
{
// Check if we have the 'Color Color' case.
@@ -322,7 +307,7 @@ private async Task> GetReferencesForMatchingType
{
// Try to look up 'Color' as a type.
var symbolResults = await searchScope.FindDeclarationsAsync(
- symbol.Name, simpleName, SymbolFilter.Type).ConfigureAwait(false);
+ symbol.Name, simpleName, SymbolFilter.Type, cancellationToken).ConfigureAwait(false);
// Return results that have accessible members.
var namedTypeSymbols = OfType(symbolResults);
@@ -354,26 +339,27 @@ private bool HasAccessibleStaticFieldOrProperty(INamedTypeSymbol namedType, stri
/// s to the s that contain
/// the static classes that those extension methods are contained in.
///
- private async Task> GetReferencesForMatchingExtensionMethodsAsync(SearchScope searchScope)
+ private async Task> GetReferencesForMatchingExtensionMethodsAsync(
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForMethod(_diagnosticId, _syntaxFacts, _node, out var nameNode) &&
nameNode != null)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
// See if the name binds. If it does, there's nothing further we need to do.
- if (!ExpressionBinds(nameNode, checkForExtensionMethods: true, cancellationToken: searchScope.CancellationToken))
+ if (!ExpressionBinds(nameNode, checkForExtensionMethods: true, cancellationToken))
{
_syntaxFacts.GetNameAndArityOfSimpleName(nameNode, out var name, out var arity);
if (name != null)
{
- var symbols = await searchScope.FindDeclarationsAsync(name, nameNode, SymbolFilter.Member).ConfigureAwait(false);
+ var symbols = await searchScope.FindDeclarationsAsync(name, nameNode, SymbolFilter.Member, cancellationToken).ConfigureAwait(false);
var methodSymbols = OfType(symbols);
var extensionMethodSymbols = GetViableExtensionMethods(
- methodSymbols, nameNode.Parent, searchScope.CancellationToken);
+ methodSymbols, nameNode.Parent, cancellationToken);
var namespaceSymbols = extensionMethodSymbols.SelectAsArray(s => s.WithSymbol(s.Symbol.ContainingNamespace));
return GetNamespaceSymbolReferences(searchScope, namespaceSymbols);
@@ -412,15 +398,16 @@ private async Task> GetReferencesForMatchingExte
/// s to the s that contain
/// the static classes that those extension methods are contained in.
///
- private async Task> GetReferencesForCollectionInitializerMethodsAsync(SearchScope searchScope)
+ private async Task> GetReferencesForCollectionInitializerMethodsAsync(
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForMethod(_diagnosticId, _syntaxFacts, _node, out _) &&
!_syntaxFacts.IsSimpleName(_node) &&
_owner.IsAddMethodContext(_node, _semanticModel))
{
var symbols = await searchScope.FindDeclarationsAsync(
- nameof(IList.Add), nameNode: null, filter: SymbolFilter.Member).ConfigureAwait(false);
+ nameof(IList.Add), nameNode: null, filter: SymbolFilter.Member, cancellationToken).ConfigureAwait(false);
// Note: there is no desiredName for these search results. We're searching for
// extension methods called "Add", but we have no intention of renaming any
@@ -428,7 +415,7 @@ private async Task> GetReferencesForCollectionIn
var methodSymbols = OfType(symbols).SelectAsArray(s => s.WithDesiredName(null));
var viableMethods = GetViableExtensionMethods(
- methodSymbols, _node.Parent, searchScope.CancellationToken);
+ methodSymbols, _node.Parent, cancellationToken);
return GetNamespaceSymbolReferences(searchScope,
viableMethods.SelectAsArray(m => m.WithSymbol(m.Symbol.ContainingNamespace)));
@@ -442,18 +429,19 @@ private async Task> GetReferencesForCollectionIn
/// s to the s that contain
/// the static classes that those extension methods are contained in.
///
- private async Task> GetReferencesForQueryPatternsAsync(SearchScope searchScope)
+ private async Task> GetReferencesForQueryPatternsAsync(
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForQuery(_diagnosticId, _node))
{
- var type = _owner.GetQueryClauseInfo(_semanticModel, _node, searchScope.CancellationToken);
+ var type = _owner.GetQueryClauseInfo(_semanticModel, _node, cancellationToken);
if (type != null)
{
// find extension methods named "Select"
return await GetReferencesForExtensionMethodAsync(
- searchScope, nameof(Enumerable.Select), type).ConfigureAwait(false);
+ searchScope, nameof(Enumerable.Select), type, predicate: null, cancellationToken).ConfigureAwait(false);
}
}
@@ -465,17 +453,20 @@ private async Task> GetReferencesForQueryPattern
/// s to the s that contain
/// the static classes that those extension methods are contained in.
///
- private async Task> GetReferencesForGetAwaiterAsync(SearchScope searchScope)
+ private async Task> GetReferencesForGetAwaiterAsync(
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForGetAwaiter(_diagnosticId, _syntaxFacts, _node))
{
var type = GetAwaitInfo(_semanticModel, _syntaxFacts, _node);
if (type != null)
{
- return await GetReferencesForExtensionMethodAsync(searchScope, WellKnownMemberNames.GetAwaiter, type,
- m => m.IsValidGetAwaiter()).ConfigureAwait(false);
+ return await GetReferencesForExtensionMethodAsync(
+ searchScope, WellKnownMemberNames.GetAwaiter, type,
+ static m => m.IsValidGetAwaiter(),
+ cancellationToken).ConfigureAwait(false);
}
}
@@ -487,17 +478,20 @@ private async Task> GetReferencesForGetAwaiterAs
/// s to the s that contain
/// the static classes that those extension methods are contained in.
///
- private async Task> GetReferencesForGetEnumeratorAsync(SearchScope searchScope)
+ private async Task> GetReferencesForGetEnumeratorAsync(
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForGetEnumerator(_diagnosticId, _syntaxFacts, _node))
{
var type = GetCollectionExpressionType(_semanticModel, _syntaxFacts, _node);
if (type != null)
{
- return await GetReferencesForExtensionMethodAsync(searchScope, WellKnownMemberNames.GetEnumeratorMethodName, type,
- m => m.IsValidGetEnumerator()).ConfigureAwait(false);
+ return await GetReferencesForExtensionMethodAsync(
+ searchScope, WellKnownMemberNames.GetEnumeratorMethodName, type,
+ static m => m.IsValidGetEnumerator(),
+ cancellationToken).ConfigureAwait(false);
}
}
@@ -509,17 +503,20 @@ private async Task> GetReferencesForGetEnumerato
/// s to the s that contain
/// the static classes that those extension methods are contained in.
///
- private async Task> GetReferencesForGetAsyncEnumeratorAsync(SearchScope searchScope)
+ private async Task> GetReferencesForGetAsyncEnumeratorAsync(
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForGetAsyncEnumerator(_diagnosticId, _syntaxFacts, _node))
{
var type = GetCollectionExpressionType(_semanticModel, _syntaxFacts, _node);
if (type != null)
{
- return await GetReferencesForExtensionMethodAsync(searchScope, WellKnownMemberNames.GetAsyncEnumeratorMethodName, type,
- m => m.IsValidGetAsyncEnumerator()).ConfigureAwait(false);
+ return await GetReferencesForExtensionMethodAsync(
+ searchScope, WellKnownMemberNames.GetAsyncEnumeratorMethodName, type,
+ static m => m.IsValidGetAsyncEnumerator(),
+ cancellationToken).ConfigureAwait(false);
}
}
@@ -531,13 +528,14 @@ private async Task> GetReferencesForGetAsyncEnum
/// s to the s that contain
/// the static classes that those extension methods are contained in.
///
- private async Task> GetReferencesForDeconstructAsync(SearchScope searchScope)
+ private async Task> GetReferencesForDeconstructAsync(
+ SearchScope searchScope, CancellationToken cancellationToken)
{
- searchScope.CancellationToken.ThrowIfCancellationRequested();
+ cancellationToken.ThrowIfCancellationRequested();
if (_owner.CanAddImportForDeconstruct(_diagnosticId, _node))
{
- var type = _owner.GetDeconstructInfo(_semanticModel, _node, searchScope.CancellationToken);
+ var type = _owner.GetDeconstructInfo(_semanticModel, _node, cancellationToken);
if (type != null)
{
// Note: we could check that the extension methods have the right number of out-params.
@@ -545,8 +543,7 @@ private async Task> GetReferencesForDeconstructA
// we'll just be permissive, with the assumption that there won't be that many matching
// 'Deconstruct' extension methods for the type of node that we're on.
return await GetReferencesForExtensionMethodAsync(
- searchScope, "Deconstruct", type,
- m => m.ReturnsVoid).ConfigureAwait(false);
+ searchScope, "Deconstruct", type, static m => m.ReturnsVoid, cancellationToken).ConfigureAwait(false);
}
}
@@ -554,10 +551,10 @@ private async Task> GetReferencesForDeconstructA
}
private async Task> GetReferencesForExtensionMethodAsync(
- SearchScope searchScope, string name, ITypeSymbol type, Func predicate = null)
+ SearchScope searchScope, string name, ITypeSymbol type, Func predicate, CancellationToken cancellationToken)
{
var symbols = await searchScope.FindDeclarationsAsync(
- name, nameNode: null, filter: SymbolFilter.Member).ConfigureAwait(false);
+ name, nameNode: null, filter: SymbolFilter.Member, cancellationToken).ConfigureAwait(false);
// Note: there is no "desiredName" when doing this. We're not going to do any
// renames of the user code. We're just looking for an extension method called
diff --git a/src/Features/Core/Portable/AddImport/SymbolReferenceFinder_PackageAssemblySearch.cs b/src/Features/Core/Portable/AddImport/SymbolReferenceFinder_PackageAssemblySearch.cs
index af318c6558c01..a1284d2bf2ac5 100644
--- a/src/Features/Core/Portable/AddImport/SymbolReferenceFinder_PackageAssemblySearch.cs
+++ b/src/Features/Core/Portable/AddImport/SymbolReferenceFinder_PackageAssemblySearch.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.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.PooledObjects;
@@ -17,15 +18,13 @@ internal abstract partial class AbstractAddImportFeatureService allReferences, CancellationToken cancellationToken)
+ ConcurrentQueue allReferences, CancellationToken cancellationToken)
{
+ // Only do this if none of the project or metadata searches produced
+ // any results. We always consider source and local metadata to be
+ // better than any NuGet/assembly-reference results.
if (allReferences.Count > 0)
- {
- // Only do this if none of the project or metadata searches produced
- // any results. We always consider source and local metadata to be
- // better than any NuGet/assembly-reference results.
return;
- }
if (!_owner.CanAddImportForType(_diagnosticId, _node, out var nameNode))
{
@@ -46,7 +45,7 @@ private partial class SymbolReferenceFinder
}
private async Task FindNugetOrReferenceAssemblyTypeReferencesAsync(
- ArrayBuilder allReferences, TSimpleNameSyntax nameNode,
+ ConcurrentQueue allReferences, TSimpleNameSyntax nameNode,
string name, int arity, bool inAttributeContext,
CancellationToken cancellationToken)
{
@@ -63,7 +62,7 @@ private partial class SymbolReferenceFinder
}
private async Task FindNugetOrReferenceAssemblyTypeReferencesWorkerAsync(
- ArrayBuilder allReferences, TSimpleNameSyntax nameNode,
+ ConcurrentQueue allReferences, TSimpleNameSyntax nameNode,
string name, int arity, bool isAttributeSearch, CancellationToken cancellationToken)
{
if (_options.SearchOptions.SearchReferenceAssemblies)
@@ -84,7 +83,7 @@ private partial class SymbolReferenceFinder
}
private async Task FindReferenceAssemblyTypeReferencesAsync(
- ArrayBuilder allReferences,
+ ConcurrentQueue allReferences,
TSimpleNameSyntax nameNode,
string name,
int arity,
@@ -110,7 +109,7 @@ private partial class SymbolReferenceFinder
private async Task FindNugetTypeReferencesAsync(
string sourceName,
string sourceUrl,
- ArrayBuilder allReferences,
+ ConcurrentQueue allReferences,
TSimpleNameSyntax nameNode,
string name,
int arity,
@@ -132,7 +131,7 @@ private partial class SymbolReferenceFinder
}
private async Task HandleReferenceAssemblyReferenceAsync(
- ArrayBuilder allReferences,
+ ConcurrentQueue allReferences,
TSimpleNameSyntax nameNode,
Project project,
bool isAttributeSearch,
@@ -154,20 +153,20 @@ private partial class SymbolReferenceFinder
}
var desiredName = GetDesiredName(isAttributeSearch, result.TypeName);
- allReferences.Add(new AssemblyReference(
+ allReferences.Enqueue(new AssemblyReference(
_owner, new SearchResult(desiredName, nameNode, result.ContainingNamespaceNames.ToReadOnlyList(), weight), result));
}
private void HandleNugetReference(
string source,
- ArrayBuilder allReferences,
+ ConcurrentQueue allReferences,
TSimpleNameSyntax nameNode,
bool isAttributeSearch,
PackageWithTypeResult result,
int weight)
{
var desiredName = GetDesiredName(isAttributeSearch, result.TypeName);
- allReferences.Add(new PackageReference(_owner,
+ allReferences.Enqueue(new PackageReference(_owner,
new SearchResult(desiredName, nameNode, result.ContainingNamespaceNames.ToReadOnlyList(), weight),
source, result.PackageName, result.Version));
}
diff --git a/src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs b/src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs
index 9fe527b3028cf..b02b3f238ba34 100644
--- a/src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs
+++ b/src/Features/Core/Portable/ChangeSignature/AbstractChangeSignatureService.cs
@@ -67,9 +67,11 @@ internal abstract class AbstractChangeSignatureService : ILanguageService
/// For some Foo(int x, params int[] p), this helps convert the "1, 2, 3" in Foo(0, 1, 2, 3)
/// to "new int[] { 1, 2, 3 }" in Foo(0, new int[] { 1, 2, 3 });
///
- protected abstract SyntaxNode CreateExplicitParamsArrayFromIndividualArguments(SeparatedSyntaxList newArguments, int startingIndex, IParameterSymbol parameterSymbol);
+ protected abstract TArgumentSyntax CreateExplicitParamsArrayFromIndividualArguments(SeparatedSyntaxList newArguments, int startingIndex, IParameterSymbol parameterSymbol)
+ where TArgumentSyntax : SyntaxNode;
- protected abstract SyntaxNode AddNameToArgument(SyntaxNode argument, string name);
+ protected abstract TArgumentSyntax AddNameToArgument(TArgumentSyntax argument, string name)
+ where TArgumentSyntax : SyntaxNode;
///
/// Only some languages support:
@@ -750,9 +752,9 @@ protected static int GetParameterIndex(SeparatedSyntaxList paramet
return separators.ToImmutable();
}
- protected virtual async Task> AddNewArgumentsToListAsync(
+ protected virtual async Task> AddNewArgumentsToListAsync(
ISymbol declarationSymbol,
- SeparatedSyntaxList newArguments,
+ SeparatedSyntaxList newArguments,
SignatureChange signaturePermutation,
bool isReducedExtensionMethod,
bool isParamsArrayExpanded,
@@ -760,8 +762,9 @@ protected static int GetParameterIndex(SeparatedSyntaxList paramet
Document document,
int position,
CancellationToken cancellationToken)
+ where TArgumentSyntax : SyntaxNode
{
- var fullList = ArrayBuilder.GetInstance();
+ var fullList = ArrayBuilder.GetInstance();
var separators = ArrayBuilder.GetInstance();
var updatedParameters = signaturePermutation.UpdatedConfiguration.ToListOfParameters();
@@ -815,10 +818,10 @@ protected static int GetParameterIndex(SeparatedSyntaxList paramet
// TODO: Need to be able to specify which kind of attribute argument it is to the SyntaxGenerator.
// https://github.com/dotnet/roslyn/issues/43354
var argument = generateAttributeArguments
- ? Generator.AttributeArgument(
+ ? (TArgumentSyntax)Generator.AttributeArgument(
name: seenNamedArguments || addedParameter.CallSiteKind == CallSiteKind.ValueWithName ? addedParameter.Name : null,
expression: expression)
- : Generator.Argument(
+ : (TArgumentSyntax)Generator.Argument(
name: seenNamedArguments || addedParameter.CallSiteKind == CallSiteKind.ValueWithName ? addedParameter.Name : null,
refKind: RefKind.None,
expression: expression);
diff --git a/src/Features/Core/Portable/CodeFixesAndRefactorings/CodeActionRequestPriorityProvider.cs b/src/Features/Core/Portable/CodeFixesAndRefactorings/CodeActionRequestPriorityProvider.cs
new file mode 100644
index 0000000000000..162718b770f50
--- /dev/null
+++ b/src/Features/Core/Portable/CodeFixesAndRefactorings/CodeActionRequestPriorityProvider.cs
@@ -0,0 +1,129 @@
+// 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.Diagnostics;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.CodeActions
+{
+ internal interface ICodeActionRequestPriorityProvider
+ {
+ CodeActionRequestPriority Priority { get; }
+
+ ///
+ /// Tracks the given as a de-prioritized analyzer that should be moved to
+ /// bucket.
+ ///
+ void AddDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer);
+
+ bool IsDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer);
+ }
+
+ internal static class ICodeActionRequestPriorityProviderExtensions
+ {
+ ///
+ /// Returns true if the given can report diagnostics that can have fixes from a code
+ /// fix provider with matching . This method is useful for performing a performance
+ /// optimization for lightbulb diagnostic computation, wherein we can reduce the set of analyzers to be executed
+ /// when computing fixes for a specific .
+ ///
+ public static bool MatchesPriority(this ICodeActionRequestPriorityProvider provider, DiagnosticAnalyzer analyzer)
+ {
+ var priority = provider.Priority;
+
+ // If caller isn't asking for prioritized result, then run all analyzers.
+ if (priority == CodeActionRequestPriority.None)
+ return true;
+
+ // 'CodeActionRequestPriority.Lowest' is used for suppression/configuration fixes,
+ // which requires all analyzer diagnostics.
+ if (priority == CodeActionRequestPriority.Lowest)
+ return true;
+
+ // The compiler analyzer always counts for any priority. It's diagnostics may be fixed
+ // by high pri or normal pri fixers.
+ if (analyzer.IsCompilerAnalyzer())
+ return true;
+
+ // Check if we are computing diagnostics for 'CodeActionRequestPriority.Low' and
+ // this analyzer was de-prioritized to low priority bucket.
+ if (priority == CodeActionRequestPriority.Low &&
+ provider.IsDeprioritizedAnalyzerWithLowPriority(analyzer))
+ {
+ return true;
+ }
+
+ // Now compute this analyzer's priority and compare it with the provider's request 'Priority'.
+ // Our internal 'IBuiltInAnalyzer' can specify custom request priority, while all
+ // the third-party analyzers are assigned 'Normal' priority.
+ var analyzerPriority = analyzer is IBuiltInAnalyzer { RequestPriority: var requestPriority }
+ ? requestPriority
+ : CodeActionRequestPriority.Normal;
+
+ return priority == analyzerPriority;
+ }
+
+ ///
+ /// Returns true if the given should be considered a candidate when computing
+ /// fixes for the given .
+ ///
+ public static bool MatchesPriority(this ICodeActionRequestPriorityProvider provider, CodeFixProvider codeFixProvider)
+ {
+ if (provider.Priority == CodeActionRequestPriority.None)
+ {
+ // We are computing fixes for all priorities
+ return true;
+ }
+ if (provider.Priority == CodeActionRequestPriority.Low)
+ {
+ // 'Low' priority can be used for two types of code fixers:
+ // 1. Those which explicitly set their 'RequestPriority' to 'Low' and
+ // 2. Those which can fix diagnostics for expensive analyzers which were de-prioritized
+ // to 'Low' priority bucket to improve lightbulb population performance.
+ // Hence, when processing the 'Low' Priority bucket, we accept fixers with any RequestPriority,
+ // as long as they can fix a diagnostic from an analyzer that was executed in the 'Low' bucket.
+ return true;
+ }
+
+ return provider.Priority == codeFixProvider.RequestPriority;
+ }
+ }
+
+ internal sealed class DefaultCodeActionRequestPriorityProvider : ICodeActionRequestPriorityProvider
+ {
+ private readonly object _gate = new();
+ private HashSet? _lowPriorityAnalyzers;
+
+ public DefaultCodeActionRequestPriorityProvider(CodeActionRequestPriority priority = CodeActionRequestPriority.None)
+ {
+ Priority = priority;
+ }
+
+ public CodeActionRequestPriority Priority { get; }
+
+ public void AddDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer)
+ {
+ lock (_gate)
+ {
+ _lowPriorityAnalyzers ??= new();
+ _lowPriorityAnalyzers.Add(analyzer);
+ }
+ }
+
+ public bool IsDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer)
+ {
+ lock (_gate)
+ {
+ return _lowPriorityAnalyzers != null && _lowPriorityAnalyzers.Contains(analyzer);
+ }
+ }
+ }
+}
diff --git a/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs b/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs
index 42745bc8f874e..fd484b78cc17f 100644
--- a/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs
+++ b/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs
@@ -103,7 +103,7 @@ static ProjectCodeRefactoringProvider.ExtensionInfo GetExtensionInfo(ExportCodeR
RefactoringToMetadataMap.TryGetValue(provider, out var providerMetadata);
var refactoring = await GetRefactoringFromProviderAsync(
- document, state, provider, providerMetadata, extensionManager, options, isBlocking: false, cancellationToken).ConfigureAwait(false);
+ document, state, provider, providerMetadata, extensionManager, options, cancellationToken).ConfigureAwait(false);
if (refactoring != null)
{
@@ -119,7 +119,6 @@ static ProjectCodeRefactoringProvider.ExtensionInfo GetExtensionInfo(ExportCodeR
TextSpan state,
CodeActionRequestPriority priority,
CodeActionOptionsProvider options,
- bool isBlocking,
Func addOperationScope,
CancellationToken cancellationToken)
{
@@ -142,7 +141,7 @@ static ProjectCodeRefactoringProvider.ExtensionInfo GetExtensionInfo(ExportCodeR
using (RoslynEventSource.LogInformationalBlock(FunctionId.Refactoring_CodeRefactoringService_GetRefactoringsAsync, providerName, cancellationToken))
{
return GetRefactoringFromProviderAsync(document, state, provider, providerMetadata,
- extensionManager, options, isBlocking, cancellationToken);
+ extensionManager, options, cancellationToken);
}
},
cancellationToken));
@@ -160,7 +159,6 @@ static ProjectCodeRefactoringProvider.ExtensionInfo GetExtensionInfo(ExportCodeR
CodeChangeProviderMetadata? providerMetadata,
IExtensionManager extensionManager,
CodeActionOptionsProvider options,
- bool isBlocking,
CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -189,7 +187,6 @@ static ProjectCodeRefactoringProvider.ExtensionInfo GetExtensionInfo(ExportCodeR
}
},
options,
- isBlocking,
cancellationToken);
var task = provider.ComputeRefactoringsAsync(context) ?? Task.CompletedTask;
diff --git a/src/Features/Core/Portable/CodeRefactorings/ICodeRefactoringService.cs b/src/Features/Core/Portable/CodeRefactorings/ICodeRefactoringService.cs
index e545c51f9ea80..3a38556eb2e98 100644
--- a/src/Features/Core/Portable/CodeRefactorings/ICodeRefactoringService.cs
+++ b/src/Features/Core/Portable/CodeRefactorings/ICodeRefactoringService.cs
@@ -15,12 +15,12 @@ internal interface ICodeRefactoringService
{
Task HasRefactoringsAsync(TextDocument document, TextSpan textSpan, CodeActionOptionsProvider options, CancellationToken cancellationToken);
- Task> GetRefactoringsAsync(TextDocument document, TextSpan textSpan, CodeActionRequestPriority priority, CodeActionOptionsProvider options, bool isBlocking, Func addOperationScope, CancellationToken cancellationToken);
+ Task> GetRefactoringsAsync(TextDocument document, TextSpan textSpan, CodeActionRequestPriority priority, CodeActionOptionsProvider options, Func addOperationScope, CancellationToken cancellationToken);
}
internal static class ICodeRefactoringServiceExtensions
{
- public static Task> GetRefactoringsAsync(this ICodeRefactoringService service, TextDocument document, TextSpan state, CodeActionOptionsProvider options, bool isBlocking, CancellationToken cancellationToken)
- => service.GetRefactoringsAsync(document, state, CodeActionRequestPriority.None, options, isBlocking, addOperationScope: _ => null, cancellationToken);
+ public static Task> GetRefactoringsAsync(this ICodeRefactoringService service, TextDocument document, TextSpan state, CodeActionOptionsProvider options, CancellationToken cancellationToken)
+ => service.GetRefactoringsAsync(document, state, CodeActionRequestPriority.None, options, addOperationScope: _ => null, cancellationToken);
}
}
diff --git a/src/Features/Core/Portable/Completion/CompletionItem.cs b/src/Features/Core/Portable/Completion/CompletionItem.cs
index 4230632eabba5..a897d36157bfa 100644
--- a/src/Features/Core/Portable/Completion/CompletionItem.cs
+++ b/src/Features/Core/Portable/Completion/CompletionItem.cs
@@ -81,6 +81,8 @@ public sealed class CompletionItem : IComparable
///
/// The span identifies the text in the document that is used to filter the initial list presented to the user,
/// and typically represents the region of the document that will be changed if this item is committed.
+ /// The latter is not always true because individual provider is free to make more complex changes to the document.
+ /// If this is the case, the provider should set to true.
///
public TextSpan Span { get; internal set; }
@@ -101,17 +103,11 @@ public sealed class CompletionItem : IComparable
public CompletionItemRules Rules { get; }
///
- /// Returns true if this item's text edit requires complex resolution that
- /// may impact performance. For example, an edit may be complex if it needs
- /// to format or type check the resulting code, or make complex non-local
- /// changes to other parts of the file.
- /// Complex resolution is used so we only do the minimum amount of work
- /// needed to display completion items. It is performed only for the
- /// committed item just prior to commit. Thus, it is ideal for any expensive
- /// completion work that does not affect the display of the item in the
- /// completion list, but is necessary for committing the item.
- /// An example of an item type requiring complex resolution is C#/VB
- /// override completion.
+ /// Returns true if this item's text edit requires complex resolution.
+ /// An edit is considered complex if the span of the change is different from
+ /// specified by .
+ ///
+ /// Example of an item type requiring complex resolution is C#/VB override completion.
///
public bool IsComplexTextEdit { get; }
diff --git a/src/Features/Core/Portable/Completion/CompletionList.cs b/src/Features/Core/Portable/Completion/CompletionList.cs
index b43b63d566e6e..5ae1d557dab9c 100644
--- a/src/Features/Core/Portable/Completion/CompletionList.cs
+++ b/src/Features/Core/Portable/Completion/CompletionList.cs
@@ -46,6 +46,9 @@ public sealed class CompletionList
/// The span identifies the text in the document that is used to filter the initial list
/// presented to the user, and typically represents the region of the document that will
/// be changed if this item is committed.
+ /// The latter is not always the case because each provider is free to make more complex changes
+ /// to the document. If this is the case, must be
+ /// set to .
///
public TextSpan Span { get; }
diff --git a/src/Features/Core/Portable/Completion/CompletionService.cs b/src/Features/Core/Portable/Completion/CompletionService.cs
index f847351cbc7b4..f1fd2f15a2bb1 100644
--- a/src/Features/Core/Portable/Completion/CompletionService.cs
+++ b/src/Features/Core/Portable/Completion/CompletionService.cs
@@ -226,6 +226,8 @@ public virtual TextSpan GetDefaultCompletionListSpan(SourceText text, int caretP
(document, var semanticModel) = await GetDocumentWithFrozenPartialSemanticsAsync(document, cancellationToken).ConfigureAwait(false);
var change = await provider.GetChangeAsync(document, item, commitCharacter, cancellationToken).ConfigureAwait(false);
GC.KeepAlive(semanticModel);
+
+ Debug.Assert(item.Span == change.TextChange.Span || item.IsComplexTextEdit);
return change;
}
else
diff --git a/src/Features/Core/Portable/Completion/CompletionService_GetCompletions.cs b/src/Features/Core/Portable/Completion/CompletionService_GetCompletions.cs
index 6916591754a54..51a93c50fa657 100644
--- a/src/Features/Core/Portable/Completion/CompletionService_GetCompletions.cs
+++ b/src/Features/Core/Portable/Completion/CompletionService_GetCompletions.cs
@@ -69,7 +69,7 @@ public abstract partial class CompletionService
(document, var semanticModel) = await GetDocumentWithFrozenPartialSemanticsAsync(document, cancellationToken).ConfigureAwait(false);
var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
- var defaultItemSpan = GetDefaultCompletionListSpan(text, caretPosition);
+ var completionListSpan = GetDefaultCompletionListSpan(text, caretPosition);
var providers = _providerManager.GetFilteredProviders(document.Project, roles, trigger, options);
@@ -91,7 +91,7 @@ public abstract partial class CompletionService
// Now, ask all the triggered providers, in parallel, to populate a completion context.
// Note: we keep any context with items *or* with a suggested item.
var triggeredContexts = await ComputeNonEmptyCompletionContextsAsync(
- document, caretPosition, trigger, options, defaultItemSpan, triggeredProviders, sharedContext, cancellationToken).ConfigureAwait(false);
+ document, caretPosition, trigger, options, completionListSpan, triggeredProviders, sharedContext, cancellationToken).ConfigureAwait(false);
// Nothing to do if we didn't even get any regular items back (i.e. 0 items or suggestion item only.)
if (!triggeredContexts.Any(static cc => cc.Items.Count > 0))
@@ -101,7 +101,7 @@ public abstract partial class CompletionService
// that's all we'll return.
var exclusiveContexts = triggeredContexts.Where(t => t.IsExclusive).ToImmutableArray();
if (!exclusiveContexts.IsEmpty)
- return MergeAndPruneCompletionLists(exclusiveContexts, defaultItemSpan, options, isExclusive: true);
+ return MergeAndPruneCompletionLists(exclusiveContexts, options, isExclusive: true);
// Great! We had some items. Now we want to see if any of the other providers
// would like to augment the completion list. For example, we might trigger
@@ -110,7 +110,7 @@ public abstract partial class CompletionService
var augmentingProviders = providers.Except(triggeredProviders).ToImmutableArray();
var augmentingContexts = await ComputeNonEmptyCompletionContextsAsync(
- document, caretPosition, trigger, options, defaultItemSpan, augmentingProviders, sharedContext, cancellationToken).ConfigureAwait(false);
+ document, caretPosition, trigger, options, completionListSpan, augmentingProviders, sharedContext, cancellationToken).ConfigureAwait(false);
GC.KeepAlive(semanticModel);
@@ -120,7 +120,7 @@ public abstract partial class CompletionService
var allContexts = triggeredContexts.Concat(augmentingContexts)
.Sort((p1, p2) => completionProviderToIndex[p1.Provider] - completionProviderToIndex[p2.Provider]);
- return MergeAndPruneCompletionLists(allContexts, defaultItemSpan, options, isExclusive: false);
+ return MergeAndPruneCompletionLists(allContexts, options, isExclusive: false);
ImmutableArray GetTriggeredProviders(
Document document, ConcatImmutableArray providers, int caretPosition, CompletionOptions options, CompletionTrigger trigger, ImmutableHashSet? roles, SourceText text)
@@ -224,7 +224,7 @@ private static bool HasAnyItems(CompletionContext cc)
private static async Task> ComputeNonEmptyCompletionContextsAsync(
Document document, int caretPosition, CompletionTrigger trigger,
- CompletionOptions options, TextSpan defaultItemSpan,
+ CompletionOptions options, TextSpan completionListSpan,
ImmutableArray providers,
SharedSyntaxContextsWithSpeculativeModel sharedContext,
CancellationToken cancellationToken)
@@ -234,7 +234,7 @@ private static bool HasAnyItems(CompletionContext cc)
{
completionContextTasks.Add(GetContextAsync(
provider, document, caretPosition, trigger,
- options, defaultItemSpan, sharedContext, cancellationToken));
+ options, completionListSpan, sharedContext, cancellationToken));
}
var completionContexts = await Task.WhenAll(completionContextTasks).ConfigureAwait(false);
@@ -243,14 +243,11 @@ private static bool HasAnyItems(CompletionContext cc)
private CompletionList MergeAndPruneCompletionLists(
ImmutableArray completionContexts,
- TextSpan defaultSpan,
in CompletionOptions options,
bool isExclusive)
{
- // See if any contexts changed the completion list span. If so, the first context that
- // changed it 'wins' and picks the span that will be used for all items in the completion
- // list. If no contexts changed it, then just use the default span provided by the service.
- var finalCompletionListSpan = completionContexts.FirstOrDefault(c => c.CompletionListSpan != defaultSpan)?.CompletionListSpan ?? defaultSpan;
+ Debug.Assert(!completionContexts.IsDefaultOrEmpty);
+
using var displayNameToItemsMap = new DisplayNameToItemsMap(this);
CompletionItem? suggestionModeItem = null;
@@ -272,7 +269,7 @@ private static bool HasAnyItems(CompletionContext cc)
}
return CompletionList.Create(
- finalCompletionListSpan,
+ completionContexts[0].CompletionListSpan, // All contexts have the same completion list span.
displayNameToItemsMap.SortToSegmentedList(),
GetRules(options),
suggestionModeItem,
diff --git a/src/Features/Core/Portable/Completion/INotifyCommittingItemCompletionProvider.cs b/src/Features/Core/Portable/Completion/INotifyCommittingItemCompletionProvider.cs
index e79da71842fdd..af3342e4068d3 100644
--- a/src/Features/Core/Portable/Completion/INotifyCommittingItemCompletionProvider.cs
+++ b/src/Features/Core/Portable/Completion/INotifyCommittingItemCompletionProvider.cs
@@ -8,7 +8,7 @@
namespace Microsoft.CodeAnalysis.Completion
{
///
- /// Interface to implement if the provider want to sign up for notifacation when one of the items it provided
+ /// Interface to implement if the provider want to sign up for notification when one of the items it provided
/// is being committed by the host, since calling doesn't necessarily
/// lead to commission.
///
diff --git a/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractImportCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractImportCompletionProvider.cs
index 88dfa6f02b32e..50c91a90be7fc 100644
--- a/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractImportCompletionProvider.cs
+++ b/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractImportCompletionProvider.cs
@@ -23,7 +23,6 @@ namespace Microsoft.CodeAnalysis.Completion.Providers
{
internal abstract class AbstractImportCompletionProvider : LSPCompletionProvider, INotifyCommittingItemCompletionProvider
{
- protected abstract Task> GetImportedNamespacesAsync(SyntaxContext syntaxContext, CancellationToken cancellationToken);
protected abstract bool ShouldProvideCompletion(CompletionContext completionContext, SyntaxContext syntaxContext);
protected abstract void WarmUpCacheInBackground(Document document);
protected abstract Task AddCompletionItemsAsync(CompletionContext completionContext, SyntaxContext syntaxContext, HashSet namespacesInScope, CancellationToken cancellationToken);
@@ -63,7 +62,7 @@ public override async Task ProvideCompletionsAsync(CompletionContext completionC
// Find all namespaces in scope at current cursor location,
// which will be used to filter so the provider only returns out-of-scope types.
- var namespacesInScope = await GetNamespacesInScopeAsync(syntaxContext, cancellationToken).ConfigureAwait(false);
+ var namespacesInScope = GetNamespacesInScope(syntaxContext, cancellationToken);
await AddCompletionItemsAsync(completionContext, syntaxContext, namespacesInScope, cancellationToken).ConfigureAwait(false);
}
@@ -75,12 +74,12 @@ private static async Task CreateContextAsync(Document document, i
return document.GetRequiredLanguageService().CreateContext(document, semanticModel, position, cancellationToken);
}
- private async Task> GetNamespacesInScopeAsync(SyntaxContext syntaxContext, CancellationToken cancellationToken)
+ private static HashSet GetNamespacesInScope(SyntaxContext syntaxContext, CancellationToken cancellationToken)
{
var semanticModel = syntaxContext.SemanticModel;
var document = syntaxContext.Document;
- var importedNamespaces = await GetImportedNamespacesAsync(syntaxContext, cancellationToken).ConfigureAwait(false);
+ var importedNamespaces = GetImportedNamespaces(syntaxContext, cancellationToken);
// This hashset will be used to match namespace names, so it must have the same case-sensitivity as the source language.
var syntaxFacts = document.GetRequiredLanguageService();
@@ -97,6 +96,35 @@ private async Task> GetNamespacesInScopeAsync(SyntaxContext synt
return namespacesInScope;
}
+ private static ImmutableArray GetImportedNamespaces(SyntaxContext context, CancellationToken cancellationToken)
+ {
+ var position = context.Position;
+ var targetToken = context.TargetToken;
+
+ // If we are immediately after `using` directive adjust position to the start of the next token.
+ // This is a workaround for an issue, when immediately after a `using` directive it is not included into the import scope.
+ // See https://github.com/dotnet/roslyn/issues/67447 for more info.
+ if (context.IsRightAfterUsingOrImportDirective)
+ position = targetToken.GetNextToken(includeZeroWidth: true).SpanStart;
+
+ var scopes = context.SemanticModel.GetImportScopes(position, cancellationToken);
+
+ using var _ = ArrayBuilder.GetInstance(out var usingsBuilder);
+
+ foreach (var scope in scopes)
+ {
+ foreach (var import in scope.Imports)
+ {
+ if (import.NamespaceOrType is INamespaceSymbol @namespace)
+ {
+ usingsBuilder.Add(@namespace.ToDisplayString(SymbolDisplayFormats.NameFormat));
+ }
+ }
+ }
+
+ return usingsBuilder.ToImmutable();
+ }
+
public override async Task GetChangeAsync(
Document document, CompletionItem completionItem, char? commitKey, CancellationToken cancellationToken)
{
diff --git a/src/Features/Core/Portable/Completion/Providers/XmlDocCommentCompletionItem.cs b/src/Features/Core/Portable/Completion/Providers/XmlDocCommentCompletionItem.cs
index c74d5c7242959..d98f6b4cafa5d 100644
--- a/src/Features/Core/Portable/Completion/Providers/XmlDocCommentCompletionItem.cs
+++ b/src/Features/Core/Portable/Completion/Providers/XmlDocCommentCompletionItem.cs
@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System.Collections.Immutable;
-using System.Diagnostics.CodeAnalysis;
namespace Microsoft.CodeAnalysis.Completion.Providers
{
@@ -18,12 +17,18 @@ public static CompletionItem Create(string displayText, string beforeCaretText,
.Add(BeforeCaretText, beforeCaretText)
.Add(AfterCaretText, afterCaretText);
+ // Set isComplexTextEdit to be always true for simplicity, even
+ // though we don't always need to make change outside the default
+ // completion list Span.
+ // See AbstractDocCommentCompletionProvider.GetChangeAsync for how
+ // the actual Span is calculated.
return CommonCompletionItem.Create(
displayText: displayText,
displayTextSuffix: "",
glyph: Glyph.Keyword,
properties: props,
- rules: rules);
+ rules: rules,
+ isComplexTextEdit: true);
}
public static string GetBeforeCaretText(CompletionItem item)
diff --git a/src/Features/Core/Portable/Completion/SharedSyntaxContextsWithSpeculativeModel.cs b/src/Features/Core/Portable/Completion/SharedSyntaxContextsWithSpeculativeModel.cs
index 8d01f369e8508..8da8a3db49e6a 100644
--- a/src/Features/Core/Portable/Completion/SharedSyntaxContextsWithSpeculativeModel.cs
+++ b/src/Features/Core/Portable/Completion/SharedSyntaxContextsWithSpeculativeModel.cs
@@ -44,7 +44,7 @@ public Task GetSyntaxContextAsync(Document document, Cancellation
static AsyncLazy GetLazySyntaxContextWithSpeculativeModel(Document document, SharedSyntaxContextsWithSpeculativeModel self)
{
return self._cache.GetOrAdd(document, d => AsyncLazy.Create(cancellationToken
- => Utilities.CreateSyntaxContextWithExistingSpeculativeModelAsync(d, self._position, cancellationToken), cacheResult: true));
+ => Utilities.CreateSyntaxContextWithExistingSpeculativeModelAsync(d, self._position, cancellationToken)));
}
}
}
diff --git a/src/Features/Core/Portable/ConvertForEachToFor/AbstractConvertForEachToForCodeRefactoringProvider.cs b/src/Features/Core/Portable/ConvertForEachToFor/AbstractConvertForEachToForCodeRefactoringProvider.cs
index 200fbaa386dd6..5e242ce2dec1e 100644
--- a/src/Features/Core/Portable/ConvertForEachToFor/AbstractConvertForEachToForCodeRefactoringProvider.cs
+++ b/src/Features/Core/Portable/ConvertForEachToFor/AbstractConvertForEachToForCodeRefactoringProvider.cs
@@ -116,7 +116,7 @@ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext conte
var collectionVariableToken = generator.Identifier(collectionVariable.ToString()).WithAdditionalAnnotations(RenameAnnotation.Create());
// this expression is from user code. don't simplify this.
- var expression = foreachCollectionExpression.WithoutAnnotations(SimplificationHelpers.DontSimplifyAnnotation);
+ var expression = foreachCollectionExpression.WithoutAnnotations(SimplificationHelpers.DoNotSimplifyAnnotation);
var collectionStatement = generator.LocalDeclarationStatement(
type,
collectionVariableToken,
diff --git a/src/Features/Core/Portable/ConvertToInterpolatedString/AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs b/src/Features/Core/Portable/ConvertToInterpolatedString/AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs
index 9f223f5acc547..a55a0ed7fe36e 100644
--- a/src/Features/Core/Portable/ConvertToInterpolatedString/AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs
+++ b/src/Features/Core/Portable/ConvertToInterpolatedString/AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs
@@ -149,7 +149,7 @@ async Task<(TInvocationExpressionSyntax? invocation, TArgumentSyntax? placeholde
if (invocation != null)
{
// look for a string argument containing `"...{0}..."`, followed by more arguments.
- var arguments = syntaxFacts.GetArgumentsOfInvocationExpression(invocation);
+ var arguments = (SeparatedSyntaxList)syntaxFacts.GetArgumentsOfInvocationExpression(invocation);
for (int i = 0, n = arguments.Count - 1; i < n; i++)
{
var argument = arguments[i];
@@ -231,7 +231,7 @@ bool ContainsIndex(string stringLiteralText, string indexString)
var syntaxFacts = document.GetRequiredLanguageService();
var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
- var arguments = syntaxFacts.GetArgumentsOfInvocationExpression(invocation);
+ var arguments = (SeparatedSyntaxList)syntaxFacts.GetArgumentsOfInvocationExpression(invocation);
var literalExpression = (TLiteralExpressionSyntax?)syntaxFacts.GetExpressionOfArgument(placeholderArgument);
Contract.ThrowIfNull(literalExpression);
@@ -252,7 +252,7 @@ bool ContainsIndex(string stringLiteralText, string indexString)
var newRoot = root.ReplaceNode(invocation, replacementNode.WithTriviaFrom(invocation));
return document.WithSyntaxRoot(newRoot);
- ImmutableArray GetReorderedArgumentsAfterPlaceholderArgument()
+ ImmutableArray GetReorderedArgumentsAfterPlaceholderArgument()
{
var placeholderIndex = arguments.IndexOf(placeholderArgument);
Contract.ThrowIfTrue(placeholderIndex < 0);
@@ -285,7 +285,7 @@ ImmutableArray GetReorderedArgumentsAfterPlaceholderArgument()
return unnamedArguments.Concat(namedAndUnnamedArguments);
}
- ImmutableArray ExpandArgumentExpressions(ImmutableArray argumentsAfterPlaceholder)
+ ImmutableArray ExpandArgumentExpressions(ImmutableArray argumentsAfterPlaceholder)
{
using var _ = ArrayBuilder.GetInstance(out var builder);
foreach (var argument in argumentsAfterPlaceholder)
diff --git a/src/Features/Core/Portable/DesignerAttribute/DesignerAttributeDiscoveryService.cs b/src/Features/Core/Portable/DesignerAttribute/DesignerAttributeDiscoveryService.cs
index ec42c6a055770..ff979cbe1da97 100644
--- a/src/Features/Core/Portable/DesignerAttribute/DesignerAttributeDiscoveryService.cs
+++ b/src/Features/Core/Portable/DesignerAttribute/DesignerAttributeDiscoveryService.cs
@@ -89,7 +89,7 @@ private static async ValueTask HasDesignerCategoryTypeAsync(Project projec
var asyncLazy = s_metadataIdToDesignerAttributeInfo.GetValue(
metadataId, _ => AsyncLazy.Create(cancellationToken =>
- ComputeHasDesignerCategoryTypeAsync(solutionServices, solutionKey, peReference, cancellationToken), cacheResult: true));
+ ComputeHasDesignerCategoryTypeAsync(solutionServices, solutionKey, peReference, cancellationToken)));
return await asyncLazy.GetValueAsync(cancellationToken).ConfigureAwait(false);
}
@@ -159,7 +159,7 @@ private static async ValueTask HasDesignerCategoryTypeAsync(Project projec
// The top level project version for this project. We only care if anything top level changes here.
// Downstream impact will already happen due to us keying off of the references a project has (which will
// change if anything it depends on changes).
- var lazyProjectVersion = AsyncLazy.Create(project.GetSemanticVersionAsync, cacheResult: true);
+ var lazyProjectVersion = AsyncLazy.Create(project.GetSemanticVersionAsync);
// Switch to frozen semantics if requested. We don't need to wait on generators to run here as we want to
// be lightweight. We'll also continue running in the future. So if any changes to happen that are
@@ -222,28 +222,31 @@ private static async ValueTask HasDesignerCategoryTypeAsync(Project projec
bool? hasDesignerCategoryType = null;
using var _ = ArrayBuilder<(DesignerAttributeData data, VersionStamp version)>.GetInstance(out var results);
- foreach (var document in project.Documents)
+
+ // Avoid realizing document instances until needed.
+ foreach (var documentId in project.DocumentIds)
{
// If we're only analyzing a specific document, then skip the rest.
- if (specificDocument != null && document != specificDocument)
+ if (specificDocument != null && documentId != specificDocument.Id)
continue;
// If we don't have a path for this document, we cant proceed with it.
// We need that path to inform the project system which file we're referring to.
- if (document.FilePath == null)
+ var filePath = project.State.DocumentStates.GetRequiredState(documentId).FilePath;
+ if (filePath is null)
continue;
// If nothing has changed at the top level between the last time we analyzed this document and now, then
// no need to analyze again.
var projectVersion = await lazyProjectVersion.GetValueAsync(cancellationToken).ConfigureAwait(false);
- if (_documentToLastReportedInformation.TryGetValue(document.Id, out var existingInfo) &&
+ if (_documentToLastReportedInformation.TryGetValue(documentId, out var existingInfo) &&
existingInfo.projectVersion == projectVersion)
{
continue;
}
hasDesignerCategoryType ??= await HasDesignerCategoryTypeAsync(project, cancellationToken).ConfigureAwait(false);
- var data = await ComputeDesignerAttributeDataAsync(document, hasDesignerCategoryType.Value).ConfigureAwait(false);
+ var data = await ComputeDesignerAttributeDataAsync(project, documentId, filePath, hasDesignerCategoryType.Value).ConfigureAwait(false);
if (data.Category != existingInfo.category)
results.Add((data, projectVersion));
}
@@ -251,33 +254,34 @@ private static async ValueTask HasDesignerCategoryTypeAsync(Project projec
return results.ToImmutable();
async Task ComputeDesignerAttributeDataAsync(
- Document document, bool hasDesignerCategoryType)
+ Project project, DocumentId documentId, string filePath, bool hasDesignerCategoryType)
{
- Contract.ThrowIfNull(document.FilePath);
-
// We either haven't computed the designer info, or our data was out of date. We need
// So recompute here. Figure out what the current category is, and if that's different
// from what we previously stored.
var category = await ComputeDesignerAttributeCategoryAsync(
- hasDesignerCategoryType, document, cancellationToken).ConfigureAwait(false);
+ hasDesignerCategoryType, project, documentId, cancellationToken).ConfigureAwait(false);
return new DesignerAttributeData
{
Category = category,
- DocumentId = document.Id,
- FilePath = document.FilePath,
+ DocumentId = documentId,
+ FilePath = filePath,
};
}
}
public static async Task ComputeDesignerAttributeCategoryAsync(
- bool hasDesignerCategoryType, Document document, CancellationToken cancellationToken)
+ bool hasDesignerCategoryType, Project project, DocumentId documentId, CancellationToken cancellationToken)
{
// simple case. If there's no DesignerCategory type in this compilation, then there's definitely no
// designable types.
if (!hasDesignerCategoryType)
return null;
+ // Wait to realize the document to avoid unnecessary allocations when indexing documents.
+ var document = project.GetRequiredDocument(documentId);
+
var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
var syntaxFacts = document.GetRequiredLanguageService();
diff --git a/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs b/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs
index 94ad6d68a5495..5440da68a0b85 100644
--- a/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs
+++ b/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs
@@ -25,47 +25,43 @@ internal interface IDiagnosticAnalyzerService
DiagnosticAnalyzerInfoCache AnalyzerInfoCache { get; }
///
- /// Re-analyze given projects and documents
+ /// Re-analyze given projects and documents. If both and are null,
+ /// then re-analyzes the entire for the given .
///
- void Reanalyze(Workspace workspace, IEnumerable? projectIds = null, IEnumerable? documentIds = null, bool highPriority = false);
+ void Reanalyze(Workspace workspace, IEnumerable? projectIds, IEnumerable? documentIds, bool highPriority);
///
/// Get specific diagnostics currently stored in the source. returned diagnostic might be out-of-date if solution has changed but analyzer hasn't run for the new solution.
///
- Task> GetSpecificCachedDiagnosticsAsync(Workspace workspace, object id, bool includeSuppressedDiagnostics = false, bool includeNonLocalDocumentDiagnostics = true, CancellationToken cancellationToken = default);
+ Task> GetSpecificCachedDiagnosticsAsync(Workspace workspace, object id, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
///
/// Get diagnostics currently stored in the source. returned diagnostic might be out-of-date if solution has changed but analyzer hasn't run for the new solution.
///
- Task> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId = null, DocumentId? documentId = null, bool includeSuppressedDiagnostics = false, bool includeNonLocalDocumentDiagnostics = true, CancellationToken cancellationToken = default);
+ Task> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
///
/// Get diagnostics for the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
///
- Task> GetDiagnosticsAsync(Solution solution, ProjectId? projectId = null, DocumentId? documentId = null, bool includeSuppressedDiagnostics = false, bool includeNonLocalDocumentDiagnostics = true, CancellationToken cancellationToken = default);
+ Task> GetDiagnosticsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
///
/// Force computes diagnostics and raises diagnostic events for the given project or solution. all diagnostics returned should be up-to-date with respect to the given project or solution.
///
- Task ForceAnalyzeAsync(Solution solution, Action onProjectAnalyzed, ProjectId? projectId = null, CancellationToken cancellationToken = default);
-
- ///
- /// True if given project has any diagnostics
- ///
- bool ContainsDiagnostics(Workspace workspace, ProjectId projectId);
+ Task ForceAnalyzeAsync(Solution solution, Action onProjectAnalyzed, ProjectId? projectId, CancellationToken cancellationToken);
///
/// Get diagnostics of the given diagnostic ids from the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// Note that for project case, this method returns diagnostics from all project documents as well. Use
/// if you want to fetch only project diagnostics without source locations.
///
- Task> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId = null, DocumentId? documentId = null, ImmutableHashSet? diagnosticIds = null, bool includeSuppressedDiagnostics = false, bool includeNonLocalDocumentDiagnostics = true, CancellationToken cancellationToken = default);
+ Task> GetDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableHashSet? diagnosticIds, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
///
/// Get project diagnostics (diagnostics with no source location) of the given diagnostic ids from the given solution. all diagnostics returned should be up-to-date with respect to the given solution.
/// Note that this method doesn't return any document diagnostics. Use to also fetch those.
///
- Task> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId = null, ImmutableHashSet? diagnosticIds = null, bool includeSuppressedDiagnostics = false, bool includeNonLocalDocumentDiagnostics = true, CancellationToken cancellationToken = default);
+ Task> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet? diagnosticIds, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken);
///
/// Try to return up to date diagnostics for the given span for the document.
@@ -76,16 +72,16 @@ internal interface IDiagnosticAnalyzerService
/// This API will only force complete analyzers that support span based analysis, i.e. compiler analyzer and
/// s that support .
/// For the rest of the analyzers, it will only return diagnostics if the analyzer has already been executed.
- /// Use
+ /// Use
/// if you want to force complete all analyzers and get up-to-date diagnostics for all analyzers for the given span.
///
Task<(ImmutableArray diagnostics, bool upToDate)> TryGetDiagnosticsForSpanAsync(
TextDocument document, TextSpan range, Func? shouldIncludeDiagnostic,
- bool includeSuppressedDiagnostics = false,
- CodeActionRequestPriority priority = CodeActionRequestPriority.None,
- DiagnosticKind diagnosticKind = DiagnosticKind.All,
- bool isExplicit = false,
- CancellationToken cancellationToken = default);
+ bool includeSuppressedDiagnostics,
+ ICodeActionRequestPriorityProvider priorityProvider,
+ DiagnosticKind diagnosticKind,
+ bool isExplicit,
+ CancellationToken cancellationToken);
///
/// Return up to date diagnostics for the given span for the document
@@ -98,25 +94,42 @@ internal interface IDiagnosticAnalyzerService
Task> GetDiagnosticsForSpanAsync(
TextDocument document, TextSpan? range, Func? shouldIncludeDiagnostic,
bool includeCompilerDiagnostics,
- bool includeSuppressedDiagnostics = false,
- CodeActionRequestPriority priority = CodeActionRequestPriority.None,
- Func? addOperationScope = null,
- DiagnosticKind diagnosticKind = DiagnosticKind.All,
- bool isExplicit = false,
- CancellationToken cancellationToken = default);
+ bool includeSuppressedDiagnostics,
+ ICodeActionRequestPriorityProvider priorityProvider,
+ Func? addOperationScope,
+ DiagnosticKind diagnosticKind,
+ bool isExplicit,
+ CancellationToken cancellationToken);
}
internal static class IDiagnosticAnalyzerServiceExtensions
{
+ ///
+ /// Return up to date diagnostics for the given for the given .
+ ///
+ /// This can be expensive since it is force analyzing diagnostics if it doesn't have up-to-date one yet.
+ ///
+ ///
public static Task> GetDiagnosticsForSpanAsync(this IDiagnosticAnalyzerService service,
- TextDocument document, TextSpan range, string? diagnosticId = null,
- bool includeSuppressedDiagnostics = false, Func? addOperationScope = null,
- DiagnosticKind diagnosticKind = DiagnosticKind.All, bool isExplicit = false,
- CancellationToken cancellationToken = default)
- => service.GetDiagnosticsForSpanAsync(document, range, diagnosticId, includeSuppressedDiagnostics, CodeActionRequestPriority.None, addOperationScope, diagnosticKind, isExplicit, cancellationToken);
+ TextDocument document, TextSpan? range, CancellationToken cancellationToken)
+ => service.GetDiagnosticsForSpanAsync(document, range, DiagnosticKind.All, cancellationToken);
///
- /// Return up to date diagnostics for the given span for the document
+ /// Return up to date diagnostics of the given for the given
+ /// for the given .
+ ///
+ /// This can be expensive since it is force analyzing diagnostics if it doesn't have up-to-date one yet.
+ ///
+ ///
+ public static Task> GetDiagnosticsForSpanAsync(this IDiagnosticAnalyzerService service,
+ TextDocument document, TextSpan? range, DiagnosticKind diagnosticKind, CancellationToken cancellationToken)
+ => service.GetDiagnosticsForSpanAsync(document, range,
+ diagnosticId: null, includeSuppressedDiagnostics: false,
+ priorityProvider: new DefaultCodeActionRequestPriorityProvider(),
+ addOperationScope: null, diagnosticKind, isExplicit: false, cancellationToken);
+
+ ///
+ /// Return up to date diagnostics for the given and parameters for the given .
///
/// This can be expensive since it is force analyzing diagnostics if it doesn't have up-to-date one yet. If
/// is not null, it gets diagnostics only for this given
///
public static Task> GetDiagnosticsForSpanAsync(this IDiagnosticAnalyzerService service,
- TextDocument document, TextSpan? range, string? diagnosticId = null,
- bool includeSuppressedDiagnostics = false,
- CodeActionRequestPriority priority = CodeActionRequestPriority.None,
- Func? addOperationScope = null,
- DiagnosticKind diagnosticKind = DiagnosticKind.All,
- bool isExplicit = false,
- CancellationToken cancellationToken = default)
+ TextDocument document, TextSpan? range, string? diagnosticId,
+ bool includeSuppressedDiagnostics,
+ ICodeActionRequestPriorityProvider priorityProvider,
+ Func? addOperationScope,
+ DiagnosticKind diagnosticKind,
+ bool isExplicit,
+ CancellationToken cancellationToken)
{
Func? shouldIncludeDiagnostic = diagnosticId != null ? id => id == diagnosticId : null;
return service.GetDiagnosticsForSpanAsync(document, range, shouldIncludeDiagnostic,
- includeCompilerDiagnostics: true, includeSuppressedDiagnostics, priority,
+ includeCompilerDiagnostics: true, includeSuppressedDiagnostics, priorityProvider,
addOperationScope, diagnosticKind, isExplicit, cancellationToken);
}
}
diff --git a/src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs b/src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs
index 2ea77484145e6..84ec3c0066259 100644
--- a/src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs
+++ b/src/Features/Core/Portable/EditAndContinue/AbstractEditAndContinueAnalyzer.cs
@@ -205,8 +205,13 @@ private SyntaxNode FindStatement(SyntaxNode declarationBody, TextSpan span, out
protected abstract SyntaxNode? TryGetPartnerLambdaBody(SyntaxNode oldBody, SyntaxNode newLambda);
+ ///
+ /// Determines if two syntax nodes are the same, disregarding trivia differences.
+ ///
+ protected abstract bool AreEquivalentLambdaBodies(SyntaxNode oldLambda, SyntaxNode oldLambdaBody, SyntaxNode newLambda, SyntaxNode newLambdaBody);
+
protected abstract Match ComputeTopLevelMatch(SyntaxNode oldCompilationUnit, SyntaxNode newCompilationUnit);
- protected abstract Match ComputeBodyMatch(SyntaxNode oldBody, SyntaxNode newBody, IEnumerable>? knownMatches);
+ protected abstract Match ComputeBodyMatchImpl(SyntaxNode oldBody, SyntaxNode newBody, IEnumerable>? knownMatches);
protected abstract Match ComputeTopLevelDeclarationMatch(SyntaxNode oldDeclaration, SyntaxNode newDeclaration);
protected abstract IEnumerable GetSyntaxSequenceEdits(ImmutableArray oldNodes, ImmutableArray newNodes);
@@ -243,11 +248,6 @@ private SyntaxNode FindStatement(SyntaxNode declarationBody, TextSpan span, out
protected abstract bool StatementLabelEquals(SyntaxNode node1, SyntaxNode node2);
- ///
- /// Determines if two syntax nodes are the same, disregarding trivia differences.
- ///
- protected abstract bool AreEquivalent(SyntaxNode left, SyntaxNode right);
-
///
/// Returns true if the code emitted for the old active statement part ( of )
/// is the same as the code emitted for the corresponding new active statement part ( of ).
@@ -408,13 +408,13 @@ protected virtual string GetSuspensionPointDisplayName(SyntaxNode node, EditKind
protected abstract ushort LineDirectiveSyntaxKind { get; }
protected abstract SymbolDisplayFormat ErrorDisplayFormat { get; }
protected abstract List GetExceptionHandlingAncestors(SyntaxNode node, bool isNonLeaf);
- protected abstract void GetStateMachineInfo(SyntaxNode body, out ImmutableArray suspensionPoints, out StateMachineKinds kinds);
+ internal abstract StateMachineInfo GetStateMachineInfo(SyntaxNode body);
protected abstract TextSpan GetExceptionHandlingRegion(SyntaxNode node, out bool coversAllChildren);
internal abstract void ReportTopLevelSyntacticRudeEdits(ArrayBuilder diagnostics, Match match, Edit edit, Dictionary editMap);
internal abstract void ReportEnclosingExceptionHandlingRudeEdits(ArrayBuilder diagnostics, IEnumerable> exceptionHandlingEdits, SyntaxNode oldStatement, TextSpan newStatementSpan);
internal abstract void ReportOtherRudeEditsAroundActiveStatement(ArrayBuilder diagnostics, Match match, SyntaxNode oldStatement, SyntaxNode newStatement, bool isNonLeaf);
- internal abstract void ReportMemberBodyUpdateRudeEdits(ArrayBuilder diagnostics, SyntaxNode newMember, TextSpan? span);
+ internal abstract void ReportMemberOrLambdaBodyUpdateRudeEditsImpl(ArrayBuilder diagnostics, SyntaxNode newDeclaration, SyntaxNode newBody, TextSpan? span);
internal abstract void ReportInsertedMemberSymbolRudeEdits(ArrayBuilder diagnostics, ISymbol newSymbol, SyntaxNode newNode, bool insertingIntoExistingContainingType);
internal abstract void ReportStateMachineSuspensionPointRudeEdits(ArrayBuilder diagnostics, SyntaxNode oldNode, SyntaxNode newNode);
@@ -428,6 +428,7 @@ protected virtual string GetSuspensionPointDisplayName(SyntaxNode node, EditKind
internal abstract bool IsNestedFunction(SyntaxNode node);
internal abstract bool IsLocalFunction(SyntaxNode node);
+ internal abstract bool IsGenericLocalFunction(SyntaxNode node);
internal abstract bool IsClosureScope(SyntaxNode node);
internal abstract bool ContainsLambda(SyntaxNode declaration);
internal abstract SyntaxNode GetLambda(SyntaxNode lambdaBody);
@@ -935,6 +936,9 @@ private LambdaInfo(List? activeNodeIndices, Match? match, Synta
NewBody = newLambdaBody;
}
+ public bool HasActiveStatement
+ => ActiveNodeIndices != null;
+
public LambdaInfo WithMatch(Match match, SyntaxNode newLambdaBody)
=> new(ActiveNodeIndices, match, newLambdaBody);
}
@@ -946,8 +950,8 @@ public LambdaInfo WithMatch(Match match, SyntaxNode newLambdaBody)
SyntaxNode? newBody,
SemanticModel oldModel,
SemanticModel newModel,
- ISymbol oldSymbol,
- ISymbol newSymbol,
+ ISymbol oldMember,
+ ISymbol newMember,
SourceText newText,
ImmutableArray oldActiveStatements,
ImmutableArray newActiveStatementSpans,
@@ -992,8 +996,6 @@ public LambdaInfo WithMatch(Match match, SyntaxNode newLambdaBody)
try
{
- ReportMemberBodyUpdateRudeEdits(diagnostics, newDeclaration, GetDiagnosticSpan(newDeclaration, EditKind.Update));
-
_testFaultInjector?.Invoke(newBody);
// Populated with active lambdas and matched lambdas.
@@ -1042,34 +1044,36 @@ public LambdaInfo WithMatch(Match match, SyntaxNode newLambdaBody)
activeNodes.Add(new ActiveNode(activeStatementIndex, oldStatementSyntax, oldEnclosingLambdaBody, statementPart, trackedNode));
}
- var bodyMatch = ComputeBodyMatch(oldBody, newBody, activeNodes.Where(n => n.EnclosingLambdaBody == null).ToArray(), diagnostics, out var oldHasStateMachineSuspensionPoint, out var newHasStateMachineSuspensionPoint);
- var map = ComputeMap(bodyMatch, activeNodes, ref lazyActiveOrMatchedLambdas, diagnostics);
+ var activeNodesInBody = activeNodes.Where(n => n.EnclosingLambdaBody == null).ToArray();
- if (oldHasStateMachineSuspensionPoint)
- {
- ReportStateMachineRudeEdits(oldModel.Compilation, oldSymbol, newBody, diagnostics);
- }
- else if (newHasStateMachineSuspensionPoint &&
- !capabilities.Grant(EditAndContinueCapabilities.NewTypeDefinition))
- {
- // Adding a state machine, either for async or iterator, will require creating a new helper class
- // so is a rude edit if the runtime doesn't support it
- if (newSymbol is IMethodSymbol { IsAsync: true })
- {
- diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.MakeMethodAsyncNotSupportedByRuntime, GetDiagnosticSpan(newDeclaration, EditKind.Insert)));
- }
- else
- {
- diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.MakeMethodIteratorNotSupportedByRuntime, GetDiagnosticSpan(newDeclaration, EditKind.Insert)));
- }
- }
+ var bodyMatch = ComputeBodyMatch(oldBody, newBody, activeNodesInBody);
+ var map = ComputeMap(bodyMatch, activeNodes, ref lazyActiveOrMatchedLambdas);
+
+ var oldStateMachineInfo = GetStateMachineInfo(oldBody);
+ var newStateMachineInfo = GetStateMachineInfo(newBody);
+ ReportStateMachineBodyUpdateRudeEdits(bodyMatch, oldStateMachineInfo, newBody, newStateMachineInfo, hasActiveStatement: activeNodesInBody.Length != 0, diagnostics);
+
+ ReportMemberOrLambdaBodyUpdateRudeEdits(
+ diagnostics,
+ oldModel,
+ oldBody,
+ oldMember,
+ newDeclaration,
+ newBody,
+ newMember,
+ bodyMatch,
+ capabilities,
+ oldStateMachineInfo,
+ newStateMachineInfo);
ReportLambdaAndClosureRudeEdits(
oldModel,
+ oldMember,
oldBody,
newModel,
newBody,
- newSymbol,
+ newMember,
+ bodyMatch,
lazyActiveOrMatchedLambdas,
map,
capabilities,
@@ -1089,7 +1093,7 @@ public LambdaInfo WithMatch(Match match, SyntaxNode newLambdaBody)
// We create syntax map even if it's not necessary: if any data member initializers are active/contain lambdas.
// Since initializers are usually simple the map should not be large enough to make it worth optimizing it away.
if (!activeNodes.IsEmpty() ||
- newHasStateMachineSuspensionPoint ||
+ newStateMachineInfo.HasSuspensionPoints ||
newBodyHasLambdas ||
IsConstructorWithMemberInitializers(newDeclaration) ||
IsDeclarationWithInitializer(oldDeclaration) ||
@@ -1350,17 +1354,16 @@ private ActiveStatement GetActiveStatementWithSpan(UnmappedActiveStatement oldSt
}
///
- /// Calculates a syntax map of the entire method body including all lambda bodies it contains (recursively).
+ /// Calculates a syntax map of the entire method body including all lambda bodies it contains.
///
private BidirectionalMap ComputeMap(
- Match bodyMatch,
- ArrayBuilder activeNodes,
- ref Dictionary? lazyActiveOrMatchedLambdas,
- ArrayBuilder diagnostics)
+ Match memberBodyMatch,
+ ArrayBuilder memberBodyActiveNodes,
+ ref Dictionary? lazyActiveOrMatchedLambdas)
{
ArrayBuilder>? lambdaBodyMatches = null;
var currentLambdaBodyMatch = -1;
- var currentBodyMatch = bodyMatch;
+ var currentBodyMatch = memberBodyMatch;
while (true)
{
@@ -1381,7 +1384,7 @@ private ActiveStatement GetActiveStatementWithSpan(UnmappedActiveStatement oldSt
var newLambdaBody1 = TryGetPartnerLambdaBody(oldLambdaBody1, newNode);
if (newLambdaBody1 != null)
{
- lambdaBodyMatches.Add(ComputeLambdaBodyMatch(oldLambdaBody1, newLambdaBody1, activeNodes, lazyActiveOrMatchedLambdas, diagnostics));
+ lambdaBodyMatches.Add(ComputeLambdaBodyMatch(oldLambdaBody1, newLambdaBody1, memberBodyActiveNodes, lazyActiveOrMatchedLambdas));
}
if (oldLambdaBody2 != null)
@@ -1389,7 +1392,7 @@ private ActiveStatement GetActiveStatementWithSpan(UnmappedActiveStatement oldSt
var newLambdaBody2 = TryGetPartnerLambdaBody(oldLambdaBody2, newNode);
if (newLambdaBody2 != null)
{
- lambdaBodyMatches.Add(ComputeLambdaBodyMatch(oldLambdaBody2, newLambdaBody2, activeNodes, lazyActiveOrMatchedLambdas, diagnostics));
+ lambdaBodyMatches.Add(ComputeLambdaBodyMatch(oldLambdaBody2, newLambdaBody2, memberBodyActiveNodes, lazyActiveOrMatchedLambdas));
}
}
}
@@ -1406,15 +1409,15 @@ private ActiveStatement GetActiveStatementWithSpan(UnmappedActiveStatement oldSt
if (lambdaBodyMatches == null)
{
- return BidirectionalMap.FromMatch(bodyMatch);
+ return BidirectionalMap.FromMatch(memberBodyMatch);
}
var map = new Dictionary();
var reverseMap = new Dictionary();
// include all matches, including the root:
- map.AddRange(bodyMatch.Matches);
- reverseMap.AddRange(bodyMatch.ReverseMatches);
+ map.AddRange(memberBodyMatch.Matches);
+ reverseMap.AddRange(memberBodyMatch.ReverseMatches);
foreach (var lambdaBodyMatch in lambdaBodyMatches)
{
@@ -1436,46 +1439,43 @@ private ActiveStatement GetActiveStatementWithSpan(UnmappedActiveStatement oldSt
private Match ComputeLambdaBodyMatch(
SyntaxNode oldLambdaBody,
SyntaxNode newLambdaBody,
- IReadOnlyList activeNodes,
- [Out] Dictionary activeOrMatchedLambdas,
- [Out] ArrayBuilder diagnostics)
+ IReadOnlyList