fsprojects / fantomas

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

Comment no longer attached to autoproperty #2948

Closed nojaf closed 11 months ago

nojaf commented 11 months ago

Issue created from fantomas-online

Code

module A

type X() =
    member val Y: int = 7 
            // some comment
            with get,set

Result

module A

type X() =
    member val Y: int = 7 with get, set
// some comment

Problem description

The range of the AutoProperty doesn't include the with get,set, resulting in the comment jumping around. Related to https://github.com/dotnet/fsharp/pull/15835

Extra information

Options

Fantomas main branch at 2023-08-21T13:40:39Z - a0abc9785fd06761da59110feb77f11261863e47

Default Fantomas configuration

Did you know that you can ignore files when formatting by using a .fantomasignore file? PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

nojaf commented 11 months ago

Fixed in https://github.com/fsprojects/fantomas/pull/2920