You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Idempotency problem when a comment follows a multiline infix expression in a let binding #3488
When a let binding's body is an infix expression with the operator at the end of the line, followed by a comment, the first format moves the operator to the start of the next line and the second format joins the expression onto one line.
Happens with +, |> and ^^, with a line or a block comment, and with a blank line before the comment. Without the comment, or with the expression already on one line or with the operator already leading, it is stable. Outside a let binding (a top-level expression) it is stable too.
A regression: 6.3.16 and 7.0.3 give let x = c + d followed by the comment, stable. 8.0.2 and main alternate as above. Found in src/Compiler/Service/ServiceDeclarationLists.fs of dotnet/fsharp.
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 2026-09-22T13:02:48Z - 588898c
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.
Activity
Attach an indented comment to the outermost node at its column
Bump the packages group with 10 updates (#280)