From 978b5506f21a7807e9696c1a20c2c71b05435288 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:29:58 +0400 Subject: [PATCH] emacs rust shennanigans --- config/emacs/emacs.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 76543ea4..09993a30 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -1028,6 +1028,21 @@ this should be useful later :config (setq rustic-format-on-save nil) (setq rustic-lsp-client 'eglot) + + (defun setup-rust () + "Setup for ‘rust-mode’." + ;; Configuration taken from rust-analyzer’s manual: + ;; https://rust-analyzer.github.io/manual.html#configuration + (setq-local eglot-workspace-configuration + ;; Setting the workspace configuration for every + ;; rust-mode buffer, you can also set it with dir-local + ;; variables, should you want different configuration + ;; per project/directory. + '(:rust-analyzer + :cargo (:features ["all"])))) + + (add-hook 'rustic-mode-hook #'setup-rust) + :custom (rustic-cargo-use-last-stored-arguments t)) #+end_src