Closed lerouxrgd closed 4 months ago
I have the same issue and I even don't config the rust-format-on-save
. I found the rust-after-save-hook
is rust-after-save-method
. Looks like #515 move rust-after-save-hook
to rust-common.el
, and the rust-after-save-method
actually in rust-rustfmt.el.
Does rust-common.el
forgot import the rust-format
?
Does rust-common.el forgot import the rust-format?
You're right. Does this PR make it work: https://github.com/rust-lang/rust-mode/pull/517 ?
@psibi Unfortunately, it doesn't, I try add rust-rustfmt
in rust-common
and it fixed on my side.
modified rust-common.el
@@ -4,6 +4,8 @@
;; rust-common code for both prog-mode and tree-sitter one
;;; Code:
+(require 'rust-rustfmt)
+
(defcustom rust-before-save-hook 'rust-before-save-method
"Function for formatting before save."
:type 'function
@ccqpein Cool, want to send a PR with your changes ?
I just gave the PR #519 . cc @lerouxrgd does the PR fix the issue on your side too?
Hello,
Here is my current config:
Then in rust-mode (when editing a Rust file), the format on save is not happening.
Strangely, it says:
I keep having the same message if I try too change what is in the
:init
and:config
statements.