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

Extra newlines repeatedly being added inside an object expression #601

Closed
aca02djr opened this issue Dec 16, 2019 · 0 comments · Fixed by #602
Closed

Extra newlines repeatedly being added inside an object expression #601

aca02djr opened this issue Dec 16, 2019 · 0 comments · Fixed by #602

Comments

@aca02djr
Copy link

Description

Having an issue where additional newlines are being added on every format in certain circumstances when using object expressions.

Repro code

online fantomas tool link - if you run a format and then paste the output back into the input then you will see additional newlines added repeatedly, e.g.:

file

Example code:

namespace Blah

open System

module Test =
    type ISomething =
        inherit IDisposable
        abstract DoTheThing: string -> unit

    let test (something: IDisposable) (somethingElse: IDisposable) =
        { new ISomething with
            member __.DoTheThing whatever =
              printfn "%s" whatever
              printfn "%s" whatever
            member __.Dispose() =
                something.Dispose()
                somethingElse.Dispose() }

Seems very similar to #535 which has been closed but doesn't seem to fix the above example.

Thanks!

nojaf added a commit that referenced this issue Dec 19, 2019
* Adding regression test for duplicate newlines in object expression.

* Fixing test for duplicate newlines in object expression. Fixes #601
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

Successfully merging a pull request may close this issue.

1 participant