[VSCODE][Rust analyzer] Rust server is stuck on Starting : cyclic dependency error


The rust server is stuck on the "Starting" stage in VSCode. Rust-analyzer output show the following error message :

[ERROR ra_project_model] cyclic dependency diesel_derives -> diesel

  • Project / Workspace : Diesel
  • rustc 1.40.0 (73528e339 2019-12-16)
  • VSCode 1.47.3
  • WSL Ubuntu 18.04 - Linux home 4.4.0-18362-Microsoft #836-Microsoft Mon May 05 16:04:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux

Also, Rust-analyzer consumes 80% of CPU (with 3 processes) in starting stage, and 60% when the rust server is stopped (the processes aren't killed?).

How can I fix this error? It seems to explain why the Rust server doesn't start. Please note that it works with RLS.

For some reason, using directly the rust-analyzer extension and not the Rust one (with the engine configured with rust-analyzer) seems to work.

Do you have any information about that?

rust-lang.rust extension does not fully support rust-analyzer at the moment. We will fix that soon-ish, but for the time being the recommended way to use rust-analyzer is via matklad.rust-analyzer extension.

1 Like

Ok, thank you.

I don't know if the features listed here are ready for workspace? I'm experiencing some issues and I don't know if it's directly related to the use of the rust-analyzer extension or it's not ready for workspaces.

Apparently the extension is loaded, I can see the outputs from the server and from the client. I still have this error [ERROR ra_project_model] cyclic dependency diesel_derives -> diesel but I don't know if it's a blocking one.

I still have my CPU heavily (> 60%) used by rust-analyzer-linux but the main features aren't available : code completion, goto implem/definition, ...

Do I need to open an issue on the main repository?

Looking to the server logs, when killing a process, I can see these logs :

ERROR ra_project_model] cyclic dependency diesel_derives -> diesel
[Info  - 11:40:43 PM] Connection to server got closed. Server will restart.
[ERROR ra_project_model] cyclic dependency diesel_derives -> diesel

Apparently processes aren't killed / duplicated when I shutdown / start VSCode (or the rust-analyzer extension). I don't know if it's related to the error / to the workspace that needs more process. And for now it doesn't explain why the features aren't working.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.