How to document a function so Visual Studio's Intellisense displays it?

So, when I code, I am usually in Visual Studio and I am used to writing documentation above my functions as follows:

[sourcecode language=”cpp”]
/*
* The is SomeFunction that does some action.
*/
private void SomeFunction(int inSomeValue)
{
// write code here
}
[/sourcecode]

However, it annoys me that this information doesn’t show up in Visual Studio’s Intellisense. So I took time to look up the proper way to make function documentation show up in Intellisense.

It turns out that you can type /// above a function and Visual Studio will automagically populate the markup needed to have your comments show up in intellisense.

[sourcecode language=”cpp”]
///

/// The is SomeFunction that does some action.
///

///Enter an integer as some value here. private void SomeFunction(int inSomeValue)
{
// write code here
}
[/sourcecode]

So it seems if you use this syntax, the function documentation will now show up in Visual Studio’s Intellisense.

Leave a Reply

How to post code in comments?

*