I am an a-bit-futher-than-newbie Arch Linux user... I have been working with this setup (emacs + rustic + rust-analyzer + lsp-ui et cetera with settings like in here https://robert.kra.hn/posts/rust-emacs-setup/) for a month now. Yesterday I tried to install anki package from AUR, but after building it wouldn't make it to life, so i removed the whole thing using sudo pacman -Rs anki, because it installs a lot of stuff with it (including rust platform for some reason), and it seems that after all of these manipulations rust platform stopped working with emacs... Today I've tried using things like rustup component add rustc and rustup component remove/add rust-analyzer and so on... it actually reinstalled some stuff, but helped not much. So any suggestions are welcome :(
Here some logs from when i start any default project (generated via cargo new --bin):
[yas] Prepared just-in-time loading of snippets successfully.
Loading /home/geo/.emacs.d/custom.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
C-<mouse-1> is undefined
Making completion list... [2 times]
LSP :: Connected to [rust-analyzer:9205/starting]. [2 times]
LSP :: rust-analyzer:9205 initialized successfully in folders: (/home/geo)
LSP :: rust-analyzer failed to discover workspace
I am afraid of line saying that rust analyzer is opened in /home/geo folder, but maybe that's just I am...
Here is my full config: https://github.com/geothecode/save/blob/laptop/.emacs.d/init.el
Before: everything was working fine, no errors, no specific warnings - just fine; I had all kind of support from the lsp needed, lsp-ui was working (but now stopped showing up).
The solution posted by Rorschach in a comment worked for me:
rust-analyzer should init in your project folder- (1) remove the wrong workspaces (eg. /home/geo) with lsp-workspace-folders-remove, (2) make sure lsp-auto-guess-root is nil, (3) and open a rust file in your project to interactively set the correct workspace root*
Shortly:
- lsp-workspace-folders-remove
- set lsp-auto-guess-root to nil
- open your project's rust file