Skip to content

Commit

Permalink
Merge pull request #539 from Dev380/fix-auto-mode-treesit
Browse files Browse the repository at this point in the history
fix(treesit): auto mode precedence of rust-mode
  • Loading branch information
psibi authored Apr 15, 2024
2 parents b2b18aa + 3592c10 commit e54bbae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rust-mode-treesitter.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
(require 'treesit)
(require 'rust-ts-mode)

;; HACK: `rust-ts-mode' adds itself to the `auto-mode-alist'
;; after us, so we need to readd `rust-mode' to the front of
;; the list after loading `rust-ts-mode'.
(setq auto-mode-alist (delete '("\\.rs\\'" . rust-mode) auto-mode-alist))
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))

(define-derived-mode rust-mode rust-ts-mode "Rust"
"Major mode for Rust code.
Expand Down

0 comments on commit e54bbae

Please sign in to comment.