Can I refresh an XML comment in Visual Studio to reflect parameters that have changed?

风流意气都作罢 提交于 2019-12-03 14:38:38

问题


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)


回答1:


Check out GhostDoc. It is a Visual Studio extension that will generate your XML comments for you.




回答2:


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.



来源:https://stackoverflow.com/questions/10451482/can-i-refresh-an-xml-comment-in-visual-studio-to-reflect-parameters-that-have-ch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!