CodeMaid is an open source Visual Studio extension to cleanup, dig through and simplify our C#, C++, F#, VB, XAML, XML, ASP, HTML, CSS and JavaScript coding.
You're welcome. :). You can close the Spade tool window to disable code digging which will help with very large files. Performance improvements are in the works for future releases so stay tuned.
Good extension, but I have some remarks: What for in VS2012 there "Find in solution" in context menu and "collapse all recursively" in solution explorer? VS2012 already has this functions. There would be great if I can configure what buttons to display in context menu and solution explorer. What do you think about updating icons to make them pixel-clear because thy are blurry?
CodeMaid has had and continues support for those commands since earlier editions of Visual Studio (ex: VS2010). You're right that Visual Studio has newly introduced them in VS2012.
I've added a backlog card for voting/comments on configuring toolbar and context menu visibility here: https://trello.com/c/O5ldkODW
I'd be very happy to update the icons, do you know any icon designers who might be interested?
As a C# developer, this tool is a pretty good collection of most wanted tools: easy to learn, easy to customize (e.g. the reorganizing tool). I like the code map displaying regions, embedded methods, interfaces etc., so I easily can navigate between them. Congratulations to the developer of CodeMaid!
I have checked CodeMaid against VS10x CodeMap and I have to say that for my daily work and regarding to what I really need: CodeMaid is on the same Level like VS10x CodeMap.
Can you please add an option to turn off Spade if file is larger than configurable threshold?
I have a file (auto-generated classes from XSD) that is 35,000 lines and Spade takes forever! If I could tell Spade to ignore files longer than say 1000 lines it would be helpful.
Spade should fully run asynchronously - so although it may take a long time for it to load I wouldn't expect a performance hit except on a single core machine. I've created a Trello card for further discussion here: https://trello.com/c/ha1vFRS7
This is a seriously useful extension! I specifically use it to help preserve my sanity against "random whitespace syndrome" suffered by some other devs ;)
I would like to suggest that when you add new Insert/Remove features not to enable them automatically. It can produce unexpected results in the cleanup.
I would prefer using a CheckedListBox for the Insert/Remove items than LinkLabels, but that's a minor nitpick.
Hehe, it is good to help any dev's sanity stay afloat. ;)
That's a good point for discussion about auto-disabling new features for consistency. The big downside is that users would have to manually search through the configuration on each update to find/enable new features. I think it is fairly common to enable new features, and give the user the option to go in and turn them off if they don't like them. Happy to discuss further, I've created a Trello card here: https://trello.com/c/eoLpxzGI for discussion.
That's good feedback. I was trying to be clever and conserve space because those lists get pretty massive - but I have heard a few times that it is not very intuitive. Created a Trello card for that as well: https://trello.com/c/q4QjOEBe for voting/comments.
Thanks for the feedback points, they're certainly appreciated - and enjoy. :)
Would it be possible to have CodeMaid settings be part of the standard Visual Studio settings. This would allow exporting along with all the standard settings.
They used to be built in to VS settings, but I took them out several versions ago. The built in settings does not support nested levels for extensions without registry hacks (which was a source of issues) and the size of the configuration window is a fixed small size. Now in v0.6.0 CodeMaid supports exporting settings as well, but it is an independent step.
Seems like a valuable extension to the Visual Studio IDE, but unfortunately it crashes Visual Studio 2013 for me whenever I open a project. It may be conflicting with another extension I have but I'm unware of it causing any issues.
There is a known issue with VS2012 C++ projects that Microsoft is looking into (https://connect.microsoft.com/VisualStudio/feedback/details/770205/accessing-envdte80-codeclass2-c-members-hangs-vs2012). The workaround for now is to close the Spade tool window which is the part of CodeMaid that is accessing an API which is no longer functioning in VS2012.
If your issue is not with C++ projects, please let me know some additional details and I'd be happy to look into it. BitBucket is where we track issues so that would be the best place to report it: https://bitbucket.org/s_cadwallader/codemaid/issues
I love it. Keeps the code clean. It would be cool if it wouldn't remove the "using" statements required by code that is commented. I sometimes comment out some lines while debugging and if I decide to use that code I have to add the "using" statement again.
Thanks, glad you love it. :) The using statement removal logic comes directly from Microsoft (i.e. CodeMaid just invokes it). You could ask them about it but I suspect they would say it is by design that they don't analyze commented out code.
Steve, you wrote a fantastic tool! We are using it to clean code before running StyleCop and love results. This is one of the best extensions to VS out there. Keep up with a good work!
Really nice extension. I thing though, the CodeMaid Spade fail to parse the `para` tag of the documentation comment, instead it read it as text. Sorry, I can't find a place to post this bug so I post it here.
Thanks for the nice thoughts and feedback. You're right that the para tag was not supported, but I have added support for it and it will be present the next release. Thanks for the suggestion. :)
I downloaded CodeMaid v0.5.6 and installed it.
I've run uninstallation (from Tools>Extensions) and then restarted VS but the CodeMaid menu is still present and I can't open the solution that I'm working on (it's quite large) because CodeMaid hangs (The code maid spade pane just says 'loading <classname>').
I'd be grateful for a workaround as the only way I can open this solution now is to run VS in safe mode!
Thanks
Ed
In regards to the hang, is it a C++ solution? There is a known issue that Microsoft is looking into with the VS2012 C++ API. The workaround for now is to close the Spade tool window. Details: https://connect.microsoft.com/VisualStudio/feedback/details/770205/accessing-envdte80-codeclass2-c-members-hangs-vs2012
I haven't heard of that installation difficulty before. CodeMaid is utilizing the standard VSIX installer for Visual Studio extensions. Here's a few things to check/try:
* Can you disable the extension?
* Did you install it under a different Windows user profile?
* Is it also installed under VS2010?
* If you run Visual Studio as an administrator, does the uninstall work correctly?
Hope it helps,
-Steve Cadwallader
Thanks for responding Steve,
It's a C# solution (with around 25 sub projects, including MVC4). The hang does look related to the spade tool window - but your link doesn't seem to work. VS only hangs when I open my project. I am able to access the code maid menus before I've opened any project.
-When I first installed CodeMaid, I did so running as administrator. I've tried to uninstall as administrator.
-Uninstall/Disable both complete (via Extensions & Updates window) but don't remove the CodeMaid menu, although they do seem to remove the functionality behind the menu items. Is there a way to do a manual uninstall?
-It is also installed under VS2010 but I've not tried running it
-If I could clean up my installation, I could try installing it as a non-administrator user.
It is now in a state where I've tried to uninstall it but now on VS startup I get an error message: The '... CodeMaidPackage ...' did not load correctly. This at least means I can open my solution and contine working!
Sorry to hear of your ongoing troubles. I believe you need to uninstall it under both VS2010, and both VS2012 for it to be removed. I would have expected it to disappear from VS2012 after it was uninstalled there though, so it sounds like something in your install is corrupted.
You could try forcing an uninstall, check out: http://stackoverflow.com/questions/1526733/uninstalling-the-vs2010-extension-without-the-extension-manager
For a while, I've had the problem of Visual Studio freezing up randomly, with the only message being that "Visual Studio is waiting for a background operation to complete". The only way to regain control is to kill Visual Studio from the task explorer.
I disabled automatic format on save, and I haven't encountered the issue since disabling it more than 4 weeks ago. I'd like to get an error log or exception listing, but given that I can't get to the output window when this occurs, the error logging in CodeMaid won't help. Any idea on how I can identify the exact issue w/CodeMaid?
This happens at work and and home, so it's not just a computer configuration problem. It did seem to happen occasionally in VS2010, but much less frequently.
Hi MackieChan -
There was a fix for this issue in the latest release v0.5.6 which was released three weeks ago. Are you still seeing the issue with v0.5.6 installed?
If so please let me know and we'll turn this into a BitBucket issue. Some information that would be helpful to diagnose the problem would be if there is a file that consistently reproduces the issue, the language being used, and if any modal dialogs are appearing during the cleanup process.
Hope it helps,
-Steve Cadwallader
Yep, I've confirmed that it is v0.5.6 that I'm using and that it still occurs. It's C#, and there isn't a specific file that seems to reproduce it; it seems to happen randomly (usually it happens about 1-3 times a day, given an 8 hour day). No model dialog occurs during cleanup, I just get a "Codemaid is cleaning {filename}" in the status bar and Visual Studio freezes. I'm not 100% sure that it's CodeMaid, but when I turn off CodeMaid's format on save, the issue seems to go away.
I've disabled every other addon/plugin except resharper, but the issue always occurs as long as I have CodeMaid format on save enabled.
Hi, I just installed this extension on VS2012, and it's great! However I can't find out how to configure it. Under Tools->Options, I don't the CodeMaid category. Is there something wrong with my VS installation? Thanks!
Hi Steven -
Glad to hear you like it! You can find CodeMaid's configuration under its own top level menu item "CodeMaid"->"Configuration". It used to be integrated into Tools->Options but I pulled it out after awhile so I could have some more advanced functionality.
Hope it helps and enjoy, :)
-Steve Cadwallader
Hi, first of all thanks for the good work!
I just noticed, that when installing VSCommands 2010 extension. The build progress is no longer reported. When i disable the VSCommands extension it again works as before. Are there any known incompatibilities between the two extensions? And is there a possibilty to fix this? I wouldn't mind to contribute if it would be possible to fix it.
Kind regards,
Tobias
Hi Tobias -
You're welcome, glad to hear you like it! :)
I'm not familiar with that compatibility issue. I've converted this into a new BitBucket issue here: https://bitbucket.org/s_cadwallader/codemaid/issue/168/progress-window-not-functional-in
Thanks for reporting it,
-Steve Cadwallader
hi,
awesome work and thank you, but i have 2 problems
- if i select automatically run clean up on file save, VS hangs and i have to close it by using Task Manger end Task command.
- if i right click on Project and try to batch clean files CodeMaid starts cleaning but after a while same thing as above happens.
i don't know if it helps but i also have resharper and Net Demon installed too, so maybe there is a conflict ?
thanks in advanced.
Hi DevMondo -
Glad to hear that you're liking CodeMaid. :)
I'd like to look into the issue you're encountering. Will you open an issue on BitBucket here: https://bitbucket.org/s_cadwallader/codemaid/issues ? Some information that would be helpful to have is the kind of project (ex: C#, C++, etc.), a specific file or code segment if you can narrow it down, and any other specifics.
There is a known open issue with certain VS2012 C++ files causing the IDE to hang if you have the CodeMaid Spade tool window open. I'm waiting on feedback from Microsoft, more details here: https://connect.microsoft.com/VisualStudio/feedback/details/770205/accessing-envdte80-codeclass2-c-members-hangs-vs2012
Thanks and looking forward to resolving it,
-Steve Cadwallader
I have uninstall codemaid inside the control panel/programs... but i still able to see CodeMaid in my VS2010 Extensions, now that i install VS 2012, i want to reinstall CodeMaid, but it shows this error, "Install Error : Microsoft.VisualStudio.ExtensionManager.InstallByMsiException: You need to use the Programs and Features pane in the Windows Control Panel to remove CodeMaid." but CodeMaid is no longer inside the Installed Application in my Control Panel/Programs..please help thnx
Since v0.5.0 CodeMaid simply uses a VSIX installer - so it is controlled within the Visual Studio 2010/2012 Extension Manager.
If you had an earlier version of CodeMaid installed you would have needed to use the Windows Programs & Features area. Do you know what version you previously had installed? If it didn't uninstall correctly, I'd recommend double-clicking on that old installer to utilize its repair/remove functionality.
Hi thank you for your reply,
i was able to see that windows installer that i use to install that old CodeMaid, it was version 0.3.0, as i remember i intended to use it in VS2010.
I re-install it, then unsinstall it again, but when i open the VS2010 or VS2012, codemaid is still in the extension manager, i also try to update codemaid both in VS2010 and VS2012 but an error shows "the extension can't be installed.... you need to use the programs and features pane to remove codemaid" but codemaid is no longer in the Programs pane.
please help me, thnx
If CodeMaid still appears in the Extension Manager after it has been uninstalled, what version does it report?
Is it possible that you have CodeMaid installed under multiple user accounts? Here are two scenarios other users encountered for additional explanation: https://bitbucket.org/s_cadwallader/codemaid/issue/22/codemaid-did-not-load-correctly
https://bitbucket.org/s_cadwallader/codemaid/issue/93/unable-to-uninstall-previous-version-to
If it isn't the case that CodeMaid was installed under a different user account, then I would recommend trying these steps:
1) Install the old version that appears to be installed (ex: v0.3.0)
2) Upgrade to the last MSI based installer (i.e. v0.4.3 available here https://bitbucket.org/s_cadwallader/codemaid/downloads/CodeMaid_v0.4.3.msi)
3) Uninstall CodeMaid v0.4.3
4) Install the latest CodeMaid which utilizes the simpler VSIX installation model
Hope it helps.
Is there a plan to add support to the Express and VS Shell (Integrated) editions? Thanks.
// --------
11/9/2012 10:28:08 AM - Searching for applicable products...
11/9/2012 10:28:08 AM - Found installed product - Microsoft Visual C++ Express 2010
11/9/2012 10:28:08 AM - Found installed product - Microsoft Visual Studio 2012 Shell (Integrated)
11/9/2012 10:28:08 AM - Found installed product - Microsoft Visual Studio Express 2012 for Windows Desktop
11/9/2012 10:28:08 AM - Found installed product - Global Location
11/9/2012 10:28:08 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
Visual Studio Express does not support/allow extensions. http://stackoverflow.com/questions/7940249/restrictions-on-installing-extensions-or-add-ins-in-visual-studio-2010-express
I haven't tested CodeMaid in the Shell (Integrated) configuration. If you would like to be a guinea pig and see what happens in that setup, please send an email to codemaid at gmail and I'll send you back a custom version that allows it so you can see what happens.
I installed codemaid tonight using nuget, but now when I open my unmanaged C++ solution in VS2012 and try to open a file, VS hangs "waiting for background operation to complete". I gave it 10 minutes hoping it was a one time set up issue. I've had to disable it for now. Suggestions on what to check? I have these extensions installed: AStyle, Indent Guides, Visual Studio Extensions, VS Commands for Visual Studio 2012, Windows Debugger Extension, Windows Driver Tools
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 (used to work in VS2010). There is an open bug for CodeMaid here: https://bitbucket.org/s_cadwallader/codemaid/issue/142/spade-starts-endless-process-in-vs-2012-c
and more importantly an open bug on Microsoft Connect here: https://connect.microsoft.com/VisualStudio/feedback/details/770205/accessing-envdte80-codeclass2-c-members-hangs-vs2012
If you can go vote up the Microsoft Connect bug that would be very appreciated and we'll hopefully get it resolved soon!
Thanks for the catch Fisher! It looks like the language service for JavaScript was renamed and received a new GUID in the latest VS2012 updates. I've updated the code to handle either the old or new language service variants and it will be present in the next release. In the meantime you can work-around the command being disabled by right-clicking on the file in the solution explorer to clean it up. This uses a different mechanism to determine the file type (since the file may not be open) and that route is not affected by the recent change to VS2012 RC.
Hi Fisher -
Yes, that fix was present in v0.5.4 so the menu items should be enabling correctly now. However I did find that the same update was needed in a second location where the code cleanup algorithm is chosen based on the document language - which again changed in VS2012. This fix will be present in the next release, and before that in the next beta which I plan to release this weekend on BitBucket.
Thanks for pointing out that the issue was incomplete.
-Steve Cadwallader