doomemacs/modules/lang/rust/config.el

43 lines
1.1 KiB
EmacsLisp
Raw Normal View History

;;; lang/rust/config.el -*- lexical-binding: t; -*-
2015-09-30 12:28:52 -04:00
2017-09-19 05:07:24 +02:00
;;
;; Plugins
;;
(def-package! rust-mode
2015-09-30 12:28:52 -04:00
:mode "\\.rs$"
:config
(def-menu! +rust/build-menu
"TODO"
'(("run" :exec "cargo run" :cwd t :when (+rust-cargo-project-p))
("build" :exec "cargo build" :cwd t :when (+rust-cargo-project-p)))
:prompt "Cargo: "))
2015-09-30 12:28:52 -04:00
(def-package! racer
:after rust-mode
:config
(unless (file-exists-p racer-cmd)
2018-02-14 07:40:05 -05:00
(warn! "Couldn't find racer binary. Code completion won't work"))
(unless (file-directory-p racer-rust-src-path)
(warn! "Couldn't find rust source. Code completion won't work"))
(add-hook! 'rust-mode-hook #'(eldoc-mode racer-mode))
(set! :lookup 'rust-mode
:definition #'racer-find-definition
:documentation #'racer-describe))
2017-02-19 18:57:16 -05:00
(def-package! company-racer
:when (featurep! :completion company)
:after racer
:config (set! :company-backend 'rust-mode '(company-racer)))
2017-02-19 18:57:16 -05:00
(def-package! flycheck-rust
:when (featurep! :feature syntax-checker)
2017-09-19 05:07:24 +02:00
:after rust-mode
:hook (flycheck-mode . flycheck-rust-setup)
:init (add-hook 'rust-mode-hook #'flycheck-mode))
2015-09-30 12:28:52 -04:00