reddit / emacs

rust with emacs

zebisnaga · 2022-09-05 21:11
Hi guys, I am learning rust but i am using vscode with rust analyzer for that. I followed some guides to Work with rust in emacs but i dont quite like mostly because of the inline error check Is there a way to make emacs behave like rust-analyzer from vscode with the full inline error ?
zeroc7992 · 2022-09-05 22:12
This should get you started. https://robert.kra.hn/posts/rust-emacs-setup/
zebisnaga · 2022-09-05 22:39
Thanks but i already followed this guide but it was a little bit overwhelming about configs ... There are some feautures i would like to Change but i could nota find documentation
PhantomSeahorse · 2022-09-06 02:32
https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/
zebisnaga · 2022-09-06 08:14
this is 100% what i want, thanks
gnuvince · 2022-09-06 13:42
I write Rust professionally using Emacs. This is my entire config for Rust: (use-package rust-mode :ensure t :mode "\\.rs$" :config (setq rust-format-on-save t) (add-hook 'rust-mode-hook 'cargo-minor-mode) :custom-face (rust-question-mark-face ((t (:inherit font-lock-builtin-face :foreground "#ff0000" :weight bold))))) (use-package cargo :ensure t :defer t :diminish cargo-minor-mode) (use-package eglot :ensure t :hook ((go-mode . eglot-ensure) (rust-mode . eglot-ensure))) Make sure that `rust-analyzer` is in your PATH and that gives a pretty decent out-of-the-box experience.
zebisnaga · 2022-09-06 13:57
you dont use inline highlight?
gnuvince · 2022-09-06 14:22
Not sure what that is.
zebisnaga · 2022-09-06 16:54
this https://i.imgur.com/xP1AwAY.png
gnuvince · 2022-09-06 16:59
I have the squiggly lines, but not the explanation in the buffer itself—the error message is displayed in the echo area.
zebisnaga · 2022-09-06 18:25
Can you show me an Example? Thanks !!!