Scott Dorman

ephemeral segment

  Home  |   Contact  |   Syndication    |   Login
  608 Posts | 11 Stories | 900 Comments | 51 Trackbacks

News


Post Categories

Image Galleries


Microsoft Store


Creative Commons License



Locations of visitors to this page

Subscribers to this feed

TwitterCounter for @sdorman

View blog authority

Add to Technorati Favorites

Windows Live Alerts

AddThis Social Bookmark Button

LinkedIn profile

Community Credit profile

The Code Project

Follow me on Twitter

Get Free Shots from Snap.com

Community Credit Hall of Fame

Get Feedghost

Xobni outlook add-in for your inbox



Support This Site

Tag Cloud


Article Categories

Archives

Post Categories

Image Galleries

One of the new features coming up in Visual Studio 2008, is the ability to ignore spaces in declaration statements. This was a bug opened on the Microsoft Connect site a long time ago and it is finally getting some work done to fix it.

Unfortunately, even in Visual Studio 2008, we won't have full alignment options like the ability to control how individual symbols are aligned in the editor, but there will be some help for aligning declaration statements. This isn't in the Beta 2 release, but it will be in the final release (and any other Beta or RC releases).

According to Karen Liu, there is a new option added to the Tools | Options | Text Editor | C# | Formatting | Spacing | Set other spacing options. This new option is a check box titled "Ignore spaces in declaration statements" and applies to:

  • Constants and Fields
  • Local variables

The option will apply for every location that a field or local variable is valid, including:

  • Block
  • For-statement
  • Foreach-statement
  • Using-statement

If the option is on, spaces around attributes, modifiers, type, identifier, and the binary operator will be retained but the spacing within the right-hand-side expression will continue to be formatted. Spacing between multiple statements will continue to be removed and it will continue to not format around comments.

I'm not entirely clear yet how the end result of this will actually work in practice since I don't have a version of Visual Studio 2008 that contains this feature. I like the fact that it will allow me to align declaration statements, but I'm not sold on the idea of applying this to for, foreach, and using statements.

posted on Wednesday, September 26, 2007 12:28 PM