atom-ide-rust
atom-ide-rust copied to clipboard
Support custom command / toolchain for rustfmt
I'd like to be able to use nightly Rust for rustfmt but keep using stable Rust for everything else. Stable rust is set as the default toolchain in rustup and I always call cargo +nightly fmt
for code formatting. However, I couldn't find any option in atom-ide-rust to replicate this behaviour. Instead, everytime I save a file this package adds a whole bunch of trailing commas, likely because the option to remove those is unstable and ignored by stable rustfmt.
Version 1.1.0 should support this by configuring rust-analyzer with rust-analyzer.json
From https://rust-analyzer.github.io/manual.html#configuration :
rust-analyzer.rustfmt.extraArgs (default: [])
- Additional arguments to rustfmt.
rust-analyzer.rustfmt.overrideCommand (default: null)
- Advanced option, fully override the command rust-analyzer uses for formatting.
We can probably add a note to the readme explaining an example
@Green-Avocado rust-analyzer.json does not seem to be loaded. I tried restart all language servers, tested with misformatted json to force an error. It failed to even show any change.
My json:
{
"cargo.unsetTest": [
"minitrace"
]
}
Edit: turns out when I tried reinstalling my ide-rust package, it did not update to 1.1.1.
It works now that I've made sure it updates.