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

Newline after let bang is missing #1313

Closed
3 tasks
nojaf opened this issue Dec 22, 2020 · 0 comments · Fixed by #1315
Closed
3 tasks

Newline after let bang is missing #1313

nojaf opened this issue Dec 22, 2020 · 0 comments · Fixed by #1315

Comments

@nojaf
Copy link
Contributor

nojaf commented Dec 22, 2020

Issue created from fantomas-online

Code

  /// a codefix that generates union cases for an incomplete match expression
  let generateUnionCases =
    ifDiagnosticByMessage
      (fun diagnostic codeActionParams ->
        asyncResult {
          let! (tyRes, line, lines) = getParseResultsForFile fileName pos

          match! generateCases tyRes pos lines line |> Async.map Ok with
          | CoreResponse.Res (insertString: string, insertPosition) ->
              return
                [ { SourceDiagnostic = Some diagnostic
                    File = codeActionParams.TextDocument
                    Title = "Generate union pattern match cases"
                    Edits = [| { Range = range; NewText = replaced } |]
                    Kind = Fix } ]

          | _ -> return []
        }
        |> AsyncResult.foldResult id (fun _ -> []))
      "Incomplete pattern matches on this expression. For example"

Result

/// a codefix that generates union cases for an incomplete match expression
let generateUnionCases =
    ifDiagnosticByMessage
        (fun diagnostic codeActionParams ->
            asyncResult {
                let! (tyRes, line, lines) = getParseResultsForFile fileName pos
                match! generateCases tyRes pos lines line |> Async.map Ok with
                | CoreResponse.Res (insertString: string, insertPosition) ->
                    return
                        [ { SourceDiagnostic = Some diagnostic
                            File = codeActionParams.TextDocument
                            Title = "Generate union pattern match cases"
                            Edits = [| { Range = range; NewText = replaced } |]
                            Kind = Fix } ]

                | _ -> return []
            }
            |> AsyncResult.foldResult id (fun _ -> []))
        "Incomplete pattern matches on this expression. For example"

Problem description

The newline under let bang is missing.

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/22/2020 15:26:56 - aac3975

Default Fantomas configuration

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant