diff options
| author | jao <jao@gnu.org> | 2026-01-13 15:10:08 +0000 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-01-13 15:10:08 +0000 |
| commit | bfdb1665ca86d1b7ff52a0f839ea6ee6a5f3d59f (patch) | |
| tree | 30b8e88eef58cc293fec740363f55fdd59d9ea53 /custom/jao-custom-programming.el | |
| parent | d6277bbc3e8973571529a98143b8e80d7f270d79 (diff) | |
| download | elibs-bfdb1665ca86d1b7ff52a0f839ea6ee6a5f3d59f.tar.gz elibs-bfdb1665ca86d1b7ff52a0f839ea6ee6a5f3d59f.tar.bz2 | |
rust/rust-analyzer/eglot
Diffstat (limited to 'custom/jao-custom-programming.el')
| -rw-r--r-- | custom/jao-custom-programming.el | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/custom/jao-custom-programming.el b/custom/jao-custom-programming.el index e0c3b39..c9e33da 100644 --- a/custom/jao-custom-programming.el +++ b/custom/jao-custom-programming.el @@ -58,11 +58,20 @@ (use-package eglot :init ;; (setq eglot-ignored-server-capabilites '(:inlayHintProvider)) (defun jao-eglot-managed-mode-hook () - (flymake-mode 1) (eglot-inlay-hints-mode -1) (setq-local eldoc-display-functions '(eldoc-display-in-buffer))) - (setq eglot-events-buffer-config '(:size 0 :format full)) + (setq eglot-events-buffer-config '(:size 1000 :format full) + eglot-autoshutdown t) :config + (add-to-list 'eglot-server-programs + `(rust-mode . ("rust-analyzer" + :initializationOptions + (:check (:command "clippy") + :procMacro + (:enable t :ignored + (:async-trait ["async-trait"])) + )))) + ;; :config (add-to-list 'eglot-stay-out-of 'flymake) :hook (eglot-managed-mode . jao-eglot-managed-mode-hook) :bind (:map eglot-mode-map (("C-h ." . jao-eldoc-toggle)))) @@ -289,20 +298,36 @@ (use-package rust-mode :ensure t + :demand t + :hook (;; (rust-mode . hs-minor-mode) + (rust-mode . smartparens-mode)) :init - (setq rust-mode-treesitter-derive t)) + (setq rust-mode-treesitter-derive nil) + :config + (use-package smartparens-rust :demand t) + (jao-define-attached-buffer "\\*cargo-.+\\*" 22) + :bind (:map rust-mode-map + ("<f3>" . hs-toggle-hiding) + ("C-c a" . eglot-code-actions) + ("C-c m" . jao-transient-flymake) + ("C-c r" . eglot-rename) + ("C-c C-e" . consult-eglot-symbols))) (use-package rustic :ensure t - :after (rust-mode) - :config + :demand t + :init (setq rustic-format-on-save nil - rustic-lsp-client 'eglot) + rustic-lsp-client 'eglot) ;; 'lsp-mode 'eglot nil + :config + (jao-define-attached-buffer '(major-mode . rustic-compilation-mode) 25) :custom (rustic-cargo-use-last-stored-arguments t) - (rustic-analyzer-command '("rustup" "run" "stable" "rust-analyzer"))) + (rustic-analyzer-command '("rust-analyzer"))) + +(use-package rust-playground + :ensure t) -(use-package rust-playground :ensure t) ;;;; Clojure (use-package clojure-mode |
