Alex Rivera | Logout

How to add description to functions and function parameters?

Asked 2011-04-19T13:46:56.983
46

I'm writing a VB.NET function with a ton of overloads. I've seen that most .NET functions have parameter descriptions in IntelliSense. For example, when typing in String.Compare(, IntelliSense says Compares two specified System.String objects and returns... you get the idea. This description changes and you click through different overloaded versions of the same functions. When you start typing in something for a parameter, it describes the parameter you're currently inputting as well. Example: strA: The first string to compare..

How can I give such descriptions to my functions?

Edit
Report

2 Answers

8

Use xml comments. There are some predefined tags that load into intellisense after you compile. and the wonderful thing is, if you place your cursor on the line above your function, then press ''' (triple-single quote, if that makes sense) and enter, it will prefill a bunch of stuff for you. Heres an article:

Documenting Your Code with XML Comments

answered 2011-04-19T13:54:25.040
3

Place the cursor on the line before the method and type three apostrophes ('''). You will get a template for writing XML documentation for the method and it's parameters.

answered 2011-04-19T13:52:07.727

Your Answer