2018-03-20 21:19:37 -04:00
|
|
|
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
|
|
|
;;; lang/rust/doctor.el
|
2018-03-12 13:16:16 -04:00
|
|
|
|
2019-04-22 03:10:25 -04:00
|
|
|
(assert! (or (not (featurep! +lsp))
|
|
|
|
(featurep! :tools lsp))
|
|
|
|
"This module requires (:tools lsp)")
|
|
|
|
|
2021-10-19 19:26:26 +01:00
|
|
|
(assert! (or (not (featurep! +tree-sitter))
|
|
|
|
(featurep! :tools tree-sitter))
|
|
|
|
"This module requires (:tools tree-sitter)")
|
|
|
|
|
2019-04-25 18:31:42 +02:00
|
|
|
(unless (executable-find "rustc")
|
|
|
|
(warn! "Couldn't find rustc binary"))
|
2019-04-22 03:10:25 -04:00
|
|
|
|
|
|
|
(unless (executable-find "cargo")
|
|
|
|
(warn! "Couldn't find cargo binary"))
|
|
|
|
|
2019-07-09 20:35:09 +02:00
|
|
|
(if (featurep! +lsp)
|
2020-02-29 19:09:50 -05:00
|
|
|
(when (require 'rustic nil t)
|
|
|
|
(pcase rustic-lsp-server
|
2019-07-09 20:35:09 +02:00
|
|
|
(`rust-analyzer
|
2020-02-23 15:35:12 -05:00
|
|
|
(unless (executable-find "rust-analyzer")
|
|
|
|
(warn! "Couldn't find rust analyzer (rust-analyzer)")))
|
2019-07-09 20:35:09 +02:00
|
|
|
(`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)
|
2019-10-17 01:47:58 -04:00
|
|
|
(warn! "Couldn't find Rust's source code at RUST_SRC_PATH or `racer-rust-src-path'"))))
|