question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accept <inheritdoc />

See original GitHub issue

Issue: R# throws a warning at me, saying that an exception is not documented. Although it’s already documented in the corresponding interface. This already should be enough - IMHO.

Although - if I use the <inheritdoc /> tag it definitely should not throw a warning around. Right?

4rurb

Here my simplified code broken down to the important parts.

/// <inheritdoc />
[Serializable]
public sealed class CantMoveForwardException
{
    public CantMoveForwardException(){}
    public CantMoveForwardException(string message) : base(message){}
    public CantMoveForwardException(string message, Exception innerException) : base(message, innerException){}
}

public interface IMyService
{
    /// <summary> ... </summary>
    /// <exception cref="CantMoveForwardException"> ... </exception>
    void MoveForward();
}

public class MyService : IMyService
{
    /// <inheritdoc />
    public void MoveForward()
    {
        if (!CanMoveForward)
        {
            throw new CantMoveForwardException("Can not move forward.");
        }

        _beforeCurrent.Push(Current);
        Current = _afterCurrent.Pop();
    }
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:15
  • Comments:7

github_iconTop GitHub Comments

4reactions
ManticSiccommented, Feb 6, 2020

I’ll look at it as soon as possible

1reaction
JeremyMortoncommented, Feb 11, 2020

A quickfix could be provided for the parent documentation (if it’s a source file that is modifiable, as opposed to just in an external assembly that isn’t built from the solution), as well as another quickfix that adds the documentation to this implementation, since you can provide more documentation tags after /// <inheritdoc /> which will add or override documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the <inheritdoc /> Tag
The use of the <inheritdoc /> custom XML comments tag can help minimize the effort required to document complex APIs by allowing common...
Read more >
Any benefit to using <inheritdoc/>?
The <inheritdoc> tag is still very needed. I use it often. It allows you to inherit comments or comment parts also from not...
Read more >
Add a way to inherit documentation <inheritdoc /> #313
The compiler MUST allow the use of an inheritdoc element as a top-level element in XML documentation comments; The compiler MUST allow the...
Read more >
Allow {@inheritdoc} and additional documentation
Inherits a bit of description docs, depending on context. So for instance you can do "@return string {@inheritdoc}" to inherit the description ...
Read more >
Inherit Documentation in C# - GeeksforGeeks
The C# programming language documentation tag <inheritdoc/> states that a documentation comment must inherit documentation from a base class ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found