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

Space after chain lambda function is not allowed #1440

Closed
TobyShaw opened this issue Feb 10, 2021 · 0 comments · Fixed by #1443
Closed

Space after chain lambda function is not allowed #1440

TobyShaw opened this issue Feb 10, 2021 · 0 comments · Fixed by #1443

Comments

@TobyShaw
Copy link

Issue created from fantomas-online

Code

let blah =
    Mock().Returns(fun _ ->
                {
                    dasdasdsadsadsadsa = ""
                    Sdadsadasdasdas =  "sdsadsadasdsa"
                })

Error

Fantomas was able to format the code but the result appears to be invalid F# code.
Please open an issue.

Formatted result:

let blah =
    Mock ()
        .Returns(fun _ ->
            {
                dasdasdsadsadsadsa = ""
                Sdadsadasdasdas = "sdsadsadasdsa"
            })

Problem description

Fantomas generated invalid F# code.

Options

Fantomas Master at 02/09/2021 19:52:07 - bd72240

    { config with
                MaxLineLength = 100
                SpaceBeforeUppercaseInvocation = true
                SpaceBeforeClassConstructor = true
                SpaceBeforeMember = true
                SpaceBeforeColon = true
                SpaceBeforeSemicolon = true
                IndentOnTryWith = true
                MultilineBlockBracketsOnSameColumn = true
                NewlineBetweenTypeDefinitionAndMembers = true
                AlignFunctionSignatureToIndentation = true
                AlternativeLongMemberDefinitions = true
                MultiLineLambdaClosingNewline = true
                DisableElmishSyntax = true }

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

@nojaf nojaf changed the title Invalid code generation on HEAD Space after chain lambda function is not allowed Feb 10, 2021
nojaf added a commit that referenced this issue Feb 12, 2021
* Update gitpod.yml

* Add init task for gitpod

* Don't add space between first function call in chain. Fixes #1440.

* Add release notes for 4.4.0-beta-006.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants