doomemacs/modules/lang/rust/doctor.el
Jeetaditya Chatterjee 547860e847
docs(tree-sitter): add doctor checks for flag
add in a check ala lsp, this has been applied to every module with tree
sitter support
2022-05-22 21:26:00 +01:00

33 lines
1.1 KiB
EmacsLisp

;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/rust/doctor.el
(assert! (or (not (featurep! +lsp))
(featurep! :tools lsp))
"This module requires (:tools lsp)")
(assert! (or (not (featurep! +tree-sitter))
(featurep! :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 (featurep! +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'"))))