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.
Would it be possible to add a feature to convert marked Property Settings to Setter Tag in other words convert exsist control property to style setter e.g.
Thanks for the feature suggestion, but that's pretty outside of CodeMaid's scope. I'd recommend ReSharper as a tool for refactoring support.
I think you can only have one review posted, so creating this one may have removed the previous one. In the future you can use Trello for feature suggestions here: https://trello.com/board/future/4f6e6dcc255ed1e9085b8665
thanks for this great extension, saves hours of dirty code formatting work. One thing I don't exactly know if it's supported by your extension is a hint to this. keyword when reoranizing a class. StyleCop informs me about missing this keyword, I've assumed when using reorganizing class it's done by code maid. Maybe I missed something?
Wonderful, I'm glad to hear CodeMaid is saving you a lot of time and making your code cleaner. :)
StyleCop does have a rule (SA1101) to prefix all local calls with "this." - but CodeMaid does not enforce it. So if your code already has that prefix it won't be removed by CodeMaid, but it won't be inserted either. I know ReSharper has a setting that will insert those prefixes, but by default they actually recommend removing them because they're redundant to the compiler.
Hi Steve, I like this plugin very much. Unfortunately since I have been using Visual Studio 2012 the option "Automatically run cleanup on file save" is no longer working correctly. Your extension does the sort of using statements, but it does not remove unused using statements anymore. Anything we can do about it? Are there any log files I can send you to solve this issue?
This is by design to resolve a possible race condition that can occur during refactoring. You can re-enable the old behavior within Configuration->Cleaning->Visual Studio->Run remove unused using statements->Skip during automatic cleanup on save. Keep in mind that some VS refactoring operations though will clash with this behavior which is why it is disabled by default.
One of the best extensions i've ever worked with. It's just fantastic and easy to use. It's light, compact and very, very effective in improving productivity. Seriously, i really loved it.
It would be nice if you, in the Spade window, added a view type that can tell us wich methods belong to each interface/Parent class. Like if i have method X that is implemented for interface Y, a group, like the enums group, would show up in Spade separating methods/properties from interface Y and inteface F. That would be just perfect.
This just saved me hours of time. Was working on a test project with thousands of methods and wanted to get them sorted. Installed CodeMaild and reorganized and now they are all ordered as I wanted.
Also issued cleanup which performed my next favorite refactor which removed all the unused using statements and extra blank lines.
I downloaded the latest release and now when the code cleanup runs it sorts using statements alphabetically; however, it does not keep the System usings above my project usings which in turn makes StyleCop unhappy. FYI - I always put my using statements inside the namespace. Any chance you can update the tool to resolve this issue?
Example
Before running cleanup using System; using Project;
After running cleanup using Project; using System;
I wasn't able to reproduce this issue. Will you open an issue on BitBucket (https://bitbucket.org/s_cadwallader/codemaid/) including your configuration (ex: if you have configured CodeMaid to re-insert unused using statements and which ones in what order), and a small code sample?
Excellent utility. The editor colouring for methods, properties and classes makes the world of difference. Code cleanup is fabulous, trims away all that bloat! Also the Spade to see your methods and properies in a clickable list is very handy indeed.
Seems like pretty good extension, but for me it worked only twice, after that I'm still getting this error:
(in VS2010 prof.)
CodeMaid stopped cleaning 'FileName.cs': System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at EnvDTE80.DTE2.ExecuteCommand(String CommandName, String CommandArgs) at
Later I realized, that it's on file which is not included in solution.
But there is also another bug. when using usings inside namespaces, it truncate their names.
e.g.: using System.Collections.Generic; becomes: using System.Collections.Gene
in source starting with: namespace My.Services.Business { using System.Activities; using My.Model.MyStore; using My.DataContracts.MyStore.Base; using System.Collections.Generic;
There are a few open bugs that cropped up while I was on vacation. Using statements defined inside namespaces is one that has been reported and is in progress: https://bitbucket.org/s_cadwallader/codemaid/issue/117/using-statements-corrupted-if-within
Sorry for the troubles, I'll be working on them this weekend.
Update: The fix for this is now in beta testing. If you'd like to try it out please download the latest release directly from BitBucket. Thanks for reporting the bug!
One major flaw: it kills refactoring for me. After installing CodeMaid, refactoring hangs VS to the death, after removing CodeMaid, it works just well again.
Sorry to hear of the trouble you are having. There is a known issue in progress (see https://bitbucket.org/s_cadwallader/codemaid/issue/119/codemaid-hangs-when-renaming-something-and) that if you have enabled both "Automatically run cleanup on file save" and "Run reorganize at start of cleanup" and use a native VS refactoring operation Visual Studio will hang. It should be fixed soon and the temporary work-around is to disable either one of those two options. Hope it helps.
Update: The fix for this is now in beta testing. If you'd like to try it out please download the latest release directly from BitBucket. Thanks for reporting the bug!
Top extension. Automatically tiding up after I click save is great, and I love the options on what gets modified (especially being able to re-add using statements that I always want). I'll being paying close attention to any updates that come from this extension.
Thanks Dan, glad to hear it. :) Feel free to join in on the discussions on what comes next on the Trello board here https://trello.com/board/future/4f6e6dcc255ed1e9085b8665
Hi,
I am using VS 2012 Premium update 2, with python tools for visual studio. When I save the file, the trailing spaces at the end of lines are not getting removed, even though "Remove end of line whitespace" option is checked.
Is there a fix?
thanks!
Which kind of file (.html, .js, .xml, etc.) is not removing end of line whitespace? Are other CodeMaid cleanup operations running successfully on that file?
Wouldn't it be useful to sort base class and interface names at a class definition to some definitive order? Like base class first, then all interfaces in alphabetical order. Similar to sorting all using statements (which have their own special sorting as well). I usually don't have too many interfaces in my code, what do others think about it?
I didn't have a strong opinion on this one which is why I haven't chimed in. I turned this concept into a Trello card for you to see if you get any more responses over there: https://trello.com/c/3GqHdVqW
Spade does not have support for XAML files yet. It currently supports C# and C++. I have created a card on Trello here: https://trello.com/c/9UdT5NIW
Feel free to vote up the card, and/or fork the code on BitBucket if you want to jump start it faster. :)
It would be nice if this extension could support code switching between partial classes in C#. We don't need it very much but did some refactoring today and it would been really nice to have.
Good idea, I like it. I've turned it into a Trello backlog card here: https://trello.com/c/lEQ840VZ for voting/comments.
Feel free to vote up the card, and/or fork the code on BitBucket if you want to jump start it faster. :)
Yep, I have some interest and there is an existing card on the Trello backlog here: https://trello.com/c/bzZtNrH9
Feel free to vote up the card, and/or fork the code on BitBucket if you want to jump start it faster. :)
Thanks for the reminder Brandon. Microsoft did not originally release the icon library with VS2012, but I went and checked and they have been published now.
I've put in a Trello card for the next release to update the icons accordingly: https://trello.com/c/2N21g0HQ
After 16..24 hours of work without reopen VS 2012, memory allocated is over 650MB, this make VS too slow, if I remove CodeMaid, have no trouble.
I call twice "Cleanup All Code..." over my solution (www.pildra.com.br), about 12K lines, Windows Task Manager report 730 MB VS allocated, before is about 115MB.
I think have a memory leak.
CodeMaid is a good tool.
Thanks.
I'm glad you like the tool, and thanks for reporting the memory usage you are seeing. I have turned this into a BitBucket issue here: https://bitbucket.org/s_cadwallader/codemaid/issue/185/review-and-improve-memory-usage-during
I have been working with Sandcastle documentation which has an extension of .aml and would love to have codemaid auto format documents, however it does not recognize the extension.
Hi Jim -
I've added your feature request to the Trello backlog here: https://trello.com/c/ULEZa4xF
I'm not familiar with Sandcastle documentation, but if you'd like to email me a small sample via codemaid at gmail I can take a look to see how much work it would be to support it.
-Steve Cadwallader
Thanks for pointing that out. You can fix it by going to CodeMaid->Configuration->Cleaning->File Types and changing the exclude regular expression from .*.Designer.cs to .*\.Designer\.cs This is intended to exclude windows forms generated code, but the periods were not being properly escaped so it could improperly ignore similarly named files.
I've checked in the fix for this and it will be present in the next release. Thanks again for your help finding that. :)
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