lang/rust: check for racer binary + RUST_SRC_PATH first
This commit is contained in:
parent
8361e13383
commit
e0dab9f5fa
1 changed files with 7 additions and 5 deletions
|
@ -24,13 +24,15 @@
|
|||
:init
|
||||
(add-hook! 'rust-mode-hook #'(racer-mode eldoc-mode flycheck-rust-setup))
|
||||
:config
|
||||
(setq racer-cmd (expand-file-name "racer/target/release/racer" +rust-src-dir)
|
||||
racer-rust-src-path (expand-file-name "rust/src/" +rust-src-dir))
|
||||
|
||||
(set! :jump 'rust-mode :definition #'racer-find-definition)
|
||||
(setq racer-cmd (or (executable-find "racer")
|
||||
(expand-file-name "racer/target/release/racer" +rust-src-dir))
|
||||
racer-rust-src-path (or (getenv "RUST_SRC_PATH")
|
||||
(expand-file-name "rust/src/" +rust-src-dir)))
|
||||
|
||||
(unless (file-exists-p racer-cmd)
|
||||
(warn "rust-mode: racer binary can't be found; auto-completion is disabled")))
|
||||
(warn "rust-mode: racer binary can't be found; auto-completion is disabled"))
|
||||
|
||||
(set! :jump 'rust-mode :definition #'racer-find-definition))
|
||||
|
||||
|
||||
(def-package! company-racer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue