0

In the below code in xml documentations there is mismatch between the names of parameters in method's arguments and name of parameters in xml documentation. Is there any way to auto correct the xml documentation signature or any feature provided in resharper to auto correct the xml documentation.

#region Get Images

/// <summary>
///  Get Images 
/// </summary>
/// <param name="par1"></param>
/// <param name="par2"></param>
/// <returns></returns>
public Collection<UserImage> GetImages()
{
    return GetImages("");
}

/// <summary>
///  Get Images 
/// </summary>
/// <param name="par1"></param>
/// <param name="par2"></param>
/// <returns></returns>
public Collection<UserImage> GetImages(string imageType)
{
    return GetImages(0, imageType);
}

/// <summary>
///  Get Images 
/// </summary>
/// <param name="par1"></param>
/// <param name="par2"></param>
/// <returns></returns>
public Collection<UserImage> GetImages(int imageId)
{
    return GetImages(imageId, "");
}

/// <summary>
///  Get Images 
/// </summary>
/// <param name="par1"></param>
/// <param name="par2"></param>
/// <returns></returns>
public Collection<UserImage> GetImages(int imageId,string imageType)
{
    return null;
}

#endregion

For example i want the method with xml documentation like this:

/// <summary>
///  Get Images 
/// </summary>
/// <param name="imageId"></param>
/// <param name="imageType"></param>
/// <returns></returns>
public Collection<UserImage> GetImages(int imageId,string imageType)
{
    return null;
}

#endregion

2 Answers 2

6

GhostDoc will do this for you. After installation you get a new context menu item in VS 'Document this' (and a corresponding keyboard shortcut).

If no XML comments are present, it will add them. If they are already present, they should get updated as you require.

http://submain.com/products/ghostdoc.aspx

Sign up to request clarification or add additional context in comments.

7 Comments

How does it know that xml documentation needs to be corrected and the arguments in the function?
It looks at params elements, compares them to the arguments and updates if required. I've tried an example, it works well.
Thanks,Adam it works well one thing more ,currently with that feature i have to go to each method and press CTRL+Shift+D to perform the xml documentation.Is there way to correct xml documentation all the methods in a class file?
If I remember the documentation correctly, it was left out on purpose: now you can review the autogenerated comments, which you will not do if there is a "document file" or "document project" option.
Ah true, I suppose it does force the casting of a human eye on the generated comments. Seems like a good idea.
|
1

The only way I know to "auto correct" xml with R# is to delete the existing xml documentation and hit /// again. Sorry I don't have a better answer.

I believe it's not possible because R# doesn't what need to correct the xml documentation or method signature.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.