feat: migrate to rust-mode

This is because rustic has seemingly broken down temporarily
This commit is contained in:
Muhammad Nauman Raza 2022-12-26 23:14:35 +00:00
parent ae5eba8f87
commit e7eda8979c
No known key found for this signature in database
GPG key ID: 62D07698363B5010

View file

@ -15,10 +15,10 @@
(use-package markdown-mode) (use-package markdown-mode)
;; Diagnostics ;; Diagnostics
(use-package flycheck-rust ;; (use-package flycheck-rust
:after flycheck ;; :after flycheck
:init ;; :init
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)) ; Enable flycheck-rust where flycheck is enabled. If not a rust file, does nothing. ;; (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 (use-package flycheck-inline
:after flycheck :after flycheck
@ -40,10 +40,13 @@
(add-hook 'before-save-hook 'gofmt-before-save)) ; Format on save (add-hook 'before-save-hook 'gofmt-before-save)) ; Format on save
;; Rust ;; Rust
(use-package rustic (use-package rust-mode
:config
(add-hook 'rust-mode-hook
(lambda () (prettify-symbols-mode))) ; Prettify code automatically
(add-hook 'rust-mode-hook 'eglot-ensure) ; Enable eglot compatibility
:custom :custom
(rustic-format-trigger 'on-save) ; Format buffer on save (rust-format-on-save t)) ; Format on save
(rustic-lsp-client 'eglot)) ; Make eglot the default LSP client
;; Disable flymake for eglot - in favour of flycheck ;; Disable flymake for eglot - in favour of flycheck
(add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1))) (add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1)))