I may have missed something here but I have not found it. I always like to know what changes are going to be made before anything goes making them. So being able to scan the solution then review the suggested changes would be a must for me.
as a test I created a simple VS2013 MFC application with various classes and code then ran CodeMaid Clean up All Code. The result was then not able to be compiled a CodeMaid removed the EOF character from the end of the .rc2 file, so I would be very fearful of running this on larger projects.
Thanks for the constructive criticism, that is very helpful.
For that specific item with the .rc2 EOF indicator not being on a separate line, Issue #18 opened and resolved for the next minor release. There is a "Remove end of file trailing new line" option that could be disabled in the interim.
I've also placed a card in the backlog to investigate adding integration tests that would iterate across all the different project templates and invoke CodeMaid actions upon them. https://trello.com/c/Sqv2bIWC
First its awesome and second its awesome, very light weight and incredible. But for some reasons it doesn't work on solution level clean-up all. I have mix projects in solution, ASP.NET MVC, Web API, Silverlight, WCF, Windows Service etc.. and total around 50+ projects excluding unit test projects :)... if it work at solution level then save more time for me and save me 50+ individual project level clicks...
VS2013 had a known issue with solution level cleanups being disabled. They fixed it recently with Update 2. If that doesn't do the trick a shortcut is you can multi-select projects and do cleanup on several at once. Also feel free to open a BitBucket issue and we can figure it out if it wasn't the VS update.
Code Maid persistently crashed the GUI for the project I maintain without me using any code maid features. I guess its for hobby use only. Using C++ VS2010 Vista.
The loaded solution consists of 8 legacy programs with origins in VMS consisting mostly of C with Win API with some newer simple C++.
The VS GUI crashed in the following instances: rearranging window positions, selecting class view and while browsing the code before I un-installed it. After un-installing and before installing of code maid there were no VS crashes. I have been using VS 2010 to maintain this code since 2010 without any GUI crashes.
Setting the Display Theme to dark seems to only be partially implemented.
Certain portions of the window are in a dark theme, but everything else is light grey on white, making it unreadable.
You can see an example of how it displays here:
Thanks for reporting the issue. I am unable to reproduce. Will you file a bug on BitBucket including details like an exported copy of your settings, what version of Visual Studio you are using and which Visual Studio theme you are using?
Do you have plans to add additional StyleCop rules to the reorganize method? Personally I would like to have it move using directives inside the namespace and add the file copyright XML that is required by StyleCop.
It would also be nice to have your extension turn on stylecop on a project so I do not have to edit the csproj file directly.
Overall I love it though.
Glad to hear you love it. :) Please check out the product backlog on Trello to vote/comment/suggest new features:
Some of your suggestions are already present:
Thanks for the suggestion. I think there is already another VS extension that is focused on statement alignment - check out: http://visualstudiogallery.msdn.microsoft.com/7179e851-a263-44b7-a177-1d31e33c84fd
The new Format Comment functionality currently only supports VS2012 and higher. There is a backlog card to add support for VS2010 here: https://trello.com/c/QylslKhh/115-add-comment-formatting-support-to-vs2010
If you call 'CleanUp All Code' in VS2013 you get this error with Codemaid(0.6.2):
Microsoft Visual Studio
Could not load file or assembly 'Microsoft.VisualStudio.Package.LanguageService.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Das System kann die angegebene Datei nicht finden.
Thanks Alexander. I have created two new issues on BitBucket for those VS2013 batch cleanup issues:
Alexander: Hopefully you're tracking the BitBucket issue (https://bitbucket.org/s_cadwallader/codemaid/issue/220/vs2013-cleanup-all-code-shows-error), but if not it has been identified and passed on to Microsoft here:
Trying to use CodeMade 0.6.2 with VS2012. After I open the project everything works well until I go to the "Spade" window, then everything hangs and VS shows the "waiting for a background process" window forever. nothing works until I kill VS and start over.
This is a known issue with the C++ API in VS2012. You can use CodeMaid, but you will have to close the Spade tool window which accesses parts of the API that are now hanging in VS2012. This is not an issue in VS2010, and Microsoft has fixed it for VS2013. So the issue only occurs with VS2012 C++ projects.
Microsoft was very helpful when I worked with them on this issue, and in addition to resolving it for future releases (e.g. VS2013) they provided some workaround suggestions for VS2012. They're non-trivial, but they are on my radar and progress can be tracked on BitBucket here: https://bitbucket.org/s_cadwallader/codemaid/issue/142/spade-starts-endless-process-in-vs-2012-c
I have a rater big C# Project, on witch VS2012 crashes when I run a Code CleanUp.
The Project has ~770 files, and VS always crashes at ~400 cleaned up with OOM or another simmilar exception. (Before that the Memory use slowly increases)
If I copy a piece of code to a different C# code files and go back to the file that the code was copied from (two files are unsaved at this point), Visual Studio crashes and had to restart. If I save all the files immediately and reopen the file it doesn't crash. This crash is happening on the latest update, which I installed today on July 11.
I copied code in two different projects.
After today's update (July 9, 2013), CodeMaid is now crashing Visual Studio 2012 after a file is saved after an F2-initiated Rename Refactor. This occurs after ALL renames, including methods and classes. If I rename class 'SampleClass' to 'SampleClass2' for example, all other code files referencing SampleClass are changed and saved successfully, but SampleClass.cs is not saved and Visual Studio freezes for a while with the message "CodeMaid is cleaning 'SampleClass.cs'..." in the lower left corner (using about 30% of my i5 750 CPU consistently).
After about half a minute, Visual Studio crashes and I get the following message from Windows: http://i.imgur.com/U9mzYd5.png
The crash also occurs after refactoring the name of a method not referenced by any other code.
This is particularly frustrating because I use CodeMaid constantly. I'm going to try re-installing it with the hope of the error disappearing.
Reinstalling didn't fix the issue, but I found a setting that prevents crashing. In the top Cleaning section in the Configuration window, unchecking 'Use undo transactions' eliminates the issue. So the crash seems to be related to using CodeMaid's undo feature with Rename Refactors.
Yes, this is a known issue that was reported with v0.6.1 - see BitBucket here: https://bitbucket.org/s_cadwallader/codemaid/issue/213/refactor-rename-starts-endless-clean-loop
The workaround you suggested is the recommended approach for now (disable undo transactions).
Thanks for the report and sorry for the trouble.
I've just uploaded a beta release with a fix for this issue here: https://bitbucket.org/s_cadwallader/codemaid/downloads/CodeMaid_v0.6.1.1_BETA.vsix
If you have a chance will you give it a try? The change is pretty minimal, a new configuration option that by default will skip undo transactions during automatic cleanup on save which is what led to an infinite loop.
I have just come across your fantastic utility, but in my codebase I have alot of compiler directives inside my code.
If I have a compiler directive inside a method, it handles the reorganizing fine.
If I have a compiler directive around a method or some properties they loose their place.
I tried too wrk around this by commenting out the #if #endif statement, but it only moves the comments above the section and not below it.
Hi d3 -
You're right, reorganization does not currently handle preprocessor directives. There is a card in the backlog to add that functionality, feel free to visit it to vote it up and/or add comments: https://trello.com/c/Qqd0GLqI
Glad to hear otherwise you are liking the tool. :)