-
-
Notifications
You must be signed in to change notification settings - Fork 204
Description
While applying Fantomas to our code base, I fell upon this issue where the type annotation will be filled with spaces to match up with the previous expressions length. In the example, if you remove one call of anotherOne, the formatting will adjust the length of the spacing that will be added in consequence.
Seems like we might be setting the position of the closing > in accordance to the wrong expression
There is an easy workaround. This will not materialize itself if the faulty expression is directly on the next line from the first expression, ie. :
module SomeModule =
let someFunctionCall() = "hello"
let anotherOne s = s
let alsoAnotherOne s = s |> ignore
type SomeType with
member this.Reraise() =
(someFunctionCall()) |> anotherOne |> anotherOne |> alsoAnotherOne
Unchecked.defaultof<_>Issue created from fantomas-online
Code
module SomeModule =
let someFunctionCall() = "hello"
let anotherOne s = s
let alsoAnotherOne s = s |> ignore
type SomeType with
member this.Reraise() =
(someFunctionCall()) |> anotherOne |> anotherOne |> alsoAnotherOne
Unchecked.defaultof<_>Result
module SomeModule =
let someFunctionCall () = "hello"
let anotherOne s = s
let alsoAnotherOne s = s |> ignore
type SomeType with
member this.Reraise() =
(someFunctionCall ()) |> anotherOne |> anotherOne |> alsoAnotherOne
Unchecked.defaultof<_ >
Problem description
Please describe here the Fantomas problem you encountered.
Check out our Contribution Guidelines.
Extra information
- The formatted result breaks my code.
- The formatted result gives compiler warnings.
- I or my company would be willing to help fix this.
- I would like a release if this problem is solved.
Options
Fantomas main branch at 2025-08-06T12:58:25Z - cbee488
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.