lang/rust: add doctor checks for lsp servers

This commit is contained in:
Henrik Lissner 2019-07-09 20:35:09 +02:00
parent 2f86c01170
commit 7b04bee2de
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -11,10 +11,21 @@
(unless (executable-find "cargo")
(warn! "Couldn't find cargo binary"))
(when (require 'racer nil t)
;; racer
(unless (file-exists-p racer-cmd)
(warn! "Couldn't find the racer binary at `racer-cmd'"))
;; rust source code (rustup component add rust-src)
(unless (file-directory-p racer-rust-src-path)
(warn! "Couldn't find Rust's source code at RUST_SRC_PATH or `racer-rust-src-path'.")))
(if (featurep! +lsp)
(let ((lsp-server 'rls))
(when (require 'rustic nil t)
(setq lsp-server rustic-lsp-server))
(pcase lsp-server
(`rust-analyzer
(unless (executable-find "ra_lsp_server")
(warn! "Couldn't find rust analyzer (ra_lsp_server)")))
(`rls
(unless (executable-find "rls")
(warn! "Couldn't find rls")))))
(when (require 'racer nil t)
;; racer
(unless (file-exists-p racer-cmd)
(warn! "Couldn't find the racer binary at `racer-cmd'"))
;; rust source code (rustup component add rust-src)
(unless (file-directory-p racer-rust-src-path)
(warn! "Couldn't find Rust's source code at RUST_SRC_PATH or `racer-rust-src-path'."))))