Use Visual Assist X to refractor Arduino source code

by Visual Micro 7. February 2012 12:00

Visual Assist X by "Whole Tomatoe Software" is, amonst other things, a very good refractoring and code highlite tool.
 
I would not normally suggest an addin for Visual Studio, let alone one you pay for, because they all slow things down. However the Visual Assist X (VAX) tool is so well used and well written that it is worth trying it out.
Below you will find a brief overview of the VAX tool along with instructions about how to configure arduino .pde and .ino files as c++ files in VAX

Develop new code faster with fewer errors

Read code faster than ever with fewer errors with enhanced syntax coloring. Write code at blinding speeds with Suggestions, Acronyms and Snippets. Identify and correct errors before compiling.

Quickly understand existing code

Enhanced IntelliSense and enhanced completion listboxes help to shed light on unfamiliar classes and members. Get detailed information on current symbols and quick shots of info by looking at small context and definition fields.

Refactor existing code making it easier to read and cheaper to maintain

Visual Assist X offers fast and easy refactoring across ALL languages in your solution with its suggested refactoring and code outline view. "I have to say that I like this feature the most. Highlite a chunk of code and have a method automatically created for you! A great way to re-structure code."

How to configure VAX to recognise .pde or .ino source files as c++ files

You have two options... 

If you have already setup visual studio color coding (as per Visual Micros Arduino guide) then you might only need to follow the instructions below. Otherwise follow the official whole tomatoe C/C++ setup guide. You need to configure for both .pde and .ino Arduino file extensions
Add ".pde;.ino;" to ExtSource in the following location
HKEY_CURRENT_USER\Software\Whole Tomato\Visual Assist X\VANet8

Press Rebuild on the Performance tab of the Visual Assist X options dialog and restart your IDE

NOTE:-
Replace 8.0 with 10.0 if you use VS 2010.
Replace 8.0 with 9.0 if you use VS 2008.
Replace 8.0 with 7.1 if you use VS.NET 2003.
Replace 8.0 with 7.0 if you use VS.NET 2002.

Replace VANet8 with VANet10 for Visual Studio 2010.
Replace VANet8 with VSNet9 if you use VS2008.
Replace VANet8 with VSNet if you use VS.NET 2003.
Replace VANet8 with VANet7.0 if you use VS.NET 2002