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

Pipe is indented too far #1327

Closed
1 of 3 tasks
nojaf opened this issue Dec 23, 2020 · 1 comment · Fixed by #1328
Closed
1 of 3 tasks

Pipe is indented too far #1327

nojaf opened this issue Dec 23, 2020 · 1 comment · Fixed by #1328

Comments

@nojaf
Copy link
Contributor

nojaf commented Dec 23, 2020

Issue created from fantomas-online

Code

module X =
  let getValSignature displayContext (v: FSharpMemberOrFunctionOrValue) =
    let name =
      if v.DisplayName.StartsWith "( " then
        v.LogicalName
      else
        v.DisplayName
      |> PrettyNaming.QuoteIdentifierIfNeeded
    
    ()

Result

module X =
  let getValSignature displayContext (v: FSharpMemberOrFunctionOrValue) =
    let name =
      if v.DisplayName.StartsWith "( " then
        v.LogicalName
      else
        v.DisplayName
        |> PrettyNaming.QuoteIdentifierIfNeeded

    ()

Problem description

Not sure why but the |> PrettyNaming.QuoteIdentifierIfNeeded is part of the else branch after formatting.

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/23/2020 11:44:01 - 01a3162

    { config with
                IndentSize = 2 }

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

@nojaf
Copy link
Contributor Author

nojaf commented Dec 23, 2020

The problem occurs earlier:

module X =
  let getValSignature displayContext (v: FSharpMemberOrFunctionOrValue) =
    let name =
      if v.DisplayName.StartsWith "( " 
      then v.LogicalName
      else v.DisplayName
      |> PrettyNaming.QuoteIdentifierIfNeeded
    
    ()

formatted to the source above is different AST again.

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.

1 participant