Skip to content

Convert between => and { return ...; } based on line length (WONTFIX) #452

Closed
@Hixie

Description

@Hixie

It would be interesting if the formatter could automatically add or remove braces based on the line length.

For example, turning this:

   bool get hasSize {
     return true;
   }
   int crazyLongFunction(int withMany, int manyMany, int arguments) => withMany + manyMany + arguments +
      withMany * 2 + manyMany * 5 + arguments;

...into this:

   bool get hasSize => true;
   int crazyLongFunction(int withMany, int manyMany, int arguments) {
     return withMany + manyMany + arguments + withMany * 2 + manyMany * 5 + arguments;
   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions