-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Excessive line breaking #43
Comments
It's intentional. Any expression containing The last two examples consist of one-liner expressions. |
I would only drop a |> down to the next line if the line was too long, or maybe if there was more than two pipes. Does a reverse pipe get formatted the same? |
@7sharp9 Reverse pipe is treated as one-liner. Since |
It does look like the line breaking is a bit excessive for some quite common uses of |>. For example:
becomes
and
becomes
|
These line breakings are indeed excessive. It would be nice to add a few common patterns to print |
Hello, i have more general issue but with same Title. Hi, Thank you in advance! |
The situation has improved in #434, please create a new issue with additional suggestions if necessary. |
Hello. I also feel that Fantomas adds too many line breaks by default. Thankfully, I'm able to control this with the Max... settings. However, I can't find a way to control the following examples: Code: open System open System.IO Result: open System
open System.IO Code: type JpgDir = string type TifDir = string Result: type JpgDir = string
type TifDir = string Code: module A = Array;; module L = List;; Result: module A = Array
module L = List Code: let trace x = printfn "%A" x; x Result: let trace x =
printfn "%A" x
x Code: let tryParseInt s = try Some (int s) with | :? FormatException -> None Result: let tryParseInt s =
try
Some(int s)
with :? FormatException ->
None Code: let boolToInt x = match x with | true -> 1 | false -> 0
let boolToInt' = function | true -> 1 | false -> 0 Result: let boolToInt x =
match x with
| true -> 1
| false -> 0
let boolToInt' =
function
| true -> 1
| false -> 0 Of these examples--most of which I realize are not idiomatic F#!--the last one with the pattern match is my highest priority. If you'd like, I'll be happy to open a new issue just for the pattern match example. Thank you. |
I have line breaks set at 120, and I had this line:
which ended at line 79, but it was still broke down like this:
I actually don't mind in this case, but just posted the issue to make sure this was intentional and not a bug, as it doesn't seem consistent because fantomas does the opposite for functions. I had this:
and it was converted to this:
The text was updated successfully, but these errors were encountered: