Vscode-rust: RLS hangs with "[building]" status, without error message

Created on 10 Sep 2018  路  11Comments  路  Source: rust-lang/vscode-rust

When I open my project, RLS hangs in the "[building]" state without any error message.

RLS screenshot

I tried setting "rust-client.logToFile": true, but the log files it creates are completely empty.

The RLS components are installed and up-to-date:

$ rustup component add rls-preview rust-src rust-analysis
info: component 'rls-preview' for target 'x86_64-apple-darwin' is up to date
info: component 'rust-src' is up to date
info: component 'rust-analysis' for target 'x86_64-apple-darwin' is up to date

The active toolchain, according to rust show, is nightly-2018-08-31-x86_64-apple-darwin.

I'd like to give you a more useful bug report, but I'm not sure how to even debug the issue. Do you have any suggestions as to how to figure out what's causing RLS to hang?

Most helpful comment

Hi,

I had similar issue on Windows with VS Code 1.27.2 for the last 2 weeks. I think I finally managed to fix it. Here are the steps I have taken:

  1. Uninstalled rust extension,
  2. Removed all the VS Code caches,
  3. Killed all the hanging rls processes,
  4. Run rustup update
  5. Run cargo clean in all the projects I was having this issue with

After that the issue seems to be gone, at least for the last couple hours. This also made the autocompletion a lot more reliable.

Hope that helps.

All 11 comments

Hi,

I had similar issue on Windows with VS Code 1.27.2 for the last 2 weeks. I think I finally managed to fix it. Here are the steps I have taken:

  1. Uninstalled rust extension,
  2. Removed all the VS Code caches,
  3. Killed all the hanging rls processes,
  4. Run rustup update
  5. Run cargo clean in all the projects I was having this issue with

After that the issue seems to be gone, at least for the last couple hours. This also made the autocompletion a lot more reliable.

Hope that helps.

@joliss could you try running cargo clean and rustup update on the command line and see if there is still a problem? If there is could you let me know which project you're working on please?

Thank you, cargo clean and rustup update fixed it for me.

I wish there was better error reporting when things go wrong, but perhaps this is an issue on RLS's side.

I'll just go ahead and close this issue then.

I ran into this after updating Rust to 1.31.0. Here's what fixed it for me:

  1. Close Visual Studio Code
  2. Kill all hanging rls processes (there were a lot of them)
  3. Run cargo clean
  4. Start Visual Studio Code again

Quit vscode and run killall rls fixes the issue for me. Just wondering, since this seems to be a common issue, would it make sense for the rls plugin to detect such situation (e.g. multiple running or not responding rls instances)?

Thanks for this. Old processes were indeed the issue for me as well. I agree with @rlei that for many users, 'killall' and similar commands may feel a bit intimidating.

Thanks for the solution. It works well for me.

This shouldn't be closed, since manual workaround is not a fix.

Why this issue have been closed since no fix has been implemented?!

rm -rf ~/.cargo/.package-cache 

I hope rls can display some information in the OUTPUT tab of vscode or console.
If you only show things like "RLS: Buildings", we won鈥檛 be able to determine what will happen
Who knows what we have to wait for

Was this page helpful?
0 / 5 - 0 ratings