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

Multiline string inside lambda expression fails to format #1299

Closed
1 of 3 tasks
shivinsky opened this issue Dec 17, 2020 · 2 comments
Closed
1 of 3 tasks

Multiline string inside lambda expression fails to format #1299

shivinsky opened this issue Dec 17, 2020 · 2 comments

Comments

@shivinsky
Copy link

Issue created from fantomas-online

Code

let _ =
    [] |> List.map (fun _ -> @"a
b"     )
       |> List.length

Error

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

Formatted result:

let _ =
    []
    |> List.map
        (fun _ ->
            @"a
b")
    |> List.length

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 12/17/2020 16:49:57 - a212bf0

Default Fantomas configuration

@nojaf
Copy link
Contributor

nojaf commented Jun 5, 2021

Hello, thanks for this report. I still don't really know how to solve this but I wanted to let you know that the problem does not seems to occur when fsharp_multi_line_lambda_closing_newline=true.
Sample.

@nojaf
Copy link
Contributor

nojaf commented Jan 2, 2023

Fix available in v5.2.0-beta-001

@nojaf nojaf closed this as completed Jan 2, 2023
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

2 participants