Build rust-analyzer on FreeBSD.
The official FreeBSD package rust-analyzer crashes. I suspect this is because its built for rust stable which conflicts with the rust-nightly I have installed.
This commit is contained in:
@@ -2,10 +2,28 @@
|
||||
(require 'util-tree-sitter)
|
||||
|
||||
(defun locate-rust-analyzer ()
|
||||
"Find rust-analyzer."
|
||||
(let ((rust-analyzer-paths (list (locate-rust-analyzer-rustup) (locate-rust-analyzer-ansible-built))))
|
||||
(let ((first-non-nill-path (seq-find (lambda (elt) elt) rust-analyzer-paths)))
|
||||
first-non-nill-path
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun locate-rust-analyzer-rustup ()
|
||||
"Find rust-analyzer through rustup."
|
||||
(run-command-in-directory nil "rustup" "which" "rust-analyzer")
|
||||
)
|
||||
|
||||
(defun locate-rust-analyzer-ansible-built ()
|
||||
"Find rust-analyzer where the ansible playbook built it."
|
||||
(let ((rust-analyzer-path "/opt/rust-analyzer/target/release/rust-analyzer"))
|
||||
(when (file-exists-p rust-analyzer-path)
|
||||
rust-analyzer-path
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(use-package rust-mode
|
||||
:mode "\\.rs\\'"
|
||||
:hook (
|
||||
|
||||
Reference in New Issue
Block a user