reddit / emacs
Having problems setting up rust support
Chaqua · 2022-11-16 16:36
I am on windows and I am totally new to emacs. I have everything installed for rust already, works in my nvim setup too (I am switching to emacs dont worry). Now when I try to reload my config, or I safe a .rs file it tells me:
"file-missing Cannot open laod file. No such file or directory rustic"
So I understand that rustic is missing, but how do I fix it? The answers I find online just confuse me. I added that to my config now:
(add-to-list 'default-frame-alist '(fullscreen . maximized))
​
(setq rustic-lsp-client 'eglot)
(setq package-archives '(("melpa" . "[http://melpa.org/packages/](http://melpa.org/packages/)")
("gnu" . "[http://elpa.gnu.org/packages/](http://elpa.gnu.org/packages/)")))
(use-package rustic)
thatonelutenist · 2022-11-16 17:33
You'll want to run your `setq rustic....` after you've got the package loaded, and by default `use-package` [does not ensure that the package is actually installed](https://github.com/jwiegley/use-package#package-installation), you'll want something like:
(use-package rustic
:ensure t
:config (setq rustic-lsp-client 'eglot)))
I highly recommend giving the [use-package readme](https://github.com/jwiegley/use-package#getting-started) a solid read through, there's some quirks in there, and far too many useful features for me to go over here.
TelcDunedain · 2022-11-16 17:40
Just guessing based on what you chose to post (its a config salad that's not really coherent), but you probably need to get a handle on what use-package is and how to get it working for you first?
https://github.com/jwiegley/use-package
You probably need a minimal working emacs base with say evil, use-package and some basics before you tackle the lsp-client and rust.
Maybe starting with doom emacs would be best if you don't want to tackle all that at the beginning.
https://github.com/doomemacs/doomemacs
Chaqua · 2022-11-16 18:15
I installed doom. But after enabling :lang (rust +lsp) it told me the same error. So I searched for it and thought that would fix it.
Chaqua · 2022-11-16 18:23
Yeah that didnt fix it... It should work with doom emacs too right?
thatonelutenist · 2022-11-16 18:30
Doom emacs does it's own thing for packaging, you'll want to read the doom docs for that, but you'll probably just want to use the doom emacs rust language module instead though it's `init.el` in your `.doom.d`
thatonelutenist · 2022-11-16 18:30
Did you run a `doom sync`?
Chaqua · 2022-11-16 18:31
Ye, always after I changed smth.
When I run doom sync it works without error. Also starts without err. When I open or save an .rs file it tells me the error
Chaqua · 2022-11-16 18:39
Yeah I know. I already turned it on but it gave me the same error. Thats why I tried what I tried. Its actually (rust +lsp). And when I remove the +lsp it doesnt work either.
thatonelutenist · 2022-11-16 18:45
Yeah you are going to have to provide us with a lot more information, preferably a complete .doom.d, the config snippits you posted in the OP don't make sense at all in the context of doom emacs, and we'll need to see them in context to figure out what's going on
Chaqua · 2022-11-16 19:15
I removed everything I added so I have stock config. The only thing I changed is, that I turned on (rust +lsp).