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.
Excellent tool, perfect to maintain prjects from the get go. I would be careful doing it to large code bases as there are a few gotcha's that you will want to be sure you like the behaviour of before you go ahead and clean a whole solution.
Sorry to hear it. In regards to the crash, please check https://bitbucket.org/s_cadwallader/codemaid/issue/213/refactor-rename-starts-endless-clean-loop if you are seeing a crash during a rename operation.
As to performance, I wouldn't have expected any differences at this point but there are performance improvements in the works going forwards.
Sorry for the trouble. Yes, this is a known issue introduced in the VS2012 API and resolved by the Microsoft team for the next major release. They've offered a workaround which I am working towards implementing. For more details: https://bitbucket.org/s_cadwallader/codemaid/issue/142/spade-starts-endless-process-in-vs-2012-c
For VS2012 C++ projects, you can close the Spade tool window and still use the rest of the functionality of CodeMaid for now.
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. :)
Sorry to hear it. I haven't seen that issue or had any other users report it. Have you noticed any patterns about when your settings are getting reset, such as it happens after performing an operation in another extension? My best guess would be that the shared space where user preferences are stored are getting overwritten.
As a workaround until we can identify the source of the reset, I'd recommend exporting your settings when they're valid so you can quickly re-import them once you've noticed they have been reset.
Hi - the "Cleanup Code" menu option (and keyboard binding) are unavailable in my .html/.cshtml files. The command is available for .cs and .js files. I've gone through the configuration and the HTML checkbox is checked in the File Types section. Any ideas why this command is being disabled for these files? I'm using VS 2013.
There is a known issue with Visual Studio's devenv.exe.config file that I'm working with Microsoft to get resolved. The net effect is that the cleanup commands invoked from the solution explorer will not work, but you should still be able to cleanup files that are open as document tabs. Please follow through our BitBucket issue to track status and vote up the backing Microsoft connect issue, as well as view a workaround: https://bitbucket.org/s_cadwallader/codemaid/issue/220/vs2013-cleanup-all-code-shows-error
Is there any way to bypass code cleaning for a class or a region?
For example, in my DemoCode.cs, there are 3 classes: MyControl, MyEntity and MyHelper. I don't want MyEntity to be sorted when doing code cleaning.
Another example, in MyControl class, there are some functions in a #region block that I don't want them be sorted.
Thank you for reply.
Hi Chris -
No, currently reorganization runs on the entire file. In the case of your three classes in one file I would recommend separating the classes each to their own file as good practice and an easy workaround. However skipping a region would be a little trickier without utilizing partial classes. Is it a standard region that you would always want to skip, or just a one-time example? If you have some ideas about a feature request please start the conversation on the Trello backlog here: https://trello.com/b/VVxVhbQv/future
Hope it helps,
In our team we made it mandatory to use CodeMaid, but the sorting order rules for using statements differ across team members. For some it is correct - System usings go first, but for others they get sorted alphabetically regardless being System imports or not. We didn't find any configuration setting that would affect this.
Is this setting hidden in some config file?
Thank you for reply.
Hi Maynard -
I encountered that as well with my own team. There is a setting for this within Visual Studio's Options under Text Editor->C#->Advanced->"Place 'System' directives first when sorting usings"
This option used to be enabled by default in VS2010 and earlier, but Microsoft changed it to be disabled by default in VS2012 and later due to Windows Store apps using the Windows.* namespace.
A couple useful links:
Hope it helps, :)
Hi Zubayba -
The current version of CodeMaid no longer supports Visual Studio 2005 or Visual Studio 2008. The last version of CodeMaid that does support those versions is v0.4.3 which can be downloaded from here: https://bitbucket.org/s_cadwallader/codemaid/downloads/CodeMaid_v0.4.3.msi
Hope it helps,
I downloaded this tonight and installed it on a new machine with VS2010 -- I really like the "Format comments during cleanup, Wrap comments at column" option -- but it's disabled, and there's no way to make it turn on. What gives?
Also, completely different issue with the same feature: in the version of Code Maid installed on my home machine that I downloaded last month, the "wrap comments at column" feature was deleting the preceding white space from the first line of a block of comments. It was very annoying. I could do a reformat of the document to realign the comments -- but even with the checkbox "Run format document" checked, it didn't fix the issue when I ran CodeMaid clean (was the format document being run before the format comments? Seems to me that switching the order those items are called in would fix that issue.)
Comment formatting support is currently only available in VS2012 and higher. There is a card in the backlog here to add support for VS2010 if you would like to vote it up/track progress: https://trello.com/c/QylslKhh
There are a few known issues with comment formatting which is a new feature. You can track them and/or report them if not already present on BitBucket (https://bitbucket.org/s_cadwallader/codemaid/issues?status=new&status=open . Additionally you can download the latest alpha releases which contain some fixes.
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