feat: seamless flycheck integration for Rust

This commit is contained in:
Muhammad Nauman Raza 2022-11-16 20:42:23 +00:00
parent 131fab4a4e
commit 9e5ddf2d70
No known key found for this signature in database
GPG key ID: A9A36C429C9CAE31

View file

@ -4,7 +4,10 @@
(use-package markdown-mode) (use-package markdown-mode)
;; Diagnostics ;; Diagnostics
(use-package flycheck) (use-package flycheck
:init
(global-flycheck-mode) ; Enable flycheck everywhere by default
(push 'rustic-clippy flycheck-checkers)) ; Use clippy for Rust
;; eglot - Language Server Protocol ingegration ;; eglot - Language Server Protocol ingegration
(use-package eglot) (use-package eglot)
@ -17,10 +20,21 @@
(go-mode . flycheck-mode)) ; Enable flycheck-mode by default (go-mode . flycheck-mode)) ; Enable flycheck-mode by default
;; Rust ;; Rust
(use-package flycheck-rust
:init
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)) ; Enable flycheck-rust where flycheck is enabled. If not a rust file, does nothing.
(use-package flycheck-inline
:hook
(flycheck-mode . flycheck-inline-mode)) ; Enable flycheck-inline where flycheck is enabled
(use-package rustic (use-package rustic
:custom :custom
(rustic-lsp-client 'eglot)) ; Make eglot the default LSP client (rustic-lsp-client 'eglot)) ; Make eglot the default LSP client
;; Disable flymake for eglot - in favour of flycheck
(add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1)))
;; Lua ;; Lua
(use-package lua-mode) (use-package lua-mode)