Great tool. However, it doesn't seem to format VB as well as C#. One thing I noticed is it does not add an empty line between functions. Running CodeMaid on the below will not add an empty line between Foo and Bar.
Public Class Class1 Public Function Foo() As Integer Return 1 End Function Public Function Bar() As Integer Return 2 End Function End Class
Hi, Great Extension. By default, *.rc2 files should be excluded. If you remove the last CR/LF at the end of those files (ie if the file doesn't end with an empty line), the project doesn't compile anymore. Fred
This "great" plugin destroyed one week of work. Im really angry, cleaning up singel files works good, but when it came to cleaning up the whole solution it is deleting whole files! Big fat warning to everybody! DO NOT CLEAN THE WHOLE SOLUTION AS MENTIONED!
I'm very sorry to hear that happened to you. I have not heard of it happening before to anyone else, and I'd like to determine a root cause if you have any interest in pursuing it further. Please contact me directly via codemaid on gmail if you would like to discuss.
That's odd that you'd be seeing intermittent behavior like that. Have you tried the classic uninstall/reinstall technique? If that doesn't help please report some more details on BitBucket and we can take a look: https://bitbucket.org/s_cadwallader/codemaid/issues
DISABLED for me in Visual Studio 2012 premium. Since this is the 1st time, i am usng it, i felt that i was making some mistakes. this tool has raving reviews and i am wondering why it is not working or disabled for me. any help would be appreciated. regards, Ravi.
This is an awesome util. Thanks a lot Steve! Saved me a ton of precious time. :-)
I just wanted to bring to your notice a minor problem. When I Format the comments, it automatically messes up my copyright info at the top of the file. My company's copyright info normally follows a 3 line comment like: // <copyright file="file.cs" company="MyCompany"> // Copyright (c) 2013 CompanyName. All rights reserved. // </copyright> // <summary>The class summary</summary>
But on formatting comments, it puts it all in just a single line (sometimes 2 lines). Is this intended or am I doing something wrong :^)
Really glad to hear you like it, you're welcome. :)
There are two kinds of comment formatting, traditional comments "//" and XML comment formating "///". It looks like you have XML tags within your copyright definition, but they aren't being marked with the triple slash syntax usually associated with XML comments. If you put the third slash in that will improve behavior. You will also want to mark 'copyright' as a major tag within CodeMaid's configuration (CodeMaid->Configuration->Cleaning->Comments) so that it will always keep new lines before and after.
Hope that helps. If you're still seeing an issue please post a code sample on BitBucket and I'll take a deeper look. :)
Just learnt about this tool today reading a SO answer. Awesome utility to reformat a huge bunch of files that I had to import from another system. And managed to get it done in all of 2 mins.. Great work.
I have to reiterate a point brought up by a previous reviewer.
I like cleaning up the code to add the this keyword in front of class members and methods. It helps to make the code more unified because you NEED to use the this keyword when applying extension methods to the local class. I agree it is not needed in most cases, but it does clarify the target of the request.
StyleCop has this rule for a good reason: code transparency and consistency. Please support this in CodeMaid. it is the last item only thing it doesn't do for me.
Thanks for the suggestion. Personally I always remove them, but there's arguments for both directions.
To implement adding/removing "this." requires a richer code model than what is currently exposed through the Visual Studio API. The Roslyn project promises to expose a code model rich enough to add this kind of functionality in the future, but it has not been released. To get that behavior today you'll need to use a commercial tool (e.g. ReSharper) that has its own static compilation engine.
First off, just want to say what a great plugin this is. Question is, when I go to format HTML code it moves part of a tag onto the next line. Example being if I have a grid column with a number of properties it will format it so there is two on each line etc. Can anyone help?
Very glad you like it. :)
Visual Studio has some built in formatting options that cause that behavior, and CodeMaid invokes Visual Studio's formatting as part of the cleanup process. Check out your settings under Tools->Options->Text Editor->HTML (Web Forms)->Formatting->Tag wrapping
Hope it helps.
Not sure who else to ask, so might as well ask the Dev :) I'm trying to exclude file types that exist with in a folder named Generated. I tried .*\Generated\.cs. This seems to work initially. When I select a file inside one of these folders, the option to clean the file is gone, which is exactly what I would expect. However, I try to clean all code and I get an error from the parser that \g is an unrecognized escape sequence. How would I go about getting this to work? Thanks in advance.
Hi Derek -
The exclusion expressions are fed through a regular expression matcher - have you tried escaping the back slash \\ ?
If that doesn't do it, go ahead and vote up the backlog card here with your comments: https://trello.com/c/WTkal55t
Hope it helps, :)
Is it possible to exclude the "References" folder when doing a cleanup all on a project that has web references? Since these generated classes can at times be large and cleanup serves no purpose on those files since they will never be edited but always regenerated automatically, ignoring those files would speed up the clean up all process dramatically.
Thanks for the response Alexander, that's very helpful. :)
Greg: There's also a backlog feature card to extend the exclusion rules to include files with specifically identified <auto-generated> tags in the header which would cover those as well. If you'd like to vote it up it is located here: https://trello.com/c/WTkal55t
No, not currently. The VS API provides a code model for C# and C++ so those are the supported languages. In the future when Roslyn is released I expect to be able to increase the number of supported languages.
Did the progress bar get changed in 0.7.0? I just updated my Win 8.1/VS2010 machine to 0.7.0 and both the progress window and the task bar icon now use the somewhat useless Win 8 travelling progress bar that doesn't actually show any progress.
No, there have been no updates to the progress bar with the v0.7.0 release. Some operations are indeterminate (e.g. building an individual project vs. the solution) but that hasn't changed since previous releases.
Well, that's strange. I rolled back to 0.6.2 and the progress bars worked properly. To confirm the problem I upgraded to 0.7.0 again and, lo and behold, I still get the proper progress bars. I don't know if the second upgrade fixed it or the multiple restarts of VS, but works now.
The CodeMaid progress bars are a great feature, but they were rendered useless by the Win8 style progress bar.
This is my 1st time trying to use tools like code maid. After i installed the app using NuGet, the nuget manager app indicates that CodeMaid is disabled - when I doublie click the disabled Enable button, the app is ready to uninstall from the machine. Answer links present for a 'disabled' search on the QA page are broken.
Any help will be greatly beneficial.
My bad. Fixed it. My colleague helped me out. For folks who might need the solution: In Tools-->Option window, Under Environment, there is an option 'Extension and Updates'. In my problem, Load per user extension when running as adminstrator was NOT checked. I checked it (set the checkbox to true) and re-started vs 2013.
thanks for your patience.
Hi Ravi -
I'm glad that you figured out the source of the problem, and I appreciate you sharing it for anybody else who might encounter that setting having been changed. Hope you enjoy the tool. :)