views:

870

answers:

6

Does anyone know how to insert a line break into a summary comment in order for the line break to be reflected in Intellisense documentation?

To clarify, assume code documentation..

/// <summary>
/// Some text documentation
///  - a line break - 
/// Some more documentation
/// </summary>
public void SomeMethod() { }

So when using this method Intellisense offers a summary for the method formatted like this:

Some text documentation

Some more documentation

(Note - the 'para' tag doesn't create empty line breaks - I've tried it!)

+4  A: 

Try using this.

/// <summary>
/// <para>Paragraph 1.</para>
/// <para>Paragraph 2.</para>
/// </summary>

But I don't think you can have an actual empty line. Empty para tag gets ignored.

Brian Kim
I thought you just wanted a line break. I don't think you can have an actual empty line.
Brian Kim
how does MS do it with exceptions in methods for example?
flesh
Exceptions are separate tags in the XML. It's not a blank line in the summary, it's just rendering different sections of the documentation
bdukes
A: 

Based on the comment, how about a with a single, non-printing character in it, like a hard space?

Jekke
Visual Studio's XML parser seems to eat all space characters, even if they are in a CDATA section.
Hosam Aly
+1  A: 

Well, it is Xml. Maybe &#10;&#13;

Joel Coehoorn
nope that doesn't do it either ...
flesh
+2  A: 

Your only hope is probably something cludgy like this:

/// <summary>
/// <para>line one</para>
/// <para>_</para>
/// <para>line two</para>
/// </summary>
Andrew Hare
cludgy yes, but thats as close as ive got so far
flesh
+2  A: 

/// <summary>
/// <para>To treat comment line like a DIV tag, surround with PARA tags.</para>
/// <para>To add a break with whitespace, add the following:</para>
/// <para>&#160;</para>
/// </summary>

Al Erickson
A: 

Does anyone know how to make it work in VB ?

(such a barbaric language, but I'm forced to work with it...)

Yovav
@Yovav: Just type `'''` .
Billy ONeal