From 1fbccb6e3dde6fd0a564cd60dd40fa502fe4484f Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 15 Apr 2026 11:27:43 +0100 Subject: rust wee utils --- custom/jao-custom-programming.el | 3 +-- lib/prog/jao-rust.el | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/custom/jao-custom-programming.el b/custom/jao-custom-programming.el index cbc7d4f..f591ce1 100644 --- a/custom/jao-custom-programming.el +++ b/custom/jao-custom-programming.el @@ -66,7 +66,7 @@ (add-to-list 'eglot-server-programs `(rust-mode . ("rust-analyzer" :initializationOptions - (:check (:command "clippy") + (:check (:command "check") ;; (:command "clippy") :procMacro (:enable t :ignored (:async-trait ["async-trait"])) @@ -331,7 +331,6 @@ :config (setq rustic-format-on-save nil rustic-lsp-client 'eglot) ;; 'lsp-mode 'eglot nil - (jao-define-attached-buffer '(major-mode . rustic-compilation-mode) 25) :custom (rustic-cargo-use-last-stored-arguments nil) (rustic-analyzer-command '("rust-analyzer")) diff --git a/lib/prog/jao-rust.el b/lib/prog/jao-rust.el index 436de00..5e20744 100644 --- a/lib/prog/jao-rust.el +++ b/lib/prog/jao-rust.el @@ -62,7 +62,10 @@ (interactive) (or (re-search-forward jao-rust--tests-mod-rx nil t) (re-search-backward jao-rust--tests-mod-rx nil t) - (message "No tests module"))) + (when (y-or-n-p "No tests module. Add it?") + (goto-char (point-max)) + (insert "\n#[cfg(test)]\nmod tests {\n\n}") + (forward-line -1)))) (defun jao-rust-test-current () (interactive) -- cgit v1.2.3