Open osoviejo opened 3 years ago
Thanks for reporting the issue and for providing the sample solution. I am able to reproduce it.
What I believe is happening is that executing the code fix triggers a save, then if CodeMaid is configured for automatic cleanup on save it kicks in to further update the code. In the past where this particularly gets into a conflict between multiple write triggers is the undo API.
There's an option specifically for this scenario at CodeMaid->Options->General->Miscellaneous->Use undo transactions->Skip during automatic cleanup on save. If you re-enable this option it will bypass trying to group CodeMaid's cleanup activities in the undo log, and that effectively bypasses the loop that can cause the IDE to freeze up. I checked and confirmed with the sample solution that indeed this bypassed the issue.
Hope it helps!
Works perfectly, thank you so much!
Environment
Description
Roslyn analyzer codefix (at least for IDExxxx analyzers, maybe others) will trigger a CodeMaid cleanup on the file where the codefix is being applied. Neither the codefix nor the cleanup completes, and VS is non-responsive. After a few minutes, VS will crash and restart. While the attached repro is a Net5 Console, this also occurs with Framework 4.8 ASP.NET.
Steps to recreate
Current behavior
CodeMaid cleanup starts, neither it nor the codefix completes before VS crashes.
Expected behavior
CodeMaid cleanup should not be triggered by an analyzer codefix.
Template.zip