Adding line breaks to comments for Intellisense
30,092
Solution 1
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.
Solution 2
Try this:
/// <summary>
/// <para> [Non-Breaking Space] </para>
/// </summary>
[Non-Breaking Space]
is obtained using Alt+255 (using the Numpad).
It will show up as an empty new line. I know this is old, but it worked for me today.
Solution 3
/// <summary><br />
/// <para>To treat comment line like a DIV tag, surround them with PARA tags.</para><br />
/// <para>To add a break with whitespace, add the following line:</para><br />
/// <para> </para><br />
/// </summary>
Solution 4
Your only hope is probably something cludgy like this:
/// <summary>
/// <para>line one</para>
/// <para>_</para>
/// <para>line two</para>
/// </summary>
Related videos on Youtube
Author by
flesh
Updated on July 05, 2022Comments
-
flesh about 2 years
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!)
-
SoLaR over 6 yearsA "para" is half answer (it's actually double break), beginning and end of line gets truncated. To enforce break a line at the beginning and the end of summary add following "<para></para>" ( character get omitted - actually non visible and zero space).
-
Mahipal almost 5 yearsAs of Visual Studio 2019, you can add line breaks using
<br/>
in xml documentation. Refer the answer here.
-
-
flesh over 15 yearsnope that doesn't do it either ...
-
flesh over 15 yearshow does MS do it with exceptions in methods for example?
-
flesh over 15 yearscludgy yes, but thats as close as ive got so far
-
bdukes over 15 yearsExceptions are separate tags in the XML. It's not a blank line in the summary, it's just rendering different sections of the documentation
-
drzaus about 12 years
<br />
alone worked for me. Using the<para>
tags created too much padding which pushed the rest of my comments beyond the overflow. -
Louis Kottmann almost 12 years+1: I finally have a place to write //Magic, do not touch.
-
Joel about 11 yearsJust something I want to say: WOW!
-
Krowi about 10 years
<para> </para>
was the thing I was looking for, tnx :) -
Daryl almost 10 yearsThat maybe the most awesome and yet horrible thing to happen simultaneously at so many of the same levels that I have ever seen. For adding empty lines, I'll use Al Erickson's suggestion of
 
but for doing indenting, this is way nicer. -
Phil Lambert almost 10 yearsLadies and gentlemen, we have a winner!
-
Peter Huber over 9 yearsA slightly nicer version: /// <summary> /// <para>Paragraph 1.</para> /// <para>Paragraph 2.</para> /// </summary>
-
Peter Huber over 9 yearsSorry for the ugly formatting, but stupid stackoverflow does not allow to change a comment after 5 minutes and prevents any decent formatting anyway. Proper sample see in next comment.
-
Peter Huber over 9 yearsBasically replace "
<para>XYZ</para>
" by "XYZ<para/>
" -
Robino over 9 yearsOldsk00L! That brings me back.
-
Jack Pettinger almost 9 yearsGet in my son! Fantastic
-
Martin Braun almost 9 yearsAlt + 0173 looks more like magic. It's the invisible character and works, too.
-
Arvo Bowen over 8 yearsHow is there no accepted answer on this question? This should 100% be the accepted answer! Looking back, I guess the question was just asked badly. I'm sure the question was meant to ask how to insert a carriage return.
-
srh about 7 yearshow to use Alt+255 in VS 2015? when i try Alt+255 in VS 2015 nothing happens
-
David over 6 years
<br />
doesn't work in VS 2017. -
Tam Le about 4 years
<br/>
DOES work in VS 2019.