43 lines
1.3 KiB
EmacsLisp
43 lines
1.3 KiB
EmacsLisp
;;;; Rust mode configuration.
|
|
;; Add rust load hooks.
|
|
(use-package rustic
|
|
:config
|
|
(setq rustic-flycheck-clippy-params "--message-format=json"))
|
|
|
|
(use-package flycheck
|
|
:hook (prog-mode . flycheck-mode))
|
|
|
|
(use-package company
|
|
:hook (prog-mode . company-mode)
|
|
:config (setq company-tooltip-align-annotations t)
|
|
(setq company-minimum-prefix-length 1))
|
|
|
|
(use-package lsp-mode
|
|
:commands lsp
|
|
:config (require 'lsp-clients))
|
|
|
|
(use-package lsp-ui
|
|
:commands lsp-ui-mode
|
|
:config (setq lsp-ui-peek-enable t)
|
|
(setq lsp-ui-doc-enable nil)
|
|
(setq lsp-ui-doc-use-childframe t)
|
|
(setq lsp-ui-doc-header nil)
|
|
(setq lsp-ui-doc-position 'top)
|
|
(setq lsp-ui-doc-use-webkit nil)
|
|
:bind (:map lsp-ui-mode-map
|
|
("M-." . lsp-ui-peek-find-definitions)
|
|
("M-," . lsp-ui-peek-jump-backward)
|
|
("M-?" . lsp-ui-peek-find-references)
|
|
("M-h" . lsp-ui-doc-show)
|
|
("M-j" . lsp-ui-doc-hide)
|
|
("C-c u" . lsp-ui-imenu)
|
|
("C-c C-a" . lsp-ui-sideline-apply-code-actions)))
|
|
|
|
(use-package helm-lsp
|
|
:config
|
|
(define-key lsp-mode-map [remap xref-find-apropos] #'helm-lsp-workspace-symbol))
|
|
|
|
(use-package flycheck-rust
|
|
:config (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
|
|
|
|
(provide 'jenga-rust)
|