2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/rust/autoload.el -*- lexical-binding: t; -*-
|
2017-02-21 03:46:07 -05:00
|
|
|
|
2017-04-07 01:45:57 -04:00
|
|
|
;; TODO (defun +rust/run-cargo () (interactive))
|
|
|
|
|
2017-10-03 02:49:08 +02:00
|
|
|
;;;###autoload
|
|
|
|
(defun +rust-cargo-project-p ()
|
|
|
|
"Return t if this is a cargo project."
|
2018-03-14 18:44:55 -04:00
|
|
|
(locate-dominating-file buffer-file-name "Cargo.toml"))
|
2019-04-10 18:51:37 -04:00
|
|
|
|
2019-04-30 20:19:13 -04:00
|
|
|
;;;###autoload
|
|
|
|
(defun +rust-racer-lookup-documentation (identifier)
|
|
|
|
"A `+lookup/documentation' handler for Rust + Racer."
|
|
|
|
(let ((buf (racer--describe identifier)))
|
|
|
|
(when buf
|
|
|
|
(pop-to-buffer buf)
|
|
|
|
t)))
|
2019-11-23 16:00:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Custom Cargo commands
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +rust/cargo-audit ()
|
|
|
|
"Run 'cargo audit' for the current project."
|
|
|
|
(interactive)
|
2020-08-27 10:59:25 +02:00
|
|
|
(rustic-run-cargo-command "cargo audit"))
|