Robust generation of XML documentation comments for C#

Writing comments is something you need to get used to; sooner or later you will understand it’s worth writing comments. Haven’t you find yourself in a sitation where you don’t understand what a couple of lines of YOUR OWN code do? I have…

XML documentation comments are also important, particularly for public members/methods. Even if your project doesn’t require generating full XML documentation of the code, using Intellisense can be much more effective if it summarizes the method you are trying to use. If you want to generate XML documentation for C# in the twinkling of an eye you MUST install Roland Weigelt’s GhostDoc plugin for Visual Studio. Let me cite the author:

GhostDoc is a free add-in for Visual Studio that automatically generates XML documentation comments for C#. Either by using existing documentation inherited from base classes or implemented interfaces, or by deducing comments from name and type of e.g. methods, properties or parameters.

Once the plugin is installed and you have restared Visual Studio, go inside a method and press Ctrl + Shift + D. The XML documentation for the method appears just like that; it contain the summary, description of parameters, and information what the method returns. The only thing you have to do is to give a method a descriptive name and eventually polish what’s been generated. BTW, it works too for attributes and classes.

GhostDoc really saves your time and makes you a better developer – yet you care about the XML documentation, which is something of a higher level of understanding than your perfect code icon_smile-8539381

Previous Post
Next Post