fsprojects / fantomas

FSharp source code formatter
https://fsprojects.github.io/fantomas
Other
770 stars 194 forks source link

fsharp_space_before_colon not honored for return type info of explicit get , set #2825

Closed dawedawe closed 1 year ago

dawedawe commented 1 year ago

Issue created from fantomas-online

Code

type SomeType() =

    let mutable v: string = ""

    member val SomeAutoProp: float = 23.42 with get, set

    member this.MyProperty
        with get (): string = v
        and set (value: string): unit = v <- value

Result

type SomeType() =

    let mutable v : string = ""

    member val SomeAutoProp : float = 23.42 with get, set

    member this.MyProperty
        with get (): string = v
        and set (value : string): unit = v <- value

Problem description

Expected code:

type SomeType() =

    let mutable v : string = ""

    member val SomeAutoProp : float = 23.42 with get, set

    member this.MyProperty
        with get () : string = v
        and set (value : string) : unit = v <- value

Extra information

Options

Fantomas main branch at 2023-04-03T14:40:17Z - 9298c26c6ba8ab92e7e88cf602654350a36d6572

    { config with
                SpaceBeforeColon = true }