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

Trivia regressions around SynConst #1518

Closed
3 tasks
nojaf opened this issue Mar 13, 2021 · 0 comments · Fixed by #1519
Closed
3 tasks

Trivia regressions around SynConst #1518

nojaf opened this issue Mar 13, 2021 · 0 comments · Fixed by #1519
Assignees

Comments

@nojaf
Copy link
Contributor

nojaf commented Mar 13, 2021

Issue created from fantomas-online

Code

    match ast with
    | ParsedInput.SigFile _input ->
        // There is not much to explore in signature files
        true
    | ParsedInput.ImplFile input -> validateImplFileInput input

    match t with
    | TTuple _ -> not node.IsEmpty
    | TFun _ -> true // Fun is grouped by brackets inside 'genType astContext true t'
    | _ -> false

    let condition e =
        match e with
        | ElIf _
        | SynExpr.Lambda _ -> true
        | _ -> false // "if .. then .. else" have precedence over ","



    let source = """printfn foo

printfn bar""" // difference is the 4 spaces on line 188

    let x = 9

Result

match ast with
| ParsedInput.SigFile _input -> true
| ParsedInput.ImplFile input -> validateImplFileInput input

match t with
| TTuple _ -> not node.IsEmpty
| TFun _ -> true
| _ -> false

let condition e =
    match e with
    | ElIf _
    | SynExpr.Lambda _ -> true
    | _ -> false



let source = """printfn foo

printfn bar"""
// difference is the 4 spaces on line 188

let x = 9

Problem description

A couple of scenarios I didn't take into account when refactoring ASTTransformer.

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 03/13/2021 09:04:00 - 75f0dfc

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant