这是indexloc提供的服务,不要输入任何密码
Skip to content

[Formatting issue] Formater seems to prefer splitting on arguments too much #1732

@filiph

Description

@filiph

What input code did you provide to the formatter?

                        GoRouter.of(context)
                            .go('/play/session/${level.number}');

What output did the formatter produce?

                        GoRouter.of(
                          context,
                        ).go('/play/session/${level.number}');

What output did you expect or want the formatter to produce?

Describe how you expected the formatter to format the code, ideally by showing what you had in mind as code.

                        GoRouter.of(context)
                            .go('/play/session/${level.number}');

Anything else we should know?

I personally think the original is better, as it shows a hierarchy.

I can imagine that the new style, where the argument is on its own line, is better for ui-as-code. But when the argument is a simple, relatively short variable, I think line-splitting on that makes the code less readable, not more.

This might be related or even duplicitous with #1731 (though that one is a more obvious failure in my book, so I'm keeping them separate).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions