This commit is contained in:
Chris Cochrun 2026-05-14 10:37:02 -05:00
parent 1934d6a4ba
commit 5805c3b7ec
2 changed files with 46 additions and 4 deletions

View file

@ -3845,7 +3845,7 @@ I'd like to start learning and using rust if I can.
;; comment to disable rustfmt on save
(setq rustic-format-on-save t
rustic-lsp-client 'eglot
rustic-clippy-arguments "-- -W clippy::pedantic -W clippy::perf -W clippy::nursery -W clippy::unwrap_used"
rustic-clippy-arguments ""
rustic-rustfmt-args "--edition 2024"
rust-format-on-save t
rustic-cargo-clippy-trigger-fix 'on-compile
@ -3853,12 +3853,33 @@ I'd like to start learning and using rust if I can.
rustic-cargo-test-disable-warnings t
rustic-cargo-test-runner 'nextest
rustic-format-trigger 'on-save
rustic-analyzer-command '("rust-analyzer")
rustic-test-arguments "--benches --tests --all-features -- --nocapture")
(defun chris/rustic-setup ()
"setup some more stuff for rustic mode"
(setq rustic-compile-command "just r"))
(add-hook 'rustic-mode-hook #'chris/rustic-setup)
(with-eval-after-load 'eglot
(setq eglot-server-programs
(cl-remove-if (lambda (elm)
(and (listp elm)
(listp (car elm))
(eq 'rustic-mode (caar elm)))) eglot-server-programs))
(add-to-list 'eglot-server-programs
'((rustic-mode :language-id "rust")
eglot-rust-analyzer
"rust-analyzer" :initializationOptions
(:lru (:capacity 64)
:files (:exclude ("flatpak-builder-tools" "cosmic-flatpak-runtime"
"flatpak-out" "mupdf" "build-dir" ".zed"
"mupdf-cargo-sources.json" "cargo-sources.json"))
:semanticHighlighting (:operator (:enable :json-false))
(:punctuation (:enable :json-false))
(:strings (:enable :json-false))
(:nonStandardTokens (:enable :json-false))))))
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
(add-to-list 'compilation-error-regexp-alist rustic-compilation-error)
@ -4014,7 +4035,7 @@ Let's give eglot a try.
(use-package eglot
:commands eglot
:custom
(eglot-events-buffer-config '(:size 20000 :format full))
(eglot-events-buffer-config '(:size 20000000 :format lisp))
:hook
(c++-mode . eglot-ensure)
(c++-ts-mode . eglot-ensure)

25
init.el
View file

@ -2832,7 +2832,7 @@ current buffer's, reload dir-locals."
;; comment to disable rustfmt on save
(setq rustic-format-on-save t
rustic-lsp-client 'eglot
rustic-clippy-arguments "-- -W clippy::pedantic -W clippy::perf -W clippy::nursery -W clippy::unwrap_used"
rustic-clippy-arguments ""
rustic-rustfmt-args "--edition 2024"
rust-format-on-save t
rustic-cargo-clippy-trigger-fix 'on-compile
@ -2840,12 +2840,33 @@ current buffer's, reload dir-locals."
rustic-cargo-test-disable-warnings t
rustic-cargo-test-runner 'nextest
rustic-format-trigger 'on-save
rustic-analyzer-command '("rust-analyzer")
rustic-test-arguments "--benches --tests --all-features -- --nocapture")
(defun chris/rustic-setup ()
"setup some more stuff for rustic mode"
(setq rustic-compile-command "just r"))
(add-hook 'rustic-mode-hook #'chris/rustic-setup)
(with-eval-after-load 'eglot
(setq eglot-server-programs
(cl-remove-if (lambda (elm)
(and (listp elm)
(listp (car elm))
(eq 'rustic-mode (caar elm)))) eglot-server-programs))
(add-to-list 'eglot-server-programs
'((rustic-mode :language-id "rust")
eglot-rust-analyzer
"rust-analyzer" :initializationOptions
(:lru (:capacity 64)
:files (:exclude ("flatpak-builder-tools" "cosmic-flatpak-runtime"
"flatpak-out" "mupdf" "build-dir" ".zed"
"mupdf-cargo-sources.json" "cargo-sources.json"))
:semanticHighlighting (:operator (:enable :json-false))
(:punctuation (:enable :json-false))
(:strings (:enable :json-false))
(:nonStandardTokens (:enable :json-false))))))
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
(add-to-list 'compilation-error-regexp-alist rustic-compilation-error)
@ -2932,7 +2953,7 @@ current buffer's, reload dir-locals."
(use-package eglot
:commands eglot
:custom
(eglot-events-buffer-config '(:size 20000 :format full))
(eglot-events-buffer-config '(:size 20000000 :format lisp))
:hook
(c++-mode . eglot-ensure)
(c++-ts-mode . eglot-ensure)