skibidi toilet
This commit is contained in:
parent
a5296e48a6
commit
9f01f11afd
1 changed files with 3 additions and 31 deletions
|
@ -1029,37 +1029,9 @@ this should be useful later
|
||||||
(setq rustic-format-on-save nil)
|
(setq rustic-format-on-save nil)
|
||||||
(setq rustic-lsp-client 'eglot)
|
(setq rustic-lsp-client 'eglot)
|
||||||
|
|
||||||
(defun setup-rust ()
|
|
||||||
"Setup for ‘rust-mode’."
|
|
||||||
;; Configuration taken from rust-analyzer’s manual:
|
|
||||||
;; https://rust-analyzer.github.io/manual.html#configuration
|
|
||||||
(setq-local eglot-workspace-configuration
|
|
||||||
;; Setting the workspace configuration for every
|
|
||||||
;; rust-mode buffer, you can also set it with dir-local
|
|
||||||
;; variables, should you want different configuration
|
|
||||||
;; per project/directory.
|
|
||||||
'(:rust-analyzer
|
|
||||||
(:cargo (:features "all")))))
|
|
||||||
|
|
||||||
(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
|
(add-to-list 'eglot-server-programs
|
||||||
'(rustic-mode . (eglot-rust-analyzer "rust-analyzer")))
|
`(rustic-mode . ("rust-analyzer" :initializationOptions
|
||||||
|
( :cargo ( :features "all")))))
|
||||||
:custom
|
:custom
|
||||||
(rustic-cargo-use-last-stored-arguments t))
|
(rustic-cargo-use-last-stored-arguments t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
Loading…
Reference in a new issue