diff --git a/Compilers.sln b/Compilers.sln
index f64f8fed7d47a..51915cf42f962 100644
--- a/Compilers.sln
+++ b/Compilers.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27102.0
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29731.156
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.UnitTests", "src\Compilers\Core\CodeAnalysisTest\Microsoft.CodeAnalysis.UnitTests.csproj", "{A4C99B85-765C-4C65-9C2A-BB609AAB09E6}"
EndProject
@@ -118,26 +118,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSha
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.CodeAnalysis.VisualBasic.Workspaces", "src\Workspaces\VisualBasic\Portable\Microsoft.CodeAnalysis.VisualBasic.Workspaces.vbproj", "{57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeStyle", "CodeStyle", "{B20208C3-D3A6-4020-A274-6BE3786D29FB}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CodeStyle", "src\CodeStyle\Core\Analyzers\Microsoft.CodeAnalysis.CodeStyle.csproj", "{275812EE-DEDB-4232-9439-91C9757D2AE4}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CodeStyle.Fixes", "src\CodeStyle\Core\CodeFixes\Microsoft.CodeAnalysis.CodeStyle.Fixes.csproj", "{5FF1E493-69CC-4D0B-83F2-039F469A04E1}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CodeStyle.UnitTests", "src\CodeStyle\Core\Tests\Microsoft.CodeAnalysis.CodeStyle.UnitTests.csproj", "{9FF1205F-1D7C-4EE4-B038-3456FE6EBEAF}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.CodeStyle", "src\CodeStyle\CSharp\Analyzers\Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj", "{AA87BFED-089A-4096-B8D5-690BDC7D5B24}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes", "src\CodeStyle\CSharp\CodeFixes\Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj", "{A07ABCF5-BC43-4EE9-8FD8-B2D77FD54D73}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests", "src\CodeStyle\CSharp\Tests\Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests.csproj", "{5018D049-5870-465A-889B-C742CE1E31CB}"
-EndProject
-Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.CodeAnalysis.VisualBasic.CodeStyle", "src\CodeStyle\VisualBasic\Analyzers\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj", "{2531A8C4-97DD-47BC-A79C-B7846051E137}"
-EndProject
-Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes", "src\CodeStyle\VisualBasic\CodeFixes\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.vbproj", "{0141285D-8F6C-42C7-BAF3-3C0CCD61C716}"
-EndProject
-Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests", "src\CodeStyle\VisualBasic\Tests\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests.vbproj", "{E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510}"
-EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CSharpAnalyzerDriver", "src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.shproj", "{54E08BF5-F819-404F-A18D-0AB9EA81EA04}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "BasicAnalyzerDriver", "src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.shproj", "{E8F0BAA5-7327-43D1-9A51-644E81AE55F1}"
@@ -162,24 +142,27 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Net.Compilers.Too
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
- src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
- src\Dependencies\CodeAnalysis.Debugging\Microsoft.CodeAnalysis.Debugging.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
- src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
- src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4
- src\Compilers\Core\CommandLine\CommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 4
+ 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
+ src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CSharpCompilerExtensions.projitems*{21b239d0-d144-430f-a394-c066d58ee267}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CSharpWorkspaceExtensions.projitems*{21b239d0-d144-430f-a394-c066d58ee267}*SharedItemsImports = 5
+ src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 5
+ src\Compilers\Core\CommandLine\CommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 5
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{54e08bf5-f819-404f-a18d-0ab9ea81ea04}*SharedItemsImports = 13
- src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 4
- src\Compilers\Core\CommandLine\CommandLine.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 4
- src\Compilers\Core\CommandLine\CommandLine.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4
- src\Compilers\Server\ServerShared\ServerShared.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4
+ 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\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CompilerExtensions.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceExtensions.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 5
+ src\Compilers\Core\CommandLine\CommandLine.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 5
+ src\Compilers\Core\CommandLine\CommandLine.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 5
src\Compilers\Core\CommandLine\CommandLine.projitems*{ad6f474e-e6d4-4217-91f3-b7af1be31ccc}*SharedItemsImports = 13
- src\Dependencies\CodeAnalysis.Debugging\Microsoft.CodeAnalysis.Debugging.projitems*{afde6bea-5038-4a4a-a88e-dbd2e4088eed}*SharedItemsImports = 4
- src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{afde6bea-5038-4a4a-a88e-dbd2e4088eed}*SharedItemsImports = 4
- src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 4
+ src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 5
src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{c1930979-c824-496b-a630-70f5369a636f}*SharedItemsImports = 13
src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13
src\Dependencies\CodeAnalysis.Debugging\Microsoft.CodeAnalysis.Debugging.projitems*{d73adf7d-2c1c-42ae-b2ab-edc9497e4b71}*SharedItemsImports = 13
- src\Compilers\Core\CommandLine\CommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 4
+ src\Compilers\Core\CommandLine\CommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 5
src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{e8f0baa5-7327-43d1-9a51-644e81ae55f1}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -367,42 +350,6 @@ Global
{57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C}.Release|Any CPU.Build.0 = Release|Any CPU
- {275812EE-DEDB-4232-9439-91C9757D2AE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {275812EE-DEDB-4232-9439-91C9757D2AE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {275812EE-DEDB-4232-9439-91C9757D2AE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {275812EE-DEDB-4232-9439-91C9757D2AE4}.Release|Any CPU.Build.0 = Release|Any CPU
- {5FF1E493-69CC-4D0B-83F2-039F469A04E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5FF1E493-69CC-4D0B-83F2-039F469A04E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5FF1E493-69CC-4D0B-83F2-039F469A04E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5FF1E493-69CC-4D0B-83F2-039F469A04E1}.Release|Any CPU.Build.0 = Release|Any CPU
- {9FF1205F-1D7C-4EE4-B038-3456FE6EBEAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9FF1205F-1D7C-4EE4-B038-3456FE6EBEAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9FF1205F-1D7C-4EE4-B038-3456FE6EBEAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9FF1205F-1D7C-4EE4-B038-3456FE6EBEAF}.Release|Any CPU.Build.0 = Release|Any CPU
- {AA87BFED-089A-4096-B8D5-690BDC7D5B24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AA87BFED-089A-4096-B8D5-690BDC7D5B24}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AA87BFED-089A-4096-B8D5-690BDC7D5B24}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AA87BFED-089A-4096-B8D5-690BDC7D5B24}.Release|Any CPU.Build.0 = Release|Any CPU
- {A07ABCF5-BC43-4EE9-8FD8-B2D77FD54D73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A07ABCF5-BC43-4EE9-8FD8-B2D77FD54D73}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A07ABCF5-BC43-4EE9-8FD8-B2D77FD54D73}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A07ABCF5-BC43-4EE9-8FD8-B2D77FD54D73}.Release|Any CPU.Build.0 = Release|Any CPU
- {5018D049-5870-465A-889B-C742CE1E31CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5018D049-5870-465A-889B-C742CE1E31CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5018D049-5870-465A-889B-C742CE1E31CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5018D049-5870-465A-889B-C742CE1E31CB}.Release|Any CPU.Build.0 = Release|Any CPU
- {2531A8C4-97DD-47BC-A79C-B7846051E137}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2531A8C4-97DD-47BC-A79C-B7846051E137}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2531A8C4-97DD-47BC-A79C-B7846051E137}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2531A8C4-97DD-47BC-A79C-B7846051E137}.Release|Any CPU.Build.0 = Release|Any CPU
- {0141285D-8F6C-42C7-BAF3-3C0CCD61C716}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0141285D-8F6C-42C7-BAF3-3C0CCD61C716}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0141285D-8F6C-42C7-BAF3-3C0CCD61C716}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0141285D-8F6C-42C7-BAF3-3C0CCD61C716}.Release|Any CPU.Build.0 = Release|Any CPU
- {E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510}.Release|Any CPU.Build.0 = Release|Any CPU
{15FEBD1B-55CE-4EBD-85E3-04898260A25B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15FEBD1B-55CE-4EBD-85E3-04898260A25B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15FEBD1B-55CE-4EBD-85E3-04898260A25B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -489,15 +436,6 @@ Global
{5F8D2414-064A-4B3A-9B42-8E2A04246BE5} = {D9591377-7868-4D64-9314-83E0C92A871B}
{21B239D0-D144-430F-A394-C066D58EE267} = {D9591377-7868-4D64-9314-83E0C92A871B}
{57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C} = {D9591377-7868-4D64-9314-83E0C92A871B}
- {275812EE-DEDB-4232-9439-91C9757D2AE4} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
- {5FF1E493-69CC-4D0B-83F2-039F469A04E1} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
- {9FF1205F-1D7C-4EE4-B038-3456FE6EBEAF} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
- {AA87BFED-089A-4096-B8D5-690BDC7D5B24} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
- {A07ABCF5-BC43-4EE9-8FD8-B2D77FD54D73} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
- {5018D049-5870-465A-889B-C742CE1E31CB} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
- {2531A8C4-97DD-47BC-A79C-B7846051E137} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
- {0141285D-8F6C-42C7-BAF3-3C0CCD61C716} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
- {E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
{54E08BF5-F819-404F-A18D-0AB9EA81EA04} = {32A48625-F0AD-419D-828B-A50BDABA38EA}
{E8F0BAA5-7327-43D1-9A51-644E81AE55F1} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37}
{15FEBD1B-55CE-4EBD-85E3-04898260A25B} = {274B96B7-F815-47E3-9CA4-4024A57A478F}
diff --git a/Roslyn.sln b/Roslyn.sln
index d2fba318f3cdc..006dc5ba17a8f 100644
--- a/Roslyn.sln
+++ b/Roslyn.sln
@@ -330,7 +330,7 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.CodeAnalysis.Visu
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes", "src\CodeStyle\VisualBasic\CodeFixes\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.vbproj", "{0141285D-8F6C-42C7-BAF3-3C0CCD61C716}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CodeStyle.UnitTests", "src\CodeStyle\Core\Tests\Microsoft.CodeAnalysis.CodeStyle.UnitTests.csproj", "{9FF1205F-1D7C-4EE4-B038-3456FE6EBEAF}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities", "src\CodeStyle\Core\Tests\Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities.csproj", "{9FF1205F-1D7C-4EE4-B038-3456FE6EBEAF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests", "src\CodeStyle\CSharp\Tests\Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests.csproj", "{5018D049-5870-465A-889B-C742CE1E31CB}"
EndProject
@@ -458,9 +458,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compiler", "Compiler", "{7A
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workspace", "Workspace", "{9C1BE25C-5926-4E56-84AE-D2242CB0627E}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities", "src\EditorFeatures\DiagnosticsTestUtilities\Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities.csproj", "{1C2DAB75-D024-4C04-9F3F-B2F881D805EE}"
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
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\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
@@ -470,6 +473,7 @@ Global
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CSharpWorkspaceExtensions.projitems*{21b239d0-d144-430f-a394-c066d58ee267}*SharedItemsImports = 5
src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 5
src\Analyzers\VisualBasic\Analyzers\VisualBasicAnalyzers.projitems*{2531a8c4-97dd-47bc-a79c-b7846051e137}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\VisualBasicCompilerExtensions.projitems*{2531a8c4-97dd-47bc-a79c-b7846051e137}*SharedItemsImports = 5
src\Analyzers\Core\Analyzers\Analyzers.projitems*{275812ee-dedb-4232-9439-91c9757d2ae4}*SharedItemsImports = 5
src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.projitems*{275812ee-dedb-4232-9439-91c9757d2ae4}*SharedItemsImports = 5
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CompilerExtensions.projitems*{275812ee-dedb-4232-9439-91c9757d2ae4}*SharedItemsImports = 5
@@ -502,10 +506,12 @@ Global
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceExtensions.projitems*{99f594b1-3916-471d-a761-a6731fc50e9a}*SharedItemsImports = 13
src\Analyzers\VisualBasic\CodeFixes\VisualBasicCodeFixes.projitems*{9f9ccc78-7487-4127-9d46-db23e501f001}*SharedItemsImports = 13
src\Analyzers\CSharp\CodeFixes\CSharpCodeFixes.projitems*{a07abcf5-bc43-4ee9-8fd8-b2d77fd54d73}*SharedItemsImports = 5
+ src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CSharpWorkspaceExtensions.projitems*{a07abcf5-bc43-4ee9-8fd8-b2d77fd54d73}*SharedItemsImports = 5
src\Analyzers\VisualBasic\Analyzers\VisualBasicAnalyzers.projitems*{a1bcd0ce-6c2f-4f8c-9a48-d9d93928e26d}*SharedItemsImports = 5
src\Analyzers\VisualBasic\CodeFixes\VisualBasicCodeFixes.projitems*{a1bcd0ce-6c2f-4f8c-9a48-d9d93928e26d}*SharedItemsImports = 5
src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{a1bcd0ce-6c2f-4f8c-9a48-d9d93928e26d}*SharedItemsImports = 5
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
@@ -1197,6 +1203,10 @@ Global
{D55FB2BD-CC9E-454B-9654-94AF5D910BF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D55FB2BD-CC9E-454B-9654-94AF5D910BF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D55FB2BD-CC9E-454B-9654-94AF5D910BF7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1C2DAB75-D024-4C04-9F3F-B2F881D805EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1C2DAB75-D024-4C04-9F3F-B2F881D805EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1C2DAB75-D024-4C04-9F3F-B2F881D805EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1C2DAB75-D024-4C04-9F3F-B2F881D805EE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1410,6 +1420,7 @@ Global
{DF17AF27-AA02-482B-8946-5CA8A50D5A2B} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5}
{7A69EA65-4411-4CD0-B439-035E720C1BD3} = {DF17AF27-AA02-482B-8946-5CA8A50D5A2B}
{9C1BE25C-5926-4E56-84AE-D2242CB0627E} = {DF17AF27-AA02-482B-8946-5CA8A50D5A2B}
+ {1C2DAB75-D024-4C04-9F3F-B2F881D805EE} = {EE97CB90-33BB-4F3A-9B3D-69375DEC6AC6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29}
diff --git a/src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems b/src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
index 18ced76af3610..75cbcb90b5e1b 100644
--- a/src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
+++ b/src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
@@ -8,4 +8,18 @@
Microsoft.CodeAnalysis.CSharp.Analyzers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/CSharpAnalyzersResources.resx b/src/Analyzers/CSharp/Analyzers/CSharpAnalyzersResources.resx
new file mode 100644
index 0000000000000..7a3a5136e48e1
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/CSharpAnalyzersResources.resx
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+ Convert switch statement to expression
+
+
+ Use 'switch' expression
+
+
+ Use explicit type instead of 'var'
+
+
+ Use explicit type
+
+
+ use 'var' instead of explicit type
+
+
+ Use implicit type
+
+
+ Using directive is unnecessary.
+
+
\ No newline at end of file
diff --git a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionConstants.cs b/src/Analyzers/CSharp/Analyzers/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionConstants.cs
similarity index 100%
rename from src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionConstants.cs
rename to src/Analyzers/CSharp/Analyzers/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionConstants.cs
diff --git a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs b/src/Analyzers/CSharp/Analyzers/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs
similarity index 100%
rename from src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs
rename to src/Analyzers/CSharp/Analyzers/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs
diff --git a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs b/src/Analyzers/CSharp/Analyzers/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs
similarity index 86%
rename from src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs
rename to src/Analyzers/CSharp/Analyzers/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs
index 65a99d7d05f51..6479740ef837c 100644
--- a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs
+++ b/src/Analyzers/CSharp/Analyzers/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs
@@ -6,12 +6,17 @@
using System.Globalization;
using System.Linq;
using Microsoft.CodeAnalysis.CodeStyle;
-using Microsoft.CodeAnalysis.CSharp.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.PooledObjects;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle;
+#else
+using Microsoft.CodeAnalysis.CSharp.CodeStyle;
+using Microsoft.CodeAnalysis.Options;
+#endif
+
namespace Microsoft.CodeAnalysis.CSharp.ConvertSwitchStatementToExpression
{
using Constants = ConvertSwitchStatementToExpressionConstants;
@@ -23,8 +28,8 @@ public ConvertSwitchStatementToExpressionDiagnosticAnalyzer()
: base(IDEDiagnosticIds.ConvertSwitchStatementToExpressionDiagnosticId,
CSharpCodeStyleOptions.PreferSwitchExpression,
LanguageNames.CSharp,
- new LocalizableResourceString(nameof(CSharpFeaturesResources.Convert_switch_statement_to_expression), CSharpFeaturesResources.ResourceManager, typeof(CSharpFeaturesResources)),
- new LocalizableResourceString(nameof(CSharpFeaturesResources.Use_switch_expression), CSharpFeaturesResources.ResourceManager, typeof(CSharpFeaturesResources)))
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.Convert_switch_statement_to_expression), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)),
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.Use_switch_expression), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)))
{
}
@@ -48,7 +53,7 @@ private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
var options = context.Options;
var cancellationToken = context.CancellationToken;
- var optionSet = options.GetDocumentOptionSetAsync(syntaxTree, cancellationToken).GetAwaiter().GetResult();
+ var optionSet = options.GetOptions(syntaxTree, cancellationToken);
if (optionSet == null)
{
return;
@@ -90,9 +95,6 @@ private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
.Add(Constants.ShouldRemoveNextStatementKey, shouldRemoveNextStatement.ToString(CultureInfo.InvariantCulture))));
}
- public override bool OpenFileOnly(OptionSet options)
- => false;
-
public override DiagnosticAnalyzerCategory GetAnalyzerCategory()
=> DiagnosticAnalyzerCategory.SemanticSpanAnalysis;
}
diff --git a/src/Features/CSharp/Portable/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs b/src/Analyzers/CSharp/Analyzers/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs
similarity index 93%
rename from src/Features/CSharp/Portable/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs
rename to src/Analyzers/CSharp/Analyzers/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs
index 7f946fbdd7a47..c7f873fc7fc50 100644
--- a/src/Features/CSharp/Portable/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs
+++ b/src/Analyzers/CSharp/Analyzers/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs
@@ -15,8 +15,8 @@ internal sealed class CSharpMakeStructFieldsWritableDiagnosticAnalyzer : Abstrac
{
private static readonly DiagnosticDescriptor s_diagnosticDescriptor = CreateDescriptor(
IDEDiagnosticIds.MakeStructFieldsWritable,
- new LocalizableResourceString(nameof(FeaturesResources.Make_readonly_fields_writable), FeaturesResources.ResourceManager, typeof(FeaturesResources)),
- new LocalizableResourceString(nameof(FeaturesResources.Make_readonly_fields_writable), FeaturesResources.ResourceManager, typeof(FeaturesResources)),
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.Make_readonly_fields_writable), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)),
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.Make_readonly_fields_writable), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)),
isUnneccessary: false);
public CSharpMakeStructFieldsWritableDiagnosticAnalyzer()
diff --git a/src/Features/CSharp/Portable/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs b/src/Analyzers/CSharp/Analyzers/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
similarity index 90%
rename from src/Features/CSharp/Portable/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
rename to src/Analyzers/CSharp/Analyzers/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
index 1d5cbb12455c1..690f4bc1913d5 100644
--- a/src/Features/CSharp/Portable/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
+++ b/src/Analyzers/CSharp/Analyzers/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
@@ -21,11 +21,11 @@ namespace Microsoft.CodeAnalysis.CSharp.RemoveUnnecessaryImports
internal sealed class CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer :
AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer
{
- private static readonly LocalizableString s_TitleAndMessageFormat =
- new LocalizableResourceString(nameof(CSharpFeaturesResources.Using_directive_is_unnecessary), CSharpFeaturesResources.ResourceManager, typeof(CSharpFeaturesResources));
+ private static readonly LocalizableString s_titleAndMessageFormat =
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.Using_directive_is_unnecessary), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources));
protected override LocalizableString GetTitleAndMessageFormatForClassificationIdDescriptor()
- => s_TitleAndMessageFormat;
+ => s_titleAndMessageFormat;
// C# has no need to do any merging of using statements. Only VB needs to
// merge import clauses to an import statement if it all the import clauses
diff --git a/src/Features/CSharp/Portable/RemoveUnusedMembers/CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs b/src/Analyzers/CSharp/Analyzers/RemoveUnusedMembers/CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs
similarity index 100%
rename from src/Features/CSharp/Portable/RemoveUnusedMembers/CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs
rename to src/Analyzers/CSharp/Analyzers/RemoveUnusedMembers/CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs
diff --git a/src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpTypeStyleDiagnosticAnalyzerBase.cs b/src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpTypeStyleDiagnosticAnalyzerBase.cs
similarity index 93%
rename from src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpTypeStyleDiagnosticAnalyzerBase.cs
rename to src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpTypeStyleDiagnosticAnalyzerBase.cs
index be9422d9c60fe..5a087f869cd7b 100644
--- a/src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpTypeStyleDiagnosticAnalyzerBase.cs
+++ b/src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpTypeStyleDiagnosticAnalyzerBase.cs
@@ -4,13 +4,20 @@
using System.Collections.Immutable;
using Microsoft.CodeAnalysis.CodeStyle;
-using Microsoft.CodeAnalysis.CSharp.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Utilities;
using Microsoft.CodeAnalysis.Diagnostics;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Text;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle;
+using Microsoft.CodeAnalysis.Internal.Options;
+using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
+#else
+using Microsoft.CodeAnalysis.CSharp.CodeStyle;
+using Microsoft.CodeAnalysis.Options;
+#endif
+
namespace Microsoft.CodeAnalysis.CSharp.Diagnostics.TypeStyle
{
internal abstract partial class CSharpTypeStyleDiagnosticAnalyzerBase :
@@ -50,7 +57,7 @@ private void HandleVariableDeclaration(SyntaxNodeAnalysisContext context)
var options = context.Options;
var syntaxTree = context.Node.SyntaxTree;
var cancellationToken = context.CancellationToken;
- var optionSet = options.GetDocumentOptionSetAsync(syntaxTree, cancellationToken).GetAwaiter().GetResult();
+ var optionSet = options.GetOptions(syntaxTree, cancellationToken);
if (optionSet == null)
{
return;
diff --git a/src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpUseExplicitTypeDiagnosticAnalyzer.cs b/src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpUseExplicitTypeDiagnosticAnalyzer.cs
similarity index 73%
rename from src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpUseExplicitTypeDiagnosticAnalyzer.cs
rename to src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpUseExplicitTypeDiagnosticAnalyzer.cs
index 36f32c29e145d..5a8016473b58e 100644
--- a/src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpUseExplicitTypeDiagnosticAnalyzer.cs
+++ b/src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpUseExplicitTypeDiagnosticAnalyzer.cs
@@ -11,10 +11,10 @@ namespace Microsoft.CodeAnalysis.CSharp.Diagnostics.TypeStyle
internal sealed class CSharpUseExplicitTypeDiagnosticAnalyzer : CSharpTypeStyleDiagnosticAnalyzerBase
{
private static readonly LocalizableString s_Title =
- new LocalizableResourceString(nameof(CSharpFeaturesResources.Use_explicit_type), CSharpFeaturesResources.ResourceManager, typeof(CSharpFeaturesResources));
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.Use_explicit_type), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources));
private static readonly LocalizableString s_Message =
- new LocalizableResourceString(nameof(CSharpFeaturesResources.Use_explicit_type_instead_of_var), CSharpFeaturesResources.ResourceManager, typeof(CSharpFeaturesResources));
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.Use_explicit_type_instead_of_var), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources));
protected override CSharpTypeStyleHelper Helper => CSharpUseExplicitTypeHelper.Instance;
diff --git a/src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpUseImplicitTypeDiagnosticAnalyzer.cs b/src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpUseImplicitTypeDiagnosticAnalyzer.cs
similarity index 73%
rename from src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpUseImplicitTypeDiagnosticAnalyzer.cs
rename to src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpUseImplicitTypeDiagnosticAnalyzer.cs
index 61c0b5bcec2d9..ddd863b4d86e5 100644
--- a/src/Features/CSharp/Portable/Diagnostics/Analyzers/CSharpUseImplicitTypeDiagnosticAnalyzer.cs
+++ b/src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpUseImplicitTypeDiagnosticAnalyzer.cs
@@ -11,10 +11,10 @@ namespace Microsoft.CodeAnalysis.CSharp.Diagnostics.TypeStyle
internal sealed class CSharpUseImplicitTypeDiagnosticAnalyzer : CSharpTypeStyleDiagnosticAnalyzerBase
{
private static readonly LocalizableString s_Title =
- new LocalizableResourceString(nameof(CSharpFeaturesResources.Use_implicit_type), CSharpFeaturesResources.ResourceManager, typeof(CSharpFeaturesResources));
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.Use_implicit_type), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources));
private static readonly LocalizableString s_Message =
- new LocalizableResourceString(nameof(CSharpFeaturesResources.use_var_instead_of_explicit_type), CSharpFeaturesResources.ResourceManager, typeof(CSharpFeaturesResources));
+ new LocalizableResourceString(nameof(CSharpAnalyzersResources.use_var_instead_of_explicit_type), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources));
protected override CSharpTypeStyleHelper Helper => CSharpUseImplicitTypeHelper.Instance;
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.cs.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.cs.xlf
new file mode 100644
index 0000000000000..41e4343826eef
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.cs.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.de.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.de.xlf
new file mode 100644
index 0000000000000..1fa732976bc70
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.de.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.es.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.es.xlf
new file mode 100644
index 0000000000000..e86b6fd743550
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.es.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.fr.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.fr.xlf
new file mode 100644
index 0000000000000..91e381942a969
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.fr.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.it.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.it.xlf
new file mode 100644
index 0000000000000..f8127025883aa
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.it.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ja.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ja.xlf
new file mode 100644
index 0000000000000..493c9858e58ea
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ja.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ko.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ko.xlf
new file mode 100644
index 0000000000000..0670bd07fdf91
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ko.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pl.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pl.xlf
new file mode 100644
index 0000000000000..313c3713ae648
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pl.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pt-BR.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pt-BR.xlf
new file mode 100644
index 0000000000000..b60b78635247a
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pt-BR.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ru.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ru.xlf
new file mode 100644
index 0000000000000..51a6c4515b829
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ru.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.tr.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.tr.xlf
new file mode 100644
index 0000000000000..ab24c1f9d8194
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.tr.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hans.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hans.xlf
new file mode 100644
index 0000000000000..a137e0031ea66
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hans.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hant.xlf b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hant.xlf
new file mode 100644
index 0000000000000..528244822866b
--- /dev/null
+++ b/src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.zh-Hant.xlf
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ Convert switch statement to expression
+
+
+
+
+ Make readonly fields writable
+ {Locked="readonly"} "readonly" is C# keyword and should not be localized.
+
+
+
+ Use explicit type
+
+
+
+
+ Use explicit type instead of 'var'
+
+
+
+
+ Use implicit type
+
+
+
+
+ Use 'switch' expression
+
+
+
+
+ Using directive is unnecessary.
+
+
+
+
+ use 'var' instead of explicit type
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
index 3a21b34bea507..426f864366797 100644
--- a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
+++ b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
@@ -8,4 +8,16 @@
Microsoft.CodeAnalysis.CSharp.CodeFixes
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixesResources.resx b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixesResources.resx
new file mode 100644
index 0000000000000..0fa3bc0af6cdf
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixesResources.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Remove Unnecessary Usings
+
+
\ No newline at end of file
diff --git a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs b/src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs
similarity index 100%
rename from src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs
rename to src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs
diff --git a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs
similarity index 96%
rename from src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs
rename to src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs
index 89109bac18706..ce99a31c5e424 100644
--- a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs
+++ b/src/Analyzers/CSharp/CodeFixes/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs
@@ -94,10 +94,10 @@ protected override async Task FixAllAsync(Document document, ImmutableArray> createChangedDocument)
- : base(CSharpFeaturesResources.Convert_switch_statement_to_expression, createChangedDocument)
+ : base(CSharpAnalyzersResources.Convert_switch_statement_to_expression, createChangedDocument)
{
}
}
diff --git a/src/Features/CSharp/Portable/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs
similarity index 94%
rename from src/Features/CSharp/Portable/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs
rename to src/Analyzers/CSharp/CodeFixes/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs
index ca5d6ead8a516..32e1d43f720b0 100644
--- a/src/Features/CSharp/Portable/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs
+++ b/src/Analyzers/CSharp/CodeFixes/MakeStructFieldsWritable/CSharpMakeStructFieldsWritableCodeFixProvider.cs
@@ -72,10 +72,10 @@ protected override Task FixAllAsync(
return Task.CompletedTask;
}
- private class MyCodeAction : CodeAction.DocumentChangeAction
+ private class MyCodeAction : CustomCodeActions.DocumentChangeAction
{
public MyCodeAction(Func> createChangedDocument)
- : base(FeaturesResources.Make_readonly_fields_writable, createChangedDocument)
+ : base(CSharpAnalyzersResources.Make_readonly_fields_writable, createChangedDocument)
{
}
}
diff --git a/src/Features/CSharp/Portable/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsCodeFixProvider.cs
similarity index 92%
rename from src/Features/CSharp/Portable/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsCodeFixProvider.cs
rename to src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsCodeFixProvider.cs
index 279270cdedacb..086959c98c7b5 100644
--- a/src/Features/CSharp/Portable/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsCodeFixProvider.cs
+++ b/src/Analyzers/CSharp/CodeFixes/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsCodeFixProvider.cs
@@ -18,6 +18,6 @@ public CSharpRemoveUnnecessaryImportsCodeFixProvider()
}
protected override string GetTitle()
- => CSharpFeaturesResources.Remove_Unnecessary_Usings;
+ => CSharpCodeFixesResources.Remove_Unnecessary_Usings;
}
}
diff --git a/src/Features/CSharp/Portable/RemoveUnusedMembers/CSharpRemoveUnusedMembersCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/RemoveUnusedMembers/CSharpRemoveUnusedMembersCodeFixProvider.cs
similarity index 100%
rename from src/Features/CSharp/Portable/RemoveUnusedMembers/CSharpRemoveUnusedMembersCodeFixProvider.cs
rename to src/Analyzers/CSharp/CodeFixes/RemoveUnusedMembers/CSharpRemoveUnusedMembersCodeFixProvider.cs
diff --git a/src/Features/CSharp/Portable/TypeStyle/UseExplicitTypeCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseExplicitTypeCodeFixProvider.cs
similarity index 96%
rename from src/Features/CSharp/Portable/TypeStyle/UseExplicitTypeCodeFixProvider.cs
rename to src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseExplicitTypeCodeFixProvider.cs
index b9fc257d48219..de0bd69146452 100644
--- a/src/Features/CSharp/Portable/TypeStyle/UseExplicitTypeCodeFixProvider.cs
+++ b/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseExplicitTypeCodeFixProvider.cs
@@ -158,12 +158,12 @@ private static ExpressionSyntax GenerateTupleDeclaration(ITypeSymbol typeSymbol,
.WithTrailingTrivia(parensDesignation.GetTrailingTrivia());
}
- private class MyCodeAction : CodeAction.DocumentChangeAction
+ private class MyCodeAction : CustomCodeActions.DocumentChangeAction
{
public MyCodeAction(Func> createChangedDocument)
- : base(CSharpFeaturesResources.Use_explicit_type_instead_of_var,
+ : base(CSharpAnalyzersResources.Use_explicit_type_instead_of_var,
createChangedDocument,
- CSharpFeaturesResources.Use_explicit_type_instead_of_var)
+ CSharpAnalyzersResources.Use_explicit_type_instead_of_var)
{
}
}
diff --git a/src/Features/CSharp/Portable/TypeStyle/UseImplicitTypeCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseImplicitTypeCodeFixProvider.cs
similarity index 91%
rename from src/Features/CSharp/Portable/TypeStyle/UseImplicitTypeCodeFixProvider.cs
rename to src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseImplicitTypeCodeFixProvider.cs
index 8bb23b62b5567..68d0b39828e3d 100644
--- a/src/Features/CSharp/Portable/TypeStyle/UseImplicitTypeCodeFixProvider.cs
+++ b/src/Analyzers/CSharp/CodeFixes/UseImplicitOrExplicitType/UseImplicitTypeCodeFixProvider.cs
@@ -61,12 +61,12 @@ internal static void ReplaceTypeWithVar(SyntaxEditor editor, SyntaxNode node)
editor.ReplaceNode(node, implicitType);
}
- private class MyCodeAction : CodeAction.DocumentChangeAction
+ private class MyCodeAction : CustomCodeActions.DocumentChangeAction
{
public MyCodeAction(Func> createChangedDocument)
- : base(CSharpFeaturesResources.use_var_instead_of_explicit_type,
+ : base(CSharpAnalyzersResources.use_var_instead_of_explicit_type,
createChangedDocument,
- CSharpFeaturesResources.use_var_instead_of_explicit_type)
+ CSharpAnalyzersResources.use_var_instead_of_explicit_type)
{
}
}
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.cs.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.cs.xlf
new file mode 100644
index 0000000000000..83634e639a670
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.cs.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.de.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.de.xlf
new file mode 100644
index 0000000000000..04a6b5b230d99
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.de.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.es.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.es.xlf
new file mode 100644
index 0000000000000..a497d47ea7999
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.es.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.fr.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.fr.xlf
new file mode 100644
index 0000000000000..e6ca85c182096
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.fr.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.it.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.it.xlf
new file mode 100644
index 0000000000000..40223718d3388
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.it.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ja.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ja.xlf
new file mode 100644
index 0000000000000..371fbaad95807
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ja.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ko.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ko.xlf
new file mode 100644
index 0000000000000..0e536c63f1947
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ko.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pl.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pl.xlf
new file mode 100644
index 0000000000000..bbc685aaae351
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pl.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pt-BR.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pt-BR.xlf
new file mode 100644
index 0000000000000..94d6b21e2a368
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pt-BR.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ru.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ru.xlf
new file mode 100644
index 0000000000000..0ca6a99e6fc4d
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ru.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.tr.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.tr.xlf
new file mode 100644
index 0000000000000..86a6aa1579fe4
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.tr.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hans.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hans.xlf
new file mode 100644
index 0000000000000..b412e0b764e21
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hans.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hant.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hant.xlf
new file mode 100644
index 0000000000000..91ebe54d92312
--- /dev/null
+++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hant.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Usings
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems b/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
index fd6f6a1d6daff..fe7ed340241a6 100644
--- a/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
+++ b/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems
@@ -8,4 +8,16 @@
Microsoft.CodeAnalysis.CSharp.Analyzers.UnitTests
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/EditorFeatures/CSharpTest/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionFixAllTests.cs b/src/Analyzers/CSharp/Tests/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionFixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionFixAllTests.cs
rename to src/Analyzers/CSharp/Tests/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionFixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionTests.cs b/src/Analyzers/CSharp/Tests/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionTests.cs
rename to src/Analyzers/CSharp/Tests/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionTests.cs
index 3c4f7f6a796b0..df9ff295604cb 100644
--- a/src/EditorFeatures/CSharpTest/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionTests.cs
+++ b/src/Analyzers/CSharp/Tests/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionTests.cs
@@ -5,8 +5,6 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeFixes;
-using Microsoft.CodeAnalysis.CodeStyle;
-using Microsoft.CodeAnalysis.CSharp.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.ConvertSwitchStatementToExpression;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
using Microsoft.CodeAnalysis.Diagnostics;
@@ -15,6 +13,14 @@
using Roslyn.Test.Utilities;
using Xunit;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle;
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.CodeStyle;
+using Microsoft.CodeAnalysis.CSharp.CodeStyle;
+#endif
+
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ConvertSwitchStatementToExpression
{
public partial class ConvertSwitchStatementToExpressionTests : AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
diff --git a/src/EditorFeatures/CSharpTest/MakeStructFieldsWritable/MakeStructFieldsWritableTests.cs b/src/Analyzers/CSharp/Tests/MakeStructFieldsWritable/MakeStructFieldsWritableTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/MakeStructFieldsWritable/MakeStructFieldsWritableTests.cs
rename to src/Analyzers/CSharp/Tests/MakeStructFieldsWritable/MakeStructFieldsWritableTests.cs
diff --git a/src/EditorFeatures/CSharpTest/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.cs b/src/Analyzers/CSharp/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.cs
rename to src/Analyzers/CSharp/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.cs
diff --git a/src/EditorFeatures/CSharpTest/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests_FixAllTests.cs b/src/Analyzers/CSharp/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests_FixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests_FixAllTests.cs
rename to src/Analyzers/CSharp/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests_FixAllTests.cs
diff --git a/src/EditorFeatures/CSharpTest/RemoveUnusedMembers/RemoveUnusedMembersTests.cs b/src/Analyzers/CSharp/Tests/RemoveUnusedMembers/RemoveUnusedMembersTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/RemoveUnusedMembers/RemoveUnusedMembersTests.cs
rename to src/Analyzers/CSharp/Tests/RemoveUnusedMembers/RemoveUnusedMembersTests.cs
index 20670aa4b59f9..02c38d24a9646 100644
--- a/src/EditorFeatures/CSharpTest/RemoveUnusedMembers/RemoveUnusedMembersTests.cs
+++ b/src/Analyzers/CSharp/Tests/RemoveUnusedMembers/RemoveUnusedMembersTests.cs
@@ -1096,7 +1096,7 @@ public void M()
using var workspace = CreateWorkspaceFromOptions(source, testParameters);
var diagnostics = await GetDiagnosticsAsync(workspace, testParameters).ConfigureAwait(false);
diagnostics.Verify(Diagnostic("IDE0052", "P").WithLocation(3, 17));
- var expectedMessage = string.Format(FeaturesResources.Private_property_0_can_be_converted_to_a_method_as_its_get_accessor_is_never_invoked, "MyClass.P");
+ var expectedMessage = string.Format(AnalyzersResources.Private_property_0_can_be_converted_to_a_method_as_its_get_accessor_is_never_invoked, "MyClass.P");
Assert.Equal(expectedMessage, diagnostics.Single().GetMessage());
}
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests.cs b/src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseExplicitTypeTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests.cs
rename to src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseExplicitTypeTests.cs
index 46f57a2e0c96a..2a0d8fa07f40e 100644
--- a/src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests.cs
+++ b/src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseExplicitTypeTests.cs
@@ -5,16 +5,22 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeFixes;
-using Microsoft.CodeAnalysis.CodeStyle;
-using Microsoft.CodeAnalysis.CSharp.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.Diagnostics.TypeStyle;
using Microsoft.CodeAnalysis.CSharp.TypeStyle;
using Microsoft.CodeAnalysis.Diagnostics;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle;
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.CodeStyle;
+using Microsoft.CodeAnalysis.CSharp.CodeStyle;
+using Microsoft.CodeAnalysis.Options;
+#endif
+
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics.UseExplicitType
{
public partial class UseExplicitTypeTests : AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
@@ -470,6 +476,9 @@ void Method(Program? x)
await TestInRegularAndScriptAsync(before, after, options: ExplicitTypeExceptWhereApparent());
}
+#if !CODE_STYLE // Tests depending on product code which need new nullable APIs are disabled for Code Style layer
+ // https://github.com/dotnet/roslyn/issues/41462 tracks enabling these tests for Code Style layer
+
[WpfFact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExplicitType)]
[WorkItem(40477, "https://github.com/dotnet/roslyn/issues/40477")]
public async Task NullableType()
@@ -963,6 +972,7 @@ void Method(System.Collections.Generic.IEnumerable<(Program, Program)> x)
await TestMissingInRegularAndScriptAsync(before, new TestParameters(options: ExplicitTypeForBuiltInTypesOnly()));
await TestInRegularAndScriptAsync(before, after, options: ExplicitTypeExceptWhereApparent());
}
+#endif
[WpfFact, Trait(Traits.Feature, Traits.Features.CodeActionsUseExplicitType)]
[WorkItem(23907, "https://github.com/dotnet/roslyn/issues/23907")]
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests_FixAllTests.cs b/src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseExplicitTypeTests_FixAllTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests_FixAllTests.cs
rename to src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseExplicitTypeTests_FixAllTests.cs
index cb99d76c85ac8..b2a1a8f6666ab 100644
--- a/src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseExplicitTypeTests_FixAllTests.cs
+++ b/src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseExplicitTypeTests_FixAllTests.cs
@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System.Threading.Tasks;
-using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Test.Utilities;
using Xunit;
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseImplicitTypeTests.cs b/src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseImplicitTypeTests.cs
similarity index 99%
rename from src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseImplicitTypeTests.cs
rename to src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseImplicitTypeTests.cs
index 1246727595952..c59efd6d94e35 100644
--- a/src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseImplicitTypeTests.cs
+++ b/src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseImplicitTypeTests.cs
@@ -5,17 +5,23 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeFixes;
-using Microsoft.CodeAnalysis.CodeStyle;
using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.CodeStyle;
using Microsoft.CodeAnalysis.CSharp.Diagnostics.TypeStyle;
using Microsoft.CodeAnalysis.CSharp.TypeStyle;
using Microsoft.CodeAnalysis.Diagnostics;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.CSharp.Internal.CodeStyle;
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.CodeStyle;
+using Microsoft.CodeAnalysis.CSharp.CodeStyle;
+using Microsoft.CodeAnalysis.Options;
+#endif
+
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics.UseImplicitType
{
public partial class UseImplicitTypeTests : AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest
diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseImplicitTypeTests_FixAllTests.cs b/src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseImplicitTypeTests_FixAllTests.cs
similarity index 100%
rename from src/EditorFeatures/CSharpTest/Diagnostics/UseImplicitOrExplicitType/UseImplicitTypeTests_FixAllTests.cs
rename to src/Analyzers/CSharp/Tests/UseImplicitOrExplicitType/UseImplicitTypeTests_FixAllTests.cs
diff --git a/src/Features/Core/Portable/CodeStyle/AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs b/src/Analyzers/Core/Analyzers/AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs
similarity index 98%
rename from src/Features/Core/Portable/CodeStyle/AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs
rename to src/Analyzers/Core/Analyzers/AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs
index 467e3ada0737b..bb4303e7ed823 100644
--- a/src/Features/Core/Portable/CodeStyle/AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs
+++ b/src/Analyzers/Core/Analyzers/AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs
@@ -6,10 +6,16 @@
using System.Diagnostics;
using System.Linq;
using Microsoft.CodeAnalysis.Diagnostics;
-using Microsoft.CodeAnalysis.Options;
namespace Microsoft.CodeAnalysis.CodeStyle
{
+#if CODE_STYLE
+ using OptionSet = AnalyzerConfigOptions;
+ using Microsoft.CodeAnalysis.Internal.Options;
+#else
+ using Microsoft.CodeAnalysis.Options;
+#endif
+
internal abstract class AbstractBuiltInCodeStyleDiagnosticAnalyzer : AbstractCodeStyleDiagnosticAnalyzer, IBuiltInAnalyzer
{
///
diff --git a/src/Features/Core/Portable/CodeQuality/AbstractCodeQualityDiagnosticAnalyzer.cs b/src/Analyzers/Core/Analyzers/AbstractCodeQualityDiagnosticAnalyzer.cs
similarity index 80%
rename from src/Features/Core/Portable/CodeQuality/AbstractCodeQualityDiagnosticAnalyzer.cs
rename to src/Analyzers/Core/Analyzers/AbstractCodeQualityDiagnosticAnalyzer.cs
index 45c9f3f4c8daf..3594b9219eef9 100644
--- a/src/Features/Core/Portable/CodeQuality/AbstractCodeQualityDiagnosticAnalyzer.cs
+++ b/src/Analyzers/Core/Analyzers/AbstractCodeQualityDiagnosticAnalyzer.cs
@@ -4,12 +4,25 @@
using System.Collections.Immutable;
using Microsoft.CodeAnalysis.Diagnostics;
-using Microsoft.CodeAnalysis.Options;
namespace Microsoft.CodeAnalysis.CodeQuality
{
+#if CODE_STYLE
+ using OptionSet = AnalyzerConfigOptions;
+#else
+ using OptionSet = Options.OptionSet;
+#endif
+
+ // Consider moving all the CodeQuality diagnostic analyzers into analyzer repo as CA rules.
internal abstract class AbstractCodeQualityDiagnosticAnalyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
{
+ // Diagnostics in CodeStyle layer should be warnings by default.
+#if CODE_STYLE
+ private const DiagnosticSeverity DefaultSeverity = DiagnosticSeverity.Warning;
+#else
+ private const DiagnosticSeverity DefaultSeverity = DiagnosticSeverity.Info;
+#endif
+
private readonly GeneratedCodeAnalysisFlags _generatedCodeAnalysisFlags;
protected AbstractCodeQualityDiagnosticAnalyzer(
@@ -49,7 +62,7 @@ protected static DiagnosticDescriptor CreateDescriptor(
=> new DiagnosticDescriptor(
id, title, messageFormat,
DiagnosticCategory.CodeQuality,
- DiagnosticSeverity.Info,
+ DefaultSeverity,
isEnabledByDefault,
description,
customTags: DiagnosticCustomTags.Create(isUnneccessary, isConfigurable, customTags));
diff --git a/src/CodeStyle/Core/Analyzers/AbstractCodeStyleDiagnosticAnalyzer.cs b/src/Analyzers/Core/Analyzers/AbstractCodeStyleDiagnosticAnalyzer.cs
similarity index 93%
rename from src/CodeStyle/Core/Analyzers/AbstractCodeStyleDiagnosticAnalyzer.cs
rename to src/Analyzers/Core/Analyzers/AbstractCodeStyleDiagnosticAnalyzer.cs
index 43d61fbbadbef..69f35b0f840a7 100644
--- a/src/CodeStyle/Core/Analyzers/AbstractCodeStyleDiagnosticAnalyzer.cs
+++ b/src/Analyzers/Core/Analyzers/AbstractCodeStyleDiagnosticAnalyzer.cs
@@ -9,6 +9,13 @@ namespace Microsoft.CodeAnalysis.CodeStyle
{
internal abstract class AbstractCodeStyleDiagnosticAnalyzer : DiagnosticAnalyzer
{
+ // Diagnostics in CodeStyle layer should be warnings by default.
+#if CODE_STYLE
+ private const DiagnosticSeverity DefaultSeverity = DiagnosticSeverity.Warning;
+#else
+ private const DiagnosticSeverity DefaultSeverity = DiagnosticSeverity.Hidden;
+#endif
+
protected readonly string DescriptorId;
protected readonly DiagnosticDescriptor Descriptor;
@@ -88,7 +95,7 @@ protected static DiagnosticDescriptor CreateDescriptorWithId(
=> new DiagnosticDescriptor(
id, title, messageFormat,
DiagnosticCategory.Style,
- DiagnosticSeverity.Hidden,
+ !isUnneccessary ? DefaultSeverity : DiagnosticSeverity.Hidden,
isEnabledByDefault: true,
description: description,
customTags: DiagnosticCustomTags.Create(isUnneccessary, isConfigurable, customTags));
diff --git a/src/Analyzers/Core/Analyzers/Analyzers.projitems b/src/Analyzers/Core/Analyzers/Analyzers.projitems
index 835232f3a5a06..cdfe32e390e3d 100644
--- a/src/Analyzers/Core/Analyzers/Analyzers.projitems
+++ b/src/Analyzers/Core/Analyzers/Analyzers.projitems
@@ -8,4 +8,22 @@
Microsoft.CodeAnalysis.Analyzers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/AnalyzersResources.resx b/src/Analyzers/Core/Analyzers/AnalyzersResources.resx
new file mode 100644
index 0000000000000..006db427523aa
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/AnalyzersResources.resx
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Private member '{0}' is unused.
+
+
+ Remove unused private members
+
+
+ Remove unread private members
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
\ No newline at end of file
diff --git a/src/Features/Core/Portable/Diagnostics/DiagnosticAnalyzerCategory.cs b/src/Analyzers/Core/Analyzers/DiagnosticAnalyzerCategory.cs
similarity index 100%
rename from src/Features/Core/Portable/Diagnostics/DiagnosticAnalyzerCategory.cs
rename to src/Analyzers/Core/Analyzers/DiagnosticAnalyzerCategory.cs
diff --git a/src/Features/Core/Portable/Diagnostics/DiagnosticCategory.cs b/src/Analyzers/Core/Analyzers/DiagnosticCategory.cs
similarity index 100%
rename from src/Features/Core/Portable/Diagnostics/DiagnosticCategory.cs
rename to src/Analyzers/Core/Analyzers/DiagnosticCategory.cs
diff --git a/src/Features/Core/Portable/Diagnostics/DiagnosticCustomTags.cs b/src/Analyzers/Core/Analyzers/DiagnosticCustomTags.cs
similarity index 100%
rename from src/Features/Core/Portable/Diagnostics/DiagnosticCustomTags.cs
rename to src/Analyzers/Core/Analyzers/DiagnosticCustomTags.cs
diff --git a/src/Features/Core/Portable/Shared/Utilities/DeserializationConstructorCheck.cs b/src/Analyzers/Core/Analyzers/Helpers/DeserializationConstructorCheck.cs
similarity index 100%
rename from src/Features/Core/Portable/Shared/Utilities/DeserializationConstructorCheck.cs
rename to src/Analyzers/Core/Analyzers/Helpers/DeserializationConstructorCheck.cs
diff --git a/src/Features/Core/Portable/Diagnostics/DiagnosticHelper.cs b/src/Analyzers/Core/Analyzers/Helpers/DiagnosticHelper.cs
similarity index 98%
rename from src/Features/Core/Portable/Diagnostics/DiagnosticHelper.cs
rename to src/Analyzers/Core/Analyzers/Helpers/DiagnosticHelper.cs
index 23047b9a9a867..0c9c410009b62 100644
--- a/src/Features/Core/Portable/Diagnostics/DiagnosticHelper.cs
+++ b/src/Analyzers/Core/Analyzers/Helpers/DiagnosticHelper.cs
@@ -10,7 +10,6 @@
using System.Runtime.Serialization.Json;
using System.Text;
using Microsoft.CodeAnalysis.PooledObjects;
-using Microsoft.CodeAnalysis.RemoveUnnecessaryParentheses;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.Diagnostics
@@ -74,7 +73,7 @@ public static Diagnostic Create(
///
///
/// a map of location tag to index in additional locations.
- /// for an example of usage.
+ /// see AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer for an example of usage.
///
/// Arguments to the message of the diagnostic.
/// The instance.
diff --git a/src/Features/Core/Portable/Diagnostics/IBuiltInAnalyzer.cs b/src/Analyzers/Core/Analyzers/IBuiltInAnalyzer.cs
similarity index 92%
rename from src/Features/Core/Portable/Diagnostics/IBuiltInAnalyzer.cs
rename to src/Analyzers/Core/Analyzers/IBuiltInAnalyzer.cs
index 4113fdb398894..58b3342a2440d 100644
--- a/src/Features/Core/Portable/Diagnostics/IBuiltInAnalyzer.cs
+++ b/src/Analyzers/Core/Analyzers/IBuiltInAnalyzer.cs
@@ -2,10 +2,14 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.CodeAnalysis.Options;
-
namespace Microsoft.CodeAnalysis.Diagnostics
{
+#if CODE_STYLE
+ using OptionSet = AnalyzerConfigOptions;
+#else
+ using OptionSet = Options.OptionSet;
+#endif
+
///
/// This interface is a marker for all the analyzers that are built in.
/// We will record non-fatal-watson if any analyzer with this interface throws an exception.
diff --git a/src/Features/Core/Portable/Diagnostics/Analyzers/IDEDiagnosticIdToOptionMappingHelper.cs b/src/Analyzers/Core/Analyzers/IDEDiagnosticIdToOptionMappingHelper.cs
similarity index 97%
rename from src/Features/Core/Portable/Diagnostics/Analyzers/IDEDiagnosticIdToOptionMappingHelper.cs
rename to src/Analyzers/Core/Analyzers/IDEDiagnosticIdToOptionMappingHelper.cs
index 2f3e060422969..25683466748a9 100644
--- a/src/Features/Core/Portable/Diagnostics/Analyzers/IDEDiagnosticIdToOptionMappingHelper.cs
+++ b/src/Analyzers/Core/Analyzers/IDEDiagnosticIdToOptionMappingHelper.cs
@@ -7,7 +7,12 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
+
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
using Microsoft.CodeAnalysis.Options;
+#endif
namespace Microsoft.CodeAnalysis.Diagnostics
{
diff --git a/src/Features/Core/Portable/Diagnostics/Analyzers/IDEDiagnosticIds.cs b/src/Analyzers/Core/Analyzers/IDEDiagnosticIds.cs
similarity index 100%
rename from src/Features/Core/Portable/Diagnostics/Analyzers/IDEDiagnosticIds.cs
rename to src/Analyzers/Core/Analyzers/IDEDiagnosticIds.cs
diff --git a/src/Features/Core/Portable/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs b/src/Analyzers/Core/Analyzers/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
similarity index 98%
rename from src/Features/Core/Portable/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
rename to src/Analyzers/Core/Analyzers/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
index 22eb06d5bde29..c60632e9f9ebc 100644
--- a/src/Features/Core/Portable/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
+++ b/src/Analyzers/Core/Analyzers/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
@@ -8,13 +8,19 @@
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.Diagnostics;
-using Microsoft.CodeAnalysis.Fading;
using Microsoft.CodeAnalysis.LanguageServices;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.Internal.Fading;
+using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
+#else
+using Microsoft.CodeAnalysis.Fading;
+using Microsoft.CodeAnalysis.Options;
+#endif
+
namespace Microsoft.CodeAnalysis.RemoveUnnecessaryImports
{
internal abstract class AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer
diff --git a/src/Features/Core/Portable/RemoveUnusedMembers/AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs b/src/Analyzers/Core/Analyzers/RemoveUnusedMembers/AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs
similarity index 97%
rename from src/Features/Core/Portable/RemoveUnusedMembers/AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs
rename to src/Analyzers/Core/Analyzers/RemoveUnusedMembers/AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs
index e2d98ece72a82..86fbd5abddd0c 100644
--- a/src/Features/Core/Portable/RemoveUnusedMembers/AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs
+++ b/src/Analyzers/Core/Analyzers/RemoveUnusedMembers/AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs
@@ -25,15 +25,15 @@ internal abstract class AbstractRemoveUnusedMembersDiagnosticAnalyzer
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.de.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.de.xlf
new file mode 100644
index 0000000000000..498d962bf5a16
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.de.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.es.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.es.xlf
new file mode 100644
index 0000000000000..410d344c3fabc
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.es.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.fr.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.fr.xlf
new file mode 100644
index 0000000000000..6e6ff02f36fc4
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.fr.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.it.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.it.xlf
new file mode 100644
index 0000000000000..7b63778518f78
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.it.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ja.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ja.xlf
new file mode 100644
index 0000000000000..a7372b064ff71
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ja.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ko.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ko.xlf
new file mode 100644
index 0000000000000..1cd95ca2ad1f5
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ko.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pl.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pl.xlf
new file mode 100644
index 0000000000000..3bcf3e59a4d1a
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pl.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pt-BR.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pt-BR.xlf
new file mode 100644
index 0000000000000..7a51052aedcf2
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.pt-BR.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ru.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ru.xlf
new file mode 100644
index 0000000000000..66c1ebc9c910b
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.ru.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.tr.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.tr.xlf
new file mode 100644
index 0000000000000..f79dd2881321c
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.tr.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hans.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hans.xlf
new file mode 100644
index 0000000000000..065c3fe73b297
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hans.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hant.xlf b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hant.xlf
new file mode 100644
index 0000000000000..ffb2c56a92fa6
--- /dev/null
+++ b/src/Analyzers/Core/Analyzers/xlf/AnalyzersResources.zh-Hant.xlf
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+ Private member '{0}' can be removed as the value assigned to it is never read.
+
+
+
+
+ Private member '{0}' is unused.
+
+
+
+
+ Private method '{0}' can be removed as it is never invoked.
+
+
+
+
+ Private property '{0}' can be converted to a method as its get accessor is never invoked.
+
+
+
+
+ Remove unread private members
+
+
+
+
+ Remove unused private members
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/CodeFixes.projitems b/src/Analyzers/Core/CodeFixes/CodeFixes.projitems
index 1f4c475613ded..f35655448b391 100644
--- a/src/Analyzers/Core/CodeFixes/CodeFixes.projitems
+++ b/src/Analyzers/Core/CodeFixes/CodeFixes.projitems
@@ -8,4 +8,12 @@
Microsoft.CodeAnalysis.CodeFixes
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/CodeFixesResources.resx b/src/Analyzers/Core/CodeFixes/CodeFixesResources.resx
new file mode 100644
index 0000000000000..6286bd89d8bda
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/CodeFixesResources.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Remove unused member
+
+
\ No newline at end of file
diff --git a/src/Features/Core/Portable/CodeFixes/PredefinedCodeFixProviderNames.cs b/src/Analyzers/Core/CodeFixes/PredefinedCodeFixProviderNames.cs
similarity index 100%
rename from src/Features/Core/Portable/CodeFixes/PredefinedCodeFixProviderNames.cs
rename to src/Analyzers/Core/CodeFixes/PredefinedCodeFixProviderNames.cs
diff --git a/src/Features/Core/Portable/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsCodeFixProvider.cs
similarity index 100%
rename from src/Features/Core/Portable/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsCodeFixProvider.cs
rename to src/Analyzers/Core/CodeFixes/RemoveUnnecessaryImports/AbstractRemoveUnnecessaryImportsCodeFixProvider.cs
diff --git a/src/Features/Core/Portable/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs
similarity index 97%
rename from src/Features/Core/Portable/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs
rename to src/Analyzers/Core/CodeFixes/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs
index 7efd256298e83..a89a61a4a4fb4 100644
--- a/src/Features/Core/Portable/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs
+++ b/src/Analyzers/Core/CodeFixes/RemoveUnusedMembers/AbstractRemoveUnusedMembersCodeFixProvider.cs
@@ -123,12 +123,13 @@ protected static void AdjustAndAddAppropriateDeclaratorsToRemove(SyntaxNode pare
}
}
- private class MyCodeAction : CodeAction.DocumentChangeAction
+ private class MyCodeAction : CustomCodeActions.DocumentChangeAction
{
public MyCodeAction(Func> createChangedDocument)
- : base(FeaturesResources.Remove_unused_member, createChangedDocument)
+ : base(CodeFixesResources.Remove_unused_member, createChangedDocument)
{
}
}
}
}
+
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.cs.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.cs.xlf
new file mode 100644
index 0000000000000..0aadbca67849d
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.cs.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.de.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.de.xlf
new file mode 100644
index 0000000000000..75df42ce49ffe
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.de.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.es.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.es.xlf
new file mode 100644
index 0000000000000..591606cd23a71
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.es.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.fr.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.fr.xlf
new file mode 100644
index 0000000000000..1ad3e99f44ea2
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.fr.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.it.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.it.xlf
new file mode 100644
index 0000000000000..c4dcd2abb708d
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.it.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ja.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ja.xlf
new file mode 100644
index 0000000000000..a0073c0953ab4
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ja.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ko.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ko.xlf
new file mode 100644
index 0000000000000..a5a7a4cda4a89
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ko.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pl.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pl.xlf
new file mode 100644
index 0000000000000..6fff60f559211
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pl.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pt-BR.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pt-BR.xlf
new file mode 100644
index 0000000000000..624207c5b5e5f
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pt-BR.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ru.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ru.xlf
new file mode 100644
index 0000000000000..3422358616da9
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ru.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.tr.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.tr.xlf
new file mode 100644
index 0000000000000..e20e1000cd04a
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.tr.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hans.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hans.xlf
new file mode 100644
index 0000000000000..a10943cbb611f
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hans.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hant.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hant.xlf
new file mode 100644
index 0000000000000..147cd90852095
--- /dev/null
+++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hant.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove unused member
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Features/VisualBasic/Portable/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb b/src/Analyzers/VisualBasic/Analyzers/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb
similarity index 94%
rename from src/Features/VisualBasic/Portable/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb
rename to src/Analyzers/VisualBasic/Analyzers/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb
index 1b11c6b060a1a..b0cb99a0c513e 100644
--- a/src/Features/VisualBasic/Portable/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb
+++ b/src/Analyzers/VisualBasic/Analyzers/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsDiagnosticAnalyzer.vb
@@ -17,7 +17,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryImports
Inherits AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer
Private Shared ReadOnly s_TitleAndMessageFormat As LocalizableString =
- New LocalizableResourceString(NameOf(VBFeaturesResources.Imports_statement_is_unnecessary), VBFeaturesResources.ResourceManager, GetType(VBFeaturesResources.VBFeaturesResources))
+ New LocalizableResourceString(NameOf(VisualBasicAnalyzersResources.Imports_statement_is_unnecessary), VisualBasicAnalyzersResources.ResourceManager, GetType(VisualBasicAnalyzersResources))
Protected Overrides Function GetTitleAndMessageFormatForClassificationIdDescriptor() As LocalizableString
Return s_TitleAndMessageFormat
diff --git a/src/Features/VisualBasic/Portable/RemoveUnusedMembers/VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb b/src/Analyzers/VisualBasic/Analyzers/RemoveUnusedMembers/VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb
similarity index 100%
rename from src/Features/VisualBasic/Portable/RemoveUnusedMembers/VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb
rename to src/Analyzers/VisualBasic/Analyzers/RemoveUnusedMembers/VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb
diff --git a/src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems b/src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
index f3339d0e8322b..79bdb1bfc56f9 100644
--- a/src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
+++ b/src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzers.projitems
@@ -8,4 +8,11 @@
Microsoft.CodeAnalysis.VisualBasic.Analyzers
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzersResources.resx b/src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzersResources.resx
new file mode 100644
index 0000000000000..6cf27cf64b08e
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/VisualBasicAnalyzersResources.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Imports statement is unnecessary.
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.cs.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.cs.xlf
new file mode 100644
index 0000000000000..579abb858302d
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.cs.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.de.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.de.xlf
new file mode 100644
index 0000000000000..31120dfc6584d
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.de.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.es.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.es.xlf
new file mode 100644
index 0000000000000..a911d3a74b874
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.es.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.fr.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.fr.xlf
new file mode 100644
index 0000000000000..f3658e0106798
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.fr.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.it.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.it.xlf
new file mode 100644
index 0000000000000..bf12bd6fef681
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.it.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ja.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ja.xlf
new file mode 100644
index 0000000000000..4b5f2770f970d
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ja.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ko.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ko.xlf
new file mode 100644
index 0000000000000..bfe754350a3c2
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ko.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.pl.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.pl.xlf
new file mode 100644
index 0000000000000..9eee58372b626
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.pl.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.pt-BR.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.pt-BR.xlf
new file mode 100644
index 0000000000000..1284298bed50b
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.pt-BR.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ru.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ru.xlf
new file mode 100644
index 0000000000000..74cabc8569602
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.ru.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.tr.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.tr.xlf
new file mode 100644
index 0000000000000..5b1641f003ba4
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.tr.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.zh-Hans.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.zh-Hans.xlf
new file mode 100644
index 0000000000000..5a4f2857e3eae
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.zh-Hans.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.zh-Hant.xlf b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.zh-Hant.xlf
new file mode 100644
index 0000000000000..595dcb9968dd7
--- /dev/null
+++ b/src/Analyzers/VisualBasic/Analyzers/xlf/VisualBasicAnalyzersResources.zh-Hant.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Imports statement is unnecessary.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Features/VisualBasic/Portable/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsCodeFixProvider.vb
similarity index 92%
rename from src/Features/VisualBasic/Portable/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsCodeFixProvider.vb
rename to src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsCodeFixProvider.vb
index 7989daab5a04c..e5aa91550bc86 100644
--- a/src/Features/VisualBasic/Portable/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsCodeFixProvider.vb
+++ b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnnecessaryImports/VisualBasicRemoveUnnecessaryImportsCodeFixProvider.vb
@@ -18,7 +18,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryImports
End Sub
Protected Overrides Function GetTitle() As String
- Return VBFeaturesResources.Remove_Unnecessary_Imports
+ Return VisualBasicCodeFixesResources.Remove_Unnecessary_Imports
End Function
End Class
End Namespace
diff --git a/src/Features/VisualBasic/Portable/RemoveUnusedMembers/VisualBasicRemoveUnusedMembersCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/RemoveUnusedMembers/VisualBasicRemoveUnusedMembersCodeFixProvider.vb
similarity index 100%
rename from src/Features/VisualBasic/Portable/RemoveUnusedMembers/VisualBasicRemoveUnusedMembersCodeFixProvider.vb
rename to src/Analyzers/VisualBasic/CodeFixes/RemoveUnusedMembers/VisualBasicRemoveUnusedMembersCodeFixProvider.vb
diff --git a/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems b/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
index eed7dac7f5d66..e700dab7a348d 100644
--- a/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
+++ b/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems
@@ -8,4 +8,11 @@
Microsoft.CodeAnalysis.VisualBasic.CodeFixes
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixesResources.resx b/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixesResources.resx
new file mode 100644
index 0000000000000..09b97e6c440a9
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixesResources.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Remove Unnecessary Imports
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.cs.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.cs.xlf
new file mode 100644
index 0000000000000..555342ffe1150
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.cs.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.de.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.de.xlf
new file mode 100644
index 0000000000000..a9d89d9445ab5
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.de.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.es.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.es.xlf
new file mode 100644
index 0000000000000..dd2518cc469d9
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.es.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.fr.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.fr.xlf
new file mode 100644
index 0000000000000..dedadf4d1f2ee
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.fr.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.it.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.it.xlf
new file mode 100644
index 0000000000000..e74df4226f7e4
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.it.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ja.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ja.xlf
new file mode 100644
index 0000000000000..35076ab1c8898
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ja.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ko.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ko.xlf
new file mode 100644
index 0000000000000..e74347336c0bc
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ko.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pl.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pl.xlf
new file mode 100644
index 0000000000000..5e43bbedbe6c0
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pl.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pt-BR.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pt-BR.xlf
new file mode 100644
index 0000000000000..2f1cd7930c0d0
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pt-BR.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ru.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ru.xlf
new file mode 100644
index 0000000000000..bc92945efc796
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ru.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.tr.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.tr.xlf
new file mode 100644
index 0000000000000..0333553460761
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.tr.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hans.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hans.xlf
new file mode 100644
index 0000000000000..b3d956ab71d5c
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hans.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hant.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hant.xlf
new file mode 100644
index 0000000000000..ddacccfc2a1e6
--- /dev/null
+++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hant.xlf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ Remove Unnecessary Imports
+
+
+
+
+
\ No newline at end of file
diff --git a/src/EditorFeatures/VisualBasicTest/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.vb b/src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.vb
similarity index 100%
rename from src/EditorFeatures/VisualBasicTest/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.vb
rename to src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests.vb
diff --git a/src/EditorFeatures/VisualBasicTest/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests_FixAllTests.vb b/src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests_FixAllTests.vb
similarity index 100%
rename from src/EditorFeatures/VisualBasicTest/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests_FixAllTests.vb
rename to src/Analyzers/VisualBasic/Tests/RemoveUnnecessaryImports/RemoveUnnecessaryImportsTests_FixAllTests.vb
diff --git a/src/EditorFeatures/VisualBasicTest/RemoveUnusedMembers/RemoveUnusedMembersTests.vb b/src/Analyzers/VisualBasic/Tests/RemoveUnusedMembers/RemoveUnusedMembersTests.vb
similarity index 100%
rename from src/EditorFeatures/VisualBasicTest/RemoveUnusedMembers/RemoveUnusedMembersTests.vb
rename to src/Analyzers/VisualBasic/Tests/RemoveUnusedMembers/RemoveUnusedMembersTests.vb
diff --git a/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems b/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
index 6c5681358ea13..f44dc5b8742ad 100644
--- a/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
+++ b/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems
@@ -8,4 +8,9 @@
Microsoft.CodeAnalysis.VisualBasic.Analyzers.UnitTests
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CodeStyle/BannedSymbols.txt b/src/CodeStyle/BannedSymbols.txt
new file mode 100644
index 0000000000000..c606990637777
--- /dev/null
+++ b/src/CodeStyle/BannedSymbols.txt
@@ -0,0 +1,8 @@
+P:Microsoft.CodeAnalysis.Project.LanguageServices; Use 'GetExtendedLanguageServices' instead in CodeStyle layer (preprocessor variable 'CODE_STYLE')
+M:Microsoft.CodeAnalysis.Host.HostWorkspaceServices.GetLanguageServices(System.String); Use 'GetExtendedLanguageServices' or directly get the language service by invoking 'GetLanguageService' or 'GetRequiredLanguageService' in CodeStyle layer (preprocessor variable 'CODE_STYLE')
+T:Microsoft.CodeAnalysis.Options.OptionSet; 'OptionSet' is not available in CodeStyle layer. Add a using/Imports statement defining 'OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions' when preprocessor variable 'CODE_STYLE' is defined
+T:Microsoft.CodeAnalysis.CodeStyle.CodeStyleOption`1; Use 'Microsoft.CodeAnalysis.Internal.Options.CodeStyleOption' instead in CodeStyle layer (preprocessor variable 'CODE_STYLE')
+T:Microsoft.CodeAnalysis.CodeStyle.CodeStyleOptions; Use 'Microsoft.CodeAnalysis.Internal.Options.CodeStyleOptions' instead in CodeStyle layer (preprocessor variable 'CODE_STYLE')
+T:Microsoft.CodeAnalysis.Options.IOption; Use 'Microsoft.CodeAnalysis.Internal.Options.IOption' instead in CodeStyle layer (preprocessor variable 'CODE_STYLE')
+T:Microsoft.CodeAnalysis.Options.OptionKey; Use 'Microsoft.CodeAnalysis.Internal.Options.OptionKey' instead in CodeStyle layer (preprocessor variable 'CODE_STYLE')
+T:Microsoft.CodeAnalysis.CodeStyle.NotificationOption; Use 'Microsoft.CodeAnalysis.Internal.Options.NotificationOption' instead in CodeStyle layer (preprocessor variable 'CODE_STYLE')
\ No newline at end of file
diff --git a/src/CodeStyle/CSharp/Analyzers/CSharpCodeStyleResources.Designer.cs b/src/CodeStyle/CSharp/Analyzers/CSharpCodeStyleResources.Designer.cs
index 10a27950593c6..54afb1516779e 100644
--- a/src/CodeStyle/CSharp/Analyzers/CSharpCodeStyleResources.Designer.cs
+++ b/src/CodeStyle/CSharp/Analyzers/CSharpCodeStyleResources.Designer.cs
@@ -10,7 +10,6 @@
namespace Microsoft.CodeAnalysis.CSharp {
using System;
- using System.Reflection;
///
@@ -20,7 +19,7 @@ namespace Microsoft.CodeAnalysis.CSharp {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class CSharpCodeStyleResources {
@@ -40,7 +39,7 @@ internal CSharpCodeStyleResources() {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.CSharp.CSharpCodeStyleResources", typeof(CSharpCodeStyleResources).GetTypeInfo().Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.CSharp.CSharpCodeStyleResources", typeof(CSharpCodeStyleResources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -61,6 +60,33 @@ internal CSharpCodeStyleResources() {
}
}
+ ///
+ /// Looks up a localized string similar to Code-block preferences.
+ ///
+ internal static string Code_block_preferences {
+ get {
+ return ResourceManager.GetString("Code_block_preferences", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Convert switch statement to expression.
+ ///
+ internal static string Convert_switch_statement_to_expression {
+ get {
+ return ResourceManager.GetString("Convert_switch_statement_to_expression", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Expression-bodied members.
+ ///
+ internal static string Expression_bodied_members {
+ get {
+ return ResourceManager.GetString("Expression_bodied_members", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Indentation preferences.
///
@@ -70,6 +96,33 @@ internal static string Indentation_preferences {
}
}
+ ///
+ /// Looks up a localized string similar to Make readonly fields writable.
+ ///
+ internal static string Make_readonly_fields_writable {
+ get {
+ return ResourceManager.GetString("Make_readonly_fields_writable", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Null-checking preferences.
+ ///
+ internal static string Null_checking_preferences {
+ get {
+ return ResourceManager.GetString("Null_checking_preferences", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Pattern matching preferences.
+ ///
+ internal static string Pattern_matching_preferences {
+ get {
+ return ResourceManager.GetString("Pattern_matching_preferences", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Space preferences.
///
@@ -79,6 +132,78 @@ internal static string Space_preferences {
}
}
+ ///
+ /// Looks up a localized string similar to Use explicit type.
+ ///
+ internal static string Use_explicit_type {
+ get {
+ return ResourceManager.GetString("Use_explicit_type", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Use explicit type instead of 'var'.
+ ///
+ internal static string Use_explicit_type_instead_of_var {
+ get {
+ return ResourceManager.GetString("Use_explicit_type_instead_of_var", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Use implicit type.
+ ///
+ internal static string Use_implicit_type {
+ get {
+ return ResourceManager.GetString("Use_implicit_type", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Use 'switch' expression.
+ ///
+ internal static string Use_switch_expression {
+ get {
+ return ResourceManager.GetString("Use_switch_expression", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to use 'var' instead of explicit type.
+ ///
+ internal static string use_var_instead_of_explicit_type {
+ get {
+ return ResourceManager.GetString("use_var_instead_of_explicit_type", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Using directive is unnecessary..
+ ///
+ internal static string Using_directive_is_unnecessary {
+ get {
+ return ResourceManager.GetString("Using_directive_is_unnecessary", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to 'using' directive preferences.
+ ///
+ internal static string using_directive_preferences {
+ get {
+ return ResourceManager.GetString("using_directive_preferences", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to var preferences.
+ ///
+ internal static string var_preferences {
+ get {
+ return ResourceManager.GetString("var_preferences", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Wrapping preferences.
///
diff --git a/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj b/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj
index 2789180c47c9b..e43000b2dd28a 100644
--- a/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj
+++ b/src/CodeStyle/CSharp/Analyzers/Microsoft.CodeAnalysis.CSharp.CodeStyle.csproj
@@ -19,11 +19,6 @@
-
-
-
-
-
@@ -76,7 +71,6 @@
-
-
+
\ No newline at end of file
diff --git a/src/CodeStyle/CSharp/CodeFixes/CSharpCodeStyleFixesResources.Designer.cs b/src/CodeStyle/CSharp/CodeFixes/CSharpCodeStyleFixesResources.Designer.cs
index 6326dd3c354e1..fd3bc473bb51d 100644
--- a/src/CodeStyle/CSharp/CodeFixes/CSharpCodeStyleFixesResources.Designer.cs
+++ b/src/CodeStyle/CSharp/CodeFixes/CSharpCodeStyleFixesResources.Designer.cs
@@ -10,7 +10,6 @@
namespace Microsoft.CodeAnalysis.CSharp {
using System;
- using System.Reflection;
///
@@ -20,7 +19,7 @@ namespace Microsoft.CodeAnalysis.CSharp {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class CSharpCodeStyleFixesResources {
@@ -40,7 +39,7 @@ internal CSharpCodeStyleFixesResources() {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.CSharp.CSharpCodeStyleFixesResources", typeof(CSharpCodeStyleFixesResources).GetTypeInfo().Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.CodeAnalysis.CSharp.CSharpCodeStyleFixesResources", typeof(CSharpCodeStyleFixesResources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -62,11 +61,29 @@ internal CSharpCodeStyleFixesResources() {
}
///
- /// Looks up a localized string similar to Remove this value when another is added..
+ /// Looks up a localized string similar to Convert switch statement to expression.
///
- internal static string EmptyResource {
+ internal static string Convert_switch_statement_to_expression {
get {
- return ResourceManager.GetString("EmptyResource", resourceCulture);
+ return ResourceManager.GetString("Convert_switch_statement_to_expression", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Expected string or char literal.
+ ///
+ internal static string Expected_string_or_char_literal {
+ get {
+ return ResourceManager.GetString("Expected_string_or_char_literal", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Remove Unnecessary Usings.
+ ///
+ internal static string Remove_Unnecessary_Usings {
+ get {
+ return ResourceManager.GetString("Remove_Unnecessary_Usings", resourceCulture);
}
}
}
diff --git a/src/CodeStyle/CSharp/CodeFixes/Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj b/src/CodeStyle/CSharp/CodeFixes/Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj
index d0715648d9ba9..eb028423c6224 100644
--- a/src/CodeStyle/CSharp/CodeFixes/Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj
+++ b/src/CodeStyle/CSharp/CodeFixes/Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.csproj
@@ -22,14 +22,14 @@
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.CodeStyle\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CSharp.CodeStyle.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CodeStyle.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CodeStyle.Fixes.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.CodeStyle\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CSharp.CodeStyle.resources.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.resources.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CodeStyle.resources.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CodeStyle.Fixes.resources.dll"/>
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.CodeStyle\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CSharp.CodeStyle.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CodeStyle.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CodeStyle.Fixes.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.CodeStyle\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CSharp.CodeStyle.resources.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes.resources.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CodeStyle.resources.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CodeStyle.Fixes.resources.dll" />
@@ -38,7 +38,7 @@
-
+
@@ -63,7 +63,6 @@
-
-
+
\ No newline at end of file
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.cs.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.cs.xlf
index 6eef083c31512..09e16175e8135 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.cs.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.cs.xlf
@@ -4,7 +4,7 @@
- Odebrat tuto hodnotu, když se přidá jiná
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.de.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.de.xlf
index b119ad5a5e8c0..036233e7dfffe 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.de.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.de.xlf
@@ -4,7 +4,7 @@
- Dieser Wert wird entfernt, wenn ein anderer hinzugefügt wird.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.es.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.es.xlf
index 1b4fa23371d84..39997e977d2e9 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.es.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.es.xlf
@@ -4,7 +4,7 @@
- Quite este valor cuando se agregue otro.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.fr.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.fr.xlf
index 7e6ae49c0448c..d1d9ec1ca4fdc 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.fr.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.fr.xlf
@@ -4,7 +4,7 @@
- Supprimer cette valeur quand une autre est ajoutée.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.it.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.it.xlf
index 63c2bde38d7c9..0a605965058a1 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.it.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.it.xlf
@@ -4,7 +4,7 @@
- Rimuovere questo valore quando ne viene aggiunto un altro.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ja.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ja.xlf
index f4006c0f79c55..0f32c9e649e41 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ja.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ja.xlf
@@ -4,7 +4,7 @@
- 別の値が追加されたら、この値を削除します。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ko.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ko.xlf
index 340f9c313b082..bf8710ae41ec4 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ko.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ko.xlf
@@ -4,7 +4,7 @@
- 다른 값을 추가할 때 이 값을 제거하세요.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.pl.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.pl.xlf
index 8e6d438112ac1..00099a3217091 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.pl.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.pl.xlf
@@ -4,7 +4,7 @@
- Usuń tę wartość, gdy dodawana jest kolejna.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.pt-BR.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.pt-BR.xlf
index afcd0a6e16671..4749986bfc9c8 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.pt-BR.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.pt-BR.xlf
@@ -4,7 +4,7 @@
- Remover este valor quando outro for adicionado.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ru.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ru.xlf
index c048734bdb588..f11932234113a 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ru.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.ru.xlf
@@ -4,7 +4,7 @@
- Удалите это значение при добавлении другого значения.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.tr.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.tr.xlf
index 294e6c4b454e9..0e444a4ea7587 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.tr.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.tr.xlf
@@ -4,7 +4,7 @@
- Başka bir değer eklendiğinde bu değeri kaldırın.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.zh-Hans.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.zh-Hans.xlf
index be6877b951bb0..dde51a473e211 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.zh-Hans.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.zh-Hans.xlf
@@ -4,7 +4,7 @@
- 在添加其他值时删除此值。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.zh-Hant.xlf b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.zh-Hant.xlf
index 8daad74a19618..d80ad5734d427 100644
--- a/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.zh-Hant.xlf
+++ b/src/CodeStyle/CSharp/CodeFixes/xlf/CSharpCodeStyleFixesResources.zh-Hant.xlf
@@ -4,7 +4,7 @@
- 當新增另一個值時移除此值。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/CSharp/Tests/Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests.csproj b/src/CodeStyle/CSharp/Tests/Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests.csproj
index aea9438b0fc68..1f69ee6cdb58a 100644
--- a/src/CodeStyle/CSharp/Tests/Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests.csproj
+++ b/src/CodeStyle/CSharp/Tests/Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests.csproj
@@ -4,13 +4,13 @@
Library
Microsoft.CodeAnalysis.CSharp
+ $(DefineConstants),CODE_STYLE
net472
true
-
@@ -18,6 +18,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CodeStyle/Core/Analyzers/AnalyzerConfigOptions.cs b/src/CodeStyle/Core/Analyzers/CompilerAnalyzerConfigOptions.cs
similarity index 100%
rename from src/CodeStyle/Core/Analyzers/AnalyzerConfigOptions.cs
rename to src/CodeStyle/Core/Analyzers/CompilerAnalyzerConfigOptions.cs
diff --git a/src/CodeStyle/Core/Analyzers/DiagnosticCategory.cs b/src/CodeStyle/Core/Analyzers/DiagnosticCategory.cs
deleted file mode 100644
index 056c7c6893115..0000000000000
--- a/src/CodeStyle/Core/Analyzers/DiagnosticCategory.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace Microsoft.CodeAnalysis.CodeStyle
-{
- internal static class DiagnosticCategory
- {
- public const string Style = nameof(Style);
- }
-}
diff --git a/src/CodeStyle/Core/Analyzers/Formatting/Formatter.cs b/src/CodeStyle/Core/Analyzers/Formatting/Formatter.cs
index bc62a7993cda9..b47d2c4151bc2 100644
--- a/src/CodeStyle/Core/Analyzers/Formatting/Formatter.cs
+++ b/src/CodeStyle/Core/Analyzers/Formatting/Formatter.cs
@@ -6,16 +6,21 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Formatting.Rules;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
-namespace Microsoft.CodeAnalysis.Formatting
+namespace Microsoft.CodeAnalysis.Internal.Formatting
{
///
/// Formats whitespace in documents or syntax trees.
///
+ ///
+ /// This utility class is only to be used by the formatting analyzer and formatting code fixer in Code Style layer.
+ /// Other components should use the public "Formatter" type defined in "Microsoft.CodeAnalysis.Formatting" namespace.
+ ///
internal static class Formatter
{
///
diff --git a/src/CodeStyle/Core/Analyzers/FormattingAnalyzerHelper.cs b/src/CodeStyle/Core/Analyzers/FormattingAnalyzerHelper.cs
index f2623226cc4e1..5aba5abd6aa31 100644
--- a/src/CodeStyle/Core/Analyzers/FormattingAnalyzerHelper.cs
+++ b/src/CodeStyle/Core/Analyzers/FormattingAnalyzerHelper.cs
@@ -8,6 +8,7 @@
#if CODE_STYLE
using FormatterState = Microsoft.CodeAnalysis.Formatting.ISyntaxFormattingService;
+using Formatter = Microsoft.CodeAnalysis.Internal.Formatting.Formatter;
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
#else
using Microsoft.CodeAnalysis.Options;
diff --git a/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj b/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj
index 62152fbdd56f4..2fd17b15decbe 100644
--- a/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj
+++ b/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj
@@ -26,9 +26,8 @@
-
-
+
diff --git a/src/CodeStyle/Core/Analyzers/Options/AnalyzerConfigOptionsExtensions.cs b/src/CodeStyle/Core/Analyzers/Options/AnalyzerConfigOptionsExtensions.cs
index bff66da9b2c7b..8687a3dd5f07e 100644
--- a/src/CodeStyle/Core/Analyzers/Options/AnalyzerConfigOptionsExtensions.cs
+++ b/src/CodeStyle/Core/Analyzers/Options/AnalyzerConfigOptionsExtensions.cs
@@ -2,7 +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 Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Internal.Options;
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
namespace Microsoft.CodeAnalysis
diff --git a/src/CodeStyle/Core/Analyzers/Options/AnalyzerOptionsExtensions.cs b/src/CodeStyle/Core/Analyzers/Options/AnalyzerOptionsExtensions.cs
new file mode 100644
index 0000000000000..ba085918e9776
--- /dev/null
+++ b/src/CodeStyle/Core/Analyzers/Options/AnalyzerOptionsExtensions.cs
@@ -0,0 +1,14 @@
+// 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.Threading;
+
+namespace Microsoft.CodeAnalysis.Diagnostics
+{
+ internal static partial class AnalyzerOptionsExtensions
+ {
+ public static AnalyzerConfigOptions GetOptions(this AnalyzerOptions analyzerOptions, SyntaxTree syntaxTree, CancellationToken cancellationToken)
+ => analyzerOptions.AnalyzerConfigOptionsProvider.GetOptions(syntaxTree);
+ }
+}
diff --git a/src/CodeStyle/Core/CodeFixes/CodeStyleFixesResources.Designer.cs b/src/CodeStyle/Core/CodeFixes/CodeStyleFixesResources.Designer.cs
index 5cbe2992fc17c..a179f6613491a 100644
--- a/src/CodeStyle/Core/CodeFixes/CodeStyleFixesResources.Designer.cs
+++ b/src/CodeStyle/Core/CodeFixes/CodeStyleFixesResources.Designer.cs
@@ -106,6 +106,15 @@ internal static string Project_of_ID_0_is_required_to_accomplish_the_task_but_is
}
}
+ ///
+ /// Looks up a localized string similar to Remove unused member.
+ ///
+ internal static string Remove_unused_member {
+ get {
+ return ResourceManager.GetString("Remove_unused_member", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Supplied diagnostic cannot be null..
///
diff --git a/src/CodeStyle/Core/CodeFixes/FormattingCodeFixHelper.cs b/src/CodeStyle/Core/CodeFixes/FormattingCodeFixHelper.cs
index 428404b7fa002..55b2b1a9a7c1e 100644
--- a/src/CodeStyle/Core/CodeFixes/FormattingCodeFixHelper.cs
+++ b/src/CodeStyle/Core/CodeFixes/FormattingCodeFixHelper.cs
@@ -2,16 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#if CODE_STYLE
-extern alias CodeStyle;
-#endif
-
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Text;
#if CODE_STYLE
-using Formatter = CodeStyle::Microsoft.CodeAnalysis.Formatting.Formatter;
+using Formatter = Microsoft.CodeAnalysis.Internal.Formatting.Formatter;
using FormatterState = Microsoft.CodeAnalysis.Formatting.ISyntaxFormattingService;
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
#else
diff --git a/src/CodeStyle/Core/CodeFixes/FormattingCodeFixProvider.cs b/src/CodeStyle/Core/CodeFixes/FormattingCodeFixProvider.cs
index 9e197ebe0da8b..e590dbdfffbb2 100644
--- a/src/CodeStyle/Core/CodeFixes/FormattingCodeFixProvider.cs
+++ b/src/CodeStyle/Core/CodeFixes/FormattingCodeFixProvider.cs
@@ -16,8 +16,7 @@
namespace Microsoft.CodeAnalysis.CodeStyle
{
- extern alias CodeStyle;
- using Formatter = CodeStyle::Microsoft.CodeAnalysis.Formatting.Formatter;
+ using Formatter = Internal.Formatting.Formatter;
using ISyntaxFormattingService = ISyntaxFormattingService;
internal abstract class AbstractFormattingCodeFixProvider : CodeFixProvider
diff --git a/src/CodeStyle/Core/CodeFixes/Host/Mef/CodeStyleHostLanguageServices.MefHostExportProvider.cs b/src/CodeStyle/Core/CodeFixes/Host/Mef/CodeStyleHostLanguageServices.MefHostExportProvider.cs
new file mode 100644
index 0000000000000..d7c3af1bdd1b1
--- /dev/null
+++ b/src/CodeStyle/Core/CodeFixes/Host/Mef/CodeStyleHostLanguageServices.MefHostExportProvider.cs
@@ -0,0 +1,70 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Composition.Hosting;
+using System.Linq;
+using System.Reflection;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.PooledObjects;
+
+namespace Microsoft.CodeAnalysis.Host
+{
+ internal sealed partial class CodeStyleHostLanguageServices : HostLanguageServices
+ {
+ private sealed class MefHostExportProvider : IMefHostExportProvider
+ {
+ private readonly CompositionHost _compositionContext;
+
+ public MefHostExportProvider(string languageName)
+ {
+ var assemblies = CreateAssemblies(languageName);
+ var compositionConfiguration = new ContainerConfiguration().WithAssemblies(assemblies);
+ _compositionContext = compositionConfiguration.CreateContainer();
+ }
+
+ private static ImmutableArray CreateAssemblies(string languageName)
+ {
+ using var disposer = ArrayBuilder.GetInstance(out var assemblyNames);
+
+ assemblyNames.Add("Microsoft.CodeAnalysis.CodeStyle.Fixes");
+ switch (languageName)
+ {
+ case LanguageNames.CSharp:
+ assemblyNames.Add("Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes");
+ break;
+
+ case LanguageNames.VisualBasic:
+ assemblyNames.Add("Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes");
+ break;
+ }
+
+ return MefHostServices.DefaultAssemblies.Concat(
+ MefHostServicesHelpers.LoadNearbyAssemblies(assemblyNames));
+ }
+
+
+ IEnumerable> IMefHostExportProvider.GetExports()
+ {
+ return _compositionContext.GetExports().Select(e => new Lazy(() => e));
+ }
+
+ IEnumerable> IMefHostExportProvider.GetExports()
+ {
+ var importer = new WithMetadataImporter();
+ _compositionContext.SatisfyImports(importer);
+ return importer.Exports;
+ }
+
+ private class WithMetadataImporter
+ {
+ [ImportMany]
+ public IEnumerable> Exports { get; set; }
+ }
+ }
+ }
+}
diff --git a/src/CodeStyle/Core/CodeFixes/Host/Mef/CodeStyleHostLanguageServices.cs b/src/CodeStyle/Core/CodeFixes/Host/Mef/CodeStyleHostLanguageServices.cs
new file mode 100644
index 0000000000000..46f7f32f77eb2
--- /dev/null
+++ b/src/CodeStyle/Core/CodeFixes/Host/Mef/CodeStyleHostLanguageServices.cs
@@ -0,0 +1,46 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#nullable enable
+
+using System.Collections.Concurrent;
+using System.Diagnostics.CodeAnalysis;
+using Microsoft.CodeAnalysis.Host.Mef;
+
+namespace Microsoft.CodeAnalysis.Host
+{
+ internal sealed partial class CodeStyleHostLanguageServices : HostLanguageServices
+ {
+ private static readonly ConcurrentDictionary s_mappedLanguageServices =
+ new ConcurrentDictionary();
+
+ private readonly HostLanguageServices _hostLanguageServices;
+ private readonly HostLanguageServices _codeStyleLanguageServices;
+
+ private CodeStyleHostLanguageServices(HostLanguageServices hostLanguageServices)
+ {
+ _hostLanguageServices = hostLanguageServices;
+
+ var exportProvider = new MefHostExportProvider(hostLanguageServices.Language);
+ _codeStyleLanguageServices = new MefWorkspaceServices(exportProvider, hostLanguageServices.WorkspaceServices.Workspace)
+ .GetLanguageServices(hostLanguageServices.Language);
+ }
+
+ public static CodeStyleHostLanguageServices? GetMappedCodeStyleLanguageServices(HostLanguageServices? hostLanguageServices)
+ => hostLanguageServices != null ? s_mappedLanguageServices.GetOrAdd(hostLanguageServices, Create) : null;
+ public static CodeStyleHostLanguageServices GetRequiredMappedCodeStyleLanguageServices(HostLanguageServices hostLanguageServices)
+ => s_mappedLanguageServices.GetOrAdd(hostLanguageServices, Create);
+ private static CodeStyleHostLanguageServices Create(HostLanguageServices hostLanguageServices)
+ => new CodeStyleHostLanguageServices(hostLanguageServices);
+
+ public override HostWorkspaceServices WorkspaceServices => _hostLanguageServices.WorkspaceServices;
+ public override string Language => _hostLanguageServices.Language;
+
+ [return: MaybeNull]
+ public override TLanguageService GetService()
+ {
+ return _codeStyleLanguageServices.GetService() ?? _hostLanguageServices.GetService();
+ }
+ }
+}
diff --git a/src/CodeStyle/Core/CodeFixes/Microsoft.CodeAnalysis.CodeStyle.Fixes.csproj b/src/CodeStyle/Core/CodeFixes/Microsoft.CodeAnalysis.CodeStyle.Fixes.csproj
index a47f73ec25b44..77179947b294b 100644
--- a/src/CodeStyle/Core/CodeFixes/Microsoft.CodeAnalysis.CodeStyle.Fixes.csproj
+++ b/src/CodeStyle/Core/CodeFixes/Microsoft.CodeAnalysis.CodeStyle.Fixes.csproj
@@ -8,19 +8,17 @@
$(DefineConstants),CODE_STYLE
-
-
+
-
diff --git a/src/CodeStyle/Core/Tests/Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities.csproj b/src/CodeStyle/Core/Tests/Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities.csproj
new file mode 100644
index 0000000000000..c86d1148f5de4
--- /dev/null
+++ b/src/CodeStyle/Core/Tests/Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities.csproj
@@ -0,0 +1,31 @@
+
+
+
+
+ Library
+ Microsoft.CodeAnalysis
+ $(DefineConstants),CODE_STYLE
+ net472
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CodeStyle/Core/Tests/Microsoft.CodeAnalysis.CodeStyle.UnitTests.csproj b/src/CodeStyle/Core/Tests/Microsoft.CodeAnalysis.CodeStyle.UnitTests.csproj
deleted file mode 100644
index f3ad82b08a20d..0000000000000
--- a/src/CodeStyle/Core/Tests/Microsoft.CodeAnalysis.CodeStyle.UnitTests.csproj
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- Library
- Microsoft.CodeAnalysis
- net472
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/CodeStyle/Core/Tests/Properties/launchSettings.json b/src/CodeStyle/Core/Tests/Properties/launchSettings.json
deleted file mode 100644
index 037383dc96d4f..0000000000000
--- a/src/CodeStyle/Core/Tests/Properties/launchSettings.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "profiles": {
- "xUnit.net Console (32-bit)": {
- "commandName": "Executable",
- "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.x86.exe",
- "commandLineArgs": "$(TargetPath) -noshadow -verbose"
- },
- "xUnit.net Console (64-bit)": {
- "commandName": "Executable",
- "executablePath": "$(NuGetPackageRoot)xunit.runner.console\\$(XUnitVersion)\\tools\\net452\\xunit.console.exe",
- "commandLineArgs": "$(TargetPath) -noshadow -verbose"
- }
- }
-}
\ No newline at end of file
diff --git a/src/CodeStyle/Directory.Build.targets b/src/CodeStyle/Directory.Build.targets
index 42e78817dd243..ee638bd401f00 100644
--- a/src/CodeStyle/Directory.Build.targets
+++ b/src/CodeStyle/Directory.Build.targets
@@ -3,5 +3,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/CodeStyle/VisualBasic/Analyzers/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj b/src/CodeStyle/VisualBasic/Analyzers/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj
index 3a31888bab0a3..81d6c219e26ab 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj
+++ b/src/CodeStyle/VisualBasic/Analyzers/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.vbproj
@@ -9,9 +9,6 @@
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.NewNameSinceWeReferenceTheAnalyzersAndNuGetCannotFigureItOut
-
-
-
@@ -71,7 +68,6 @@
-
-
+
\ No newline at end of file
diff --git a/src/CodeStyle/VisualBasic/Analyzers/VBCodeStyleResources.Designer.vb b/src/CodeStyle/VisualBasic/Analyzers/VBCodeStyleResources.Designer.vb
index 324b9fb0458f3..e64f99491c812 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/VBCodeStyleResources.Designer.vb
+++ b/src/CodeStyle/VisualBasic/Analyzers/VBCodeStyleResources.Designer.vb
@@ -12,7 +12,6 @@ Option Strict On
Option Explicit On
Imports System
-Imports System.Reflection
Namespace Microsoft.CodeAnalysis.VisualBasic.VBCodeStyleResources
@@ -23,7 +22,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.VBCodeStyleResources
'''
''' A strongly-typed resource class, for looking up localized strings, etc.
'''
- _
@@ -40,7 +39,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.VBCodeStyleResources
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
- Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VBCodeStyleResources", GetType(VBCodeStyleResources).GetTypeInfo.Assembly)
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VBCodeStyleResources", GetType(VBCodeStyleResources).Assembly)
resourceMan = temp
End If
Return resourceMan
@@ -62,11 +61,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.VBCodeStyleResources
End Property
'''
- ''' Looks up a localized string similar to Remove this value when another is added..
+ ''' Looks up a localized string similar to Imports statement is unnecessary..
'''
- Friend ReadOnly Property EmptyResource() As String
+ Friend ReadOnly Property Imports_statement_is_unnecessary() As String
Get
- Return ResourceManager.GetString("EmptyResource", resourceCulture)
+ Return ResourceManager.GetString("Imports_statement_is_unnecessary", resourceCulture)
End Get
End Property
End Module
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.cs.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.cs.xlf
index 1ee0e68ad1a94..822ec68aebddb 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.cs.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.cs.xlf
@@ -4,7 +4,7 @@
- Odebrat tuto hodnotu, když se přidá jiná
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.de.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.de.xlf
index 99b3f10583c20..db97f6a1e53a3 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.de.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.de.xlf
@@ -4,7 +4,7 @@
- Dieser Wert wird entfernt, wenn ein anderer hinzugefügt wird.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.es.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.es.xlf
index 8aa42988759c7..64164183f7dfd 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.es.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.es.xlf
@@ -4,7 +4,7 @@
- Quite este valor cuando se agregue otro.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.fr.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.fr.xlf
index 4634371cdc62b..7234bc34e7d1d 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.fr.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.fr.xlf
@@ -4,7 +4,7 @@
- Supprimer cette valeur quand une autre est ajoutée.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.it.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.it.xlf
index d19ff3feee410..10516fc35a164 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.it.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.it.xlf
@@ -4,7 +4,7 @@
- Rimuovere questo valore quando ne viene aggiunto un altro.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ja.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ja.xlf
index c8af538b8bf9b..bdbe1fcc774ee 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ja.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ja.xlf
@@ -4,7 +4,7 @@
- 別の値が追加されたら、この値を削除します。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ko.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ko.xlf
index b0790f0101343..bef266e0aa2ba 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ko.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ko.xlf
@@ -4,7 +4,7 @@
- 다른 값을 추가할 때 이 값을 제거하세요.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.pl.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.pl.xlf
index c1bb87eab5e2b..5f0deec4c6512 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.pl.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.pl.xlf
@@ -4,7 +4,7 @@
- Usuń tę wartość, gdy dodawana jest kolejna.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.pt-BR.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.pt-BR.xlf
index 17951a56a9f7c..dac32ba01c3b6 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.pt-BR.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.pt-BR.xlf
@@ -4,7 +4,7 @@
- Remover este valor quando outro for adicionado.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ru.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ru.xlf
index ab8ee10782fc2..33ee0dc7f4bea 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ru.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.ru.xlf
@@ -4,7 +4,7 @@
- Удалите это значение при добавлении другого значения.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.tr.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.tr.xlf
index d35891016275c..defa7d7f4eb4d 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.tr.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.tr.xlf
@@ -4,7 +4,7 @@
- Başka bir değer eklendiğinde bu değeri kaldırın.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.zh-Hans.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.zh-Hans.xlf
index 37d7c99d03180..4e8d2b4227b60 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.zh-Hans.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.zh-Hans.xlf
@@ -4,7 +4,7 @@
- 在添加其他值时删除此值。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.zh-Hant.xlf b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.zh-Hant.xlf
index 2f99525762e7a..150e603a9666f 100644
--- a/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.zh-Hant.xlf
+++ b/src/CodeStyle/VisualBasic/Analyzers/xlf/VBCodeStyleResources.zh-Hant.xlf
@@ -4,7 +4,7 @@
- 當新增另一個值時移除此值。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.vbproj b/src/CodeStyle/VisualBasic/CodeFixes/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.vbproj
index 0202963b78320..c65493af391db 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.vbproj
+++ b/src/CodeStyle/VisualBasic/CodeFixes/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.vbproj
@@ -5,6 +5,7 @@
Library
netstandard2.0
+ $(DefineConstants),CODE_STYLE
true
@@ -21,14 +22,14 @@
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic.CodeStyle\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CodeStyle.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CodeStyle.Fixes.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic.CodeStyle\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.resources.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.resources.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CodeStyle.resources.dll"/>
- <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CodeStyle.Fixes.resources.dll"/>
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic.CodeStyle\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CodeStyle.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\Microsoft.CodeAnalysis.CodeStyle.Fixes.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic.CodeStyle\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.resources.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes.resources.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CodeStyle.resources.dll" />
+ <_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.CodeStyle.Fixes\$(Configuration)\$(TargetFramework)\**\Microsoft.CodeAnalysis.CodeStyle.Fixes.resources.dll" />
@@ -37,7 +38,7 @@
-
+
@@ -63,7 +64,6 @@
-
-
+
\ No newline at end of file
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/VBCodeStyleFixesResources.Designer.vb b/src/CodeStyle/VisualBasic/CodeFixes/VBCodeStyleFixesResources.Designer.vb
index 53db2ae4b35e0..3ab5a6b953824 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/VBCodeStyleFixesResources.Designer.vb
+++ b/src/CodeStyle/VisualBasic/CodeFixes/VBCodeStyleFixesResources.Designer.vb
@@ -12,7 +12,6 @@ Option Strict On
Option Explicit On
Imports System
-Imports System.Reflection
Namespace Microsoft.CodeAnalysis.VisualBasic.VBCodeStyleFixesResources
@@ -23,7 +22,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.VBCodeStyleFixesResources
'''
''' A strongly-typed resource class, for looking up localized strings, etc.
'''
- _
@@ -40,7 +39,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.VBCodeStyleFixesResources
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
- Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VBCodeStyleFixesResources", GetType(VBCodeStyleFixesResources).GetTypeInfo.Assembly)
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VBCodeStyleFixesResources", GetType(VBCodeStyleFixesResources).Assembly)
resourceMan = temp
End If
Return resourceMan
@@ -62,11 +61,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.VBCodeStyleFixesResources
End Property
'''
- ''' Looks up a localized string similar to Remove this value when another is added..
+ ''' Looks up a localized string similar to Remove Unnecessary Imports.
'''
- Friend ReadOnly Property EmptyResource() As String
+ Friend ReadOnly Property Remove_Unnecessary_Imports() As String
Get
- Return ResourceManager.GetString("EmptyResource", resourceCulture)
+ Return ResourceManager.GetString("Remove_Unnecessary_Imports", resourceCulture)
End Get
End Property
End Module
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.cs.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.cs.xlf
index bf069199a868a..5126048b1e908 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.cs.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.cs.xlf
@@ -4,7 +4,7 @@
- Odebrat tuto hodnotu, když se přidá jiná
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.de.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.de.xlf
index 4aaa654e93268..a5dd43d52897e 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.de.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.de.xlf
@@ -4,7 +4,7 @@
- Dieser Wert wird entfernt, wenn ein anderer hinzugefügt wird.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.es.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.es.xlf
index d348da1699902..0eb315ebc378d 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.es.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.es.xlf
@@ -4,7 +4,7 @@
- Quite este valor cuando se agregue otro.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.fr.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.fr.xlf
index 3f76a635c7886..0b2654babf4fa 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.fr.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.fr.xlf
@@ -4,7 +4,7 @@
- Supprimer cette valeur quand une autre est ajoutée.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.it.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.it.xlf
index 589952b571ce7..7d5951426a8ab 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.it.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.it.xlf
@@ -4,7 +4,7 @@
- Rimuovere questo valore quando ne viene aggiunto un altro.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ja.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ja.xlf
index 729c694202737..348b7b15e88a5 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ja.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ja.xlf
@@ -4,7 +4,7 @@
- 別の値が追加されたら、この値を削除します。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ko.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ko.xlf
index 31d2d215a31d6..70e9c838cbe17 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ko.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ko.xlf
@@ -4,7 +4,7 @@
- 다른 값을 추가할 때 이 값을 제거하세요.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.pl.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.pl.xlf
index 9b475a809c7df..0b400e8888ee3 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.pl.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.pl.xlf
@@ -4,7 +4,7 @@
- Usuń tę wartość, gdy dodawana jest kolejna.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.pt-BR.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.pt-BR.xlf
index 7999064a8defa..8affd0e0238d0 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.pt-BR.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.pt-BR.xlf
@@ -4,7 +4,7 @@
- Remover este valor quando outro for adicionado.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ru.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ru.xlf
index 826c7dc4343bc..aa098a45afb68 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ru.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.ru.xlf
@@ -4,7 +4,7 @@
- Удалите это значение при добавлении другого значения.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.tr.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.tr.xlf
index cb54eb755ab7b..3185f715acba0 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.tr.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.tr.xlf
@@ -4,7 +4,7 @@
- Başka bir değer eklendiğinde bu değeri kaldırın.
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.zh-Hans.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.zh-Hans.xlf
index 37da7ae8e7ea4..39b97d777e54c 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.zh-Hans.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.zh-Hans.xlf
@@ -4,7 +4,7 @@
- 在添加其他值时删除此值。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.zh-Hant.xlf b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.zh-Hant.xlf
index ecb8712ecf42d..f23c770be485e 100644
--- a/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.zh-Hant.xlf
+++ b/src/CodeStyle/VisualBasic/CodeFixes/xlf/VBCodeStyleFixesResources.zh-Hant.xlf
@@ -4,7 +4,7 @@
- 當新增另一個值時移除此值。
+ Remove this value when another is added.
https://github.com/Microsoft/msbuild/issues/1661
diff --git a/src/CodeStyle/VisualBasic/Tests/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests.vbproj b/src/CodeStyle/VisualBasic/Tests/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests.vbproj
index 40a63ccdf3a1f..1276ed38fb716 100644
--- a/src/CodeStyle/VisualBasic/Tests/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests.vbproj
+++ b/src/CodeStyle/VisualBasic/Tests/Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests.vbproj
@@ -5,6 +5,7 @@
Library
net472
+ $(DefineConstants),CODE_STYLE
true
@@ -18,6 +19,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj b/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj
index a09ef090ff9a8..f58883ee0a429 100644
--- a/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj
+++ b/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj
@@ -31,6 +31,7 @@
+
diff --git a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests.cs b/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests.cs
index 81e9d97a059f8..848b179c7ee60 100644
--- a/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests.cs
+++ b/src/EditorFeatures/CSharpTest/AddUsing/AddUsingTests.cs
@@ -59,8 +59,8 @@ internal async Task TestAsync(
bool outOfProcess)
{
await TestInRegularAndScript1Async(
- initialMarkup, expectedMarkup, index, priority,
- parameters: new TestParameters(options: options, fixProviderData: outOfProcess));
+ initialMarkup, expectedMarkup, index,
+ parameters: new TestParameters(options: options, fixProviderData: outOfProcess, priority: priority));
}
}
diff --git a/src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj b/src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj
index ad56fce6215e9..5da1c530a64c0 100644
--- a/src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj
+++ b/src/EditorFeatures/CSharpTest/Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests.csproj
@@ -38,6 +38,7 @@
+
diff --git a/src/EditorFeatures/CSharpTest/PullMemberUp/CSharpPullMemberUpTests.cs b/src/EditorFeatures/CSharpTest/PullMemberUp/CSharpPullMemberUpTests.cs
index 907d1beff88b5..875c75dd2e255 100644
--- a/src/EditorFeatures/CSharpTest/PullMemberUp/CSharpPullMemberUpTests.cs
+++ b/src/EditorFeatures/CSharpTest/PullMemberUp/CSharpPullMemberUpTests.cs
@@ -1433,14 +1433,13 @@ internal Task TestWithPullMemberDialogAsync(
IEnumerable<(string name, bool makeAbstract)> selection = null,
string destinationName = null,
int index = 0,
- CodeActionPriority? priority = null,
TestParameters parameters = default)
{
var service = new TestPullMemberUpService(selection, destinationName);
return TestInRegularAndScript1Async(
initialMarkUp, expectedResult,
- index, priority,
+ index,
parameters.WithFixProviderData(service));
}
diff --git a/src/EditorFeatures/CSharpTest/Squiggles/ErrorSquiggleProducerTests.cs b/src/EditorFeatures/CSharpTest/Squiggles/ErrorSquiggleProducerTests.cs
index 17edddd17cb58..69c821beb3337 100644
--- a/src/EditorFeatures/CSharpTest/Squiggles/ErrorSquiggleProducerTests.cs
+++ b/src/EditorFeatures/CSharpTest/Squiggles/ErrorSquiggleProducerTests.cs
@@ -134,12 +134,12 @@ void Test()
var third = spans[2];
Assert.Equal(PredefinedErrorTypeNames.Suggestion, first.Tag.ErrorType);
- Assert.Equal(CSharpFeaturesResources.Using_directive_is_unnecessary, first.Tag.ToolTipContent);
+ Assert.Equal(CSharpAnalyzersResources.Using_directive_is_unnecessary, first.Tag.ToolTipContent);
Assert.Equal(40, first.Span.Start);
Assert.Equal(25, first.Span.Length);
Assert.Equal(PredefinedErrorTypeNames.Suggestion, second.Tag.ErrorType);
- Assert.Equal(CSharpFeaturesResources.Using_directive_is_unnecessary, second.Tag.ToolTipContent);
+ Assert.Equal(CSharpAnalyzersResources.Using_directive_is_unnecessary, second.Tag.ToolTipContent);
Assert.Equal(82, second.Span.Start);
Assert.Equal(60, second.Span.Length);
diff --git a/src/EditorFeatures/CSharpTest2/Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests.csproj b/src/EditorFeatures/CSharpTest2/Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests.csproj
index f415088dcefba..7247cdceb9219 100644
--- a/src/EditorFeatures/CSharpTest2/Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests.csproj
+++ b/src/EditorFeatures/CSharpTest2/Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests.csproj
@@ -24,6 +24,7 @@
+
diff --git a/src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj b/src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj
index 90b1acc4d3310..458f86012fcaf 100644
--- a/src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj
+++ b/src/EditorFeatures/Core.Wpf/Microsoft.CodeAnalysis.EditorFeatures.Wpf.csproj
@@ -51,6 +51,7 @@
+
diff --git a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj
index dfeb35fcbe69e..8ad145b777450 100644
--- a/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj
+++ b/src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj
@@ -79,6 +79,7 @@
+
diff --git a/src/EditorFeatures/TestUtilities/ChangeSignature/AbstractChangeSignatureTests.cs b/src/EditorFeatures/DiagnosticsTestUtilities/ChangeSignature/AbstractChangeSignatureTests.cs
similarity index 99%
rename from src/EditorFeatures/TestUtilities/ChangeSignature/AbstractChangeSignatureTests.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/ChangeSignature/AbstractChangeSignatureTests.cs
index 66db009cf9612..c7c86ad58599c 100644
--- a/src/EditorFeatures/TestUtilities/ChangeSignature/AbstractChangeSignatureTests.cs
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/ChangeSignature/AbstractChangeSignatureTests.cs
@@ -161,7 +161,7 @@ private string GetSignatureDescriptionString(int[] signature, int? totalParamete
/// described above.
public async Task TestAllSignatureChangesAsync(string languageName, string markup, int[] signaturePartCounts, ParseOptions parseOptions = null)
{
- Assert.Equal(signaturePartCounts.Length, 4);
+ Assert.Equal(4, signaturePartCounts.Length);
Assert.True(signaturePartCounts[0] == 0 || signaturePartCounts[0] == 1);
Assert.True(signaturePartCounts[3] == 0 || signaturePartCounts[3] == 1);
diff --git a/src/EditorFeatures/TestUtilities/ChangeSignature/ChangeSignatureTestState.cs b/src/EditorFeatures/DiagnosticsTestUtilities/ChangeSignature/ChangeSignatureTestState.cs
similarity index 100%
rename from src/EditorFeatures/TestUtilities/ChangeSignature/ChangeSignatureTestState.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/ChangeSignature/ChangeSignatureTestState.cs
diff --git a/src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
similarity index 83%
rename from src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
index c6bc6a7f648aa..cace82f08e68d 100644
--- a/src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs
@@ -5,29 +5,35 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
+using System.Diagnostics;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
-using Microsoft.CodeAnalysis.CodeStyle;
-using Microsoft.CodeAnalysis.Editor.Implementation.Preview;
using Microsoft.CodeAnalysis.Editor.UnitTests.Extensions;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.UnitTests;
-using Roslyn.Test.Utilities;
using Roslyn.Utilities;
+using Roslyn.Test.Utilities;
using Xunit;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.CodeStyle;
+using Microsoft.CodeAnalysis.Options;
+#endif
+
namespace Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions
{
[UseExportProvider]
- public abstract class AbstractCodeActionOrUserDiagnosticTest
+ public abstract partial class AbstractCodeActionOrUserDiagnosticTest
{
public struct TestParameters
{
@@ -82,6 +88,8 @@ public TestParameters WithIncludeDiagnosticsOutsideSelection(bool includeDiagnos
=> new TestParameters(parseOptions, compilationOptions, options, fixProviderData, index, priority, retainNonFixableDiagnostics, includeDiagnosticsOutsideSelection, title);
}
+ private const string AutoGeneratedAnalyzerConfigHeader = @"# auto-generated .editorconfig for code style options";
+
protected abstract string GetLanguage();
protected abstract ParseOptions GetScriptOptions();
@@ -92,11 +100,134 @@ protected TestWorkspace CreateWorkspaceFromOptions(
? TestWorkspace.Create(initialMarkup, openDocuments: false)
: CreateWorkspaceFromFile(initialMarkup, parameters);
+ // For CodeStyle layer testing, we create an .editorconfig at project root
+ // to apply the options as workspace options are not available in CodeStyle layer.
+ // Otherwise, we apply the options directly to the workspace.
+
+#if CODE_STYLE
+ // We need to ensure that our projects/documents are rooted for
+ // execution from CodeStyle layer as we will be adding a rooted .editorconfig to each project
+ // to apply the options.
+ if (parameters.options != null)
+ {
+ MakeProjectsAndDocumentsRooted(workspace);
+ AddAnalyzerConfigDocumentWithOptions(workspace, parameters.options);
+ }
+#else
workspace.ApplyOptions(parameters.options);
+#endif
return workspace;
}
+ private static void MakeProjectsAndDocumentsRooted(TestWorkspace workspace)
+ {
+ const string defaultRootFilePath = @"z:\";
+ var newSolution = workspace.CurrentSolution;
+ foreach (var projectId in workspace.CurrentSolution.ProjectIds)
+ {
+ var project = newSolution.GetProject(projectId);
+
+ string projectRootFilePath;
+ if (!PathUtilities.IsAbsolute(project.FilePath))
+ {
+ projectRootFilePath = defaultRootFilePath;
+ newSolution = newSolution.WithProjectFilePath(projectId, Path.Combine(projectRootFilePath, project.FilePath));
+ }
+ else
+ {
+ projectRootFilePath = PathUtilities.GetPathRoot(project.FilePath);
+ }
+
+ foreach (var documentId in project.DocumentIds)
+ {
+ var document = newSolution.GetDocument(documentId);
+ if (!PathUtilities.IsAbsolute(document.FilePath))
+ {
+ newSolution = newSolution.WithDocumentFilePath(documentId, Path.Combine(projectRootFilePath, document.FilePath));
+ }
+ else
+ {
+ Assert.Equal(projectRootFilePath, PathUtilities.GetPathRoot(document.FilePath));
+ }
+ }
+ }
+
+ var applied = workspace.TryApplyChanges(newSolution);
+ Assert.True(applied);
+ return;
+ }
+
+ private static void AddAnalyzerConfigDocumentWithOptions(TestWorkspace workspace, IDictionary options)
+ {
+ Debug.Assert(options != null);
+ var analyzerConfigText = GenerateAnalyzerConfigText(options);
+
+ var newSolution = workspace.CurrentSolution;
+ foreach (var project in workspace.Projects)
+ {
+ Assert.True(PathUtilities.IsAbsolute(project.FilePath));
+ var projectRootFilePath = PathUtilities.GetPathRoot(project.FilePath);
+ var documentId = DocumentId.CreateNewId(project.Id);
+ newSolution = newSolution.AddAnalyzerConfigDocument(
+ documentId,
+ ".editorconfig",
+ SourceText.From(analyzerConfigText),
+ filePath: Path.Combine(projectRootFilePath, ".editorconfig"));
+ }
+
+ var applied = workspace.TryApplyChanges(newSolution);
+ Assert.True(applied);
+ return;
+
+ static string GenerateAnalyzerConfigText(IDictionary options)
+ {
+ var textBuilder = new StringBuilder();
+
+ // Add an auto-generated header at the top so we can skip this file in expected baseline validation.
+ textBuilder.AppendLine(AutoGeneratedAnalyzerConfigHeader);
+ textBuilder.AppendLine();
+
+ foreach (var (optionKey, value) in options)
+ {
+ foreach (var location in optionKey.Option.StorageLocations)
+ {
+ if (location is IEditorConfigStorageLocation2 editorConfigStorageLocation)
+ {
+ var editorConfigString = editorConfigStorageLocation.GetEditorConfigString(value, default);
+ if (editorConfigString != null)
+ {
+ textBuilder.AppendLine(GetSectionHeader(optionKey));
+ textBuilder.AppendLine(editorConfigString);
+ textBuilder.AppendLine();
+ break;
+ }
+
+ Assert.False(true, "Unexpected non-editorconfig option");
+ }
+ }
+ }
+
+ return textBuilder.ToString();
+
+ static string GetSectionHeader(OptionKey optionKey)
+ {
+ if (optionKey.Option.IsPerLanguage)
+ {
+ switch (optionKey.Language)
+ {
+ case LanguageNames.CSharp:
+ return "[*.cs]";
+ case LanguageNames.VisualBasic:
+ return "[*.vb]";
+ }
+ }
+
+ return "[*]";
+ }
+ }
+ }
+
protected abstract TestWorkspace CreateWorkspaceFromFile(string initialMarkup, TestParameters parameters);
private TestParameters WithRegularOptions(TestParameters parameters)
@@ -199,138 +330,6 @@ protected async Task TestActionCountAsync(
}
}
- protected async Task TestAddDocumentInRegularAndScriptAsync(
- string initialMarkup, string expectedMarkup,
- ImmutableArray expectedContainers,
- string expectedDocumentName,
- TestParameters parameters = default)
- {
- await TestAddDocument(
- initialMarkup, expectedMarkup,
- expectedContainers, expectedDocumentName,
- WithRegularOptions(parameters));
- await TestAddDocument(
- initialMarkup, expectedMarkup,
- expectedContainers, expectedDocumentName,
- WithScriptOptions(parameters));
- }
-
- protected async Task> TestAddDocumentAsync(
- TestParameters parameters,
- TestWorkspace workspace,
- string expectedMarkup,
- string expectedDocumentName,
- ImmutableArray expectedContainers)
- {
- var (_, action) = await GetCodeActionsAsync(workspace, parameters);
- return await TestAddDocument(
- workspace, expectedMarkup, expectedContainers,
- expectedDocumentName, action);
- }
-
- protected async Task TestAddDocument(
- string initialMarkup,
- string expectedMarkup,
- ImmutableArray expectedContainers,
- string expectedDocumentName,
- TestParameters parameters = default)
- {
- using (var workspace = CreateWorkspaceFromOptions(initialMarkup, parameters))
- {
- var (_, action) = await GetCodeActionsAsync(workspace, parameters);
- await TestAddDocument(
- workspace, expectedMarkup, expectedContainers,
- expectedDocumentName, action);
- }
- }
-
- private async Task> TestAddDocument(
- TestWorkspace workspace,
- string expectedMarkup,
- ImmutableArray expectedFolders,
- string expectedDocumentName,
- CodeAction action)
- {
- var operations = await VerifyActionAndGetOperationsAsync(workspace, action, default);
- return await TestAddDocument(
- workspace,
- expectedMarkup,
- operations,
- hasProjectChange: false,
- modifiedProjectId: null,
- expectedFolders: expectedFolders,
- expectedDocumentName: expectedDocumentName);
- }
-
- protected async Task> TestAddDocument(
- TestWorkspace workspace,
- string expected,
- ImmutableArray operations,
- bool hasProjectChange,
- ProjectId modifiedProjectId,
- ImmutableArray expectedFolders,
- string expectedDocumentName)
- {
- var appliedChanges = ApplyOperationsAndGetSolution(workspace, operations);
- var oldSolution = appliedChanges.Item1;
- var newSolution = appliedChanges.Item2;
-
- Document addedDocument = null;
- if (!hasProjectChange)
- {
- addedDocument = SolutionUtilities.GetSingleAddedDocument(oldSolution, newSolution);
- }
- else
- {
- Assert.NotNull(modifiedProjectId);
- addedDocument = newSolution.GetProject(modifiedProjectId).Documents.SingleOrDefault(doc => doc.Name == expectedDocumentName);
- }
-
- Assert.NotNull(addedDocument);
-
- AssertEx.Equal(expectedFolders, addedDocument.Folders);
- Assert.Equal(expectedDocumentName, addedDocument.Name);
- Assert.Equal(expected, (await addedDocument.GetTextAsync()).ToString());
-
- var editHandler = workspace.ExportProvider.GetExportedValue();
- if (!hasProjectChange)
- {
- // If there is just one document change then we expect the preview to be a WpfTextView
- var content = (await editHandler.GetPreviews(workspace, operations, CancellationToken.None).GetPreviewsAsync())[0];
- using (var diffView = content as DifferenceViewerPreview)
- {
- Assert.NotNull(diffView.Viewer);
- }
- }
- else
- {
- // If there are more changes than just the document we need to browse all the changes and get the document change
- var contents = editHandler.GetPreviews(workspace, operations, CancellationToken.None);
- var hasPreview = false;
- var previews = await contents.GetPreviewsAsync();
- if (previews != null)
- {
- foreach (var preview in previews)
- {
- if (preview != null)
- {
- var diffView = preview as DifferenceViewerPreview;
- if (diffView?.Viewer != null)
- {
- hasPreview = true;
- diffView.Dispose();
- break;
- }
- }
- }
- }
-
- Assert.True(hasPreview);
- }
-
- return Tuple.Create(oldSolution, newSolution);
- }
-
internal Task TestInRegularAndScriptAsync(
string initialMarkup,
string expectedMarkup,
@@ -343,20 +342,19 @@ internal Task TestInRegularAndScriptAsync(
string title = null)
{
return TestInRegularAndScript1Async(
- initialMarkup, expectedMarkup, index, priority,
- new TestParameters(parseOptions, compilationOptions, options, fixProviderData, index, title: title));
+ initialMarkup, expectedMarkup, index,
+ new TestParameters(parseOptions, compilationOptions, options, fixProviderData, index, priority, title: title));
}
internal async Task TestInRegularAndScript1Async(
string initialMarkup,
string expectedMarkup,
int index = 0,
- CodeActionPriority? priority = null,
TestParameters parameters = default)
{
parameters = parameters.WithIndex(index);
- await TestAsync(initialMarkup, expectedMarkup, priority, WithRegularOptions(parameters));
- await TestAsync(initialMarkup, expectedMarkup, priority, WithScriptOptions(parameters));
+ await TestAsync(initialMarkup, expectedMarkup, WithRegularOptions(parameters));
+ await TestAsync(initialMarkup, expectedMarkup, WithScriptOptions(parameters));
}
internal Task TestAsync(
@@ -369,15 +367,14 @@ internal Task TestAsync(
{
return TestAsync(
initialMarkup,
- expectedMarkup, priority,
+ expectedMarkup,
new TestParameters(
- parseOptions, compilationOptions, options, fixProviderData, index));
+ parseOptions, compilationOptions, options, fixProviderData, index, priority));
}
private async Task TestAsync(
string initialMarkup,
string expectedMarkup,
- CodeActionPriority? priority,
TestParameters parameters)
{
MarkupTestFile.GetSpans(
@@ -623,9 +620,17 @@ private static async Task VerifyAgainstWorkspaceDefinitionAsync(string expectedT
foreach (var analyzerConfigDoc in project.AnalyzerConfigDocuments)
{
var root = await analyzerConfigDoc.GetTextAsync();
+ var actualString = root.ToString();
+ if (actualString.StartsWith(AutoGeneratedAnalyzerConfigHeader))
+ {
+ // Skip validation for analyzer config file that is auto-generated by test framework
+ // for applying code style options.
+ continue;
+ }
+
var expectedDocument = expectedProject.AnalyzerConfigDocuments.Single(d => d.FilePath == analyzerConfigDoc.FilePath);
var expectedRoot = await expectedDocument.GetTextAsync();
- VerifyExpectedDocumentText(expectedRoot.ToString(), root.ToString());
+ VerifyExpectedDocumentText(expectedRoot.ToString(), actualString);
}
}
}
diff --git a/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest_TestAddDocument.cs b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest_TestAddDocument.cs
new file mode 100644
index 0000000000000..592d6b2fe9f88
--- /dev/null
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest_TestAddDocument.cs
@@ -0,0 +1,153 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Editor.Implementation.Preview;
+using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
+using Microsoft.CodeAnalysis.UnitTests;
+using Roslyn.Test.Utilities;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions
+{
+ public abstract partial class AbstractCodeActionOrUserDiagnosticTest
+ {
+ protected async Task TestAddDocumentInRegularAndScriptAsync(
+ string initialMarkup, string expectedMarkup,
+ ImmutableArray expectedContainers,
+ string expectedDocumentName,
+ TestParameters parameters = default)
+ {
+ await TestAddDocument(
+ initialMarkup, expectedMarkup,
+ expectedContainers, expectedDocumentName,
+ WithRegularOptions(parameters));
+ await TestAddDocument(
+ initialMarkup, expectedMarkup,
+ expectedContainers, expectedDocumentName,
+ WithScriptOptions(parameters));
+ }
+
+ protected async Task> TestAddDocumentAsync(
+ TestParameters parameters,
+ TestWorkspace workspace,
+ string expectedMarkup,
+ string expectedDocumentName,
+ ImmutableArray expectedContainers)
+ {
+ var (_, action) = await GetCodeActionsAsync(workspace, parameters);
+ return await TestAddDocument(
+ workspace, expectedMarkup, expectedContainers,
+ expectedDocumentName, action);
+ }
+
+ protected async Task TestAddDocument(
+ string initialMarkup,
+ string expectedMarkup,
+ ImmutableArray expectedContainers,
+ string expectedDocumentName,
+ TestParameters parameters = default)
+ {
+ using (var workspace = CreateWorkspaceFromOptions(initialMarkup, parameters))
+ {
+ var (_, action) = await GetCodeActionsAsync(workspace, parameters);
+ await TestAddDocument(
+ workspace, expectedMarkup, expectedContainers,
+ expectedDocumentName, action);
+ }
+ }
+
+ private async Task> TestAddDocument(
+ TestWorkspace workspace,
+ string expectedMarkup,
+ ImmutableArray expectedFolders,
+ string expectedDocumentName,
+ CodeAction action)
+ {
+ var operations = await VerifyActionAndGetOperationsAsync(workspace, action, default);
+ return await TestAddDocument(
+ workspace,
+ expectedMarkup,
+ operations,
+ hasProjectChange: false,
+ modifiedProjectId: null,
+ expectedFolders: expectedFolders,
+ expectedDocumentName: expectedDocumentName);
+ }
+
+ protected async Task> TestAddDocument(
+ TestWorkspace workspace,
+ string expected,
+ ImmutableArray operations,
+ bool hasProjectChange,
+ ProjectId modifiedProjectId,
+ ImmutableArray expectedFolders,
+ string expectedDocumentName)
+ {
+ var appliedChanges = ApplyOperationsAndGetSolution(workspace, operations);
+ var oldSolution = appliedChanges.Item1;
+ var newSolution = appliedChanges.Item2;
+
+ Document addedDocument = null;
+ if (!hasProjectChange)
+ {
+ addedDocument = SolutionUtilities.GetSingleAddedDocument(oldSolution, newSolution);
+ }
+ else
+ {
+ Assert.NotNull(modifiedProjectId);
+ addedDocument = newSolution.GetProject(modifiedProjectId).Documents.SingleOrDefault(doc => doc.Name == expectedDocumentName);
+ }
+
+ Assert.NotNull(addedDocument);
+
+ AssertEx.Equal(expectedFolders, addedDocument.Folders);
+ Assert.Equal(expectedDocumentName, addedDocument.Name);
+ Assert.Equal(expected, (await addedDocument.GetTextAsync()).ToString());
+
+ var editHandler = workspace.ExportProvider.GetExportedValue();
+ if (!hasProjectChange)
+ {
+ // If there is just one document change then we expect the preview to be a WpfTextView
+ var content = (await editHandler.GetPreviews(workspace, operations, CancellationToken.None).GetPreviewsAsync())[0];
+ using (var diffView = content as DifferenceViewerPreview)
+ {
+ Assert.NotNull(diffView.Viewer);
+ }
+ }
+ else
+ {
+ // If there are more changes than just the document we need to browse all the changes and get the document change
+ var contents = editHandler.GetPreviews(workspace, operations, CancellationToken.None);
+ var hasPreview = false;
+ var previews = await contents.GetPreviewsAsync();
+ if (previews != null)
+ {
+ foreach (var preview in previews)
+ {
+ if (preview != null)
+ {
+ var diffView = preview as DifferenceViewerPreview;
+ if (diffView?.Viewer != null)
+ {
+ hasPreview = true;
+ diffView.Dispose();
+ break;
+ }
+ }
+ }
+ }
+
+ Assert.True(hasPreview);
+ }
+
+ return Tuple.Create(oldSolution, newSolution);
+ }
+ }
+}
diff --git a/src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionTest.cs
similarity index 97%
rename from src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionTest.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionTest.cs
index ec304ac871736..f1ff9d4cb98e4 100644
--- a/src/EditorFeatures/TestUtilities/CodeActions/AbstractCodeActionTest.cs
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionTest.cs
@@ -23,7 +23,7 @@
namespace Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions
{
- public abstract class AbstractCodeActionTest : AbstractCodeActionOrUserDiagnosticTest
+ public abstract partial class AbstractCodeActionTest : AbstractCodeActionOrUserDiagnosticTest
{
protected abstract CodeRefactoringProvider CreateCodeRefactoringProvider(
Workspace workspace, TestParameters parameters);
@@ -167,13 +167,12 @@ internal Task TestWithPickMembersDialogAsync(
string[] chosenSymbols,
Action> optionsCallback = null,
int index = 0,
- CodeActionPriority? priority = null,
TestParameters parameters = default)
{
var pickMembersService = new TestPickMembersService(chosenSymbols.AsImmutableOrNull(), optionsCallback);
return TestInRegularAndScript1Async(
initialMarkup, expectedMarkup,
- index, priority,
+ index,
parameters.WithFixProviderData(pickMembersService));
}
}
diff --git a/src/EditorFeatures/TestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs
similarity index 76%
rename from src/EditorFeatures/TestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs
index 74fffdf3e5074..1b9c99e47a051 100644
--- a/src/EditorFeatures/TestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest.cs
@@ -2,7 +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.
-using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
@@ -10,19 +9,23 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
-using Microsoft.CodeAnalysis.CodeStyle;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.UnitTests.Diagnostics;
using Roslyn.Test.Utilities;
using Roslyn.Utilities;
using Xunit;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.Options;
+#endif
+
namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics
{
- public abstract class AbstractDiagnosticProviderBasedUserDiagnosticTest : AbstractUserDiagnosticTest
+ public abstract partial class AbstractDiagnosticProviderBasedUserDiagnosticTest : AbstractUserDiagnosticTest
{
private readonly ConcurrentDictionary _analyzerAndFixerMap =
new ConcurrentDictionary();
@@ -224,56 +227,5 @@ private void AssertNoAnalyzerExceptionDiagnostics(IEnumerable diagno
var analyzerExceptionDiagnostics = diagnostics.Where(diag => diag.Descriptor.CustomTags.Contains(WellKnownDiagnosticTags.AnalyzerException));
AssertEx.Empty(analyzerExceptionDiagnostics, "Found analyzer exception diagnostics");
}
-
- #region Parentheses options
-
- private static readonly CodeStyleOption IgnorePreference =
- new CodeStyleOption(ParenthesesPreference.AlwaysForClarity, NotificationOption.None);
-
- private static readonly CodeStyleOption RequireForPrecedenceClarityPreference =
- new CodeStyleOption(ParenthesesPreference.AlwaysForClarity, NotificationOption.Suggestion);
-
- private static readonly CodeStyleOption RemoveIfUnnecessaryPreference =
- new CodeStyleOption(ParenthesesPreference.NeverIfUnnecessary, NotificationOption.Suggestion);
-
- private static IEnumerable>> GetAllExceptOtherParenthesesOptions()
- {
- yield return CodeStyleOptions.ArithmeticBinaryParentheses;
- yield return CodeStyleOptions.RelationalBinaryParentheses;
- yield return CodeStyleOptions.OtherBinaryParentheses;
- }
-
- protected IDictionary RequireArithmeticBinaryParenthesesForClarity
- => GetSingleRequireOption(CodeStyleOptions.ArithmeticBinaryParentheses);
-
- protected IDictionary RequireRelationalBinaryParenthesesForClarity
- => GetSingleRequireOption(CodeStyleOptions.RelationalBinaryParentheses);
-
- protected IDictionary RequireOtherBinaryParenthesesForClarity
- => GetSingleRequireOption(CodeStyleOptions.OtherBinaryParentheses);
-
- private IEnumerable>> GetAllParenthesesOptions()
- => GetAllExceptOtherParenthesesOptions().Concat(CodeStyleOptions.OtherParentheses);
-
- protected IDictionary IgnoreAllParentheses
- => OptionsSet(GetAllParenthesesOptions().Select(
- o => SingleOption(o, IgnorePreference)).ToArray());
-
- protected IDictionary RemoveAllUnnecessaryParentheses
- => OptionsSet(GetAllParenthesesOptions().Select(
- o => SingleOption(o, RemoveIfUnnecessaryPreference)).ToArray());
-
- protected IDictionary RequireAllParenthesesForClarity
- => OptionsSet(GetAllExceptOtherParenthesesOptions()
- .Select(o => SingleOption(o, RequireForPrecedenceClarityPreference))
- .Concat(SingleOption(CodeStyleOptions.OtherParentheses, RemoveIfUnnecessaryPreference)).ToArray());
-
- private IDictionary GetSingleRequireOption(PerLanguageOption> option)
- => OptionsSet(GetAllParenthesesOptions()
- .Where(o => o != option)
- .Select(o => SingleOption(o, RemoveIfUnnecessaryPreference))
- .Concat(SingleOption(option, RequireForPrecedenceClarityPreference)).ToArray());
-
- #endregion
}
}
diff --git a/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest_ParenthesesOptions.cs b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest_ParenthesesOptions.cs
new file mode 100644
index 0000000000000..f8c83823fc3c1
--- /dev/null
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractDiagnosticProviderBasedUserDiagnosticTest_ParenthesesOptions.cs
@@ -0,0 +1,66 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.CodeStyle;
+using Microsoft.CodeAnalysis.Options;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics
+{
+ public abstract partial class AbstractDiagnosticProviderBasedUserDiagnosticTest : AbstractUserDiagnosticTest
+ {
+ #region Parentheses options
+
+ private static readonly CodeStyleOption IgnorePreference =
+ new CodeStyleOption(ParenthesesPreference.AlwaysForClarity, NotificationOption.None);
+
+ private static readonly CodeStyleOption RequireForPrecedenceClarityPreference =
+ new CodeStyleOption(ParenthesesPreference.AlwaysForClarity, NotificationOption.Suggestion);
+
+ private static readonly CodeStyleOption RemoveIfUnnecessaryPreference =
+ new CodeStyleOption(ParenthesesPreference.NeverIfUnnecessary, NotificationOption.Suggestion);
+
+ private static IEnumerable>> GetAllExceptOtherParenthesesOptions()
+ {
+ yield return CodeStyleOptions.ArithmeticBinaryParentheses;
+ yield return CodeStyleOptions.RelationalBinaryParentheses;
+ yield return CodeStyleOptions.OtherBinaryParentheses;
+ }
+
+ protected IDictionary RequireArithmeticBinaryParenthesesForClarity
+ => GetSingleRequireOption(CodeStyleOptions.ArithmeticBinaryParentheses);
+
+ protected IDictionary RequireRelationalBinaryParenthesesForClarity
+ => GetSingleRequireOption(CodeStyleOptions.RelationalBinaryParentheses);
+
+ protected IDictionary RequireOtherBinaryParenthesesForClarity
+ => GetSingleRequireOption(CodeStyleOptions.OtherBinaryParentheses);
+
+ private IEnumerable>> GetAllParenthesesOptions()
+ => GetAllExceptOtherParenthesesOptions().Concat(CodeStyleOptions.OtherParentheses);
+
+ protected IDictionary IgnoreAllParentheses
+ => OptionsSet(GetAllParenthesesOptions().Select(
+ o => SingleOption(o, IgnorePreference)).ToArray());
+
+ protected IDictionary RemoveAllUnnecessaryParentheses
+ => OptionsSet(GetAllParenthesesOptions().Select(
+ o => SingleOption(o, RemoveIfUnnecessaryPreference)).ToArray());
+
+ protected IDictionary RequireAllParenthesesForClarity
+ => OptionsSet(GetAllExceptOtherParenthesesOptions()
+ .Select(o => SingleOption(o, RequireForPrecedenceClarityPreference))
+ .Concat(SingleOption(CodeStyleOptions.OtherParentheses, RemoveIfUnnecessaryPreference)).ToArray());
+
+ private IDictionary GetSingleRequireOption(PerLanguageOption> option)
+ => OptionsSet(GetAllParenthesesOptions()
+ .Where(o => o != option)
+ .Select(o => SingleOption(o, RemoveIfUnnecessaryPreference))
+ .Concat(SingleOption(option, RequireForPrecedenceClarityPreference)).ToArray());
+
+ #endregion
+ }
+}
diff --git a/src/EditorFeatures/TestUtilities/Diagnostics/AbstractSuppressionAllCodeTests.cs b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractSuppressionAllCodeTests.cs
similarity index 100%
rename from src/EditorFeatures/TestUtilities/Diagnostics/AbstractSuppressionAllCodeTests.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractSuppressionAllCodeTests.cs
diff --git a/src/EditorFeatures/TestUtilities/Diagnostics/AbstractSuppressionDiagnosticTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractSuppressionDiagnosticTest.cs
similarity index 100%
rename from src/EditorFeatures/TestUtilities/Diagnostics/AbstractSuppressionDiagnosticTest.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractSuppressionDiagnosticTest.cs
diff --git a/src/EditorFeatures/TestUtilities/Diagnostics/FixAllDiagnosticProvider.cs b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest.FixAllDiagnosticProvider.cs
similarity index 100%
rename from src/EditorFeatures/TestUtilities/Diagnostics/FixAllDiagnosticProvider.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest.FixAllDiagnosticProvider.cs
diff --git a/src/EditorFeatures/TestUtilities/Diagnostics/AbstractUserDiagnosticTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest.cs
similarity index 62%
rename from src/EditorFeatures/TestUtilities/Diagnostics/AbstractUserDiagnosticTest.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest.cs
index 07be82e324fa4..95c66312507b3 100644
--- a/src/EditorFeatures/TestUtilities/Diagnostics/AbstractUserDiagnosticTest.cs
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest.cs
@@ -11,23 +11,22 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
-using Microsoft.CodeAnalysis.CodeFixes.Suppression;
-using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions;
-using Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics.GenerateType;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
-using Microsoft.CodeAnalysis.GenerateType;
-using Microsoft.CodeAnalysis.Options;
-using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.CodeAnalysis.Text;
-using Microsoft.CodeAnalysis.UnitTests;
using Microsoft.CodeAnalysis.UnitTests.Diagnostics;
using Roslyn.Test.Utilities;
using Roslyn.Utilities;
using Xunit;
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.Options;
+#endif
+
namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics
{
public abstract partial class AbstractUserDiagnosticTest : AbstractCodeActionOrUserDiagnosticTest
@@ -293,158 +292,5 @@ internal async Task TestSpansAsync(
Assert.True(expectedTextSpans.SetEquals(actualTextSpans));
}
-
- internal async Task TestWithMockedGenerateTypeDialog(
- string initial,
- string languageName,
- string typeName,
- string expected = null,
- bool isMissing = false,
- Accessibility accessibility = Accessibility.NotApplicable,
- TypeKind typeKind = TypeKind.Class,
- string projectName = null,
- bool isNewFile = false,
- string existingFilename = null,
- ImmutableArray newFileFolderContainers = default,
- string fullFilePath = null,
- string newFileName = null,
- string assertClassName = null,
- bool checkIfUsingsIncluded = false,
- bool checkIfUsingsNotIncluded = false,
- string expectedTextWithUsings = null,
- string defaultNamespace = "",
- bool areFoldersValidIdentifiers = true,
- GenerateTypeDialogOptions assertGenerateTypeDialogOptions = null,
- IList assertTypeKindPresent = null,
- IList assertTypeKindAbsent = null,
- bool isCancelled = false)
- {
- using var testState = GenerateTypeTestState.Create(initial, projectName, typeName, existingFilename, languageName);
-
- // Initialize the viewModel values
- testState.TestGenerateTypeOptionsService.SetGenerateTypeOptions(
- accessibility: accessibility,
- typeKind: typeKind,
- typeName: testState.TypeName,
- project: testState.ProjectToBeModified,
- isNewFile: isNewFile,
- newFileName: newFileName,
- folders: newFileFolderContainers,
- fullFilePath: fullFilePath,
- existingDocument: testState.ExistingDocument,
- areFoldersValidIdentifiers: areFoldersValidIdentifiers,
- isCancelled: isCancelled);
-
- testState.TestProjectManagementService.SetDefaultNamespace(
- defaultNamespace: defaultNamespace);
-
- var testOptions = new TestParameters();
- var (diagnostics, actions, _) = await GetDiagnosticAndFixesAsync(testState.Workspace, testOptions);
- var generateTypeDiagFixes = diagnostics.SingleOrDefault(df => GenerateTypeTestState.FixIds.Contains(df.Id));
-
- if (isMissing)
- {
- Assert.Empty(actions);
- return;
- }
-
- var fixActions = MassageActions(actions);
- Assert.NotNull(fixActions);
-
- // Since the dialog option is always fed as the last CodeAction
- var index = fixActions.Count() - 1;
- var action = fixActions.ElementAt(index);
-
- Assert.Equal(action.Title, FeaturesResources.Generate_new_type);
- var operations = await action.GetOperationsAsync(CancellationToken.None);
- Tuple oldSolutionAndNewSolution = null;
-
- if (!isNewFile)
- {
- oldSolutionAndNewSolution = await TestOperationsAsync(
- testState.Workspace, expected, operations,
- conflictSpans: ImmutableArray.Empty,
- renameSpans: ImmutableArray.Empty,
- warningSpans: ImmutableArray.Empty,
- navigationSpans: ImmutableArray.Empty,
- expectedChangedDocumentId: testState.ExistingDocument.Id);
- }
- else
- {
- oldSolutionAndNewSolution = await TestAddDocument(
- testState.Workspace,
- expected,
- operations,
- projectName != null,
- testState.ProjectToBeModified.Id,
- newFileFolderContainers,
- newFileName);
- }
-
- if (checkIfUsingsIncluded)
- {
- Assert.NotNull(expectedTextWithUsings);
- await TestOperationsAsync(testState.Workspace, expectedTextWithUsings, operations,
- conflictSpans: ImmutableArray.Empty,
- renameSpans: ImmutableArray.Empty,
- warningSpans: ImmutableArray.Empty,
- navigationSpans: ImmutableArray.Empty,
- expectedChangedDocumentId: testState.InvocationDocument.Id);
- }
-
- if (checkIfUsingsNotIncluded)
- {
- var oldSolution = oldSolutionAndNewSolution.Item1;
- var newSolution = oldSolutionAndNewSolution.Item2;
- var changedDocumentIds = SolutionUtilities.GetChangedDocuments(oldSolution, newSolution);
-
- Assert.False(changedDocumentIds.Contains(testState.InvocationDocument.Id));
- }
-
- // Added into a different project than the triggering project
- if (projectName != null)
- {
- var appliedChanges = ApplyOperationsAndGetSolution(testState.Workspace, operations);
- var newSolution = appliedChanges.Item2;
- var triggeredProject = newSolution.GetProject(testState.TriggeredProject.Id);
-
- // Make sure the Project reference is present
- Assert.True(triggeredProject.ProjectReferences.Any(pr => pr.ProjectId == testState.ProjectToBeModified.Id));
- }
-
- // Assert Option Calculation
- if (assertClassName != null)
- {
- Assert.True(assertClassName == testState.TestGenerateTypeOptionsService.ClassName);
- }
-
- if (assertGenerateTypeDialogOptions != null || assertTypeKindPresent != null || assertTypeKindAbsent != null)
- {
- var generateTypeDialogOptions = testState.TestGenerateTypeOptionsService.GenerateTypeDialogOptions;
-
- if (assertGenerateTypeDialogOptions != null)
- {
- Assert.True(assertGenerateTypeDialogOptions.IsPublicOnlyAccessibility == generateTypeDialogOptions.IsPublicOnlyAccessibility);
- Assert.True(assertGenerateTypeDialogOptions.TypeKindOptions == generateTypeDialogOptions.TypeKindOptions);
- Assert.True(assertGenerateTypeDialogOptions.IsAttribute == generateTypeDialogOptions.IsAttribute);
- }
-
- if (assertTypeKindPresent != null)
- {
- foreach (var typeKindPresentEach in assertTypeKindPresent)
- {
- Assert.True((typeKindPresentEach & generateTypeDialogOptions.TypeKindOptions) != 0);
- }
- }
-
- if (assertTypeKindAbsent != null)
- {
- foreach (var typeKindPresentEach in assertTypeKindAbsent)
- {
- Assert.True((typeKindPresentEach & generateTypeDialogOptions.TypeKindOptions) == 0);
- }
- }
- }
- }
}
}
diff --git a/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest_GenerateTypeDialog.cs b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest_GenerateTypeDialog.cs
new file mode 100644
index 0000000000000..c521b86eaf07e
--- /dev/null
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/Diagnostics/AbstractUserDiagnosticTest_GenerateTypeDialog.cs
@@ -0,0 +1,176 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions;
+using Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics.GenerateType;
+using Microsoft.CodeAnalysis.GenerateType;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.UnitTests;
+using Roslyn.Utilities;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics
+{
+ public abstract partial class AbstractUserDiagnosticTest : AbstractCodeActionOrUserDiagnosticTest
+ {
+ internal async Task TestWithMockedGenerateTypeDialog(
+ string initial,
+ string languageName,
+ string typeName,
+ string expected = null,
+ bool isMissing = false,
+ Accessibility accessibility = Accessibility.NotApplicable,
+ TypeKind typeKind = TypeKind.Class,
+ string projectName = null,
+ bool isNewFile = false,
+ string existingFilename = null,
+ ImmutableArray newFileFolderContainers = default,
+ string fullFilePath = null,
+ string newFileName = null,
+ string assertClassName = null,
+ bool checkIfUsingsIncluded = false,
+ bool checkIfUsingsNotIncluded = false,
+ string expectedTextWithUsings = null,
+ string defaultNamespace = "",
+ bool areFoldersValidIdentifiers = true,
+ GenerateTypeDialogOptions assertGenerateTypeDialogOptions = null,
+ IList assertTypeKindPresent = null,
+ IList assertTypeKindAbsent = null,
+ bool isCancelled = false)
+ {
+ using var testState = GenerateTypeTestState.Create(initial, projectName, typeName, existingFilename, languageName);
+
+ // Initialize the viewModel values
+ testState.TestGenerateTypeOptionsService.SetGenerateTypeOptions(
+ accessibility: accessibility,
+ typeKind: typeKind,
+ typeName: testState.TypeName,
+ project: testState.ProjectToBeModified,
+ isNewFile: isNewFile,
+ newFileName: newFileName,
+ folders: newFileFolderContainers,
+ fullFilePath: fullFilePath,
+ existingDocument: testState.ExistingDocument,
+ areFoldersValidIdentifiers: areFoldersValidIdentifiers,
+ isCancelled: isCancelled);
+
+ testState.TestProjectManagementService.SetDefaultNamespace(
+ defaultNamespace: defaultNamespace);
+
+ var testOptions = new TestParameters();
+ var (diagnostics, actions, _) = await GetDiagnosticAndFixesAsync(testState.Workspace, testOptions);
+ var generateTypeDiagFixes = diagnostics.SingleOrDefault(df => GenerateTypeTestState.FixIds.Contains(df.Id));
+
+ if (isMissing)
+ {
+ Assert.Empty(actions);
+ return;
+ }
+
+ var fixActions = MassageActions(actions);
+ Assert.False(fixActions.IsDefault);
+
+ // Since the dialog option is always fed as the last CodeAction
+ var index = fixActions.Count() - 1;
+ var action = fixActions.ElementAt(index);
+
+ Assert.Equal(action.Title, FeaturesResources.Generate_new_type);
+ var operations = await action.GetOperationsAsync(CancellationToken.None);
+ Tuple oldSolutionAndNewSolution = null;
+
+ if (!isNewFile)
+ {
+ oldSolutionAndNewSolution = await TestOperationsAsync(
+ testState.Workspace, expected, operations,
+ conflictSpans: ImmutableArray.Empty,
+ renameSpans: ImmutableArray.Empty,
+ warningSpans: ImmutableArray.Empty,
+ navigationSpans: ImmutableArray.Empty,
+ expectedChangedDocumentId: testState.ExistingDocument.Id);
+ }
+ else
+ {
+ oldSolutionAndNewSolution = await TestAddDocument(
+ testState.Workspace,
+ expected,
+ operations,
+ projectName != null,
+ testState.ProjectToBeModified.Id,
+ newFileFolderContainers,
+ newFileName);
+ }
+
+ if (checkIfUsingsIncluded)
+ {
+ Assert.NotNull(expectedTextWithUsings);
+ await TestOperationsAsync(testState.Workspace, expectedTextWithUsings, operations,
+ conflictSpans: ImmutableArray.Empty,
+ renameSpans: ImmutableArray.Empty,
+ warningSpans: ImmutableArray.Empty,
+ navigationSpans: ImmutableArray.Empty,
+ expectedChangedDocumentId: testState.InvocationDocument.Id);
+ }
+
+ if (checkIfUsingsNotIncluded)
+ {
+ var oldSolution = oldSolutionAndNewSolution.Item1;
+ var newSolution = oldSolutionAndNewSolution.Item2;
+ var changedDocumentIds = SolutionUtilities.GetChangedDocuments(oldSolution, newSolution);
+
+ Assert.False(changedDocumentIds.Contains(testState.InvocationDocument.Id));
+ }
+
+ // Added into a different project than the triggering project
+ if (projectName != null)
+ {
+ var appliedChanges = ApplyOperationsAndGetSolution(testState.Workspace, operations);
+ var newSolution = appliedChanges.Item2;
+ var triggeredProject = newSolution.GetProject(testState.TriggeredProject.Id);
+
+ // Make sure the Project reference is present
+ Assert.True(triggeredProject.ProjectReferences.Any(pr => pr.ProjectId == testState.ProjectToBeModified.Id));
+ }
+
+ // Assert Option Calculation
+ if (assertClassName != null)
+ {
+ Assert.True(assertClassName == testState.TestGenerateTypeOptionsService.ClassName);
+ }
+
+ if (assertGenerateTypeDialogOptions != null || assertTypeKindPresent != null || assertTypeKindAbsent != null)
+ {
+ var generateTypeDialogOptions = testState.TestGenerateTypeOptionsService.GenerateTypeDialogOptions;
+
+ if (assertGenerateTypeDialogOptions != null)
+ {
+ Assert.True(assertGenerateTypeDialogOptions.IsPublicOnlyAccessibility == generateTypeDialogOptions.IsPublicOnlyAccessibility);
+ Assert.True(assertGenerateTypeDialogOptions.TypeKindOptions == generateTypeDialogOptions.TypeKindOptions);
+ Assert.True(assertGenerateTypeDialogOptions.IsAttribute == generateTypeDialogOptions.IsAttribute);
+ }
+
+ if (assertTypeKindPresent != null)
+ {
+ foreach (var typeKindPresentEach in assertTypeKindPresent)
+ {
+ Assert.True((typeKindPresentEach & generateTypeDialogOptions.TypeKindOptions) != 0);
+ }
+ }
+
+ if (assertTypeKindAbsent != null)
+ {
+ foreach (var typeKindPresentEach in assertTypeKindAbsent)
+ {
+ Assert.True((typeKindPresentEach & generateTypeDialogOptions.TypeKindOptions) == 0);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/EditorFeatures/DiagnosticsTestUtilities/Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities.csproj b/src/EditorFeatures/DiagnosticsTestUtilities/Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities.csproj
new file mode 100644
index 0000000000000..b33cff258d214
--- /dev/null
+++ b/src/EditorFeatures/DiagnosticsTestUtilities/Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities.csproj
@@ -0,0 +1,62 @@
+
+
+
+
+ Library
+ Microsoft.CodeAnalysis.Test.Utilities
+ net472
+ true
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ global,WORKSPACES
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/EditorFeatures/TestUtilities/MoveToNamespace/AbstractMoveToNamespaceTests.TestState.cs b/src/EditorFeatures/DiagnosticsTestUtilities/MoveToNamespace/AbstractMoveToNamespaceTests.TestState.cs
similarity index 100%
rename from src/EditorFeatures/TestUtilities/MoveToNamespace/AbstractMoveToNamespaceTests.TestState.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/MoveToNamespace/AbstractMoveToNamespaceTests.TestState.cs
diff --git a/src/EditorFeatures/TestUtilities/MoveToNamespace/AbstractMoveToNamespaceTests.cs b/src/EditorFeatures/DiagnosticsTestUtilities/MoveToNamespace/AbstractMoveToNamespaceTests.cs
similarity index 100%
rename from src/EditorFeatures/TestUtilities/MoveToNamespace/AbstractMoveToNamespaceTests.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/MoveToNamespace/AbstractMoveToNamespaceTests.cs
diff --git a/src/EditorFeatures/TestUtilities/MoveType/AbstractMoveTypeTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/MoveType/AbstractMoveTypeTest.cs
similarity index 100%
rename from src/EditorFeatures/TestUtilities/MoveType/AbstractMoveTypeTest.cs
rename to src/EditorFeatures/DiagnosticsTestUtilities/MoveType/AbstractMoveTypeTest.cs
diff --git a/src/EditorFeatures/Test/Microsoft.CodeAnalysis.EditorFeatures.UnitTests.csproj b/src/EditorFeatures/Test/Microsoft.CodeAnalysis.EditorFeatures.UnitTests.csproj
index 948e2be434df3..fcc4cfe2fd582 100644
--- a/src/EditorFeatures/Test/Microsoft.CodeAnalysis.EditorFeatures.UnitTests.csproj
+++ b/src/EditorFeatures/Test/Microsoft.CodeAnalysis.EditorFeatures.UnitTests.csproj
@@ -34,6 +34,7 @@
+
diff --git a/src/EditorFeatures/TestUtilities/PullMemberUp/PullMemberUpCodeActionTest.cs b/src/EditorFeatures/TestUtilities/PullMemberUp/PullMemberUpCodeActionTest.cs
deleted file mode 100644
index db345d237a8c0..0000000000000
--- a/src/EditorFeatures/TestUtilities/PullMemberUp/PullMemberUpCodeActionTest.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Microsoft.CodeAnalysis.CodeActions;
-using Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions;
-
-namespace Microsoft.CodeAnalysis.Test.Utilities.PullMemberUp
-{
- public abstract class PullMemberUpCodeActionTest : AbstractCodeActionTest
- {
- internal Task TestWithPullMemberDialogAsync(
- string initialMarkUp,
- string expectedResult,
- IEnumerable<(string memberName, bool makeAbstract)> selection = null,
- string target = null,
- int index = 0,
- CodeActionPriority? priority = null,
- TestParameters parameters = default)
- {
- var service = new TestPullMemberUpService(selection, target);
-
- return TestInRegularAndScript1Async(
- initialMarkUp, expectedResult,
- index, priority,
- parameters.WithFixProviderData(service));
- }
- }
-}
diff --git a/src/EditorFeatures/TestUtilities/Roslyn.Services.Test.Utilities.csproj b/src/EditorFeatures/TestUtilities/Roslyn.Services.Test.Utilities.csproj
index 9b15252cf1be4..02fa1e12ed867 100644
--- a/src/EditorFeatures/TestUtilities/Roslyn.Services.Test.Utilities.csproj
+++ b/src/EditorFeatures/TestUtilities/Roslyn.Services.Test.Utilities.csproj
@@ -98,6 +98,13 @@
+
+
+
+
+
+
+
diff --git a/src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs b/src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs
index d6334f9063827..a2e12211a78a2 100644
--- a/src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs
+++ b/src/EditorFeatures/TestUtilities/Workspaces/TestHostProject.cs
@@ -27,7 +27,6 @@ public class TestHostProject
private readonly string _assemblyName;
private readonly Type _hostObjectType;
private readonly VersionStamp _version;
- private readonly string _filePath;
private readonly string _outputFilePath;
private readonly string _defaultNamespace;
@@ -35,6 +34,7 @@ public class TestHostProject
public IEnumerable AdditionalDocuments;
public IEnumerable AnalyzerConfigDocuments;
public IEnumerable ProjectReferences;
+ private string _filePath;
public string Name
{
@@ -325,6 +325,9 @@ internal void RemoveAnalyzerConfigDocument(TestHostDocument document)
this.AnalyzerConfigDocuments = this.AnalyzerConfigDocuments.Where(d => d != document);
}
+ internal void OnProjectFilePathChanged(string filePath)
+ => _filePath = filePath;
+
public string Language
{
get
diff --git a/src/EditorFeatures/TestUtilities/Workspaces/TestWorkspace.cs b/src/EditorFeatures/TestUtilities/Workspaces/TestWorkspace.cs
index 35a6c8343268c..ef4e17acedda6 100644
--- a/src/EditorFeatures/TestUtilities/Workspaces/TestWorkspace.cs
+++ b/src/EditorFeatures/TestUtilities/Workspaces/TestWorkspace.cs
@@ -341,7 +341,7 @@ protected override void ApplyAnalyzerConfigDocumentTextChanged(DocumentId docume
protected override void ApplyAnalyzerConfigDocumentAdded(DocumentInfo info, SourceText text)
{
var hostProject = this.GetTestProject(info.Id.ProjectId);
- var hostDocument = new TestHostDocument(text.ToString(), info.Name, id: info.Id);
+ var hostDocument = new TestHostDocument(text.ToString(), info.Name, id: info.Id, filePath: info.FilePath, folders: info.Folders);
hostProject.AddAnalyzerConfigDocument(hostDocument);
this.OnAnalyzerConfigDocumentAdded(hostDocument.ToDocumentInfo());
}
@@ -354,6 +354,18 @@ protected override void ApplyAnalyzerConfigDocumentRemoved(DocumentId documentId
this.OnAnalyzerConfigDocumentRemoved(documentId);
}
+ protected override void ApplyProjectChanges(ProjectChanges projectChanges)
+ {
+ if (projectChanges.OldProject.FilePath != projectChanges.NewProject.FilePath)
+ {
+ var hostProject = this.GetTestProject(projectChanges.NewProject.Id);
+ hostProject.OnProjectFilePathChanged(projectChanges.NewProject.FilePath);
+ base.OnProjectNameChanged(projectChanges.NewProject.Id, projectChanges.NewProject.Name, projectChanges.NewProject.FilePath);
+ }
+
+ base.ApplyProjectChanges(projectChanges);
+ }
+
internal override void SetDocumentContext(DocumentId documentId)
{
OnDocumentContextUpdated(documentId);
diff --git a/src/EditorFeatures/VisualBasicTest/Diagnostics/AddImport/AddImportTests.vb b/src/EditorFeatures/VisualBasicTest/Diagnostics/AddImport/AddImportTests.vb
index 87e75428a4b81..a4b6d04f73902 100644
--- a/src/EditorFeatures/VisualBasicTest/Diagnostics/AddImport/AddImportTests.vb
+++ b/src/EditorFeatures/VisualBasicTest/Diagnostics/AddImport/AddImportTests.vb
@@ -32,10 +32,11 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.CodeActions.AddImp
placeSystemFirst As Boolean,
outOfProcess As Boolean) As Task
Await TestInRegularAndScript1Async(
- initialMarkup, expectedMarkup, index, priority,
+ initialMarkup, expectedMarkup, index,
parameters:=New TestParameters(
options:=[Option](GenerationOptions.PlaceSystemNamespaceFirst, placeSystemFirst),
- fixProviderData:=outOfProcess))
+ fixProviderData:=outOfProcess,
+ priority:=priority))
End Function
End Class
@@ -75,7 +76,7 @@ Namespace SomeNamespace
End Namespace")
End Function
-
+
Public Async Function TestAddImportWithCaseChange() As Task
Await TestAsync(
diff --git a/src/EditorFeatures/VisualBasicTest/Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests.vbproj b/src/EditorFeatures/VisualBasicTest/Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests.vbproj
index ebb61391ef3cb..a8289e092090d 100644
--- a/src/EditorFeatures/VisualBasicTest/Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests.vbproj
+++ b/src/EditorFeatures/VisualBasicTest/Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests.vbproj
@@ -37,6 +37,7 @@
+
@@ -70,7 +71,7 @@
-
+
diff --git a/src/EditorFeatures/VisualBasicTest/Squiggles/ErrorSquiggleProducerTests.vb b/src/EditorFeatures/VisualBasicTest/Squiggles/ErrorSquiggleProducerTests.vb
index 3ab2421034551..62e6e4fb02153 100644
--- a/src/EditorFeatures/VisualBasicTest/Squiggles/ErrorSquiggleProducerTests.vb
+++ b/src/EditorFeatures/VisualBasicTest/Squiggles/ErrorSquiggleProducerTests.vb
@@ -118,7 +118,7 @@ End Class"
Dim second = spans(1)
Assert.Equal(PredefinedErrorTypeNames.Suggestion, first.Tag.ErrorType)
- Assert.Equal(VBFeaturesResources.Imports_statement_is_unnecessary, CType(first.Tag.ToolTipContent, String))
+ Assert.Equal(VisualBasicAnalyzersResources.Imports_statement_is_unnecessary, CType(first.Tag.ToolTipContent, String))
Assert.Equal(Of Integer)(79, first.Span.Start)
Assert.Equal(83, first.Span.Length)
diff --git a/src/EditorFeatures/VisualBasicTest/Utils.vb b/src/EditorFeatures/VisualBasicTest/Utils.vb
index d9ba459a327ed..a323d9d310eeb 100644
--- a/src/EditorFeatures/VisualBasicTest/Utils.vb
+++ b/src/EditorFeatures/VisualBasicTest/Utils.vb
@@ -112,8 +112,10 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests
Private ReadOnly _node As T
Sub New(syntaxTree As SyntaxTree, node As T)
+#If Not CODE_STYLE Then
Contract.ThrowIfNull(syntaxTree)
Contract.ThrowIfNull(node)
+#End If
_tree = syntaxTree
_node = node
End Sub
diff --git a/src/Features/CSharp/Portable/CSharpFeaturesResources.Designer.cs b/src/Features/CSharp/Portable/CSharpFeaturesResources.Designer.cs
index c6dd0853355c9..bd269d2aa0fab 100644
--- a/src/Features/CSharp/Portable/CSharpFeaturesResources.Designer.cs
+++ b/src/Features/CSharp/Portable/CSharpFeaturesResources.Designer.cs
@@ -448,15 +448,6 @@ internal static string conversion_operator {
}
}
- ///
- /// Looks up a localized string similar to Convert switch statement to expression.
- ///
- internal static string Convert_switch_statement_to_expression {
- get {
- return ResourceManager.GetString("Convert_switch_statement_to_expression", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Convert to 'for'.
///
@@ -1105,15 +1096,6 @@ internal static string Remove_unnecessary_casts {
}
}
- ///
- /// Looks up a localized string similar to Remove Unnecessary Usings.
- ///
- internal static string Remove_Unnecessary_Usings {
- get {
- return ResourceManager.GetString("Remove_Unnecessary_Usings", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Remove unused function.
///
@@ -1440,33 +1422,6 @@ internal static string Use_0 {
}
}
- ///
- /// Looks up a localized string similar to Use explicit type.
- ///
- internal static string Use_explicit_type {
- get {
- return ResourceManager.GetString("Use_explicit_type", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Use explicit type instead of 'var'.
- ///
- internal static string Use_explicit_type_instead_of_var {
- get {
- return ResourceManager.GetString("Use_explicit_type_instead_of_var", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Use implicit type.
- ///
- internal static string Use_implicit_type {
- get {
- return ResourceManager.GetString("Use_implicit_type", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Use 'is null' check.
///
@@ -1476,24 +1431,6 @@ internal static string Use_is_null_check {
}
}
- ///
- /// Looks up a localized string similar to Use 'switch' expression.
- ///
- internal static string Use_switch_expression {
- get {
- return ResourceManager.GetString("Use_switch_expression", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to use 'var' instead of explicit type.
- ///
- internal static string use_var_instead_of_explicit_type {
- get {
- return ResourceManager.GetString("use_var_instead_of_explicit_type", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to using declaration.
///
@@ -1512,15 +1449,6 @@ internal static string using_directive {
}
}
- ///
- /// Looks up a localized string similar to Using directive is unnecessary..
- ///
- internal static string Using_directive_is_unnecessary {
- get {
- return ResourceManager.GetString("Using_directive_is_unnecessary", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Using directives must be placed inside of a namespace declaration.
///
diff --git a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx
index 7a4ddbdd52562..c9339b6528a7f 100644
--- a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx
+++ b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx
@@ -138,9 +138,6 @@
Simplify all occurrences
-
- Remove Unnecessary Usings
-
<lambda expression>
@@ -279,9 +276,6 @@
TODO: uncomment the following line if the finalizer is overridden above.
-
- Using directive is unnecessary.
-
try block
{Locked="try"} "try" is a C# keyword and should not be localized.
@@ -466,18 +460,6 @@
Properties
-
- Use explicit type instead of 'var'
-
-
- Use explicit type
-
-
- use 'var' instead of explicit type
-
-
- Use implicit type
-
Autoselect disabled due to namespace declaration.
@@ -613,12 +595,6 @@
Make 'ref struct'
{Locked="ref"}{Locked="struct"} "ref" and "struct" are C# keywords and should not be localized.
-
- Convert switch statement to expression
-
-
- Use 'switch' expression
-
Misplaced using directive
{Locked="using"} "using" is a C# keyword and should not be localized.
diff --git a/src/Features/CSharp/Portable/CodeFixes/Suppression/CSharpSuppressionCodeFixProvider.cs b/src/Features/CSharp/Portable/CodeFixes/Suppression/CSharpSuppressionCodeFixProvider.cs
index 9b6fdde883f22..68e330644833a 100644
--- a/src/Features/CSharp/Portable/CodeFixes/Suppression/CSharpSuppressionCodeFixProvider.cs
+++ b/src/Features/CSharp/Portable/CodeFixes/Suppression/CSharpSuppressionCodeFixProvider.cs
@@ -13,6 +13,7 @@
using Microsoft.CodeAnalysis.CSharp.CodeGeneration;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Simplification;
using Microsoft.CodeAnalysis.Text;
@@ -97,6 +98,7 @@ protected override SyntaxNode AddGlobalSuppressMessageAttribute(
Workspace workspace,
Compilation compilation,
IAddImportsService addImportsService,
+ SyntaxGenerator generator,
CancellationToken cancellationToken)
{
var compilationRoot = (CompilationUnitSyntax)newRoot;
diff --git a/src/Features/CSharp/Portable/CodeRefactorings/UseExplicitOrImplicitType/UseExplicitTypeCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/CodeRefactorings/UseExplicitOrImplicitType/UseExplicitTypeCodeRefactoringProvider.cs
index 18a1c84012bbd..3d1059db0b19b 100644
--- a/src/Features/CSharp/Portable/CodeRefactorings/UseExplicitOrImplicitType/UseExplicitTypeCodeRefactoringProvider.cs
+++ b/src/Features/CSharp/Portable/CodeRefactorings/UseExplicitOrImplicitType/UseExplicitTypeCodeRefactoringProvider.cs
@@ -24,7 +24,7 @@ public UseExplicitTypeCodeRefactoringProvider()
}
protected override string Title
- => CSharpFeaturesResources.Use_explicit_type;
+ => CSharpAnalyzersResources.Use_explicit_type;
protected override TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
=> CSharpUseExplicitTypeHelper.Instance.FindAnalyzableType(node, semanticModel, cancellationToken);
diff --git a/src/Features/CSharp/Portable/CodeRefactorings/UseExplicitOrImplicitType/UseImplicitTypeCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/CodeRefactorings/UseExplicitOrImplicitType/UseImplicitTypeCodeRefactoringProvider.cs
index 2d802360bfe02..f38f6458e01ab 100644
--- a/src/Features/CSharp/Portable/CodeRefactorings/UseExplicitOrImplicitType/UseImplicitTypeCodeRefactoringProvider.cs
+++ b/src/Features/CSharp/Portable/CodeRefactorings/UseExplicitOrImplicitType/UseImplicitTypeCodeRefactoringProvider.cs
@@ -24,7 +24,7 @@ public UseImplicitTypeCodeRefactoringProvider()
}
protected override string Title
- => CSharpFeaturesResources.Use_implicit_type;
+ => CSharpAnalyzersResources.Use_implicit_type;
protected override TypeSyntax FindAnalyzableType(SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
=> CSharpUseImplicitTypeHelper.Instance.FindAnalyzableType(node, semanticModel, cancellationToken);
diff --git a/src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj b/src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj
index f34a6e41dc567..5ac8ef18d009a 100644
--- a/src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj
+++ b/src/Features/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Features.csproj
@@ -43,6 +43,7 @@
+
diff --git a/src/Features/CSharp/Portable/UseExplicitTypeForConst/UseExplicitTypeForConstCodeFixProvider.cs b/src/Features/CSharp/Portable/UseExplicitTypeForConst/UseExplicitTypeForConstCodeFixProvider.cs
index 395b945108028..49ac97bdbc9ff 100644
--- a/src/Features/CSharp/Portable/UseExplicitTypeForConst/UseExplicitTypeForConstCodeFixProvider.cs
+++ b/src/Features/CSharp/Portable/UseExplicitTypeForConst/UseExplicitTypeForConstCodeFixProvider.cs
@@ -67,7 +67,7 @@ private static async Task FixAsync(
private sealed class MyCodeAction : CodeAction.DocumentChangeAction
{
public MyCodeAction(Func> createChangedDocument)
- : base(CSharpFeaturesResources.Use_explicit_type_instead_of_var,
+ : base(CSharpAnalyzersResources.Use_explicit_type_instead_of_var,
createChangedDocument)
{
}
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf
index 2c4b780198b3b..1f54020787319 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf
@@ -72,11 +72,6 @@
Přiřadit parametry out (při spuštění)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Převést příkaz switch na výraz
-
-
Převést na metodu
@@ -152,11 +147,6 @@
Zjednodušit všechny výskyty
-
-
- Odebrat nepotřebné direktivy using
-
-
Seřadit modifikátory dostupnosti
@@ -167,11 +157,6 @@
Rozpečetit třídu {0}
-
-
- Použít výraz switch
-
-
Upozornění: dočasné vkládání do volání podmíněné metody.
@@ -432,11 +417,6 @@
TODO: Zrušte komentář následujícího řádku, pokud se výše přepisuje finalizační metoda.
-
-
- Direktiva Using není potřebná.
-
-
příkaz switch
@@ -677,26 +657,6 @@
Vlastnosti
-
-
- Použít explicitní typ místo var
-
-
-
-
- Použít explicitní typ
-
-
-
-
- Použít var místo explicitního typu
-
-
-
-
- Použít implicitní typ
-
-
Automatický výběr je zakázaný kvůli deklaraci oboru názvů.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf
index 8de0e269ca438..b3e1707332c38 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf
@@ -72,11 +72,6 @@
out-Parameter zuweisen (beim Start)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Switch-Anweisung in Ausdruck konvertieren
-
-
In Methode konvertieren
@@ -152,11 +147,6 @@
Alle Vorkommen vereinfachen
-
-
- Nicht benötigte Using-Direktiven entfernen
-
-
Zugriffsmodifizierer sortieren
@@ -167,11 +157,6 @@
Versiegelung der Klasse "{0}" aufheben
-
-
- Switch-Ausdruck verwenden
-
-
Warnung: temporäres Inlining in bedingtem Methodenaufruf.
@@ -432,11 +417,6 @@
TODO: Auskommentierung der folgenden Zeile aufheben, wenn der Finalizer weiter oben überschrieben wird.
-
-
- Using-Direktive ist unnötig.
-
-
switch-Anweisung
@@ -677,26 +657,6 @@
Eigenschaften
-
-
- Expliziten Typ anstelle von "var" verwenden
-
-
-
-
- Expliziten Typ verwenden
-
-
-
-
- "var" anstelle des expliziten Typs verwenden
-
-
-
-
- Impliziten Typ verwenden
-
-
Die automatische Auswahl ist aufgrund der Namespacedeklaration deaktiviert.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf
index 184fc09570595..fd17bea704b12 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf
@@ -72,11 +72,6 @@
Asignar parámetros "out" (al inicio)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Convertir una instrucción switch en expresión
-
-
Convertir al método
@@ -152,11 +147,6 @@
Simplificar todas las repeticiones
-
-
- Eliminar instrucciones Using innecesarias
-
-
Ordenar modificadores de accesibilidad
@@ -167,11 +157,6 @@
Quitar el sello de la clase "{0}"
-
-
- Usar la expresión "switch"
-
-
Advertencia: Inserción de una llamada temporal en otra de método condicional.
@@ -432,11 +417,6 @@
TODO: quite la marca de comentario de la siguiente línea si el finalizador se ha reemplazado antes.
-
-
- El uso de la directiva no es necesario.
-
-
instrucción switch
@@ -677,26 +657,6 @@
Propiedades
-
-
- Usar un tipo explícito en lugar de 'var'
-
-
-
-
- Usar un tipo explícito
-
-
-
-
- Usar 'var' en lugar de un tipo explícito
-
-
-
-
- Usar un tipo implícito
-
-
Se ha deshabilitado la selección automática durante la declaración del espacio de nombres.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf
index 35d37e2a05e0e..68c90454345ef 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf
@@ -72,11 +72,6 @@
Assigner des paramètres 'out' (au début)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Convertir l'instruction switch en expression
-
-
Convertir en méthode
@@ -152,11 +147,6 @@
Simplifier toutes les occurrences
-
-
- Supprimer les Usings inutiles
-
-
Trier les modificateurs d'accessibilité
@@ -167,11 +157,6 @@
Classe unsealed '{0}'
-
-
- Utiliser l'expression 'switch'
-
-
Avertissement : Inlining temporaire dans un appel de méthode conditionnel.
@@ -432,11 +417,6 @@
TODO: supprimer les marques de commentaire pour la ligne suivante si le finaliseur est remplacé ci-dessus.
-
-
- La directive using n'est pas nécessaire.
-
-
instruction switch
@@ -677,26 +657,6 @@
Propriétés
-
-
- Utiliser un type explicite au lieu de 'var'
-
-
-
-
- Utiliser un type explicite
-
-
-
-
- utiliser 'var' au lieu d'un type explicite
-
-
-
-
- Utiliser un type implicite
-
-
Sélection automatique désactivée en raison d'une déclaration d'espace de noms.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf
index 4eebac0efbcef..74a33080553fe 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf
@@ -72,11 +72,6 @@
Assegnare parametri 'out' (all'inizio)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Converti l'istruzione switch in espressione
-
-
Converti in metodo
@@ -152,11 +147,6 @@
Semplifica tutte le occorrenze
-
-
- Rimuovi istruzioni using non necessarie
-
-
Ordina i modificatori di accessibilità
@@ -167,11 +157,6 @@
Rimuovi seal dalla classe '{0}'
-
-
- Usa l'espressione 'switch'
-
-
Avviso: incorporamento dell'elemento temporaneo nella chiamata a un metodo condizionale.
@@ -432,11 +417,6 @@
TODO: rimuovere il commento dalla riga seguente se è stato eseguito l'override del finalizzatore.
-
-
- La direttiva using non è necessaria.
-
-
istruzione switch
@@ -677,26 +657,6 @@
Proprietà
-
-
- Usa il tipo esplicito invece di 'var'
-
-
-
-
- Usa il tipo esplicito
-
-
-
-
- usa 'var' invece del tipo esplicito
-
-
-
-
- Usa il tipo implicito
-
-
La selezione automatica è disabilitata a causa della dichiarazione dello spazio dei nomi.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf
index b87d0c0f0a002..73a7fcc7581bc 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf
@@ -72,11 +72,6 @@
'out' パラメーターの割り当て (開始時)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- switch ステートメントを式に変換します
-
-
メソッドに変換
@@ -152,11 +147,6 @@
すべての出現箇所を簡素化します
-
-
- 不要な using の削除
-
-
アクセシビリティ修飾子を並べ替える
@@ -167,11 +157,6 @@
クラス '{0}' のシールを解除
-
-
- 'switch' 式を使用します
-
-
警告: 一時メソッド呼び出しを条件付きメソッド呼び出しにインライン展開しています。
@@ -432,11 +417,6 @@
TODO: 上のファイナライザーがオーバーライドされる場合は、次の行のコメントを解除してください。
-
-
- Using ディレクティブは必要ありません。
-
-
switch ステートメント
@@ -677,26 +657,6 @@
プロパティ
-
-
- var' ではなく明示的な型を使用します
-
-
-
-
- 明示的な型の使用
-
-
-
-
- 明示的な型ではなく 'var' を使用します
-
-
-
-
- 暗黙的な型の使用
-
-
名前空間宣言により、Autoselect は無効です。
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf
index f2786fb05eacd..1feebc3bcf9c1 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf
@@ -72,11 +72,6 @@
'out' 매개 변수 할당(시작 시)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- switch 문을 식으로 변환
-
-
메서드로 변환
@@ -152,11 +147,6 @@
모든 항목 단순화
-
-
- 불필요한 Using 제거
-
-
접근성 한정자 정렬
@@ -167,11 +157,6 @@
'{0}' 클래스 봉인 해제
-
-
- 'switch' 식 사용
-
-
경고: 임시 작업을 조건부 메서드 호출로 인라인 처리합니다.
@@ -432,11 +417,6 @@
TODO: 위의 종료자가 재정의된 경우 다음 코드 줄의 주석 처리를 제거합니다.
-
-
- Using 지시문은 필요하지 않습니다.
-
-
switch 문
@@ -677,26 +657,6 @@
속성
-
-
- var' 대신에 명시적 형식을 사용합니다.
-
-
-
-
- 명시적 형식 사용
-
-
-
-
- 대신 명시적 형식의 'var'을 사용합니다.
-
-
-
-
- 암시적 형식 사용
-
-
네임스페이스 선언으로 인해 자동 선택을 사용할 수 없습니다.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf
index a8600ac7a6021..667594f592367 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf
@@ -72,11 +72,6 @@
Przypisz parametry „out” (na początku)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Konwertuj instrukcję switch na wyrażenie
-
-
Konwertuj na metodę
@@ -152,11 +147,6 @@
Uprość wszystkie wystąpienia
-
-
- Usuń niepotrzebne użycia
-
-
Sortuj modyfikatory dostępności
@@ -167,11 +157,6 @@
Odpieczętuj klasę „{0}”
-
-
- Użyj wyrażenia „switch”
-
-
Ostrzeżenie: tymczasowe wbudowywanie do wywołania metody warunkowej.
@@ -432,11 +417,6 @@
TODO: Usunąć komentarz z poniższego wiersza, jeśli finalizator został przesłonięty powyżej.
-
-
- Dyrektywa using jest niepotrzebna.
-
-
instrukcja switch
@@ -677,26 +657,6 @@
Właściwości
-
-
- Użyj jawnego typu zamiast deklaracji „var”
-
-
-
-
- Użyj jawnego typu
-
-
-
-
- użyj deklaracji „var” zamiast jawnego typu
-
-
-
-
- Użyj niejawnego typu
-
-
Automatyczne zaznaczanie zostało wyłączone z powodu deklaracji przestrzeni nazw.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf
index 1dd4fdd0681f3..00cb6453b9269 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf
@@ -72,11 +72,6 @@
Atribuir parâmetros 'out' (no início)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Converter a instrução switch em expressão
-
-
Converter em método
@@ -152,11 +147,6 @@
Simplificar todas as ocorrências
-
-
- Remover Usos Desnecessários
-
-
Classificar modificadores de acessibilidade
@@ -167,11 +157,6 @@
Desselar a classe '{0}'
-
-
- Usar a expressão 'switch'
-
-
Aviso: embutindo a chamada de método temporária na condicional.
@@ -432,11 +417,6 @@
TODO: remover marca de comentário da linha a seguir se o finalizador for substituído acima.
-
-
- O uso da diretiva é desnecessário.
-
-
instrução switch
@@ -677,26 +657,6 @@
Propriedades
-
-
- Usar o tipo explícito em vez de 'var'
-
-
-
-
- Usar o tipo explícito
-
-
-
-
- usar 'var' em vez do tipo explícito
-
-
-
-
- Usar o tipo implícito
-
-
Seleção automática desabilitada devido à declaração de namespace.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf
index d1ef86ae9dd04..06f89a7ce6536 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf
@@ -72,11 +72,6 @@
Присвоение значений параметров "out" (при запуске)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Преобразовать оператор switch в выражение
-
-
Преобразовать в метод
@@ -152,11 +147,6 @@
Упростить все вхождения
-
-
- Удалить ненужные директивы using
-
-
Сортировать модификаторы доступности
@@ -167,11 +157,6 @@
Распечатать класс "{0}"
-
-
- Использовать выражение switch
-
-
Предупреждение: встраивание временных элементов в условный вызов метода.
@@ -432,11 +417,6 @@
TODO: раскомментировать следующую строку, если метод завершения переопределен выше.
-
-
- Директива using не нужна.
-
-
оператор switch
@@ -677,26 +657,6 @@
Свойства
-
-
- Использовать явный тип вместо var
-
-
-
-
- Использование явного типа
-
-
-
-
- Использовать var вместо явного типа
-
-
-
-
- Использование неявного типа
-
-
Автовыбор отключен из-за объявления пространства имен.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf
index 4ef34a3ce8af4..52e8f23df9e31 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf
@@ -72,11 +72,6 @@
'out' parametreleri ata (başlangıçta)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- Switch deyimini ifadeye dönüştür
-
-
Yönteme dönüştür
@@ -152,11 +147,6 @@
Tüm yinelemeleri basitleştir
-
-
- Gereksiz Kullanımları Kaldır
-
-
Erişilebilirlik değiştiricilerini sırala
@@ -167,11 +157,6 @@
'{0}' sınıfının mührünü aç
-
-
- 'Switch' ifadesini kullan
-
-
Uyarı: Koşullu yöntem çağrısında geçici öğe satır içinde kullanılıyor.
@@ -432,11 +417,6 @@
TODO: sonlandırıcı yukarıda geçersiz kılınırsa aşağıdaki satırın açıklamasını kaldırın.
-
-
- Using yönergesi gerekli değildir.
-
-
switch deyimi
@@ -677,26 +657,6 @@
Özellikler
-
-
- Var' yerine açık tür kullan
-
-
-
-
- Açık tür kullanma
-
-
-
-
- açık tür yerine 'var' kullan
-
-
-
-
- Örtük tür kullanma
-
-
Ad alanı bildirimi nedeniyle otomatik seçme devre dışı bırakıldı.
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf
index b3e4fdea70675..d765263d14d13 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf
@@ -72,11 +72,6 @@
分配 "out" (在开始处)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- 将 switch 语句转换为表达式
-
-
转换为方法
@@ -152,11 +147,6 @@
简化所有事件
-
-
- 删除不必要的 Using
-
-
对可访问性修饰符排序
@@ -167,11 +157,6 @@
Unseal 类 "{0}"
-
-
- 使用 "switch" 表达式
-
-
警告: 即将在条件方法调用中内联临时内容。
@@ -432,11 +417,6 @@
TODO: 如果在以上内容中替代了终结器,则取消注释以下行。
-
-
- Using 指令是不需要的。
-
-
switch 语句
@@ -677,26 +657,6 @@
属性
-
-
- 用显式类型代替 "var"
-
-
-
-
- 使用显式类型
-
-
-
-
- 用 "var" 代替显式类型
-
-
-
-
- 使用隐式类型
-
-
自动选择由于命名空间声明而被禁用。
diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf
index 92f07214fa73e..2f89d97cf058c 100644
--- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf
+++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf
@@ -72,11 +72,6 @@
指派 'out' 參數 (開始時)
{Locked="out"} "out" is a C# keyword and should not be localized.
-
-
- 將 switch 陳述式轉換為運算式
-
-
轉換為方法
@@ -152,11 +147,6 @@
簡化所有項目
-
-
- 移除不必要的 Using
-
-
排序協助工具修飾元
@@ -167,11 +157,6 @@
為類別 '{0}' 解密
-
-
- 使用 'switch' 運算式
-
-
警告: 內嵌臨時加入條件式方法呼叫。
@@ -432,11 +417,6 @@
TODO: 如果上方的完成項已被覆寫,即取消下行的註解狀態。
-
-
- 無須使用指示詞。
-
-
switch 陳述式
@@ -677,26 +657,6 @@
屬性
-
-
- 使用明確類型,而非 'var'
-
-
-
-
- 使用明確類型
-
-
-
-
- 使用 'var',而非明確類型
-
-
-
-
- 使用隱含類型
-
-
由於命名空間宣告,所以停用自動選取。
diff --git a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs
index dd2ceb561ebff..bdd37b11ee275 100644
--- a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs
+++ b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs
@@ -5,6 +5,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.AddImports;
+using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.Shared.Extensions;
namespace Microsoft.CodeAnalysis.CodeFixes.Suppression
@@ -35,9 +36,9 @@ protected override async Task GetChangedSuppressionDocumentAsync(Cance
var suppressionsRoot = await suppressionsDoc.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
var compilation = await suppressionsDoc.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
var addImportsService = suppressionsDoc.GetRequiredLanguageService();
-
+ var generator = suppressionsDoc.GetRequiredLanguageService();
suppressionsRoot = Fixer.AddGlobalSuppressMessageAttribute(
- suppressionsRoot, _targetSymbol, _suppressMessageAttribute, _diagnostic, workspace, compilation, addImportsService, cancellationToken);
+ suppressionsRoot, _targetSymbol, _suppressMessageAttribute, _diagnostic, workspace, compilation, addImportsService, generator, cancellationToken);
return suppressionsDoc.WithSyntaxRoot(suppressionsRoot);
}
diff --git a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs
index af9f3c024751d..8c0be721adc3c 100644
--- a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs
+++ b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs
@@ -11,6 +11,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.AddImports;
using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
@@ -123,7 +124,7 @@ protected override async Task GetChangedSuppressionDocumentAsync(Cance
var suppressionsRoot = await suppressionsDoc.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
var compilation = await suppressionsDoc.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
var addImportsService = suppressionsDoc.GetRequiredLanguageService();
-
+ var generator = suppressionsDoc.GetRequiredLanguageService();
foreach (var kvp in _diagnosticsBySymbol)
{
var targetSymbol = kvp.Key;
@@ -134,7 +135,7 @@ protected override async Task GetChangedSuppressionDocumentAsync(Cance
Contract.ThrowIfFalse(!diagnostic.IsSuppressed);
suppressionsRoot = Fixer.AddGlobalSuppressMessageAttribute(
suppressionsRoot, targetSymbol, _suppressMessageAttribute, diagnostic,
- workspace, compilation, addImportsService, cancellationToken);
+ workspace, compilation, addImportsService, generator, cancellationToken);
}
}
diff --git a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.cs b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.cs
index c4073ce67f87f..23a656727224c 100644
--- a/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.cs
+++ b/src/Features/Core/Portable/CodeFixes/Suppression/AbstractSuppressionCodeFixProvider.cs
@@ -10,6 +10,7 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.AddImports;
using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.PooledObjects;
@@ -55,6 +56,7 @@ protected abstract SyntaxNode AddGlobalSuppressMessageAttribute(
Workspace workspace,
Compilation compilation,
IAddImportsService addImportsService,
+ SyntaxGenerator generator,
CancellationToken cancellationToken);
protected abstract SyntaxNode AddLocalSuppressMessageAttribute(
diff --git a/src/Features/Core/Portable/FeaturesResources.Designer.cs b/src/Features/Core/Portable/FeaturesResources.Designer.cs
index 4e4f24ee065c7..e31578a974b59 100644
--- a/src/Features/Core/Portable/FeaturesResources.Designer.cs
+++ b/src/Features/Core/Portable/FeaturesResources.Designer.cs
@@ -2588,15 +2588,6 @@ internal static string Make_method_synchronous {
}
}
- ///
- /// Looks up a localized string similar to Make readonly fields writable.
- ///
- internal static string Make_readonly_fields_writable {
- get {
- return ResourceManager.GetString("Make_readonly_fields_writable", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Member name can be simplified.
///
@@ -3435,15 +3426,6 @@ internal static string Remove_unread_private_members {
}
}
- ///
- /// Looks up a localized string similar to Remove unused member.
- ///
- internal static string Remove_unused_member {
- get {
- return ResourceManager.GetString("Remove_unused_member", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Remove unused parameter.
///
diff --git a/src/Features/Core/Portable/FeaturesResources.resx b/src/Features/Core/Portable/FeaturesResources.resx
index 02aea7add61d9..4ba4b2719fb7c 100644
--- a/src/Features/Core/Portable/FeaturesResources.resx
+++ b/src/Features/Core/Portable/FeaturesResources.resx
@@ -1388,9 +1388,6 @@ This version used in: {2}
Adding a method with an explicit interface specifier will prevent the debug session from continuing.
-
- Remove unused member
-
Private member '{0}' is unused.
@@ -1622,10 +1619,6 @@ This version used in: {2}
'using' statement can be simplified
-
- Make readonly fields writable
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Move contents to namespace...
diff --git a/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj b/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj
index 5667ac50fb903..c75b1fe56c5a6 100644
--- a/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj
+++ b/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj
@@ -78,6 +78,7 @@
+
@@ -95,7 +96,6 @@
-
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
index 65a7c3f0bda05..844ec594369a3 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf
@@ -362,11 +362,6 @@
Nastavit jako statickou
-
-
- Umožnit zápis do polí jen pro čtení (readonly)
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Převrátit podmínku
@@ -497,11 +492,6 @@
Odebrat nepřečtené soukromé členy
-
-
- Odebrat nepoužitý člen
-
-
Odebrat nepoužívaný parametr
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
index 5ea0a6af4bea7..46108b69658ec 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf
@@ -362,11 +362,6 @@
Als statisch festlegen
-
-
- readonly-Felder als schreibbar festlegen
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Bedingten Operator umkehren
@@ -497,11 +492,6 @@
Ungelesene private Member entfernen
-
-
- Nicht verwendete Member entfernen
-
-
Nicht verwendete Parameter entfernen
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
index 3fe0e62d3ee86..e8174688cacb2 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf
@@ -362,11 +362,6 @@
Hacer estático
-
-
- Convertir en editables los campos readonly
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Invertir condicional
@@ -497,11 +492,6 @@
Quitar miembros privados no leídos
-
-
- Quitar miembros sin usar
-
-
Quitar el parámetro no utilizado
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
index 0ed8c9a36cfaa..4bfcf322ecff1 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf
@@ -362,11 +362,6 @@
Rendre statique
-
-
- Rendre les champs readonly accessibles en écriture
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Inverser un élément conditionnel
@@ -497,11 +492,6 @@
Supprimer les membres privés non lus
-
-
- Supprimer les membres non utilisés
-
-
Supprimer le paramètre inutilisé
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
index 59604fa2a42f3..f8071f515cdd9 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf
@@ -362,11 +362,6 @@
Imposta come statici
-
-
- Rendi scrivibili i campi readonly
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Inverti espressione condizionale
@@ -497,11 +492,6 @@
Rimuovi i membri privati non letti
-
-
- Rimuovi il membro inutilizzato
-
-
Rimuovere il parametro inutilizzato
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
index ff8d036230be3..0c4bffd6f6424 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf
@@ -362,11 +362,6 @@
静的にする
-
-
- readonly フィールドを書き込み可能にします
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
条件を反転します
@@ -497,11 +492,6 @@
読み取られていないプライベート メンバーを削除
-
-
- 未使用のメンバーを削除
-
-
未使用のパラメーターを削除します
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
index 026b0aef40405..72a5ea9a7698f 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf
@@ -362,11 +362,6 @@
정적으로 만들기
-
-
- readonly 필드를 쓰기 가능으로 지정
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
조건 반전
@@ -497,11 +492,6 @@
읽지 않은 private 멤버 제거
-
-
- 사용되지 않은 멤버 제거
-
-
사용하지 않는 매개 변수를 제거하세요.
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
index 35f8531753f11..0ee0a6b40382f 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf
@@ -362,11 +362,6 @@
Ustaw jako statyczne
-
-
- Ustaw możliwość zapisu dla pól z deklaracją readonly
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Odwróć warunkowe
@@ -497,11 +492,6 @@
Usuń nieodczytywane składowe prywatne
-
-
- Usuń nieużywaną składową
-
-
Usuń nieużywany parametr
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
index 1a29a17fb5f69..3063d9cf6ec6e 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf
@@ -362,11 +362,6 @@
Tornar estático
-
-
- Alterar os campos readonly para graváveis
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Inverter condicional
@@ -497,11 +492,6 @@
Remover membros particulares não lidos
-
-
- Remover membro não utilizado
-
-
Remover o parâmetro não utilizado
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
index 79a4ea6ad38c3..a63960a7b79d9 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf
@@ -362,11 +362,6 @@
Сделать статическим
-
-
- Сделать поля readonly доступными для записи
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Инвертировать условный оператор
@@ -497,11 +492,6 @@
Удалить непрочитанные закрытые члены
-
-
- Удалить неиспользуемый член
-
-
Удалите неиспользуемый параметр
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
index d9cae62a3498a..1e37cc10be9b0 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf
@@ -362,11 +362,6 @@
Statik yap
-
-
- readonly alanları yazılabilir yap
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
Koşullu öğeyi ters çevir
@@ -497,11 +492,6 @@
Okunmamış özel üyeleri kaldır
-
-
- Kullanılmayan üye kaldırma
-
-
Kullanılmayan parametreyi kaldırma
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
index 3c25405931f16..c150c0cf5f81c 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf
@@ -362,11 +362,6 @@
设为静态
-
-
- 使 readonly 字段可写
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
反转条件
@@ -497,11 +492,6 @@
删除未读的私有成员
-
-
- 删除未使用的成员
-
-
删除未使用的参数
diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
index 9c4a041412e80..06aff5b43591a 100644
--- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
+++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf
@@ -362,11 +362,6 @@
使其變成靜態
-
-
- 將 readonly 欄位設為可寫入
- {Locked="readonly"} "readonly" is C# keyword and should not be localized.
-
反轉條件
@@ -497,11 +492,6 @@
刪除未讀取的私用成員
-
-
- 移除未使用的成員
-
-
移除未使用的參數
diff --git a/src/Features/LanguageServer/ProtocolUnitTests/CodeActions/CodeActionsTests.cs b/src/Features/LanguageServer/ProtocolUnitTests/CodeActions/CodeActionsTests.cs
index a77ecb7284b48..fb380bb92e6d4 100644
--- a/src/Features/LanguageServer/ProtocolUnitTests/CodeActions/CodeActionsTests.cs
+++ b/src/Features/LanguageServer/ProtocolUnitTests/CodeActions/CodeActionsTests.cs
@@ -27,11 +27,11 @@ void M()
}
}";
var (solution, locations) = CreateTestSolution(markup);
- var expected = CreateCommand(CSharpFeaturesResources.Use_implicit_type, locations["caret"].Single());
+ var expected = CreateCommand(CSharpAnalyzersResources.Use_implicit_type, locations["caret"].Single());
var clientCapabilities = CreateClientCapabilitiesWithExperimentalValue("supportsWorkspaceEdits", JToken.FromObject(false));
var results = await RunGetCodeActionsAsync(solution, locations["caret"].Single(), clientCapabilities);
- var useImplicitTypeResult = results.Single(r => r.Title == CSharpFeaturesResources.Use_implicit_type);
+ var useImplicitTypeResult = results.Single(r => r.Title == CSharpAnalyzersResources.Use_implicit_type);
AssertJsonEquals(expected, useImplicitTypeResult);
}
diff --git a/src/Features/VisualBasic/Portable/CodeFixes/Suppression/VisualBasicSuppressionCodeFixProvider.vb b/src/Features/VisualBasic/Portable/CodeFixes/Suppression/VisualBasicSuppressionCodeFixProvider.vb
index c5ef04818a959..e9267703ad346 100644
--- a/src/Features/VisualBasic/Portable/CodeFixes/Suppression/VisualBasicSuppressionCodeFixProvider.vb
+++ b/src/Features/VisualBasic/Portable/CodeFixes/Suppression/VisualBasicSuppressionCodeFixProvider.vb
@@ -8,6 +8,7 @@ Imports System.Threading
Imports Microsoft.CodeAnalysis.AddImports
Imports Microsoft.CodeAnalysis.CodeFixes
Imports Microsoft.CodeAnalysis.CodeFixes.Suppression
+Imports Microsoft.CodeAnalysis.Editing
Imports Microsoft.CodeAnalysis.Formatting
Imports Microsoft.CodeAnalysis.Simplification
Imports Microsoft.CodeAnalysis.Text
@@ -137,6 +138,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Suppression
workspace As Workspace,
compilation As Compilation,
addImportsService As IAddImportsService,
+ generator As SyntaxGenerator,
cancellationToken As CancellationToken) As SyntaxNode
Dim compilationRoot = DirectCast(newRoot, CompilationUnitSyntax)
Dim isFirst = Not compilationRoot.Attributes.Any()
diff --git a/src/Features/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Features.vbproj b/src/Features/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Features.vbproj
index 446144358e19d..cccedd4c421ef 100644
--- a/src/Features/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Features.vbproj
+++ b/src/Features/VisualBasic/Portable/Microsoft.CodeAnalysis.VisualBasic.Features.vbproj
@@ -38,6 +38,7 @@
+
diff --git a/src/Features/VisualBasic/Portable/VBFeaturesResources.resx b/src/Features/VisualBasic/Portable/VBFeaturesResources.resx
index ebc1ffe031536..02b6ccc1e4026 100644
--- a/src/Features/VisualBasic/Portable/VBFeaturesResources.resx
+++ b/src/Features/VisualBasic/Portable/VBFeaturesResources.resx
@@ -153,9 +153,6 @@
Delete the '{0}' statement.
-
- Remove Unnecessary Imports
-
Type a name here to declare a new field.
@@ -1012,9 +1009,6 @@ Sub(<parameterList>) <statement>
TODO: uncomment the following line if Finalize() is overridden above.
-
- Imports statement is unnecessary.
-
Try block
{Locked="Try"} "Try" is a VB keyword and should not be localized.
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.cs.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.cs.xlf
index 0d3273f25546f..c5b7721070a3a 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.cs.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.cs.xlf
@@ -92,11 +92,6 @@
<Víc typů>
-
-
- Odebrat nepotřebné importy
-
-
Sem vložte název, kterým deklarujete novou položku.
@@ -1537,11 +1532,6 @@ Sub(<seznam_parametrů>) <výraz>
TODO: Zrušte komentář následujícího řádku, pokud se výše přepisuje metoda Finalize().
-
-
- Příkaz Imports není potřebný.
-
-
Blok Try
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.de.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.de.xlf
index dfdac24f1df19..510d245a5f235 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.de.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.de.xlf
@@ -92,11 +92,6 @@
<Mehrere Typen>
-
-
- Unnötige Import-Direktiven entfernen
-
-
Geben Sie hier einen Namen ein, um ein neues Feld zu deklarieren.
@@ -1537,11 +1532,6 @@ Sub(<Parameterliste>) <Ausdruck>
TODO: Auskommentierung der folgenden Zeile aufheben, wenn Finalize() oben überschrieben wird.
-
-
- Imports-Anweisung ist unnötig.
-
-
Try-Block
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.es.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.es.xlf
index c9306403e79ff..fe8a1f17b2990 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.es.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.es.xlf
@@ -92,11 +92,6 @@
<Varios tipos>
-
-
- Quitar instrucciones Import innecesarias
-
-
Escriba aquí un nombre para declarar un nuevo campo.
@@ -1537,11 +1532,6 @@ Sub(<listaDeParámetros>) <instrucción>
TODO: quite la marca de comentario de la siguiente línea si Finalize() se ha reemplazado antes.
-
-
- La declaración de importaciones no es necesaria.
-
-
Bloque Try
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.fr.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.fr.xlf
index 318181f1cd2e5..c5ce2100a3041 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.fr.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.fr.xlf
@@ -92,11 +92,6 @@
<Plusieurs types>
-
-
- Supprimer les importations superflues
-
-
Tapez un nom ici pour déclarer un nouveau champ.
@@ -1537,11 +1532,6 @@ Sub(<parameterList>) <statement>
TODO: supprimer les marques de commentaire pour la ligne suivante si Finalize() est remplacé ci-dessus.
-
-
- L'instruction Imports n'est pas utile.
-
-
Bloc Try
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.it.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.it.xlf
index 040601d324035..be83e1bffdafd 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.it.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.it.xlf
@@ -92,11 +92,6 @@
<Più tipi>
-
-
- Rimuovi Import non necessari
-
-
Digitare qui un nome per dichiarare un nuovo campo.
@@ -1537,11 +1532,6 @@ Sub(<elencoParametri>) <istruzione>
TODO: rimuovere il commento dalla riga seguente se è stato eseguito l'override di Finalize().
-
-
- L'istruzione Imports non è necessaria.
-
-
blocco Try
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ja.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ja.xlf
index f97023cf54191..0910e7d0119aa 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ja.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ja.xlf
@@ -92,11 +92,6 @@
<複数の種類>
-
-
- 不要なインポートの削除
-
-
新しいフィールドを宣言するには、ここに名前を入力します。
@@ -1537,11 +1532,6 @@ Sub(<parameterList>) <statement>
TODO: 上の Finalize() がオーバーライドされている場合は、次の行のコメントを解除してください。
-
-
- Imports ステートメントは不要です。
-
-
Try ブロック
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ko.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ko.xlf
index f524bcbdd78a7..5da8aa9a7781a 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ko.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ko.xlf
@@ -92,11 +92,6 @@
<여러 형식>
-
-
- 불필요한 Imports 제거
-
-
여기에 이름을 입력하여 새 필드를 선언하세요.
@@ -1537,11 +1532,6 @@ Sub(<parameterList>) <statement>
TODO: 위의 Finalize()가 재정의된 경우 다음 줄의 주석 처리를 제거합니다.
-
-
- Imports 문은 필요하지 않습니다.
-
-
Try 블록
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pl.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pl.xlf
index 9427095f507a8..5c439500b1290 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pl.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pl.xlf
@@ -92,11 +92,6 @@
<Wiele typów>
-
-
- Usuń niepotrzebne importy
-
-
Wpisz tutaj nazwę, aby utworzyć deklarację nowego pola.
@@ -1537,11 +1532,6 @@ Sub(<listaParametrów>) <instrukcja>
TODO: usuń komentarz z poniższego wiersza, jeśli powyższa metoda Finalize() została przesłonięta.
-
-
- Instrukcja imports jest niepotrzebna.
-
-
Blok Try
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pt-BR.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pt-BR.xlf
index 3f2074de04761..edf910539cce3 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pt-BR.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pt-BR.xlf
@@ -92,11 +92,6 @@
<Vários Tipos>
-
-
- Remover Importações Desnecessárias
-
-
Digite um nome aqui para declarar um novo campo.
@@ -1537,11 +1532,6 @@ Sub(<parameterList>) <statement>
TODO: remover marca de comentário da linha a seguir se Finalize() for substituído acima.
-
-
- A instrução Imports é desnecessária.
-
-
Bloco Try
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ru.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ru.xlf
index 1f85c8c78fa25..2ddb6090fa2d2 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ru.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ru.xlf
@@ -92,11 +92,6 @@
<Несколько типов>
-
-
- Удалить ненужные импорты
-
-
Введите здесь имя для объявления нового поля.
@@ -1537,11 +1532,6 @@ Sub(<parameterList>) <statement>
TODO: раскомментировать следующую строку, если Finalize() переопределен выше.
-
-
- Оператор Imports не нужен.
-
-
Блок Try
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.tr.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.tr.xlf
index 9d0ca347d7f9b..b66b5d9e82d55 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.tr.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.tr.xlf
@@ -92,11 +92,6 @@
<Multiple Types>
-
-
- Gereksiz İçeri Aktarmaları Kaldır
-
-
Yeni bir alan bildirmek için buraya bir ad yazın.
@@ -1537,11 +1532,6 @@ Sub(<parameterList>) <statement>
TODO: Finalize() yukarıda geçersiz kılınırsa aşağıdaki satırın açıklamasını kaldırın.
-
-
- Imports deyimi gerekli değildir.
-
-
Try bloğu
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hans.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hans.xlf
index 0dd85f6c2a024..8915c682b0d2e 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hans.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hans.xlf
@@ -92,11 +92,6 @@
<多种类型>
-
-
- 删除不必要的导入
-
-
请在此处键入名称以声明新字段。
@@ -1537,11 +1532,6 @@ Sub(<parameterList>) <statement>
TODO: 如果在以上内容中替代了 Finalize(),则取消注释以下行。
-
-
- Imports 语句是不需要的。
-
-
Try 块
diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hant.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hant.xlf
index e4d1718dbc4bb..0841dafece934 100644
--- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hant.xlf
+++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hant.xlf
@@ -92,11 +92,6 @@
<多項類型>
-
-
- 移除不必要的匯入
-
-
於此輸入名稱以宣告新的欄位。
@@ -1537,11 +1532,6 @@ Sub(<parameterList>) <statement>
TODO: 覆寫上列 Finalize() 時,取消下行的註解狀態。
-
-
- 無須 Imports 陳述式。
-
-
Try 區塊
diff --git a/src/Test/Utilities/Portable/Roslyn.Test.Utilities.csproj b/src/Test/Utilities/Portable/Roslyn.Test.Utilities.csproj
index 9a20e8ddf591a..7aac547c0edc3 100644
--- a/src/Test/Utilities/Portable/Roslyn.Test.Utilities.csproj
+++ b/src/Test/Utilities/Portable/Roslyn.Test.Utilities.csproj
@@ -59,6 +59,12 @@
+
+
+
+
+
+
diff --git a/src/VisualStudio/LiveShare/Test/PreviewCodeActionsTests.cs b/src/VisualStudio/LiveShare/Test/PreviewCodeActionsTests.cs
index 7a3c6c85ec217..6be210fe276f5 100644
--- a/src/VisualStudio/LiveShare/Test/PreviewCodeActionsTests.cs
+++ b/src/VisualStudio/LiveShare/Test/PreviewCodeActionsTests.cs
@@ -27,7 +27,7 @@ void M()
var (solution, locations) = CreateTestSolution(markup);
var expected = CreateTextEdit("var", locations["edit"].First().Range);
- var results = await TestHandleAsync(solution, CreateRunCodeActionParams(CSharpFeaturesResources.Use_implicit_type, locations["caret"].First()));
+ var results = await TestHandleAsync(solution, CreateRunCodeActionParams(CSharpAnalyzersResources.Use_implicit_type, locations["caret"].First()));
AssertJsonEquals(new LSP.TextEdit[] { expected }, results);
}
diff --git a/src/VisualStudio/LiveShare/Test/RunCodeActionsHandlerTests.cs b/src/VisualStudio/LiveShare/Test/RunCodeActionsHandlerTests.cs
index d527faf48896f..45c35e1a76534 100644
--- a/src/VisualStudio/LiveShare/Test/RunCodeActionsHandlerTests.cs
+++ b/src/VisualStudio/LiveShare/Test/RunCodeActionsHandlerTests.cs
@@ -29,7 +29,7 @@ void M()
var (solution, ranges) = CreateTestSolution(markup);
var codeActionLocation = ranges["caret"].First();
- var results = await TestHandleAsync(solution, CreateExecuteCommandParams(codeActionLocation, CSharpFeaturesResources.Use_implicit_type));
+ var results = await TestHandleAsync(solution, CreateExecuteCommandParams(codeActionLocation, CSharpAnalyzersResources.Use_implicit_type));
Assert.True((bool)results);
}
diff --git a/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.Designer.cs b/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.Designer.cs
index 0849218f7b212..3f126f465690a 100644
--- a/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.Designer.cs
+++ b/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.Designer.cs
@@ -69,33 +69,6 @@ internal static string Cannot_retrieve_the_Span_of_a_null_syntax_reference {
}
}
- ///
- /// Looks up a localized string similar to Code-block preferences.
- ///
- internal static string Code_block_preferences {
- get {
- return ResourceManager.GetString("Code_block_preferences", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Expected string or char literal.
- ///
- internal static string Expected_string_or_char_literal {
- get {
- return ResourceManager.GetString("Expected_string_or_char_literal", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Expression-bodied members.
- ///
- internal static string Expression_bodied_members {
- get {
- return ResourceManager.GetString("Expression_bodied_members", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Implement Interface.
///
@@ -150,15 +123,6 @@ internal static string Node_not_in_parent_s_child_list {
}
}
- ///
- /// Looks up a localized string similar to Null-checking preferences.
- ///
- internal static string Null_checking_preferences {
- get {
- return ResourceManager.GetString("Null_checking_preferences", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Only attributes, constructor initializers, expressions or statements can be made explicit.
///
@@ -169,15 +133,6 @@ internal static string Only_attributes_constructor_initializers_expressions_or_s
}
}
- ///
- /// Looks up a localized string similar to Pattern matching preferences.
- ///
- internal static string Pattern_matching_preferences {
- get {
- return ResourceManager.GetString("Pattern_matching_preferences", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to R&emove and Sort Usings.
///
@@ -214,24 +169,6 @@ internal static string Trivia_is_not_associated_with_token {
}
}
- ///
- /// Looks up a localized string similar to 'using' directive preferences.
- ///
- internal static string using_directive_preferences {
- get {
- return ResourceManager.GetString("using_directive_preferences", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to var preferences.
- ///
- internal static string var_preferences {
- get {
- return ResourceManager.GetString("var_preferences", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Wrapping preferences.
///
diff --git a/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.resx b/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.resx
index 54e6d99229a41..a4643510f319d 100644
--- a/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.resx
+++ b/src/Workspaces/CSharp/Portable/CSharpWorkspaceResources.resx
@@ -123,9 +123,6 @@
Namespace can not be added in this destination.
-
- Expected string or char literal
-
Node does not descend from root.
@@ -144,34 +141,15 @@
Implement Interface
-
- Code-block preferences
-
-
- Expression-bodied members
-
Indentation preferences
-
- Null-checking preferences
-
-
- Pattern matching preferences
-
Space preferences
-
- var preferences
-
Wrapping preferences
-
- 'using' directive preferences
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
R&emove and Sort Usings
diff --git a/src/Workspaces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs b/src/Workspaces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs
index 27615c20a3fa8..74c865acca872 100644
--- a/src/Workspaces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs
+++ b/src/Workspaces/CSharp/Portable/Formatting/CSharpFormattingOptions.cs
@@ -4,12 +4,14 @@
using System.Collections.Immutable;
using System.Diagnostics;
-using Microsoft.CodeAnalysis.Options;
using Roslyn.Utilities;
#if CODE_STYLE
using CSharpWorkspaceResources = Microsoft.CodeAnalysis.CSharp.CSharpCodeStyleResources;
using WorkspacesResources = Microsoft.CodeAnalysis.CodeStyleResources;
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.Options;
#endif
namespace Microsoft.CodeAnalysis.CSharp.Formatting
diff --git a/src/Workspaces/CSharp/Portable/Formatting/Rules/SpacingFormattingRule.cs b/src/Workspaces/CSharp/Portable/Formatting/Rules/SpacingFormattingRule.cs
index a253695849020..f9041017047ef 100644
--- a/src/Workspaces/CSharp/Portable/Formatting/Rules/SpacingFormattingRule.cs
+++ b/src/Workspaces/CSharp/Portable/Formatting/Rules/SpacingFormattingRule.cs
@@ -7,10 +7,12 @@
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Formatting.Rules;
-using Microsoft.CodeAnalysis.Options;
#if CODE_STYLE
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.Options;
#endif
namespace Microsoft.CodeAnalysis.CSharp.Formatting
diff --git a/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj b/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj
index fdd92f406d2a2..ddee3ed455b27 100644
--- a/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj
+++ b/src/Workspaces/CSharp/Portable/Microsoft.CodeAnalysis.CSharp.Workspaces.csproj
@@ -41,6 +41,7 @@
+
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.cs.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.cs.xlf
index 132b288b59eb3..6727a9f9e98fa 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.cs.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.cs.xlf
@@ -2,16 +2,6 @@
-
-
- Předvolby bloků kódu
-
-
-
-
- Členy s výrazem v těle
-
-
Předvolby odsazení
@@ -27,11 +17,6 @@
Obor názvů nejde přidat do tohoto cílového umístění.
-
-
- Očekával se řetězcový nebo znakový literál.
-
-
Uzel nesestupuje z kořene.
@@ -42,16 +27,6 @@
Uzel není v seznamu podřízených položek u nadřazené položky.
-
-
- Předvolby kontrol hodnoty null
-
-
-
-
- Předvolby porovnávání vzorů
-
-
Od&ebrat a seřadit direktivy Using
@@ -92,16 +67,6 @@
Předvolby zalamování
-
-
- Předvolby direktivy using
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- Předvolby pro var
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.de.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.de.xlf
index 59903b263e65c..aa15dc7b1e9ff 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.de.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.de.xlf
@@ -2,16 +2,6 @@
-
-
- Einstellungen für Codeblöcke
-
-
-
-
- Ausdruckskörpermember
-
-
Einstellungen für Einrückung
@@ -27,11 +17,6 @@
Namespace kann zu diesem Ziel nicht hinzugefügt werden.
-
-
- Erwartete Zeichenfolge oder Zeichenliteral
-
-
Knoten steigt nicht vom Stamm ab.
@@ -42,16 +27,6 @@
Knoten befindet sich nicht in der untergeordneten Liste des übergeordneten Elements
-
-
- Einstellungen für NULL-Überprüfung
-
-
-
-
- Einstellungen für den Musterabgleich
-
-
&Unnötige Using-Direktiven entfernen und sortieren
@@ -92,16 +67,6 @@
Umbrucheinstellungen
-
-
- Einstellungen für using-Anweisungen
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- Var-Einstellungen
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.es.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.es.xlf
index c7ae94379ecb4..2aa4dd86a4f2e 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.es.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.es.xlf
@@ -2,16 +2,6 @@
-
-
- Preferencias de bloque de código
-
-
-
-
- Miembros en cuerpo de expresión
-
-
Preferencias de indentación
@@ -27,11 +17,6 @@
El espacio de nombres no se puede agregar en este destino.
-
-
- Cadena o carácter literal esperados
-
-
El nodo no desciende de la raíz.
@@ -42,16 +27,6 @@
El nodo no está en una lista secundaria de la primaria
-
-
- Preferencias de comprobación de nulo
-
-
-
-
- Preferencias de coincidencia de patrón
-
-
Q&uitar y ordenar usos
@@ -92,16 +67,6 @@
Preferencias de encapsulado
-
-
- Preferencias de directiva "using"
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- Preferencias de var
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.fr.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.fr.xlf
index d36b84bb9c882..d81fff37a4442 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.fr.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.fr.xlf
@@ -2,16 +2,6 @@
-
-
- Préférences de bloc de code
-
-
-
-
- Membres expression-bodied
-
-
Préférences de mise en retrait
@@ -27,11 +17,6 @@
L'espace de noms ne peut pas être ajouté dans cette destination.
-
-
- Littéral char ou string attendu
-
-
Le nœud ne provient pas de la racine.
@@ -42,16 +27,6 @@
Le nœud ne figure pas dans la liste des enfants du parent
-
-
- Préférences de vérification de valeur Null
-
-
-
-
- Préférences correspondants au modèle
-
-
Supprim&er et trier les instructions using
@@ -92,16 +67,6 @@
Préférences d'enveloppement
-
-
- Préférences pour la directive 'using'
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- Préférences de var
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.it.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.it.xlf
index e9aa19bc79792..e680643c12376 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.it.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.it.xlf
@@ -2,16 +2,6 @@
-
-
- Preferenze per blocchi di codice
-
-
-
-
- Membri con corpo di espressione
-
-
Preferenze per rientro
@@ -27,11 +17,6 @@
Non è possibile aggiungere lo spazio dei nomi in questa destinazione.
-
-
- È previsto un valore letterale di tipo stringa o char
-
-
Il nodo non discende dalla radice.
@@ -42,16 +27,6 @@
Il nodo non è incluso nell'elenco degli elementi figlio dell'elemento padre
-
-
- Preference per controllo valori Null
-
-
-
-
- Preferenze per criteri di ricerca
-
-
Ri&muovi e ordina using
@@ -92,16 +67,6 @@
Preferenze per ritorno a capo
-
-
- Preferenze per direttive 'using'
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- Preferenze per var
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ja.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ja.xlf
index c7176159a842d..698d74492b5f6 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ja.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ja.xlf
@@ -2,16 +2,6 @@
-
-
- コード ブロックの設定
-
-
-
-
- 式のようなメンバー
-
-
インデント設定
@@ -27,11 +17,6 @@
名前空間は、このターゲットでは追加できません。
-
-
- 文字列または文字リテラルが必要です
-
-
ノードがルートから派生していません。
@@ -42,16 +27,6 @@
ノードが親の子リストにありません
-
-
- Null チェック設定
-
-
-
-
- パターン マッチング設定
-
-
Using の削除と並び替え(&E)
@@ -92,16 +67,6 @@
折り返しの設定
-
-
- 'using' ディレクティブの基本設定
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- var を優先
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ko.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ko.xlf
index b526270bc1160..a624d957ff701 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ko.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ko.xlf
@@ -2,16 +2,6 @@
-
-
- 코드 블록 기본 설정
-
-
-
-
- 식 본문 멤버
-
-
들여쓰기 기본 설정
@@ -27,11 +17,6 @@
이 대상에는 네임스페이스를 추가할 수 없습니다.
-
-
- 문자열 또는 문자 리터럴이 필요합니다.
-
-
노드가 루트의 내림차순이 아닙니다.
@@ -42,16 +27,6 @@
부모의 자식 목록에 노드가 없습니다.
-
-
- Null 검사 기본 설정
-
-
-
-
- 패턴 일치 기본 설정
-
-
Using 제거 및 정렬(&E)
@@ -92,16 +67,6 @@
기본 설정 래핑
-
-
- 'using' 지시문 기본 설정
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- var 기본 설정
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pl.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pl.xlf
index cc127ab53cf1d..f71b516b0979d 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pl.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pl.xlf
@@ -2,16 +2,6 @@
-
-
- Preferencje bloku kodu
-
-
-
-
- Składowe z wyrażeniem w treści
-
-
Preferencje wcięć
@@ -27,11 +17,6 @@
Do tego miejsca docelowego nie można dodać przestrzeni nazw.
-
-
- Oczekiwano ciągu lub literału znakowego
-
-
Węzeł nie jest elementem podrzędnym elementu głównego.
@@ -42,16 +27,6 @@
Węzeł nie znajduje się na liście elementów podrzędnych elementu nadrzędnego
-
-
- Preferencje sprawdzania wartości null
-
-
-
-
- Preferencje dopasowywania do wzorca
-
-
&Usuń i sortuj instrukcje using
@@ -92,16 +67,6 @@
Preferencje zawijania
-
-
- Preferencje dyrektywy „using”
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- Preferencje zmiennych
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pt-BR.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pt-BR.xlf
index 141bd9a09f486..bdbdcb506c524 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pt-BR.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.pt-BR.xlf
@@ -2,16 +2,6 @@
-
-
- Preferências do bloco de código
-
-
-
-
- Membros aptos para expressão
-
-
Preferências de recuo
@@ -27,11 +17,6 @@
Namespace não pode ser adicionado nesse destino.
-
-
- Cadeia de caracteres esperada ou literal char
-
-
Nó não deriva da raiz.
@@ -42,16 +27,6 @@
Nó não está na lista de filhos do pai
-
-
- Preferências de verificação nula
-
-
-
-
- Preferências de correspondência de padrões
-
-
R&emover e Classificar Usos
@@ -92,16 +67,6 @@
Preferências de quebra de linha
-
-
- Preferências da diretiva 'using'
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- preferências de var
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ru.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ru.xlf
index e490b07a224ba..15d6ed6646df2 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ru.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.ru.xlf
@@ -2,16 +2,6 @@
-
-
- Предпочтения для блоков кода
-
-
-
-
- Члены, заданные выражениями
-
-
Предпочтения для отступов
@@ -27,11 +17,6 @@
Не удается добавить пространство имен в этот конечный объект.
-
-
- Требуется строка или знаковый литерал
-
-
Узел не является корневым.
@@ -42,16 +27,6 @@
Узел не входит в родительский список дочерних узлов
-
-
- Настройки проверки на null
-
-
-
-
- Настройки соответствия шаблонов
-
-
У&далить и отсортировать директивы using
@@ -92,16 +67,6 @@
Предпочтения переноса
-
-
- предпочтения для директивы using
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- Предпочтения var
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.tr.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.tr.xlf
index f654029681ee3..b1c3ab31384ca 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.tr.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.tr.xlf
@@ -2,16 +2,6 @@
-
-
- Kod bloğu tercihleri
-
-
-
-
- İfade gövdeli Üyeler
-
-
Girinti tercihleri
@@ -27,11 +17,6 @@
Ad alanı bu hedefe eklenemez.
-
-
- Beklenen dize veya karakter sabiti değeri
-
-
Düğüm kökten azalmaz.
@@ -42,16 +27,6 @@
Düğüm üst öğenin alt öğe listesinde değil
-
-
- Null denetimi tercihleri
-
-
-
-
- Desen eşleştirme tercihleri
-
-
&Kaldır ve Sıralama Usings
@@ -92,16 +67,6 @@
Kaydırma tercihleri
-
-
- 'using' yönergesi tercihleri
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- var tercihleri
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hans.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hans.xlf
index 0573a886900be..f3aa0d431c08a 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hans.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hans.xlf
@@ -2,16 +2,6 @@
-
-
- 代码块首选项
-
-
-
-
- Expression-bodied 成员
-
-
缩进首选项
@@ -27,11 +17,6 @@
不能在此目标中添加命名空间。
-
-
- 预期的字符串或字符文本
-
-
节点并非源自根。
@@ -42,16 +27,6 @@
节点不在父级的子列表中
-
-
- Null 检查首选项
-
-
-
-
- 模式匹配首选项
-
-
删除 Using 和对其排序(&E)
@@ -92,16 +67,6 @@
包装首选项
-
-
- "using" 指令首选项
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- var 首选项
-
-
\ No newline at end of file
diff --git a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hant.xlf b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hant.xlf
index 5fe3512eb85e0..9e24387134fb9 100644
--- a/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hant.xlf
+++ b/src/Workspaces/CSharp/Portable/xlf/CSharpWorkspaceResources.zh-Hant.xlf
@@ -2,16 +2,6 @@
-
-
- 程式碼區塊喜好設定
-
-
-
-
- 運算式主體成員
-
-
縮排喜好設定
@@ -27,11 +17,6 @@
無法將命名空間加入此目的地。
-
-
- 必須是字串或字元常值
-
-
節點不是根的子系。
@@ -42,16 +27,6 @@
節點不在父代的子清單中
-
-
- Null 檢查喜好設定
-
-
-
-
- 模式比對喜好設定
-
-
移除和排序 Using(&E)
@@ -92,16 +67,6 @@
換行喜好設定
-
-
- 'using' 指示詞的喜好設定
- {Locked="using"} "using" is a C# keyword and should not be localized.
-
-
-
- var 喜好設定
-
-
\ No newline at end of file
diff --git a/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs b/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs
index c74089720b38d..f3e47026ab3f2 100644
--- a/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs
+++ b/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs
@@ -7,7 +7,11 @@
using System.Xml.Linq;
using Microsoft.CodeAnalysis.Diagnostics;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.CodeStyle
+#endif
{
internal interface ICodeStyleOption
{
diff --git a/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOptions.cs b/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOptions.cs
index 3f514a21bf4a3..4147259ea812b 100644
--- a/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOptions.cs
+++ b/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOptions.cs
@@ -4,11 +4,16 @@
using System.Collections.Immutable;
using System.Diagnostics;
-using Microsoft.CodeAnalysis.Options;
using Roslyn.Utilities;
using static Microsoft.CodeAnalysis.CodeStyle.CodeStyleHelpers;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
+using Microsoft.CodeAnalysis.Options;
+
namespace Microsoft.CodeAnalysis.CodeStyle
+#endif
{
public class CodeStyleOptions
{
@@ -403,13 +408,13 @@ private static string GetUnusedParametersPreferenceEditorConfigString(CodeStyleO
internal static class CodeStyleOptionGroups
{
- public static readonly OptionGroup Usings = new OptionGroup(WorkspacesResources.Organize_usings, priority: 1);
- public static readonly OptionGroup ThisOrMe = new OptionGroup(WorkspacesResources.this_dot_and_Me_dot_preferences, priority: 2);
- public static readonly OptionGroup PredefinedTypeNameUsage = new OptionGroup(WorkspacesResources.Language_keywords_vs_BCL_types_preferences, priority: 3);
- public static readonly OptionGroup Parentheses = new OptionGroup(WorkspacesResources.Parentheses_preferences, priority: 4);
- public static readonly OptionGroup Modifier = new OptionGroup(WorkspacesResources.Modifier_preferences, priority: 5);
- public static readonly OptionGroup ExpressionLevelPreferences = new OptionGroup(WorkspacesResources.Expression_level_preferences, priority: 6);
- public static readonly OptionGroup Field = new OptionGroup(WorkspacesResources.Field_preferences, priority: 7);
- public static readonly OptionGroup Parameter = new OptionGroup(WorkspacesResources.Parameter_preferences, priority: 8);
+ public static readonly OptionGroup Usings = new OptionGroup(CompilerExtensionsResources.Organize_usings, priority: 1);
+ public static readonly OptionGroup ThisOrMe = new OptionGroup(CompilerExtensionsResources.this_dot_and_Me_dot_preferences, priority: 2);
+ public static readonly OptionGroup PredefinedTypeNameUsage = new OptionGroup(CompilerExtensionsResources.Language_keywords_vs_BCL_types_preferences, priority: 3);
+ public static readonly OptionGroup Parentheses = new OptionGroup(CompilerExtensionsResources.Parentheses_preferences, priority: 4);
+ public static readonly OptionGroup Modifier = new OptionGroup(CompilerExtensionsResources.Modifier_preferences, priority: 5);
+ public static readonly OptionGroup ExpressionLevelPreferences = new OptionGroup(CompilerExtensionsResources.Expression_level_preferences, priority: 6);
+ public static readonly OptionGroup Field = new OptionGroup(CompilerExtensionsResources.Field_preferences, priority: 7);
+ public static readonly OptionGroup Parameter = new OptionGroup(CompilerExtensionsResources.Parameter_preferences, priority: 8);
}
}
diff --git a/src/Workspaces/Core/Portable/CodeStyle/NotificationOption.cs b/src/Workspaces/Core/Portable/CodeStyle/NotificationOption.cs
index dc9e6b9843b98..0e12008f38485 100644
--- a/src/Workspaces/Core/Portable/CodeStyle/NotificationOption.cs
+++ b/src/Workspaces/Core/Portable/CodeStyle/NotificationOption.cs
@@ -7,9 +7,11 @@
#if CODE_STYLE
using WorkspacesResources = Microsoft.CodeAnalysis.CodeStyleResources;
-#endif
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.CodeStyle
+#endif
{
///
/// Offers different notification styles for enforcing
diff --git a/src/Workspaces/Core/Portable/Formatting/Engine/AbstractFormatEngine.cs b/src/Workspaces/Core/Portable/Formatting/Engine/AbstractFormatEngine.cs
index 3b729112cff5e..46315e375de31 100644
--- a/src/Workspaces/Core/Portable/Formatting/Engine/AbstractFormatEngine.cs
+++ b/src/Workspaces/Core/Portable/Formatting/Engine/AbstractFormatEngine.cs
@@ -8,7 +8,6 @@
using System.Threading;
using Microsoft.CodeAnalysis.Formatting.Rules;
using Microsoft.CodeAnalysis.Internal.Log;
-using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.CodeAnalysis.Text;
@@ -16,6 +15,9 @@
#if CODE_STYLE
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
+using Microsoft.CodeAnalysis.Options;
#endif
namespace Microsoft.CodeAnalysis.Formatting
diff --git a/src/Workspaces/Core/Portable/Formatting/FormattingOptions.cs b/src/Workspaces/Core/Portable/Formatting/FormattingOptions.cs
index 2eb34fdd956d3..2344bb58e492f 100644
--- a/src/Workspaces/Core/Portable/Formatting/FormattingOptions.cs
+++ b/src/Workspaces/Core/Portable/Formatting/FormattingOptions.cs
@@ -4,11 +4,13 @@
using System;
using System.Collections.Immutable;
-using Microsoft.CodeAnalysis.Options;
using Roslyn.Utilities;
#if CODE_STYLE
+using Microsoft.CodeAnalysis.Internal.Options;
using WorkspacesResources = Microsoft.CodeAnalysis.CodeStyleResources;
+#else
+using Microsoft.CodeAnalysis.Options;
#endif
namespace Microsoft.CodeAnalysis.Formatting
diff --git a/src/Workspaces/Core/Portable/Log/FunctionIdOptions.cs b/src/Workspaces/Core/Portable/Log/FunctionIdOptions.cs
index be6303b0b0aa5..2179e564f8c60 100644
--- a/src/Workspaces/Core/Portable/Log/FunctionIdOptions.cs
+++ b/src/Workspaces/Core/Portable/Log/FunctionIdOptions.cs
@@ -4,7 +4,12 @@
using System;
using System.Collections.Concurrent;
+
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
using Microsoft.CodeAnalysis.Options;
+#endif
namespace Microsoft.CodeAnalysis.Internal.Log
{
diff --git a/src/Workspaces/Core/Portable/Log/Logger.cs b/src/Workspaces/Core/Portable/Log/Logger.cs
index 09a7e2ad911bc..4e6e3886d5bdf 100644
--- a/src/Workspaces/Core/Portable/Log/Logger.cs
+++ b/src/Workspaces/Core/Portable/Log/Logger.cs
@@ -5,7 +5,12 @@
using System;
using System.Linq;
using System.Threading;
+
+#if CODE_STYLE
+using Microsoft.CodeAnalysis.Internal.Options;
+#else
using Microsoft.CodeAnalysis.Options;
+#endif
namespace Microsoft.CodeAnalysis.Internal.Log
{
diff --git a/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj b/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj
index be6bb52531441..e3143cd3f2b6b 100644
--- a/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj
+++ b/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj
@@ -97,6 +97,7 @@
+
@@ -123,6 +124,12 @@
+
+
+
+
+
+
True
diff --git a/src/Workspaces/Core/Portable/Options/EditorConfig/EditorConfigStorageLocation.cs b/src/Workspaces/Core/Portable/Options/EditorConfig/EditorConfigStorageLocation.cs
index 764982f987601..eb345fae2d298 100644
--- a/src/Workspaces/Core/Portable/Options/EditorConfig/EditorConfigStorageLocation.cs
+++ b/src/Workspaces/Core/Portable/Options/EditorConfig/EditorConfigStorageLocation.cs
@@ -5,7 +5,11 @@
using System;
using Microsoft.CodeAnalysis.CodeStyle;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
internal static class EditorConfigStorageLocation
{
diff --git a/src/Workspaces/Core/Portable/Options/EditorConfig/EditorConfigStorageLocation`1.cs b/src/Workspaces/Core/Portable/Options/EditorConfig/EditorConfigStorageLocation`1.cs
index 99d97e65ede68..cc470ebfeb410 100644
--- a/src/Workspaces/Core/Portable/Options/EditorConfig/EditorConfigStorageLocation`1.cs
+++ b/src/Workspaces/Core/Portable/Options/EditorConfig/EditorConfigStorageLocation`1.cs
@@ -9,9 +9,11 @@
#if CODE_STYLE
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
-#endif
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
///
/// Specifies that an option should be read from an .editorconfig file.
diff --git a/src/Workspaces/Core/Portable/Options/EditorConfig/IEditorConfigStorageLocation.cs b/src/Workspaces/Core/Portable/Options/EditorConfig/IEditorConfigStorageLocation.cs
index 0589c03cc014f..ff32aae74cc22 100644
--- a/src/Workspaces/Core/Portable/Options/EditorConfig/IEditorConfigStorageLocation.cs
+++ b/src/Workspaces/Core/Portable/Options/EditorConfig/IEditorConfigStorageLocation.cs
@@ -5,9 +5,15 @@
using System;
using System.Collections.Generic;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+{
+ public interface IEditorConfigStorageLocation
+#else
namespace Microsoft.CodeAnalysis.Options
{
internal interface IEditorConfigStorageLocation
+#endif
{
bool TryGetOption(IReadOnlyDictionary rawOptions, Type type, out object value);
}
diff --git a/src/Workspaces/Core/Portable/Options/EditorConfig/IEditorConfigStorageLocation2.cs b/src/Workspaces/Core/Portable/Options/EditorConfig/IEditorConfigStorageLocation2.cs
index ce4a65dcf620f..71f8ba19d0134 100644
--- a/src/Workspaces/Core/Portable/Options/EditorConfig/IEditorConfigStorageLocation2.cs
+++ b/src/Workspaces/Core/Portable/Options/EditorConfig/IEditorConfigStorageLocation2.cs
@@ -4,11 +4,15 @@
#if CODE_STYLE
using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions;
-#endif
+namespace Microsoft.CodeAnalysis.Internal.Options
+{
+ public interface IEditorConfigStorageLocation2 : IEditorConfigStorageLocation
+#else
namespace Microsoft.CodeAnalysis.Options
{
internal interface IEditorConfigStorageLocation2 : IEditorConfigStorageLocation
+#endif
{
///
/// Gets the editorconfig string representation for this storage location.
diff --git a/src/Workspaces/Core/Portable/Options/IOption.cs b/src/Workspaces/Core/Portable/Options/IOption.cs
index e515933f6158b..e34e0f10bacdb 100644
--- a/src/Workspaces/Core/Portable/Options/IOption.cs
+++ b/src/Workspaces/Core/Portable/Options/IOption.cs
@@ -7,7 +7,11 @@
using System;
using System.Collections.Immutable;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
public interface IOption
{
diff --git a/src/Workspaces/Core/Portable/Options/IOptionWithGroup.cs b/src/Workspaces/Core/Portable/Options/IOptionWithGroup.cs
index f14f9bc04d76f..0381b5811bb57 100644
--- a/src/Workspaces/Core/Portable/Options/IOptionWithGroup.cs
+++ b/src/Workspaces/Core/Portable/Options/IOptionWithGroup.cs
@@ -2,7 +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.
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
///
/// Group/sub-feature associated with an .
diff --git a/src/Workspaces/Core/Portable/Options/LocalUserProfileStorageLocation.cs b/src/Workspaces/Core/Portable/Options/LocalUserProfileStorageLocation.cs
index 0c44a1a45c797..a5c42ad82ed7e 100644
--- a/src/Workspaces/Core/Portable/Options/LocalUserProfileStorageLocation.cs
+++ b/src/Workspaces/Core/Portable/Options/LocalUserProfileStorageLocation.cs
@@ -2,7 +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.
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
///
/// Specifies that the option should be stored into the user's local registry hive.
diff --git a/src/Workspaces/Core/Portable/Options/OptionGroup.cs b/src/Workspaces/Core/Portable/Options/OptionGroup.cs
index e41cc18e3dee6..4fe35d7cf2c7b 100644
--- a/src/Workspaces/Core/Portable/Options/OptionGroup.cs
+++ b/src/Workspaces/Core/Portable/Options/OptionGroup.cs
@@ -4,7 +4,11 @@
using System;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
///
/// Group/sub-feature associated with an .
diff --git a/src/Workspaces/Core/Portable/Options/OptionKey.cs b/src/Workspaces/Core/Portable/Options/OptionKey.cs
index 4900d0e910b5d..34730dc6538a7 100644
--- a/src/Workspaces/Core/Portable/Options/OptionKey.cs
+++ b/src/Workspaces/Core/Portable/Options/OptionKey.cs
@@ -8,7 +8,11 @@
using WorkspacesResources = Microsoft.CodeAnalysis.CodeStyleResources;
#endif
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
public readonly struct OptionKey : IEquatable
{
diff --git a/src/Workspaces/Core/Portable/Options/OptionStorageLocation.cs b/src/Workspaces/Core/Portable/Options/OptionStorageLocation.cs
index 14c7cf93197b0..4bd602d00ddcf 100644
--- a/src/Workspaces/Core/Portable/Options/OptionStorageLocation.cs
+++ b/src/Workspaces/Core/Portable/Options/OptionStorageLocation.cs
@@ -2,7 +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.
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
///
/// The base type of all types that specify where options are stored.
diff --git a/src/Workspaces/Core/Portable/Options/Option`1.cs b/src/Workspaces/Core/Portable/Options/Option`1.cs
index b2536e9e3e3a4..741949da71a8b 100644
--- a/src/Workspaces/Core/Portable/Options/Option`1.cs
+++ b/src/Workspaces/Core/Portable/Options/Option`1.cs
@@ -5,7 +5,11 @@
using System;
using System.Collections.Immutable;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
///
/// Marker interface for
diff --git a/src/Workspaces/Core/Portable/Options/PerLanguageOption.cs b/src/Workspaces/Core/Portable/Options/PerLanguageOption.cs
index 65de2989be7a8..86f6a4347a142 100644
--- a/src/Workspaces/Core/Portable/Options/PerLanguageOption.cs
+++ b/src/Workspaces/Core/Portable/Options/PerLanguageOption.cs
@@ -5,7 +5,11 @@
using System;
using System.Collections.Immutable;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
///
/// Marker interface for
diff --git a/src/Workspaces/Core/Portable/Options/RoamingProfileStorageLocation.cs b/src/Workspaces/Core/Portable/Options/RoamingProfileStorageLocation.cs
index b58886bba9aa4..dbb40b9df4c16 100644
--- a/src/Workspaces/Core/Portable/Options/RoamingProfileStorageLocation.cs
+++ b/src/Workspaces/Core/Portable/Options/RoamingProfileStorageLocation.cs
@@ -4,7 +4,11 @@
using System;
+#if CODE_STYLE
+namespace Microsoft.CodeAnalysis.Internal.Options
+#else
namespace Microsoft.CodeAnalysis.Options
+#endif
{
///
/// Specifies that the option should be stored into a roamed profile across machines.
diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.resx b/src/Workspaces/Core/Portable/WorkspacesResources.resx
index fe92413f9188c..00252d4e8ba5d 100644
--- a/src/Workspaces/Core/Portable/WorkspacesResources.resx
+++ b/src/Workspaces/Core/Portable/WorkspacesResources.resx
@@ -1425,42 +1425,18 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
.NET Coding Conventions
-
- Expression-level preferences
-
-
- Field preferences
-
Indentation and spacing
-
- Language keywords vs BCL types preferences
-
-
- Modifier preferences
-
New line preferences
-
- Organize usings
-
-
- Parentheses preferences
-
-
- this. and Me. preferences
-
Visual Basic files
Changing document '{0}' is not supported.
-
- Parameter preferences
-
Prefix '{0}' does not match expected prefix '{1}'
diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
index 3b9bba885af96..fbfe336bbd4ee 100644
--- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
+++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf
@@ -57,14 +57,19 @@
Při čtení obsahu zdrojového souboru {0} došlo k chybě -- {1}
-
-
- Předvolby na úrovni výrazů
+
+
+ Fix all '{0}'
+
+
+
+
+ Fix all '{0}' in '{1}'
-
-
- Předvolby polí
+
+
+ Fix all '{0}' in Solution
@@ -72,16 +77,6 @@
Odsazení a mezery
-
-
- Předvolby klíčových slov jazyka a typů BCL
-
-
-
-
- Předvolby modifikátorů
-
-
Pravidla pojmenování
@@ -102,16 +97,6 @@
Možnosti nepocházely ze zadaného řešení.
-
-
- Uspořádat direktivy using
-
-
-
-
- Předvolby závorek
-
-
Předpona {0} neodpovídá očekávané předponě {1}.
@@ -1257,6 +1242,11 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou délkou se obv
Odebírání dokumentů konfigurace analyzátoru se nepodporuje.
+
+
+ Supplied diagnostic cannot be null.
+
+
Symbol {0} nepochází ze zdroje.
@@ -1637,21 +1627,6 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou délkou se obv
Přidáno:
-
-
- Opravit vše ({0})
-
-
-
-
- Opravit vše ({0}) v: {1}
-
-
-
-
- Opravit vše ({0}) v řešení
-
-
Po:
@@ -1742,11 +1717,6 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou délkou se obv
Ke splnění úkolu se vyžaduje služba typu {0}, není ale z pracovního prostoru dostupná.
-
-
- Zadaná diagnostika nemůže být null.
-
-
Musí se zadat aspoň jedna diagnostika.
@@ -2217,11 +2187,6 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou délkou se obv
Konvence kódování v .NET
-
-
- Předvolby pro this. a Me.
-
-
Rozsah [x-y] je v obráceném pořadí.
@@ -2237,11 +2202,6 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou délkou se obv
Problém s regulárním výrazem: {0}
This is an error message shown to the user when they write an invalid Regular Expression. {0} will be the actual text of one of the above Regular Expression errors.
-
-
- Předvolby parametrů
-
-