views:

163

answers:

2

Are there any tools available for automatically formatting vb.net code - specifically for adding line breaks at a predefined line length? I'm working with a lot of code with long lines (thousands of lines), and manually reformatting it is quite time consuming. I've seen a number of tools for rearranging code into regions etc., but haven't found any that reformat with line breaks. Free would be great.

A: 

Try having VS auto-wrap your lines. The option should be in the Tools | Options | Basic | Settings | Word Wrap.

Another thing to do is go to the Edit | Advanced | Format Document menu option, which helps clear the air with not well-formed documents.

A 3rd option is to install DevExpress' Code Rush Xpress add-on, which add's very handy vertical lines for when code blocks begin and end, and also helps in refactoring code. You can get it from here: http://devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/. It's free, but doesn't support the Express editions of Visual Studio.

arabian tiger
Didn't know about the auto-wrap feature. Makes it easier to read, but I'm after a permanent solution - i.e. actually insert line breaks and '_' chars. I've got DevExpress Code Rush installed and like it, and have used the ClassCleaner plugin, but there are no line break functions I've found. Resharper has the functionality I'm after, and I'm trying the trial version of it now. It looks quite good, but doesn't meet the last criteria...
hitch
A: 

Use Visual Studio 2008 you have to use Ctrl + A + K + F for formatting your c#, vb code

Ravia