Dealing with curly braces ;}

  • Thread starter Thread starter JavaGeekRoyR
  • Start date Start date
J

JavaGeekRoyR

Hello all..

In the VS.Net IDE, is there a way to auto-format your code (such that
the curly braces for code blocks automatically align, code is
automatically indented to proper levels etc)? If not in 2003, will this
feature be available in 2005?

It sux to deal with so much variation in code formatting style between
different programmers. At least VB.net makes formatting consistent by
default. I promise to stop complaining if you will tell me how to do
this in C# :)
 
select all code in the window (ctrl-a)

then
ctrl-k ctrl-f

Also in the menu under Edit->Advanced->Format Selection

Formats all selected code in window.

I know your pain. ;)

jim
 
JavaGeekRoyR,

There is no support for this in VS.NET 2003, but in VS.NET 2005, there
is a huge amount of support for formatting. You can find it under "Tools |
Options"

Then in the dialog that shows up, go to "Text Editor | C# | Formatting"
and you can see a number of options relating to the formatting that the IDE
applies to your code.

Hope this helps.
 
what am i missing here ?
in vs.net 2003 ( and afaik all previous versions ) typing a closing brace
formats all code back to the matching opening brace.



Nicholas Paldino said:
JavaGeekRoyR,

There is no support for this in VS.NET 2003, but in VS.NET 2005, there
is a huge amount of support for formatting. You can find it under "Tools |
Options"

Then in the dialog that shows up, go to "Text Editor | C# | Formatting"
and you can see a number of options relating to the formatting that the IDE
applies to your code.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


JavaGeekRoyR said:
Hello all..

In the VS.Net IDE, is there a way to auto-format your code (such that
the curly braces for code blocks automatically align, code is
automatically indented to proper levels etc)? If not in 2003, will this
feature be available in 2005?

It sux to deal with so much variation in code formatting style between
different programmers. At least VB.net makes formatting consistent by
default. I promise to stop complaining if you will tell me how to do
this in C# :)
 
Back
Top