Skip to content
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

>> causes next thing to always go to next line, even if it's small #132

Closed
ovatsus opened this issue Feb 6, 2014 · 2 comments
Closed

>> causes next thing to always go to next line, even if it's small #132

ovatsus opened this issue Feb 6, 2014 · 2 comments

Comments

@ovatsus
Copy link

ovatsus commented Feb 6, 2014

This:

            x
            |> List.map (partition "{" >> snd >> Option.get)
            |> List.map (fun str -> if str.StartsWith "{""
                                    then HttpUtility.HtmlDecode str
                                    else str)
            |> List.map JsonValue.Parse

is turned into this:

            x
            |> List.map (partition "{"
                         >> snd
                         >> Option.get)
            |> List.map (fun str -> 
                   if str.StartsWith "{"" then HttpUtility.HtmlDecode str
                   else str)
            |> List.map JsonValue.Parse

partition "{" >> snd >> Option.get) is smaller than if str.StartsWith "{"" then HttpUtility.HtmlDecode str, so it shouldn't wrap

@dungpa
Copy link
Contributor

dungpa commented Feb 28, 2014

I think it's getting harder and harder to add good heuristics. Could you help implement a few heuristics when you have time?

I start thinking about an on-the-fly code formatter. Perhaps it can provide an alternative when parser-based formatting doesn't work well.

@nojaf
Copy link
Contributor

nojaf commented Sep 20, 2018

This does seem fixed with 2.8 release.
@ovatsus could you give it a try with the --preserveEOL option.

@nojaf nojaf closed this as completed Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants