From c668dce90be6d212067ab1c6c9f5566b2181e743 Mon Sep 17 00:00:00 2001 From: John Turner Date: Sun, 10 Mar 2024 15:23:23 -0400 Subject: [PATCH] create rust-dir-locals.el to replace eglot-rust-dir-locals.el --- dir-locals/eglot-rust-dir-locals.el | 10 ---------- dir-locals/rust-dir-locals.el | 4 ++++ 2 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 dir-locals/eglot-rust-dir-locals.el create mode 100644 dir-locals/rust-dir-locals.el diff --git a/dir-locals/eglot-rust-dir-locals.el b/dir-locals/eglot-rust-dir-locals.el deleted file mode 100644 index e2c893f..0000000 --- a/dir-locals/eglot-rust-dir-locals.el +++ /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 index 0000000..ef4f8fa --- /dev/null +++ b/dir-locals/rust-dir-locals.el @@ -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))))) -- 2.39.5