30

I added the <returns> xml tag to some of my methods but I can't see its content in IntelliSense.

Here is my code:

/// <summary>
/// we all live in a yellow summary
/// </summary>
/// <returns>what it returns</returns>
public int MyMethod()
{ .... }

Is there any way to show this content?

Hermann.Gruber
  • 903
  • 7
  • 27
remi bourgarel
  • 8,339
  • 3
  • 34
  • 67
  • 1
    Related: http://stackoverflow.com/questions/7818694/how-to-display-return-value-summary-in-msvs-intellisense – Otiel Jan 25 '13 at 08:53
  • Actually his question is related to mine. But it has an answer – remi bourgarel Jan 25 '13 at 09:37
  • 8
    Vote for it [here](http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2317525-show-returns-and-value-contents-of-xml-documen). If there's enough demand, we might get it. – Sam Sep 05 '13 at 08:40
  • 1
    I've always wondered what the point of the return tag was. I mean, I make a point of filling in some basic detail, but I've never seen the point. – Jamie Taylor Sep 23 '13 at 09:48
  • It is used in MSDN like automated documentation, which is based on your XML comments. Something like this: https://msdn.microsoft.com/en-us/library/e78f86at(v=vs.110).aspx – user5328504 Apr 12 '17 at 12:30
  • Possible duplicate of [Intellisense tip and XML returns comment (VS2008)](http://stackoverflow.com/questions/1006042/intellisense-tip-and-xml-returns-comment-vs2008) – HaveSpacesuit May 10 '17 at 19:50

3 Answers3

4

This has been finally implemented in Visual Studio 2019 v.16.6.0, only a decade later :)

From the release notes: "Returns" tag contents

A. Milto
  • 1,826
  • 1
  • 8
  • 16
  • Unfortunately it will only show up, if you hover over the method name. It is not shown when browsing through the overloads or while typing parameters. – Rev Dec 04 '20 at 11:30
3

This currently does not work (Visual Studio 2017), and is an open issue:

https://github.com/dotnet/roslyn/issues/31618

One way to make it work is to install the ReSharper Visual Studio plugin (but this is paid-for).

Hermann.Gruber
  • 903
  • 7
  • 27
-2

Sometimes it takes time for the IntelliSense to comprehend your code. To verify that the tag is there, try using the /doc compiler option like this:

csc YourClass.cs /doc:YourClass.xml

If the tag is present, then it's just a matter of IntelliSense issue which is usually fixed by its own or by restarting VS

graumanoz
  • 1,270
  • 11
  • 20