featurep! will be renamed modulep! in the future, so it's been deprecated. They have identical interfaces, and can be replaced without issue. featurep! was never quite the right name for this macro. It implied that it had some connection to featurep, which it doesn't (only that it was similar in purpose; still, Doom modules are not features). To undo such implications and be consistent with its namespace (and since we're heading into a storm of breaking changes with the v3 release anyway), now was the best opportunity to begin the transition.
33 lines
1.1 KiB
EmacsLisp
33 lines
1.1 KiB
EmacsLisp
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
|
;;; lang/rust/doctor.el
|
|
|
|
(assert! (or (not (modulep! +lsp))
|
|
(modulep! :tools lsp))
|
|
"This module requires (:tools lsp)")
|
|
|
|
(assert! (or (not (modulep! +tree-sitter))
|
|
(modulep! :tools tree-sitter))
|
|
"This module requires (:tools tree-sitter)")
|
|
|
|
(unless (executable-find "rustc")
|
|
(warn! "Couldn't find rustc binary"))
|
|
|
|
(unless (executable-find "cargo")
|
|
(warn! "Couldn't find cargo binary"))
|
|
|
|
(if (modulep! +lsp)
|
|
(when (require 'rustic nil t)
|
|
(pcase rustic-lsp-server
|
|
(`rust-analyzer
|
|
(unless (executable-find "rust-analyzer")
|
|
(warn! "Couldn't find rust analyzer (rust-analyzer)")))
|
|
(`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'"))))
|