Friday, February 13, 2009

Ghost Doc

As we were talking about autocode documenting, you should try out GhostDoc which is a very simple and easy to use add-in for Visual Studio. 

Installation

Just download the ZIP file from the website

Run the installer MSI file.

image

Check Next

image

Agree and click Next.

image

Choose the default location or change it as required.  Click Next and Next Again

image

After a few seconds you should see the following to say Installation was successful.  click Close.

Using it within Visual Studio

Start visual Studio 2008 for the first time after installation you’ll see the following message.

image

Take the default option of <CTRL><SHIFT>D and click Assign.

image

Create a new default configuration for the rules (we can create one later if the developers feel like it’s a good product to use).  click Create and then Click Finish, Visual studio should then start as normal.

From within any application source code you can add a new comment to a function by placing your cursor on the first line.

image

In the above example the cursor is on line 19 for the button1_click.  Hold down <CTRL><SHIFT> and D, or whatever you assigned above.

image

The additional comment information is automatically added.

Why use GhostDoc

So what’s so different about Ghost Doc over the built-in functionality of just typing ‘///’? 

Well, if you provide good variable names it will actually come up with reasonably good comments automatically, for example above it knew “Click” was an Event, which would not happen in the built-in options.

Also you have a whole load of functionality around customising the language used or rules that can be applied.

image

To access the configuration area choose Tools/GhostDoc/Configure GhostDoc.

image

I’m not even going to try and set out the number of options you have here.

If nothing else it’s worth a look.