]> jturnerusa.dev Git - emacs.d/commitdiff
create rust-dir-locals.el to replace eglot-rust-dir-locals.el
authorJohn Turner <jturner.usa@gmail.com>
Sun, 10 Mar 2024 19:23:23 +0000 (15:23 -0400)
committerJohn Turner <jturner.usa@gmail.com>
Sun, 10 Mar 2024 19:23:23 +0000 (15:23 -0400)
dir-locals/eglot-rust-dir-locals.el [deleted file]
dir-locals/rust-dir-locals.el [new file with mode: 0644]

diff --git a/dir-locals/eglot-rust-dir-locals.el b/dir-locals/eglot-rust-dir-locals.el
deleted file mode 100644 (file)
index e2c893f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-((rust-ts-mode . ((eval . (progn
-                            (require 'eglot)
-                            (eglot-ensure)
-                            (setq-local eglot-workspace-configuration '(:rust-analyzer  (:checkb
-                                                                                         (:command "clippy"))))
-                            (when (require 'company nil t)
-                              (company-mode 1))
-                            (when (require 'rust-mode nil t)
-                              (setq-local rust-format-on-save t
-                                          rust-rustfmt-switches  '("--edition" "2021"))))))))
diff --git a/dir-locals/rust-dir-locals.el b/dir-locals/rust-dir-locals.el
new file mode 100644 (file)
index 0000000..ef4f8fa
--- /dev/null
@@ -0,0 +1,4 @@
+((rust-ts-mode . ((eglot-workspace-configuration . (:rust-analyzer (:check (:command "clippy"))))
+                  (fmt-executable . "rustfmt")
+                  (eval . (eglot-ensure))
+                  (eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t)))))