codemaid
codemaid copied to clipboard
VS2022 Freeze / Crash
Environment
- Visual Studio version: [example 2022 Community]
- CodeMaid version: [example 12.0]
- Code language: [example C#]
Description
Hi there, I've read through some of of the open issues and found similar issues, so I flag myself here as duplicate. I just sort of want to pin point the issue I'm having, and it might assist in resolving the persistent issue (since it seems that I have the current version). Again apologies in advance for the duplicate
.
Steps to recreate
- Have items registered for cleanup in VS options (Tools->Options->Text Editor->Code Cleanup)
- Configure CodeMaid (CodeMaid.config.txt attached)
- Go to code file
- Perform
Refactor.Rename
on any member within the file (even something as small as a method parameter name) - Finalize operation -> renders entire application frozen for 3s ~ 10s, then crashes
Current behavior
Crashes entire environment
Expected behavior
Do not crash entire environment
What's causing this?
Deadlock in either a cleanup or save operation caused by Automatic Cleanup On Save
. Disabling this setting fixes the issue, then I have to run Ctrl + M ~ Ctrl + Z
and Ctrl + M ~ Ctrl + Space
after the refactor to do any needed cleanup.
Thanks for reporting the issue. It has come up before but no problem to ask the question if you haven't found the answer.
This is usually caused by a loop between multiple tools performing after save operations. So for example Visual Studio running a save, which triggers CodeMaid to run a save, then back around the circle again in an infinite loop.
In the attached CodMaid configuration (thank you for including it!), it looks like one of the "Skip during automatic cleanup on save" safety options that breaks these loops has been disabled. I suspect if you re-enable CodeMaid->Options->General->Skip undo transactions during automatic cleanup on save
that it will help break the loop you are seeing. Can you give that a try please?
Hi there, apologies for the delayed response. I'll give it a whirl and have a response for you in the next 12~24 hours 👍