-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
emacs 29 impossible to pass argument to rustfmt #252
Comments
Does this work: (setq format-all-formatters
'(("Rust" (rustfmt "--edition" "2021")))) We should add Rust to the readme. |
Yes it works when I eval the expression in emacs buffer but that's exacttly what I have in my configuration:
|
That's weird. Can you set |
Hi, I retried with this configuration with the rust-mode hook deactivated and it seems to work now with this configuration. Sorry for that, but I must have made mistake when I was trying several things with the .emacs... |
Ah no... that's because I was trying on souce with no async construction. That's the message I got:
And the error from rustfmt:
And after: (setq format-all-formatters
'(("Rust" (rustfmt "--edition" "2021")))) it works:
|
I think |
Still having this problem and I don't know where format-all is possibly finding an old version of rust, rustc, rustfmt or cargo on this fresh machine Tried this
when I evaluate these expressions then try to re-run formatting via format-all in the messages buffer I don't see the arguments "--edition 2021", I still see "Format-All: Running: /Users/shane.kennedy/.cargo/bin/rustfmt" This is emacs30 via emacs-30-plus --with-native-comp |
I have tried several things and it seems impossible to pass arguments to rustmt.
especially the edition. Is it possible to specify --edition 2021. But if I set Rust formatter like that:
or like that:
Or if I try with cargo:
It's still 2015 edition that is used.
As rust-mode provide its own format command I can workaround this qith a hook:
But format-all definitively doesn't work for Rust.
The text was updated successfully, but these errors were encountered: