Closed dbeckwith closed 6 years ago
Hello there! Apologies for the long delay.
Just pushed an update with CWD detection. Should work out of the box. Let me know if this solves your problem.
Thanks for the update! This is partially working for me. I think it's now using the rustfmt
from my rust-toolchain
version, but because the version is old enough, it requires legacy_write_mode_option: true
. Is there some way to set this option automatically based on the rustfmt
version? Like have it on only when the rustfmt
version is less than the version where they changed that write mode option? That might be nice to have in general anyway if it really is just dependent on the version, why make the user decide if they need to set that or not?
I think the commit that changed that option was released in 0.8.0.
I use project-specific toolchains for all of my projects using the
rust-toolchain
file. It would be great if I could get this plugin to use the toolchain specified in that file. Right now in my terminal when I'm in the project directory,cargo fmt
will use that toolchain because it sees the file in the project root. But when I set this plugin's configexecutable
to["cargo", "fmt"]
, it uses my default toolchain instead. I think this could be fixed by running theexecutable
with CWD set to the project root, socargo
can pick up any project-specific overrides as specified here.The reason I want this is so that the version of
rustfmt
can be pinned by therust-toolchain
file. Right now when I update mynightly
toolchain, therustfmt
version updates as well (I use"executable": ["rustup", "run", "nightly", "rustfmt"]
) and myrustfmt.toml
file in my projects can get out of date and break. If I could get this plugin to use the project toolchain version, therustfmt
version would be pinned as well and myrustfmt
config would be more stable.