Allow for local variables for rust lsp server

This commit is contained in:
Wojciech Kozlowski 2022-02-04 23:07:50 +01:00
parent 6ad008b9b9
commit 339b0fd6d0

View File

@ -209,7 +209,9 @@
(rust-new-project project-name "lib"))
(use-package rust-mode
:hook (rust-mode . lsp)
;; Adding the lsp hook this way is required to ensure local variables from .dir-locals.el are
;; passed to the LSP server.
:hook ((hack-local-variables . (lambda () (when (derived-mode-p 'rust-mode) (lsp)))))
:config
(setq exec-path (append exec-path '("/home/wojtek/.cargo/bin"))))