2015-10-01 00:28:52 +08:00
|
|
|
;;; module-rust.el
|
|
|
|
|
2017-02-21 16:46:07 +08:00
|
|
|
(defvar +rust-cache-dir (concat doom-cache-dir "+rust/")
|
|
|
|
"TODO")
|
|
|
|
|
2017-02-23 13:06:12 +08:00
|
|
|
(def-package! rust-mode
|
2015-10-01 00:28:52 +08:00
|
|
|
:mode "\\.rs$"
|
2017-02-20 07:57:16 +08:00
|
|
|
:init
|
|
|
|
(add-hook 'rust-mode-hook 'flycheck-mode)
|
2016-05-01 13:10:30 +08:00
|
|
|
:config
|
2017-02-23 13:06:12 +08:00
|
|
|
(set! :build 'cargo-run '(rust-mode toml-mode)
|
2017-02-20 07:57:16 +08:00
|
|
|
'+rust-is-cargo-project-p '+rust/cargo-run))
|
2015-10-01 00:28:52 +08:00
|
|
|
|
2015-11-30 18:31:20 +08:00
|
|
|
|
2017-02-23 13:06:12 +08:00
|
|
|
(def-package! racer
|
2016-04-24 10:08:46 +08:00
|
|
|
:after rust-mode
|
2017-02-21 16:46:07 +08:00
|
|
|
:preface
|
2017-02-20 07:57:16 +08:00
|
|
|
:init
|
2017-02-23 13:06:12 +08:00
|
|
|
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))
|
2016-04-24 10:08:46 +08:00
|
|
|
:config
|
2017-02-21 16:46:07 +08:00
|
|
|
(setq racer-cmd (expand-file-name "racer/target/release/racer" +rust-cache-dir)
|
|
|
|
racer-rust-src-path (expand-file-name "rust/src/" +rust-cache-dir))
|
|
|
|
|
2016-04-24 10:08:46 +08:00
|
|
|
;; TODO Unit test keybinds
|
2017-02-23 13:06:12 +08:00
|
|
|
(set! :company-backend 'rust-mode '(company-racer))
|
|
|
|
(map! :map rust-mode-map :m "gd" 'racer-find-definition))
|
2017-02-20 07:57:16 +08:00
|
|
|
|
|
|
|
|
2017-02-23 13:06:12 +08:00
|
|
|
(def-package! company-racer
|
2017-02-20 07:57:16 +08:00
|
|
|
:after racer)
|
|
|
|
|
|
|
|
|
2017-02-23 13:06:12 +08:00
|
|
|
(def-package! flycheck-rust
|
2017-02-20 07:57:16 +08:00
|
|
|
:after rust-mode)
|
2015-10-01 00:28:52 +08:00
|
|
|
|