ok
This commit is contained in:
parent
978b5506f2
commit
66980715aa
1 changed files with 23 additions and 6 deletions
|
@ -1042,6 +1042,23 @@ this should be useful later
|
||||||
:cargo (:features ["all"]))))
|
:cargo (:features ["all"]))))
|
||||||
|
|
||||||
(add-hook 'rustic-mode-hook #'setup-rust)
|
(add-hook 'rustic-mode-hook #'setup-rust)
|
||||||
|
(add-hook 'rust-mode-hook #'setup-rust)
|
||||||
|
|
||||||
|
|
||||||
|
;; expects initializationOptions done a bit differently (see below).
|
||||||
|
(defclass eglot-rust-analyzer (eglot-lsp-server) ()
|
||||||
|
:documentation "A custom class for rust-analyzer.")
|
||||||
|
|
||||||
|
;; Rust-analyzer requires the workspaceConfiguration sent as
|
||||||
|
;; initializationOptions at startup time. See
|
||||||
|
;; https://github.com/joaotavora/eglot/discussions/845 and
|
||||||
|
;; rust-analyzer’s manual page.
|
||||||
|
(cl-defmethod eglot-initialization-options ((server eglot-rust-analyzer))
|
||||||
|
eglot-workspace-configuration)
|
||||||
|
|
||||||
|
;; Use our custom ‘eglot-rust-analyzer’ for ‘rust-mode’.
|
||||||
|
(add-to-list 'eglot-server-programs
|
||||||
|
'(rustic-mode . (eglot-rust-analyzer "rust-analyzer")))
|
||||||
|
|
||||||
:custom
|
:custom
|
||||||
(rustic-cargo-use-last-stored-arguments t))
|
(rustic-cargo-use-last-stored-arguments t))
|
||||||
|
|
Loading…
Reference in a new issue