If you like writing comments for the function then this post is not for you :), but if you are like me who believes in writing the method name in such a way which explains the purpose of the method/function then keep reading.

Suppose if I could derive my comment just from my method/function name by merely pressing simple strokes of the keyboard ? See below for example


Looks interesting ?? Then go ahead and download GhostDoc. Its a Visual Studio extension available for 2005, 2008 and 2010. All you have to do is press cntrl+shift+D and booooom…. Comments are generated for any method, property, event, enum and for many more.

Now you may be wondering how does it generate comment with method or property name as the only input. The answer lies to its configuration go to Tools –> GhostDoc -> Options.


Scroll down to Methods and edit the method rule “State check(Is…,Has…)” you will see some expression on the right side, this is the logic through which your comments starting from “Is”  or “Has” are generated.


You can create your own rule of commenting by simply adding a new rule. To make it easy for you many macros are available which are sufficient to write any custom rule.


You might also like