summaryrefslogtreecommitdiff
path: root/dir-locals/eglot-rust-dir-locals.el
blob: 50471a4fe0c22807e88feb530169a41ddc8840b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
((rust-ts-mode . ((eval . (progn
                            (require 'rust-mode)
                            (eglot-ensure)
                            (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-c C-d" (lambda ()
                                                                                (interactive)
                                                                                (rust--compile
                                                                                 "%s doc"
                                                                                 rust-cargo-bin)))))
                  (eglot-workspace-configuration . ((:rust-analyzer . (:checkOnSave
                                                                       (:command "clippy")))))
                  (rust-format-on-save . t)               
                  (rust-rustfmt-switches . ("--edition" "2021"))))
 (nil . ((rust-cargo-bin . "env TMPDIR=~/tmp cargo"))))