Show <returns> xml tag into visual studio intellisense
Asked Answered
G

3

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?

Gemmulation answered 17/3, 2010 at 16:39 Comment(6)
Related: #7819194Revolt
Actually his question is related to mine. But it has an answerGemmulation
Vote for it here. If there's enough demand, we might get it.Bilabiate
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.Phytoplankton
It is used in MSDN like automated documentation, which is based on your XML comments. Something like this: msdn.microsoft.com/en-us/library/e78f86at(v=vs.110).aspxBoehm
Possible duplicate of Intellisense tip and XML returns comment (VS2008)Inositol
S
6

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

From the release notes: "Returns" tag contents

Streamliner answered 8/9, 2020 at 18:50 Comment(1)
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.Lelia
L
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).

Lennyleno answered 30/1, 2019 at 11:9 Comment(0)
R
-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

Ridotto answered 17/5, 2017 at 9:44 Comment(1)
This answer is incorrect. As of Visual Studio 2017, IntelliSense will never display the <return> tag.Commutation

© 2022 - 2024 — McMap. All rights reserved.