The "Reorganize Active Document" function does not work ! vs 2017 Community, vs 2019 Community preview
Environment
- Visual Studio Version: 2017 Community, Community Preview 2019
- Code Maid version: 12.0
- Coding language: C#
The description
The "Reorganize Active Document" function does not work
Current behavior
Executing "Reorganize Active Document" gives no result, nothing happens. Does not work for 2017 and 2019 community versions.
Steps to recreate
1 Open cs file 2 Click Reorganize Active File
Predictable behavior
Add regions and rearrange the document structure.
Console output
[CodeMaid Diagnostic 08:09:36 ] ReorganizeActiveCodeCommand.OnExecute invoked [CodeMaid Diagnostic 08:09:36] CodeReorganizationManager.Reorganize started for 'C:\Users_\source\repos\macgile\DataGridFilter.actual\Shared\FilterDataGrid.cs' [CodeMaid Diagnosis 08:09:36] CodeModelManager.RetrieveAllCodeItems for 'C:\Users_\source\repos\macgile\DataGridFilter.actual\Shared\FilterDataGrid.cs' [CodeMaid Diagnostic 08:09:36 ] CodeModelCache.GetCodeModel for 'C:\Users\GILLES\source\repos\macgile\DataGridFilter.actual\Shared\FilterDataGrid.cs' [CodeMaid Diagnostic 08:09:36 ] -- fetched from cache (not obsolete). [CodeMaid Diagnostic 08:09:36 ] CodeReorganizationManager.Reorganization completed for 'C:\Users__\source\repos\macgile\DataGridFilter.actual\Shared\FilterDataGrid.cs'
Thanks for reporting the issue. Does it happen on all files and projects or only certain ones? If you create a new template C# application and attempt to reorganize the default Class1.cs does the same issue occur?
I had this issue too. Some additional details which might help: Clean up on save was turned off. I turned clean up on save on, and then cleanup neither worked on save, nor on manual initiation. I created a new blank project to answer the developer query above. Codemaid worked correctly on this project. I returned to the main project I am working on, at this point code maid was working again. Both on save and when activated in the menu.
I know this is not sufficient for a reproduction, but hopefully it helps. At least it offers a workaround of sorts. If it happens again or if others are experiencing this, check what happens if you open another existing solution and then return to the original one.
My best guess is that some solutions (mine is quite large) have an issue initialising when they first load or something.
Thanks for those details @DuncanStone . VS extensions like CodeMaid all load asynchronously in the background in order to improve the startup performance of Visual Studio. There definitely can be a delay before extensions are available and yes a larger solution will make that a longer delay as there's more work happening in the IDE. You can tell if CodeMaid is fully loaded or not by looking to see if it's menu is fully available at Extensions->CodeMaid.