Skip to content

Formatter: Consider improving record formatting on inline variants #2373

@spotandjake

Description

@spotandjake

I ran into the case below on a record variant, the formatter considers the record small enough to be on one line but the document comment prevents it from being a single line so the formatter folds the rest of the children, I think in this case it would be a lot better for us to just break the record onto seperate lines completely. Or break the remaining keys onto a line and break the closing bracket onto a line.

Current formatting example:

enum rec Node<kType, rType> {
  Internal{
    /** */
    keys: Array<kType>, children: Array<Node<kType, rType>>, },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    grainfmtIssues related to the Grain formatter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions