My rust advice can be simplified thanks to brotzeit/rustic#87 being
merged.
This commit is contained in:
Henrik Lissner 2020-01-28 20:37:51 -05:00
parent fe0c5e135d
commit c5d6e6267c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 6 additions and 16 deletions

View file

@ -48,21 +48,11 @@
:desc "all" "a" #'rustic-cargo-test
:desc "current test" "t" #'rustic-cargo-current-test))
(defadvice! +rust--dont-install-packages-p (orig-fn &rest args)
:around #'rustic-setup-lsp
(cl-letf (;; `rustic-setup-lsp' uses `package-installed-p' to determine if
;; lsp-mode/elgot are available. This breaks because Doom doesn't
;; use package.el to begin with (and lazy loads it).
((symbol-function #'package-installed-p)
(lambda (pkg)
(require pkg nil t)))
;; If lsp/elgot isn't available, it attempts to install lsp-mode
;; via package.el. Doom manages its own dependencies so we disable
;; that behavior.
((symbol-function #'rustic-install-lsp-client-p)
(lambda (&rest _)
(message "No LSP server running"))))
(apply orig-fn args))))
;; If lsp/elgot isn't available, it attempts to install lsp-mode via
;; package.el. Doom manages its own dependencies so we disable that behavior.
(defadvice! +rust--dont-install-packages-p (&rest _)
:override #'rustic-install-lsp-client-p
(message "No LSP server running")))
(use-package! racer

View file

@ -1,6 +1,6 @@
;; -*- no-byte-compile: t; -*-
;;; lang/rust/packages.el
(package! rustic :pin "a6b8cd8db8")
(package! rustic :pin "c7cab3fbe6")
(unless (featurep! +lsp)
(package! racer :pin "a0bdf778f0"))