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

"Better" support for nesting complex expressions in async { } blocks #386

Closed
isaacabraham opened this issue Dec 18, 2018 · 5 comments
Closed

Comments

@isaacabraham
Copy link

let! bindings don't indent the same as non-let! ones:

let x data =
    async { 
        let bar =
            data
            |> Array.map id
            |> Array.filter ((=) 1)
            |> Array.countBy id
            |> async.Return
        return bar
    }

But if you change the let to a let!:

let x data =
    async { 
        let! bar = data
                   |> Array.map id
                   |> Array.filter ((=) 1)
                   |> Array.countBy id
                   |> async.Return
        return bar
    }

This uses up lots of horizontal space and doesn't scale well if the expression is larger.

@nojaf
Copy link
Contributor

nojaf commented Dec 18, 2018

Please mention your configuration. What is the value of PreserveEndOfLine?

@isaacabraham
Copy link
Author

Just using the default settings e.g. create an empty fsx file, put in the code above and use fantomas foo.fsx.

@nojaf
Copy link
Contributor

nojaf commented May 8, 2020

This behaviour has been improved by now.
I did encounter one minor related bug.

@nojaf nojaf closed this as completed May 8, 2020
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