29 lines
931 B
EmacsLisp

;; Rust language integration
(require 'rust-mode)
(require 'lsp-mode)
;(require 'racer)
;(require 'flycheck-rust)
;
;(setq racer-cmd (expand-file-name "~/.cargo/bin/racer"))
;(setq flycheck-rust-cargo-executable (expand-file-name "~/.cargo/bin/cargo"))
;
;(defun jwall:rust-mode-hook ()
; (setq-local company-tooltip-align-annotations t)
;
; (local-set-key (kbd "TAB") #'company-indent-or-complete-common)
; (setq-local company-idle-delay 2)
; (setq-local company-minimum-prefix-length 2)
; (flycheck-mode)
; (racer-mode))
;
;(add-hook 'rust-mode-hook 'jwall:rust-mode-hook)
;;(add-hook 'racer-mode-hook 'eldoc-mode)
;(add-hook 'racer-mode-hook 'company-mode)
;(add-hook 'flycheck-mode-hook 'flycheck-rust-setup)
(with-eval-after-load 'lsp-mode
(setq lsp-rust-rls-command '("rustup" "run" "nightly" "rls"))
(require 'lsp-rust)
(add-hook 'rust-mode-hook #'lsp-rust-enable)
(add-hook 'rust-mode-hook #'flycheck-mode))