Error: rust-analyzer failed to discover workspace

It looks something is wrong with rust-analyzer and/or QtCreator.


First attempt

I installed it via: rustup component add rust-analyzer, and then tried adding rust-analyzer in QtCreator with the following options:

  • Initialisation options: empty
  • Executable: rustup
  • Arguments: run stable rust-analyzer

Then I opened an .rs file from a workspace that looks like this:

.
├── Cargo.lock
├── Cargo.toml
├── sensors
│   ├── Cargo.toml
│   └── src
│       ├── DS18B20.rs
│       └── lib.rs
└── thermo
    ├── Cargo.toml
    └── src
        ├── jwt_updater.rs 
        ├── lib.rs
        ├── main.rs
        ├── sensor_poller.rs
        ├── sensors_poller.rs
        └── sink.rs

and got this error in the output:

LanguageClient Rust: Error: rust-analyzer failed to discover workspace
LanguageClient Rust: The command "rustup run stable rust-analyzer" terminated with exit code 101

Second attempt

This time I tried to specify a path to workspace's Cago.toml:

  • Initialisation options: { "linkedProjects": ["/home/dimanne/devel/raspberrypi/thermo_rust/Cargo.toml"] }
    • (I am not sure this the correct option to set, to be honest)

but it resulted in:

LanguageClient Rust: The command "/home/dimanne/.cargo/bin/rustup run stable rust-analyzer" terminated with exit code 101

(it stopped saying that it could not find workspace, it just exiting)

Does anyone have ideas of what I could be missing?

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.