refactor!(rust): remove racer and default to +lsp

BREAKING CHANGE: Racer is no longer developed and its project page
recommends using rust-analyzer instead. Moreover, users have reported
issues trying to build/install it on recent versions of rust, so I've
removed support for Racer from Doom, and now default solely to LSP for
IDE features.

Users that want these features will need to activate the module's +lsp
flag (along with the :tools lsp module) and install rust-analyzer. See
the module's README for instructions.

Close: #6705
Co-authored-by: c1ttim <c1ttim@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2022-09-07 01:17:29 +02:00
parent 20c50755e8
commit 63b0ebeda7
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
5 changed files with 3 additions and 25 deletions

View file

@ -24,7 +24,6 @@ e.g. ~cargo~.
** Packages
- [[doom-package:][rustic]]
- [[doom-package:][racer]] unless [[doom-module:][+lsp]]
** Hacks
- rustic has been modified /not/ to automatically install lsp-mode or eglot if
@ -52,10 +51,8 @@ rustup update --no-self-update
** Other Requirements
- If [[doom-module:][:editor format]] is enabled, you'll need =rustfmt=: ~$ rustup component add
rustfmt-preview~.
- Users without [[doom-module:][+lsp]] enabled will need [[doom-package:][racer]]: ~$ cargo +nightly install racer~
(with requires rust nightly edition).
- Users with [[doom-module:][+lsp]] enabled will need:
- =rust-analyzer= or =rls=
- Users with [[doom-module:][+lsp]] enabled will need [[https://rust-analyzer.github.io/][rust-analyzer]] (rls is supported, but
[[https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html][deprecated]]).
- Using the following commands requires:
- ~cargo-process-check~: ~$ cargo install cargo-check~
- ~cargo-process-clippy~: ~$ rustup component add clippy-preview~

View file

@ -7,14 +7,6 @@
"Return t if this is a cargo project."
(locate-dominating-file buffer-file-name "Cargo.toml"))
;;;###autoload
(defun +rust-racer-lookup-documentation (identifier)
"A `+lookup/documentation' handler for Rust + Racer."
(let ((buf (racer--describe identifier)))
(when buf
(pop-to-buffer buf)
t)))
;;
;;; Custom Cargo commands

View file

@ -76,12 +76,3 @@
(:prefix ("t" . "cargo test")
:desc "all" "a" #'rustic-cargo-test
:desc "current test" "t" #'rustic-cargo-current-test)))
(use-package! racer
:unless (modulep! +lsp)
:hook (rustic-mode-local-vars . racer-mode)
:config
(set-lookup-handlers! 'rustic-mode
:definition '(racer-find-definition :async t)
:documentation '+rust-racer-lookup-documentation))

View file

@ -2,5 +2,3 @@
;;; lang/rust/packages.el
(package! rustic :pin "6eec9713876d698510ee3715698fd42c1571e307")
(unless (modulep! +lsp)
(package! racer :pin "1e63e98626737ea9b662d4a9b1ffd6842b1c648c"))

View file

@ -164,7 +164,7 @@
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor