-
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 VSCode plugin stuck while fetching #9384
Comments
Can you try |
Thanks @bjorn3 for the quick response.
No hang.
Nothing unusual there, I think. I tried killing those processes and restarting vscode, and I get the same 2 processes. |
I tried running
|
The rust-analyzer proc-macro process waits for commands from the main rust-analyzer process and then runs proc macros as requested. This prevents a proc macro from being able to bring down the whole rust-analyzer process. Can you attach a debugger to the main process and get a backtrace for all threads? ( |
Sure. Here's what I get:
|
It looks like maybe rust-analyzer is working correctly, but the VSCode plugin is not communicating with it for some reason? |
I face a similar issue since upgrading yesterday. The binary will not be downloaded and the directory |
One of the threads is trying to log information to stderr. I wonder if it is stuck there. (not sure if this thread being stuck can even cause this kind of hang) Can you get another backtrace to see if thread #4 is still trying to log to stderr? |
Hmm, it does seem to still be doing that:
|
Do you have |
I had
but removing them does not help I'm afraid. Capturing a backtrace when they are off gives me:
Note that thread 4 is not trying to log anymore. |
Btw, I also tried to bypass stderr logging by pointing the config to a small bash script which redirected stderr: #!/bin/bash
/home/arong/Downloads/rust-analyzer-x86_64-unknown-linux-gnu $@ 2>/tmp/analyzer_err.log Unfortunately, it did not help. With logging enabled, it does log a lot though. With logging disabled, the stderr file is completely empty. |
fwiw, the last entry of stderr when logging is enabled is:
So it seems like rust-analyzer does its job and finishes? After that, it doesn't log anything else. |
I tried to debug the vscode extension after cloning the |
Tried to isolate the extension which causes the issue and in my setup disabling |
Amazing. I also had ilspy installed! Disabling that plugin solved everything for me. It looks like ILSpy also had an update 1 day ago, so it might be that one which caused issues. Either way, there are some mysterious conflicts going on here. |
I wonder if this is related to icsharpcode/ilspy-vscode#75. |
@bjorn3 Possibly, though I didn't see any high cpu usage from that extension (or anything else) during my tests. |
This was probably a conflict with ILSpy, let's close it. |
I also encountered a similar problem, my solution is |
You saved me. I had this issue for some reason on my Windows where rust-analyzer was hanging on "fetching metadata". Deleting .package-cache was the solution. |
Rust-analyzer stopped working for me a few days ago. I think it was after upgrading to the latest plugin version.
Rust-analyzer shows: "Fetching" with a spinner indefinitely. Sometimes I have gotten it to show "Fetching: metadata".
I can replicate this in an empty project just after running
cargo init mytestproject
.I have tried these steps:
~/.cargo/registry
and~/.cargo/git
.rustup update
.analysis-stats
command, and it seems to work ok (except for some performance counters):I'm lost as to how to debug this further. Any suggestions about where to look would be helpful.
The text was updated successfully, but these errors were encountered: