If I write the function:
public static uint FindAUint(double firstParam)
{
}
I can generate the xml comments by typing '///', it gives :
/// <summary>
/// *Here I type the summary of the method*
/// </summary>
/// <param name="firstParam">*Summary of param*</param>
/// <returns>*Summary of return*</returns>
public static uint FindAUint(double firstParam)
{
}
If I then decide I need to update my method to be:
/// <summary>
/// *Here I type the summary of the method*
/// </summary>
/// <param name="firstParam">*Summary of param*</param>
/// <returns>*Summary of return*</returns>
public static uint FindAUint(double firstParam,double newParam, double newParam2)
{
}
Is there a way to get visual studio to add the new params into the xml without losing the descriptions of the previous ones?
(I should mention I am using Visual Studio Express; I wouldn't put it past Microsoft to disallow the feature in the Express version though)
Just hit (by default) Ctrl+D anywhere within a method, and it will add XML Documentation comments with defaults filled in (though they typically should be modified/expanded).
An XML comment encountered outside the document type declaration is represented by the Comment value syntax element. It contains the comment text from the XML message. If the value of the element contains the character sequence --> , the sequence is replaced with the text --> .
The syntax for adding XML comments in your code is triple slashes /// followed by one of the supported XML tags.
Check out GhostDoc. It is a Visual Studio extension that will generate your XML comments for you.
ReSharper works very nice for me; it warns whenever the XML comment does not match a method's signature.
Also, using the ALT + ENTER keyboard shortcut, ReSharper can fix these mismatches by adding/removing the necessary XML comments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With