purcell / emacs.d

An Emacs configuration bundle with batteries included
BSD 2-Clause "Simplified" License
6.84k stars 2.05k forks source link

Rust flycheck setup no longer working #808

Closed sgarciac closed 1 year ago

sgarciac commented 2 years ago

As far as I understand,

(when (maybe-require-package 'flycheck-rust)
  (with-eval-after-load 'rust-mode
    (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)))

in the rust initializer is no longer working after the change from flycheck to flymake, but it is still needed. I got it working by replacing 'flycheck-mode-hook by 'flymake-mode-hook in the add-hook call.

purcell commented 2 years ago

True, because flycheck-mode is never enabled. Instead, it should probably be

(when (maybe-require-package 'flycheck-rust)
  (with-eval-after-load 'rust-mode
    (with-eval-after-load 'flycheck
      (flycheck-rust-setup))))

Would you like to test that out locally?

purcell commented 2 years ago

Hmm, in fact, that's not quite it. I'd probably try adding flycheck-rust-setup to rust-mode-hook instead.

sgarciac commented 2 years ago
(when (maybe-require-package 'flycheck-rust)
  (with-eval-after-load 'rust-mode
    (add-hook 'rust-mode-hook #'flycheck-rust-setup)))

does work locally for me.

purcell commented 1 year ago

This got added to the default config, so closing now...