I am working with C# and Visual Studio (2015, made no check on other versions).
I have a problem with an overridden method for the code documentation. Please see following example
public class BaseClass
{
public BaseClass()
{ }
/// <summary>
/// BaseClass.MethodName comment
/// </summary>
public virtual void MethodName()
{ }
}
public class InheritedClass : BaseClass
{
public InheritedClass(): base()
{ }
public override void MethodName()
{ }
}
public class Test
{
public static void m()
{
BaseClass b = new BaseClass();
b.MethodName();
InheritedClass i = new InheritedClass();
i.MethodName();
BaseClass iasb = i;
iasb.MethodName();
}
}
If I move the cursor over the 3 different calls to MethodName() I get:
It seems that code comments lookup on overridden methods doesn't scan also base classes, neither when the overridden method has no "overridden" comment. Instead I would like, if possible, that if the inherited class does not have any local comment the base class' comment is displayed. In addition it would also be nice that if the inherited class has a local comment, developer had the option to tell whether the local comment has to override completely the base class' comment, or if the local comment has to be combiled in some way with base class' one.
Any suggestion?