Group and Order Namespace Declarations

By Michael Flanakin @ 10:13 PM :: 144 Views :: 0 Comments :: Visual Studio, (Open), (Unreported) :: Digg it!

One of the great features of Visual Studio 2005 is the ability to dynamically add namespace declarations to your using/imports block at the top of the document while you're hacking away at code. As anal as I am about my code, I just wish the namespaces would be grouped and ordered in some fashion. All the feature does is toss the namespace to the end of the list; however, what I'd like to see is the ability to configure a rule for how to group and order the names. I think the best way to explain myself is with an example. So, let's say I'm using 6 namespaces: 3 .NET BCL namespaces, 2 third-party namespaces, and 1 namespace from my app. I want them all alphabetized and grouped as such, like so...

using System;
using System.Text;
using System.Web;

using Indigo.Business;
using Indigo.Web;

using Flanakin.Business;

This is helpful for when you're looking thru the file, you can see the namespaces at a very quick glance. Granted, you don't really need to look at them much, but if they have to be there, it only makes sense to put them in some sort of logical order.

Ratings

Comments

Currently, there are no comments. Be the first to post one!
Click here to post a comment



Archives Archives

Categories Categories

Related Links Related Links