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

Enum comments removed #572

Closed
theimowski opened this issue Nov 27, 2019 · 0 comments
Closed

Enum comments removed #572

theimowski opened this issue Nov 27, 2019 · 0 comments

Comments

@theimowski
Copy link
Member

theimowski commented Nov 27, 2019

Description

Triple slash comments for an Enum get removed for all but first case.

Repro code

https://jindraivanek.gitlab.io/fantomas-ui/#?code=C4TwDgpgBAglC8AoKKoHoNQMIHsC2eEAdsFAGY4BO2AhgM4RwC0UYlEDlAbhACbKoAPrQZx4UAAwCUGNNnyES5KiIgAhKC3Z4cPfqijCs9dQigBGaeky4CxUhWrGGWTVBoAbOjijbdfKyMTV3EAJiA

Given following sample.fs:

type A =
    /// Comment for CaseA - preserved
    | CaseA = 0
    /// Comment for CaseB - removed
    | CaseB = 1
    /// Comment for CaseC - also removed
    | CaseC = 2

Run fantomas sample.fs, result is:

type A =
    /// Comment for CaseA - preserved
    | CaseA = 0
    | CaseB = 1
    | CaseC = 2

Same applies to double slash comments:

type A =
    // Comment for CaseA - preserved
    | CaseA = 0
    // Comment for CaseB - removed
    | CaseB = 1
    // Comment for CaseC - also removed
    | CaseC = 2

But if you make it an union, it works ok:

type A =
    /// Comment for CaseA - preserved
    | CaseA
    /// Comment for CaseB - all preserved now
    | CaseB
    /// Comment for CaseC - all preserved now
    | CaseC
theimowski added a commit to theimowski/fantomas that referenced this issue Nov 28, 2019
@nojaf nojaf closed this as completed in 9f349df Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant