Visual Studio Code Formatting Properties and Solutions

Link. January 24, 2007. Comments [2]. Posted in: .NET | Development

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!



Wednesday, January 24, 2007 1:43:28 AM (SA Pacific Standard Time, UTC-05:00)
Hey Tomas,

I agree, that would be really nice -- a base configuration and the ability to override for individual solutions/projects.

Actually I think tabs/spaces and tab size would be sufficient, that's the largest pain at the moment, at least for me. The rest is just typing :-)

Could you throw it up on Connect and post a link for me to vote on? Or do they not take enhancement requests there?

- Kim
Thursday, January 25, 2007 5:12:00 PM (SA Pacific Standard Time, UTC-05:00)
Excellent thought -

I've thought in the past that perhaps just a simple comment convention at the top of a file (similar to the macros that certain source control systems use) would be a great way to indicate space/tab/tab-size preference. (Then standalone text editors could follow suit...)
Comments are closed.

Syndicate

About

Tomas Restrepo is a software developer located in Colombia, South America. His interests include .NET, Connected Systems, PowerShell and lately dynamic programming languages. More...

tomasrestrepo @ twitter My Flickr photostream My saved links on delicious My Technorati Profile

email: tomas@winterdom.com
msn: tomasr@passport.com

View my profile on LinkedIn

MVP logo

Ads


Categories

Statistics

Total Posts: 1050
This Year: 1
This Month: 1
This Week: 0
Comments: 825

Archive

Other

Copyright © 2002-2008, Tomas Restrepo.

Powered by: newtelligence dasBlog 2.2.8279.16125

Sign In