CSharpAnalyzers/ExceptionalReSharper

Exceptional does not understand the property exception xml doc that it generates

Closed this issue · 5 comments

When I use exceptional to generate the xml comments for a potential ArgumentOutOfRangeException in both the getter and setter, it generated the following:

 /// <exception cref="ArgumentOutOfRangeException" accessor="get">Index is out of range.</exception>
 /// <exception cref="ArgumentOutOfRangeException" accessor="set">Index is out of range.</exception>

The problem is that Exceptional fails to see the exceptions as documented because of the accessor attribute in both, that it generated. It keeps warning that the exception is neither documented or caught. On top of this, it also begins warning that the exceptions it generated documentation for are not thrown.

Both times I've encountered this issue has been when working with an indexer property. I do not know if this issue is exclusive to indexers.

@wiredwiz do you have a sample of the code in use?

When the below kind of code is used seems to work fine:

/// <exception cref="SecurityException" accessor="set">Foo</exception>
public string this[string a]
{
    set
    {
        throw new SecurityException("Foo");
    }
}

Ok, I'm not entirely sure what is going on now. I just checked the issue in the same instance of studio that has been sitting open since yesterday and now it seems to have corrected itself. Also, when I try to remove and recreate the comments now it behaves as it should. I guess there must have been some delay or confusion in the updating of the warnings or something. In any case I will close this issue till I can reliably reproduce this behavior again.

Yes, I also noticed that there are some glitches with that...

I will try to devote some time to reading over the source of this project so as to contribute back to it. I'm not familiar with creating ReSharper extensions at all but I'd like to help with some of this if I can find the free time.