Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silly auto-formatting for chained method calls / builder pattern #750

Open
VorpalBlade opened this issue Jul 17, 2024 · 1 comment
Open

Comments

@VorpalBlade
Copy link
Contributor

When you have chained method calls / builder pattern the Rune auto-formatter wants to put it all on one line. It would be better if it formatted this like rustfmt split over several:

systemd::Systemd::from_pkg("btrfs-progs", "[email protected]", package_managers.get("pacman").unwrap()).name("[email protected]").enable(cmds)?;

I would prefer something like:

systemd::Systemd::from_pkg("btrfs-progs",
                           "[email protected]",
                           package_managers.get("pacman").unwrap())
    .name("[email protected]")
    .enable(cmds)?;
@VorpalBlade
Copy link
Contributor Author

You can also get this to happen with a long vector passed as an argument to a function. It seems that rune only inserts line breaks between statements, never breaking overly long lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant