In general terms, the options Visual Studio offers for code formatting are adequate (or at least they work for me), particularly in VS2005. Here's one suggestion that would make them even more useful for me: Make them selectable by solution.

Here's the problem: I have Visual Studio configured with a set of settings that I am very comfortable with and that formats code just like I want it. For example: use spaces instead of tabs, 3 spaces == 1 tab, insert spaces between parenthesis in control flow expressions and stuff like that.

However, I also participate and collaborate in other projects that use different conventions (like open source projects), and it is really a pain to either manually try to keep the code conforming or constantly exporting and importing saved setting sets to work on a project (particularly since I might have two different VS instances running projects with different settings at the same time).

So here's what I'd love to see: A way to create and save multiple "Code Formatting" profiles and then simply associate a VS solution with a specific profile, regardless of what the default configuration is. That way, whenever you opened up a solution, Visual Studio would already be configured with the right settings.

Part of the capabilities are already there in Visual Studio with the capability to export/import vssettings files, this would just be a way to load a given set of settings in memory when the solution is loaded; instead of actually writing them to the registry or wherever they are stored and made permanent. It's worth noting that I'm not talking about making all Visual Studio settings configurable this way; merely what's under the Text Editor node (or possibly a subset of it) and I'm talking about associating them with the entire solution, not with individual projects.

Of course, there's probably zero chance of ever being implemented (at least before 10 years :-)) but I thought I might as well throw it out there and see if anyone else thought it would be a good feature to have around.

Update: Kim Gräsman suggested posting this as a suggestion on Microsoft Connect. It can be found here, so please vote if you think this would be useful!

Technorati tags: ,

Tomas Restrepo

Software developer located in Colombia. Sr. PFE at Microsoft.