Aligning @ Equals
Ok, i'll admit when it comes to formatting code, but is there a way to stop VS.NET 2005 from removing the extra spaces i put in to align my code?
When i write:
some.thing = 1;
some.other_thing = 2;
I end up with:
some.thing = 1;
some.other_thing = 2;
Surprisingly annoying
[701 byte] By [
a0-0b] at [2007-12-24]
The formatting options in VS 2005 do not directly support this kind of alignment, but I can offer you a workaround that should prevent VS from removing the extra spaces. Under Tools\Options\Text Editor\C#\Formatting\Spacing, scroll down to the bottom of the options list on the right hand side and look for "Set spacing for operators". If you change this to "Ignore spaces around binary operators" it will prevent VS from fiddling with the extra spaces you are inserting before and/or after "=". Of course, we won't automatically adjust the spacing around other binary operators, either, so there is a downside.
If you like, you can request this feature through http://connect.microsoft.com/VisualStudio/Feedback. By entering your request there, you'll be able to track it and see when (and if) it will make it into VS.
Thanks,
-Tom Meschter
Software Dev, Visual C# IDE