diff options
author | John Turner <jturner.usa@gmail.com> | 2023-03-25 03:22:02 -0400 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2023-03-25 03:22:02 -0400 |
commit | 8e08d49a9496b330ffdb46009c1028a554ea9a3b (patch) | |
tree | 293845c365af281001ad262ac7fb18bf13bbc22a | |
parent | a12a48a0a3ae147a45f51203bfbc02f89541d7c6 (diff) | |
download | emacs.d-8e08d49a9496b330ffdb46009c1028a554ea9a3b.tar.gz |
dir-locals.el configured to use rust-mode features in rust-ts-mode
-rw-r--r-- | dir-locals/eglot-rust-dir-locals.el | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/dir-locals/eglot-rust-dir-locals.el b/dir-locals/eglot-rust-dir-locals.el index 5f7d0c6..68be387 100644 --- a/dir-locals/eglot-rust-dir-locals.el +++ b/dir-locals/eglot-rust-dir-locals.el @@ -1,7 +1,16 @@ -((rust-mode . ((eval . (eglot-ensure)) - (eglot-workspace-configuration . ((:rust-analyzer . (:checkOnSave - (:command "clippy"))))) - (rust-format-on-save . t) - (rust-format-goto-problem . t) - (rust-rustfmt-switches . ("--edition" "2021")))) +((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 . "TMPDIR=~/tmp cargo")))) |