Open Wozniax1 opened 11 months ago
Seeing the same issue on my machine using the same environment as OP
I am seeing the same issue on my machine. Only difference from OP is that I am using Visual Studio Professional 2022 v17.7.2.
I can confirm that a different machine that is running Visual Studio Professional 2022 v17.6.4 IS working as expected.
Same issue on my end too. Running CodeMaid in Diagnostics mode resulted in this message in the Output:
[CodeMaid Diagnostic 07:24:02 PM] WindowEventListener.OnWindowChange raised for 'C:*****\Application.cs'
Only explicit call to 'Cleanup Active Document' from the extension menu invokes CodeMaid.
Hope this helps. Thanks!
UPDATE: Issue persists after latest update to VS 2022 Community 17.7.3 Re-installing CodeMaid didn't help
Same issue on my machine VS 2022 Community 17.7.2 C++ language
This is my second update on the issue. Here is a list of steps that brought CodeMaid's cleanup-on-save back in the game for me:
In my efforts to solve the case by myself, I cloned and debugged the CodeMaid.2022 project. It had issues that pointed to possible library version conflicts (there were "method not found" exceptions). This made me try re-installation with manual VS files cleanup. Once the debug started working, it turned out it nicely cleans on save some small test app projects with a couple of open source file windows. That's when I went for closing the windows in the bigger solution.
Hope this may help.
Thanks for the tip. This will work if nothing else helps. But that can't be the way to solve this problem. Completely uninstalling Visual Studio is very time-consuming if you also want to have the many extensions back in the same individual configuration.
Thanks for the tip. This will work if nothing else helps. But that can't be the way to solve this problem. Completely uninstalling Visual Studio is very time-consuming if you also want to have the many extensions back in the same individual configuration.
@illusion-walk I completely agree with your point. I just listed everything I tried. In fact, I had multiple re-installations of VS that just didn't help. Closing all open .cs files for a solution that had probably hundreds of them is what actually made it work, for me.
Yes, after closing all open .cs files the auto format on save is working well! Thanks a lot for the hint! This is definitely much easier than reinstalling VS :D
If you are also using a CMake project, check this option: Clean -> General -> Perform partial clean when files are no longer part of the solution.
Environment
Description
Automatic Cleanup On Save option not working after update to VS 17.7.0. In 17.6.X it worked.
Steps to recreate
Current behavior
Now on saving a file it does nothing, but when clicked Cleanup Active Document directly it formats it.
Expected behavior
Formatting should run on saving a file.