omnisharp-roslyn
omnisharp-roslyn copied to clipboard
Inherited documentation (inheritdoc) is not used during signature help
When using inheritdoc as per #1806, documentation is now correctly inherited, but the inherited documentation is not used in places such as signature help, only in tooltips.
Example code that reproduces this for me:
public interface IA
{
/// <summary>
/// This is foo in the interface!
/// </summary>
/// <param name="param">This is my param.</param>
void foo(int param);
}
public class A : IA
{
/// <inheritdoc/>
public void foo(int param)
{
// Hovering on "foo" will show "This is foo in the interface!", but getting signature help in between
// the parantheses will not show any documentation for "foo" nor for "param".
this.foo();
}
}

If you make it explicit, it works as intended in both tooltips and signature help:
public interface IA
{
/// <summary>
/// This is foo in the interface!
/// </summary>
/// <param name="param">This is my param.</param>
void foo(int param);
}
public class A : IA
{
/// <summary>
/// This is foo in the class!
/// </summary>
/// <param name="param">This is my param in the class.</param>
public void foo(int param)
{
this.foo();
}
}

Omitting inheritdoc entirely has the same problem as making it explicit.
Another case that doesn't work is for extension methods.
You want to wrap some BCL function in an extension method, and reuse that function's docs:
/// <inheritdoc cref="Array.IndexOf{T}(T[], T)"/>
public static int IndexOf<T>(this T[] array, T value)
{
return Array.IndexOf(array, value);
}
Would also love to be able to see docs from inheritdoc inside of a param (see example constructor docs below), but it doesn't work in VSCode.
public class MyObject {
/// <summary>Represents a value.</summary>
public int MyValue { get; }
/// <summary>
/// Create an object with a value.
/// </summary>
/// <param name="myValue"><inheritdoc cref="MyValue" /></param>
public MyObject(int myValue) => MyValue = myValue;
}
