C++ source code formatter for Visual studio 2008

Started by
10 comments, last by daviangel 15 years, 3 months ago
is there a source code formatter for Visual Studio 2008 in C++ mode??? i know there is a Format Selection thing there but for me it does not do its job well...is there a plugin or something where i can run inside VS2008 much like the one in code::blocks called Astyle(i think this does the job right)??? thanks for the replies
Advertisement
Not sure if this is what you're looking for, but there is Visual Assist.
You can also run astyle from the command line via Cygwin. If you need to run it in Visual Studio, you can probably just launch it as an external tool.
There are a small selection of editor preferences in Visual Studio for things like tab size, fill tabs with spaces etc. I assume you're looking for something more than that, but just in case...

Visit http://www.mugsgames.com

Stroids, a retro style mini-game for Windows PC. http://barryskellern.itch.io/stroids

Mugs Games on Twitter: [twitter]MugsGames[/twitter] and Facebook: www.facebook.com/mugsgames

Me on Twitter [twitter]BarrySkellern[/twitter]

@PKLoki yeah im looking for more than that...the formatting feature for C# in VS 2008 is better than in C++ why is that???

@Rydinare How can i do that?

@_fastcall is there a free thing like that?
Quote:Original post by Skeezix
@PKLoki yeah im looking for more than that...the formatting feature for C# in VS 2008 is better than in C++ why is that???

@Rydinare How can i do that?

@_fastcall is there a free thing like that?


You can download Cygwin here: www.cygwin.org

Cygwin gives you a lot of the Linux tools on Windows. It can be a pretty big install, though. Make sure to choose the astyle package when you install.

I usually just run from the command line, with options such as:

astyle --style=ansi -t -S filename1 .. filenamen

But, to embed this within Visual Studio, here's how you do it:

1) Go to Tools->External Tools.
2) Click Add
3) Make the title Astyle
4) Make the command: C:\cygwin\bin\astyle.exe (Assuming you installed Cygwin to C:\cygwin\bin)
5) Make the arguments: --style=ansi --style=ansi -t -S $(ItemPath) (Or whatever arguments you like. Check the arguments here: Astyle Documentation)
6) Click apply.

When you want to run on the file you currently have open, simply go to the Tools menu and click Astyle to use.
I just installed cygwin and it did not have an Astyle.exe...
Quote:Make sure to choose the astyle package when you install.

If you did not do this, just install it using setup.exe file and select it.
Quote:Original post by Eagle11
I just installed cygwin and it did not have an Astyle.exe...


You didn't select the astyle package, so it wasn't installed. Run setup again.
Quote:Original post by Skeezix
@PKLoki yeah im looking for more than that...the formatting feature for C# in VS 2008 is better than in C++ why is that???


C# is exceptionally easier to parse (and thus make formatting/intellisense tools for) than C++.

This topic is closed to new replies.

Advertisement