Search code examples
vb.netvisual-studio-2015intellisensexml-documentation

IntelliSense and collapsed XML Comments not displayed as needed in designview


I'm am trying to create XML comments for IntelliSense and use the following to do it:

'''<summary>Units
''' <para>MinOccurs: '0'</para>
''' </summary>
Public Property S_Units As String = Nothing

Collapsed it looks like this:

'''<summary>BinLocation
Public Property B_BinLocation As String = Nothing

What i am trying to do is to add an XMLcomment and when it is collapsed, it simulates the way it is displayed when drilling down on a System property like Microssoft's String.Padright Property below (i know this is just regular comments but require the same effect)

'
' Summary:
'     Returns a new string that left-aligns the characters in this string by padding
'     them on the right with a specified Unicode character, for a specified total length.
'
' Parameters:
'   totalWidth:
'     The number of characters in the resulting string, equal to the number of original
'     characters plus any additional padding characters.
'
'   paddingChar:
'     A Unicode padding character.
'
' Returns:
'     A new string that is equivalent to this instance, but left-aligned and padded
'     on the right with as many paddingChar characters as needed to create a length
'     of totalWidth. However, if totalWidth is less than the length of this instance,
'     the method returns a reference to the existing instance. If totalWidth is equal
'     to the length of this instance, the method returns a new string that is identical
'     to this instance.
'
' Exceptions:
'   T:System.ArgumentOutOfRangeException:
'     totalWidth is less than zero.
Public Function PadRight(totalWidth As Integer, paddingChar As Char) As [String]

Collapsed it looks like this:

...Public Function PadRight(totalWidth As Integer) As [String]

Notice the ellipse in line with the Function declaration If I simulate the structure used here i get the below:

'
' Summary:
'    Summary Line
'
' Returns:
'     Returns Line
Public Property S_Units As String = Nothing

Resulting in collapsed:

' ...
Public Property S_Units As String = Nothing

Notice the ellipse above the Property declaration. 1 notable point is I get the String sample from The System Namespace and the VS tab displays String [from metadata]

Could this be why it shows differently or am i missing some import or reference somewhere?

Anything i can try?


Solution

  • You are confusing a special visualizer view as an optional view for xml comments.

    Prior to VS2015, this particular visualizer did not exist for VB and "Go To Definition" would have taken you to the "Object Browser". This view is controlled by the "Text Editor" option "Go To Definition".

    enter image description here

    As the description states, this view is constructed from the type's metadata and the xml documentation file (if it exists in the reference path). You can read about this metadata in the article: Metadata and Self-Describing Components.

    There is no way to enable this view for main code editor. If you were to compile your code to a library and reference it in another solution you would see this visualizer view when you clicked "Go To Definition".