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

Regression since 6.3.5: Shorthand lambda pushes args far out right with name-sensitive alignment; discrepancy with normal lambda #3097

Closed
1 of 4 tasks
cmeeren opened this issue Jun 27, 2024 · 1 comment · Fixed by #3101

Comments

@cmeeren
Copy link
Contributor

cmeeren commented Jun 27, 2024

Issue created from fantomas-online

Code and expected output

workstations
|> Seq.sumBy
    _.GetWeeklyValueWithoutAccessCheck(
        year,
        week,
        CapacityAggregateValueType.CostPrice,
        category
    )

Result

workstations
|> Seq.sumBy
    _.GetWeeklyValueWithoutAccessCheck(year,
                                       week,
                                       CapacityAggregateValueType.CostPrice,
                                       category)

Problem description

This regression appeared in 6.3.5. (Fantomas 6.3.4 correctly formats it as the code at the top.)

Note that this does not happen with a normal (non-shorthand) lambda. Fantomas correctly formats this:

workstations
|> Seq.sumBy (fun x ->
    x.GetWeeklyValueWithoutAccessCheck(
        year,
        week,
        CapacityAggregateValueType.CostPrice,
        category
    ))

Extra information

  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.
  • I would like a release if this problem is solved.

Options

Fantomas main branch at 1/1/1990

    { config with
                MaxLineLength = 50 }

Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

@dawedawe
Copy link
Member

Hey @cmeeren,
thanks for raising the issue. I'll try to find some time for this soon.

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.

2 participants