Add some default settings for rust-analyzer.

This commit is contained in:
Tom Alexander 2023-09-09 03:47:34 -04:00
parent db5b400408
commit b86d7813a9
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -40,7 +40,12 @@
(eglot-ensure) (eglot-ensure)
(let ((rust-analyzer-command (locate-rust-analyzer))) (let ((rust-analyzer-command (locate-rust-analyzer)))
(when rust-analyzer-command (when rust-analyzer-command
(add-to-list 'eglot-server-programs `(rust-ts-mode . (,rust-analyzer-command))) ;; (add-to-list 'eglot-server-programs `(rust-ts-mode . (,rust-analyzer-command)))
(add-to-list 'eglot-server-programs `(rust-ts-mode . (,rust-analyzer-command :initializationOptions (:imports (:granularity (:enforce t :group "item")
:merge (:glob nil)
:prefix "self")
:inlayHints (:maxLength nil)
:workspace (:symbol (:search (:limit 1024)))))))
) )
) )
(add-hook 'before-save-hook 'eglot-format-buffer nil 'local) (add-hook 'before-save-hook 'eglot-format-buffer nil 'local)
@ -76,7 +81,7 @@
;; ;;
;; ( ;; (
;; (rust-ts-mode . ((eglot-workspace-configuration ;; (rust-ts-mode . ((eglot-workspace-configuration
;; . (:rust-analyzer (:cargo (:features "compare")))) ;; . (:rust-analyzer (:cargo (:noDefaultFeatures t :features "compare"))))
;; )) ;; ))
;; ) ;; )