Q

Is there some sort of code formatter that will let me format others' source code files to my own sta

This Content Component encountered an error

I know you can use the command Ctrl+K,Ctrl+F to format selected code, but is there some tool or add-in that will allow me to fix other things other than tab indentions? Some kind of code formatter that will allow me to format other peoples source code files to my own standard settings? With the .NET CodeModel I figure someone has written one. In fact, I'm thinking about trying to write my own. There are a few more settings than just...

tabs that you can change in the automatic and manual code formatting provided by VS.NET. Tools -> Options -> Text Editor -> C# -> Formatting shows the available C# formatting options (as you can see in TODO).

Figure 1: C# formatting options
Figure 1: C# formatting options

For prose, I prefer the settings as shown, because I like the opening brace on the same line as the construct. For example:


if( foo ) {
  ...
}

I find this style better suited to a small amount of space than the formatting settings as provided out of the box:


if( foo )
{
  ...
}

Of course, these aren't all possible settings, but I find them to be the kinds of things that I've wanted to change when formatting code.

This was first published in November 2002

Dig deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close