rust-lang / rust-mode

Emacs configuration for Rust
Apache License 2.0
1.1k stars 176 forks source link

Default key bindings and rust-format-on-save doesn't work with rust-ts-mode #542

Closed C-Entropy closed 2 months ago

C-Entropy commented 2 months ago

My configuration:

(use-package rust-mode
  :hook
  ((rust-mode rust-ts-mode)
   .
   (lambda ()
     (setq indent-tabs-mode nil)
     (prettify-symbols-mode)))
  :config
  (setq rust-format-on-save t)
  :init
  (setq rust-mode-treesitter-derive t))

Default key bindings and rust-format-on-save doesn't work with rust-ts-mode.

psibi commented 2 months ago

The hook you secificied doesn't seem to be right, can you remove the hook and try without it ?

psibi commented 2 months ago

I tested it locally and this works for me:

(use-package rust-mode
  :ensure t
  :defer t
  :init
  (setq rust-mode-treesitter-derive t)
  :config
  (setq rust-format-on-save t))
C-Entropy commented 2 months ago

I tested it locally and this works for me:

(use-package rust-mode
  :ensure t
  :defer t
  :init
  (setq rust-mode-treesitter-derive t)
  :config
  (setq rust-format-on-save t))

This works, thanks!