Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept <inheritdoc /> #73

Open
boop5 opened this issue May 24, 2018 · 7 comments
Open

Accept <inheritdoc /> #73

boop5 opened this issue May 24, 2018 · 7 comments
Assignees

Comments

@boop5
Copy link

boop5 commented May 24, 2018

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();
    }
}
@Tsanas
Copy link

Tsanas commented Jun 10, 2018

Pretty essential...

@jamesmcguirepro
Copy link

I agree, this is a pretty big gap 😞

@jamesmcguirepro
Copy link

Looks the same as #26, #32, and #65

@ManticSic
Copy link
Collaborator

I'll look at it as soon as possible

@ManticSic
Copy link
Collaborator

What do you expect, how should Exceptional behave?

Simple solution
Ignoring any methods using /// <inheritdoc />

More complex solution
Checking the parents documentation if the exception is already documented.

  • If not: highlight the expression and provide catch quickfix
  • If not: highlight the expression (and provide documentation quickfix (could be hard to be implement, because the parent type can be outside the project))

Checking the parents documentation if all documented exceptions are thrown.

  • If not: highlight the method

@jamesmcguirepro
Copy link

I think Exceptional should checking the parent's documentation.

If the parent type is outside the project, I wouldn't expect to be able to do a quickfix on the parent type. However, it'd be nice to maintain the ability to quickfix the implementation's documentation.

@JeremyMorton
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants