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
|
:init
|
||||||
(add-hook! 'rust-mode-hook #'(racer-mode eldoc-mode flycheck-rust-setup))
|
(add-hook! 'rust-mode-hook #'(racer-mode eldoc-mode flycheck-rust-setup))
|
||||||
:config
|
:config
|
||||||
(setq racer-cmd (expand-file-name "racer/target/release/racer" +rust-src-dir)
|
(setq racer-cmd (or (executable-find "racer")
|
||||||
racer-rust-src-path (expand-file-name "rust/src/" +rust-src-dir))
|
(expand-file-name "racer/target/release/racer" +rust-src-dir))
|
||||||
|
racer-rust-src-path (or (getenv "RUST_SRC_PATH")
|
||||||
(set! :jump 'rust-mode :definition #'racer-find-definition)
|
(expand-file-name "rust/src/" +rust-src-dir)))
|
||||||
|
|
||||||
(unless (file-exists-p racer-cmd)
|
(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
|
(def-package! company-racer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue