]> jturnerusa.dev Git - emacs.d/commitdiff
update eglot-rust-dir-locals.el
authorJohn Turner <jturner.usa@gmail.com>
Tue, 12 Sep 2023 04:45:02 +0000 (00:45 -0400)
committerJohn Turner <jturner.usa@gmail.com>
Tue, 12 Sep 2023 04:45:02 +0000 (00:45 -0400)
dir-locals/eglot-rust-dir-locals.el

index 0c7e83d87239a02e58ce902c8027f0f034e4cc45..e2c893f5e0661e2ca2af2682c59563deea0856b5 100644 (file)
@@ -1,19 +1,10 @@
 ((rust-ts-mode . ((eval . (progn
-                            (require 'rust-mode)
                             (require 'eglot)
-                            (advice-add 'eglot-inlay-hints-mode :around 'ignore)
-                            (eglot-ensure)                            
-                            (company-mode 1)
-                            (use-local-map (make-composed-keymap (list rust-mode-map rust-ts-mode-map)))
-                            (add-hook 'before-save-hook rust-before-save-hook nil t)
-                            (add-hook 'after-save-hook rust-after-save-hook nil t)
-                            (keymap-set (current-local-map)
-                                        "C-c C-c C-d"
-                                        (lambda ()
-                                          (interactive)
-                                          (rust--compile
-                                            "env TMPDIR=${HOME}/tmp cargo test && cargo doc")))))
-                  (eglot-workspace-configuration . (:rust-analyzer  (:check
-                                                                     (:command "clippy"))))
-                  (rust-format-on-save . t)               
-                  (rust-rustfmt-switches . ("--edition" "2021")))))
+                            (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"))))))))