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

Newline added before let binding with attribute in class #786

Closed
ErikSchierboom opened this issue Apr 24, 2020 · 1 comment
Closed

Newline added before let binding with attribute in class #786

ErikSchierboom opened this issue Apr 24, 2020 · 1 comment

Comments

@ErikSchierboom
Copy link
Contributor

Issue created from fantomas-ui

If you define a let binding in a class definition that has an attribute applied to it, an extra newline is introduced:

Code

module Tests

open Xunit

type AppointmentTests() =

    [<Fact>]
    member __.``Test one``() =
        1 |> should equal 1

    [<Fact>]
    let ``Test two``() =
        2 |> should equal 2
    
    let ``Test three``() =
        3 |> should equal 3

    [<Fact>]
    member __.``Test four``() =
        4 |> should equal 4

    [<Fact>]
    let ``Test five``() =
        5 |> should equal 5

Result

module Tests

open Xunit

type AppointmentTests() =

    [<Fact>]
    member __.``Test one``() = 1 |> should equal 1


    [<Fact>]
    let ``Test two``() = 2 |> should equal 2

    let ``Test three``() = 3 |> should equal 3

    [<Fact>]
    member __.``Test four``() = 4 |> should equal 4


    [<Fact>]
    let ``Test five``() = 5 |> should equal 5

Options

Fantomas 3.2.0

Name Value
IndentOnTryWith false
IndentSpaceNum 4
KeepNewlineAfter false
MaxIfThenElseShortWidth 40
PageWidth 120
ReorderOpenDeclaration false
SemicolonAtEndOfLine false
SpaceAfterComma true
SpaceAfterSemicolon true
SpaceAroundDelimiter true
SpaceBeforeArgument true
SpaceBeforeColon false
StrictMode false
@ErikSchierboom ErikSchierboom changed the title [Bug report from fantomas-ui] Newline added before let binding with attribute in class Newline added before let binding with attribute in class Apr 24, 2020
@ErikSchierboom
Copy link
Contributor Author

This is fixed in Fantomas 4 preview. See this example.

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