Where do you put the function documentation so that it shows up on intellisense?

17,190

Solution 1

Use XML comments above the function signature.

    /// <summary>
    /// Summary
    /// </summary>
    /// <param name="param1">Some Parameter.</param>
    /// <returns>What this method returns.</returns>

The GhostDoc plugin can help generate these for you.

Solution 2

To auto-generate the three-slash comment section on top of an existing method, just place the cursor on an empty line, right above the method definition and type three forward slashes ("///"). Visual Studio will auto-generate a three-slash comment that corresponds to your method. It will have placeholders for the summary, each parameter (if any) and the return value (if any). You just have to fill-in the blanks.

I would recommend you don't try to write these description blocks by hand and not to copy from one method to another. Third-party tools are also not necessary to generate them (at least in Visual Studio 2010).

Solution 3

"XML Documentation Comments (C# Programming Guide) In Visual C# you can create documentation for your code by including XML tags in special comment fields in the source code directly before the code block they refer to."

http://msdn.microsoft.com/en-us/library/b2s063f7.aspx

you can then use Sandcastle to generate chm files too if you want

http://www.hanselman.com/blog/SandcastleMicrosoftCTPOfAHelpCHMFileGeneratorOnTheTailsOfTheDeathOfNDoc.aspx

Solution 4

As well as the XML comments you need to enable building the documentation (in the project settings) and keep the generated XML file with the assembly.

Share:
17,190
Alex319
Author by

Alex319

Updated on June 07, 2022

Comments

  • Alex319
    Alex319 about 2 years

    I'm writing a library and I want to put documentation in my functions so that it will show up in intellisense, kind of like how the intellisense for the built in functions shows descriptions for each of the parameters and for the function itself. How do you put the documentation in? Is it through comments in the function or is it in some separate file?