fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Wrong XmlDoc for union case when previous case contains no bar

Open auduchinok opened this issue 4 years ago • 2 comments

Xml doc has wrong reported range (which may affect tooling) and a comment from previous case without bar is shown in the wrong case:

type U =
    /// Aa
    A
    /// Bb
    | B
Screenshot 2021-04-27 at 16 38 20

With bar it works as expected:

type U =
    /// Aa
    | A
    /// Bb
    | B
Screenshot 2021-04-27 at 16 39 57

auduchinok avatar Apr 27 '21 13:04 auduchinok

Another issue is the comment is not detected for A at all: Screenshot 2021-04-27 at 20 43 24

auduchinok avatar Apr 27 '21 17:04 auduchinok

I was about to report this exact issue, due to this: https://github.com/fsprojects/fantomas/issues/1563

What I was going to report was that the following gets no docstring emitted:

type Foo =
    /// Hi!
    Bar of int

Whereas it does in the following:

type Foo =
    /// Hi!
    | Bar of int

Smaug123 avatar Apr 28 '21 19:04 Smaug123