Skip to content

Stroustrup: Type alias for anonymous record type #2179

@nojaf

Description

@nojaf

Issue created from fantomas-online

Code

type Props =
  {| SessionId: string
     Dispatch: Msg -> unit
     OnTextareaFocus: unit -> unit |}

type Props =
  { SessionId: string
    Dispatch: Msg -> unit
    OnTextareaFocus: unit -> unit }

Result

type Props =
    {| SessionId: string
       Dispatch: Msg -> unit
       OnTextareaFocus: unit -> unit |}

type Props = {
    SessionId: string
    Dispatch: Msg -> unit
    OnTextareaFocus: unit -> unit
}

Problem description

I propose to include this case as part of the scope of #1408
Expected result:

type Props = {| 
    SessionId: string
    Dispatch: Msg -> unit
    OnTextareaFocus: unit -> unit 
|}

To solve this, fsharp_multiline_block_brackets_on_same_column would need to respected first.

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 branch at 2022-04-01T14:31:49Z - b6828ff

    { config with
                MultilineBlockBracketsOnSameColumn = true
                Ragnarok = true }

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions