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

Class parameters expands unit for long lines #1494

Closed
3 tasks
dbrattli opened this issue Feb 27, 2021 · 2 comments · Fixed by #1496
Closed
3 tasks

Class parameters expands unit for long lines #1494

dbrattli opened this issue Feb 27, 2021 · 2 comments · Fixed by #1496

Comments

@dbrattli
Copy link

Issue created from fantomas-online

Code

type ISingleExpressionValue<'p, 'o, 'v when 'p :> IProperty and 'o :> IOperator and 'p: equality and 'o: equality and 'v: equality> () =
    abstract Property: 'p
    abstract Operator: 'o
    abstract Value: 'v

Result

type ISingleExpressionValue<'p, 'o, 'v when 'p :> IProperty and 'o :> IOperator and 'p: equality and 'o: equality and 'v: equality>
    (

    ) =
    abstract Property : 'p
    abstract Operator : 'o
    abstract Value : 'v

Problem description

Looks like class parameters are expanded into multiple lines where e.g unit will be written as:

(

) =

instead of

() =

Note that this seems to happen only for longer lines. Shorter lines will write () =.

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 02/26/2021 15:24:05 - 83ff34e

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?

@nojaf
Copy link
Contributor

nojaf commented Feb 27, 2021

Thanks for the report, this is a bit silly indeed.

@nojaf
Copy link
Contributor

nojaf commented Feb 27, 2021

@dbrattli I also noticed that the generic part and the constraints lead to not respecting the max_line_length.
If this bothers you, I would ask you to open an issue with the F# style guide and ask for clarification on how to deal with this.

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.

2 participants