Add Code Cleanup support for Visual Basic#48092
Add Code Cleanup support for Visual Basic#48092sharwell merged 48 commits intodotnet:mainfrom paul1956:VBCodeCleanup
Conversation
… are Skipped. Format Document, System Imports first and separate Import Groups are working.
…preferences and header preferences thought (not covered in C# either) most fail and are skipped for 1 or 2 reasons "IFixAllGetFixesService is missing" or the fixes for Compiler issues are not running.
|
Ping @sharwell |
|
Ping |
src/EditorFeatures/VisualBasicTest/Formatting/CodeCleanUpTests.vb
Outdated
Show resolved
Hide resolved
src/EditorFeatures/VisualBasicTest/Formatting/CodeCleanUpTests.vb
Outdated
Show resolved
Hide resolved
src/Features/VisualBasic/Portable/CodeCleanup/VisualBasicCodeCleanupService.vb
Outdated
Show resolved
Hide resolved
src/Features/VisualBasic/Portable/CodeCleanup/VisualBasicCodeCleanupService.vb
Outdated
Show resolved
Hide resolved
src/Features/VisualBasic/Portable/CodeCleanup/VisualBasicCodeCleanupService.vb
Outdated
Show resolved
Hide resolved
src/Features/VisualBasic/Portable/CodeCleanup/VisualBasicCodeCleanupService.vb
Outdated
Show resolved
Hide resolved
src/Features/VisualBasic/Portable/CodeCleanup/VisualBasicCodeCleanupService.vb
Outdated
Show resolved
Hide resolved
src/Features/VisualBasic/Portable/CodeCleanup/VisualBasicCodeCleanupService.vb
Outdated
Show resolved
Hide resolved
| End Using | ||
| End If | ||
|
|
||
| Return currentDocument |
There was a problem hiding this comment.
this logic looks like it would be identical to C#. i would have expected there to be a shared base class extracted from the C# version, and the Vb and C# versions would subclass it and only od things specific to those languages.
There was a problem hiding this comment.
@CyrusNajmabadi It was and worked perfectly in 2 previews (though no tests) and then someone disabled it.
There was a problem hiding this comment.
ok. so to move forward. we should move all the duplicated logic you have here to a single place (ideally an abstract base class). VB and C# will then subclass that.
| ' Add a progress item for each enabled option we're going to fix-up. | ||
| progressTracker.AddItems(enabledDiagnosticSets.Length) | ||
|
|
||
| For Each diagnosticSet1 As DiagnosticSet In enabledDiagnosticSets |
There was a problem hiding this comment.
| For Each diagnosticSet1 As DiagnosticSet In enabledDiagnosticSets | |
| For Each diagnosticSet1 In enabledDiagnosticSets |
|
Ping |
|
@sharwell @CyrusNajmabadi Anything else I need to do to move this forward? |
src/VisualStudio/Core/Def/Implementation/CodeCleanup/AbstractCodeCleanupFixerProvider.cs
Show resolved
Hide resolved
|
@sharwell this LGTM. Do you have any concerns here? |
|
Ping |
|
Ping @dotnet/roslyn-compiler |
|
It doesn't look like anything ander Compilers is touched. In reply to: 801287118 [](ancestors = 801287118) |
src/Features/Core/Portable/CodeCleanup/AbstractCodeCleanupService.cs
Outdated
Show resolved
Hide resolved
src/Features/VisualBasic/Portable/CodeCleanup/VisualBasicCodeCleanupService.vb
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Implementation/CodeCleanup/AbstractCodeCleanupFixerProvider.cs
Show resolved
Hide resolved
|
@CyrusNajmabadi it looks like we reached a working state. As a follow-up, it would be good to consolidate the fixer exports to avoid duplicating items in the configuration dialog. |
|
Thank you @paul1956 ! This should be in 16.10 Preview 2. 👍 |
Tests would fail because of "IFixAllGetFixesService is missing from workspace" and are Skipped or the CodeFix is just not run. Format Document, System Imports first and separate Import Groups are all working. There is also something missing that prevents Visual Studio from running Visual Basic Code Cleanup or providing a separate list of what features are exposed.
Fixes #47876