fix(rust): ensure order of modes in auto-mode-alist

Depending on install order, the rust-mode might get precedence, causing
rustic to not be loaded on *.rs files.
This commit is contained in:
Henrik Lissner 2024-08-27 03:12:13 -04:00
parent 89f5af8104
commit 1430e9c700
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -9,8 +9,15 @@
;;; Packages
(use-package! rustic
:mode ("\\.rs\\'" . rust-mode)
:mode ("\\.rs\\'" . rustic-mode)
:preface
;; HACK: `rust-mode' and `rustic' add entries to `auto-mode-alist', but
;; package load order makes which gets precedence unpredictable. By removing
;; them early, we rely on the `:mode' directives above to re-insert them
;; with the correct order.
(setq auto-mode-alist (assoc-delete-all "\\.rs\\'" auto-mode-alist))
;; HACK `rustic' sets up some things too early. I'd rather disable it and let
;; our respective modules standardize how they're initialized.
(setq rustic-lsp-client nil)