Skip to content

Long pattern with & is not respecting max line length. #1780

Description

@nojaf

Issue created from fantomas-online

Code

           let v,x =
             match n with
             | Voluptatem voluptatem & Praesentium praesentium & Molestiae molestiae & Repudiandae repudiandae & Exercitationem exercitationem & Assumenda assumenda ->
               libero, []
             | _ -> saepe, delectus

Result

let v, x =
    match n with
    | Voluptatem voluptatem & Praesentium praesentium & Molestiae molestiae & Repudiandae repudiandae & Exercitationem exercitationem & Assumenda assumenda ->
        libero, []
    | _ -> saepe, delectus

Problem description

To respect the max line length, we could format it like

           let v,x =
             match n with
             | Voluptatem voluptatem 
               & Praesentium praesentium 
               & Molestiae molestiae 
               & Repudiandae repudiandae 
               & Exercitationem exercitationem 
               & Assumenda assumenda ->
               libero, []
             | _ -> saepe, delectus

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 06/12/2021 10:31:17 - 8f71594

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions