Friday, September 25, 2009

DevTnT 13 – GhostDoc

GhostDoc is a plug-in for Visual Studio that can automatically generate XML comments. GhostDoc uses a configurable rule set to derive meaningful comments for constructors, events, properties and events.

For example: XML comments for constructors should start with “Initializes a new instance of the <classname> class.” GhostDoc can automatically generate that comment.

A method called “button1_Click” will be commented with “Handles the Click event of the button1 control”, complete with comments for the parameters.

A property “NameOfTheUser” will be commented “Gets or sets the name of the user”.

The rules of GhostDoc can be extensively customized, but in my experience this usually isn’t necessary because the default rules are pretty good.


One disadvantage of GhostDoc is that there is no official support for documenting an entire class (or project or solution) at once. There is an unofficial Visual Studio macro that does exactly this, though:

No comments:

Post a Comment