-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust-analyzer not working in vscode #4894
Comments
Try the rust-analyzer extension. The rust-analyzer support in the official Rust extension is prematurely as far as I am aware. |
Already tried that. |
Can you post the logs for the rust-analyzer extension? (output pane and then "Rust Analyzer Language Server") |
I just detected that it's working fine for a project but not for another, what should I check? I haven't changed anything as far as I remember. |
For which project does it not work? Is there a |
|
Sorry, this not fixed the issue, I was still looking the other project.
Yes, there's a https://gist.github.com/Edu4rdSHL/763a4f0774af6bf32257d83f5de1c720 |
Does |
Yes, this work:
Same happens calling a nonexistent field inside a struct, rust-analyzer == no errors, cargo check:
Edit:
I don't use any cargo features. |
Moving the same src and Cargo.* files to another new folder works... weird thing, I will just move this. |
I have the same issue when upgrading rust analyzer. I think there is some incompatibility in database files between versions. only 'cargo clean' helps |
Rust-analyzer currently doesn't persist anything on the disk. |
Yep, |
I am having the same issue that Rust Analyzer does not work for me at all. I use Cargo to create a project but while writing code in main.rs I don't get any help from Rust Analyzer. No code completion no hints nothing. Any help to make this work is greatly appreciated |
I have the same issue: it works in |
For some reason, the config for pointing to the server seems to be failing on fresh installs. I was able to fix mine by finding the path to my You will need to look in your
|
One another thing you might need to check is that, |
This issue has been fixed a long time ago, if you have problems please use another issue. I'm unsubscribing from it. |
It's a bit strange because I would expect at least having child folders. It seems it can be worked around by creating a VsCode Workspace with the exact same folders, then rust-analyser seems to find the nested Cargo.toml... |
I was using rustlings. |
|
|
It only works when your working top dir in vs code is the project though, so I have to do |
If you're at your wits end and nothing else is working, try deleting your (I had a messed up setting and I didn't know it) |
if you're having trouble to get rust-analyzer to detect a file that's directly horizontal to |
it isn't even working on |
Had the same issue, I had 2 rust workspaces in my project, one of them in the root and the other in a sub-directory. It was working for both workspaces but for the workspace in the sub-directory, it was only working for a few packages which was a weird behaviour. Adding this to my {
"rust-analyzer.linkedProjects": [
"./Cargo.toml",
"packages/data/challenge/Cargo.toml"
]
} |
For anyone else, you have to open root directory in VS, not file. |
This will be change in the future: #17537 |
I've used cargo clean. Im in the root directory. I have this issue where it fails to emit diagnostics only for examples. Library code works as expected. I tried to make a minimal example, but this minimal example works as expected. so im not sure whats unique about this non working repo |
Hello, I'm having the problem that rust-analyzer doesn't show errors regarding to nonexistent or wrong typed variables, bad number of function parameters and more, while RLS works fine. Tried with the @matklad rust-analyzer extension and the official Rust extension changing the engine to rust-analyzer, using one extension at time.
I also switched to nightly builds but nothing changed. How can I debug that? rust-analyzer was working but after an update just stopping working.
Edit: I also tried resetting all extensions settings to default regarding to rust-analyzer, nothing changed as well.
The text was updated successfully, but these errors were encountered: