Closed LukasKalbertodt closed 6 years ago
Thanks for raising the issue.
Should be fairly easy to support by passing the current directory to rustfmt
as --config-path
and letting it find the config by itself. Unfortunately, the feature only works in rustfmt-nightly
, which fails to run on my system. Fairly safe to assume that many others use the regular rustfmt
. Should probably wait until it stabilizes.
Oh, I see. I do use the nighlty version via "executable": ["rustup", "run", "nightly", "rustfmt"]
. Maybe we could add a flag unstableFeatures
in the settings to enable things like this? I don't expect rustfmt to stabilize anytime soon tbh :/
Apart from that: I'm fairly sure even the old (stable) rustfmt
was configurable via rustfmt.toml
and that it would also traverse all parents directories until a configuration file is found. Maybe this plugin could start rustfmt
in the directory of the file being formatted(*)? Shouldn't that work?
(*) Or maybe: path of sublime project if a project is opened, otherwise path of file being formatted.
There's actually a fresh pull request for that. Until it's merged, you could pull from csmulhern/sublime-rust-fmt and see if it works for you, or suggest changes if not.
Released 0.1.5
with support for config files. Let me know if it works for you.
Works for me :)
Thank you and @csmulhern for solving my issues with this plugin so quickly!
When formatting buffers corresponding to a file on disk, it would be nice to get the same behavior as when executing
rustfmt
from the command line: it searches for arustfmt.toml
starting at the directory of the file and going up from there. As far as I can see, this plugin does not search for arustfmt.toml
at the moment..