Add XML Comments

The Add XML Comments code provider imports an XML comment from a base type, or an interface to the member under cursor. If the base type or the interface does not contain XML comments, the code provider creates an XML comment stub.

Availability

From the context menus or via shortcuts:

  • when the edit cursor or caret is on a class member.

Example

interface IAddXMLComments
{
    /// <summary>
    /// This method adds b to a and converts the result to string.
    /// </summary>
    /// <param name="a">First parameter</param>
    /// <param name="b">Second parameter</param>
    /// <returns></returns>
    string TestMethod(int a, int b);
}
class AddXMLComments: IAddXMLComments
{
    public string TestMethod(int a, int b)
    {
        return String.Format("{0}{1}", a, b);
    }
}
Interface IAddXMLComments
    ''' <summary>
    ''' This method adds b to a and converts the result to string.
    ''' </summary>
    ''' <param name="a">First parameter</param>
    ''' <param name="b">Second parameter</param>
    ''' <returns></returns>
    Function TestMethod(ByVal a As Integer, ByVal b As Integer) As String
End Interface
Public Class AddXMLComments
    Implements IAddXMLComments
    Public Function TestMethod(ByVal a As Integer, ByVal b As Integer) As String
        Return String.Format("{0}{1}", a, b)
    End Function
End Class

Result:

interface IAddXMLComments
{
    /// <summary>
    /// This method adds b to a and converts the result to string.
    /// </summary>
    /// <param name="a">First parameter</param>
    /// <param name="b">Second parameter</param>
    /// <returns></returns>
    string TestMethod(int a, int b);
}
class AddXMLComments: IAddXMLComments
{
    /// <summary>
    /// This method adds b to a and converts the result to string.
    /// </summary>
    /// <param name="a">First parameter</param>
    /// <param name="b">Second parameter</param>
    /// <returns></returns>
    public string TestMethod(int a, int b)
    {
        return String.Format("{0}{1}", a, b);
    }
}
Interface IAddXMLComments
    ''' <summary>
    ''' This method adds b to a and converts the result to string.
    ''' </summary>
    ''' <param name="a">First parameter</param>
    ''' <param name="b">Second parameter</param>
    ''' <returns></returns>
    Function TestMethod(ByVal a As Integer, ByVal b As Integer) As String
End Interface
Public Class AddXMLComments
    Implements IAddXMLComments
    ''' <summary>
    ''' This method adds b to a and converts the result to string.
    ''' </summary>
    ''' <param name="a">First parameter</param>
    ''' <param name="b">Second parameter</param>
    ''' <returns></returns>
    Function TestMethod(ByVal a As Integer, ByVal b As Integer) As String
        Return String.Format("{0}{1}", a, b)
    End Function
End Class