Skip to content

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

Closed

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?

Activity

  1. added a commit that references this issue on Feb 26, 2026
    f29c2b9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions