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

comment deleted on reformat #1343

Closed
jmagaram opened this issue Dec 30, 2020 · 3 comments · Fixed by #1479
Closed

comment deleted on reformat #1343

jmagaram opened this issue Dec 30, 2020 · 3 comments · Fixed by #1479

Comments

@jmagaram
Copy link

Issue created from fantomas-online

Code

if stateSub.Value |> State.hasChanges then
    // Push changes
    let! pushed = push state

    // Import new etags of pushed items
    do
        pushed
        |> Option.bind Dto.changesAsImport
        |> Option.iter (fun changes -> update (Import changes) |> ignore)

Result

if stateSub.Value |> State.hasChanges then
    // Push changes
    let! pushed = push state

    do
        pushed
        |> Option.bind Dto.changesAsImport
        |> Option.iter (fun changes -> update (Import changes) |> ignore)

Problem description

Notice how the comment above the do statement is removed

Options

Fantomas Master at 12/26/2020 15:00:23 - 76fa31e

Default Fantomas configuration

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

@Evangelink

This comment has been minimized.

@nojaf
Copy link
Contributor

nojaf commented Jan 8, 2021

Hey @jmagaram, thanks for reporting this issue.

Not sure whether I should create a separate issue but I am facing a similar issue:

Yes, @Evangelink please always report a separate issue and do not chime in on another issue that looks related to you.
See Contribution guidelines.

@nojaf
Copy link
Contributor

nojaf commented Jan 9, 2021

I took a look at this yesterday and it not easy to solve in Fantomas straightaway. Having more information in the AST would greatly benefit us in solving this problem. See linked PR to FSharp compiler.

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

Successfully merging a pull request may close this issue.

3 participants