39 lines
952 B
EmacsLisp
39 lines
952 B
EmacsLisp
;;; lang/rust/config.el -*- lexical-binding: t; -*-
|
|
|
|
;;
|
|
;; Plugins
|
|
;;
|
|
|
|
(def-package! rust-mode
|
|
:mode "\\.rs$"
|
|
:config
|
|
(set! :env "RUST_SRC_PATH")
|
|
(setq rust-indent-method-chain t)
|
|
(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: "))
|
|
|
|
|
|
(def-package! racer
|
|
:after rust-mode
|
|
:config
|
|
(add-hook! 'rust-mode-hook #'(eldoc-mode racer-mode))
|
|
(set! :lookup 'rust-mode
|
|
:definition #'racer-find-definition
|
|
:documentation #'racer-describe))
|
|
|
|
|
|
(def-package! company-racer
|
|
:when (featurep! :completion company)
|
|
:after racer
|
|
:config (set! :company-backend 'rust-mode '(company-racer)))
|
|
|
|
|
|
(def-package! flycheck-rust
|
|
:when (featurep! :feature syntax-checker)
|
|
:after rust-mode
|
|
:hook (flycheck-mode . flycheck-rust-setup)
|
|
:init (add-hook 'rust-mode-hook #'flycheck-mode))
|
|
|