I installed rust-analyzer followingdocs/user/README.md, but when opening any folder or adding it to workspace, it fails with the following error: rust-analyzer failed to load workspace: No such file or directory (os error 2) and with information: ...
Failed to load workspaces. 可见Rust-Analyzer是想要找到Cargo.toml但是具体是怎么找就不知道了. 这时候我们只需要切换到具体的工程文件就行了,比如我这里是~/App/rCore-Tutorial-Code-2024S,我就通过SSH,进行切换. 直接选择打开刚刚路径的工程文件即可. 这时候就没有报错了:...
(os error 30) rust-analyzer failed to load workspace: Failed to read Cargo metadata for Rust sources: Failed to run `cargo metadata --manifest-path /home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.toml`: `cargo metadata` exited with an error: Updating ...
在过去18天里,我们已经用rustup,VS Code 和 rust-analyzer设置好了环境。我们度过了作为 Rust 新手开发者的艰难时刻,并学习了应该依赖那些箱(crate)。 现在是时候建立一个真正的项目了。 创建工作空间 并不是一定要用 Cargo 的工作空间(workspaces),但我建议用它。就像 node.js 一样,当把应用逻辑拆分为更小的...
[ERROR rust_analyzer::reload] failed to switch workspaces: rust-analyzer failed to load workspace:remind-me/Cargo.toml`: `cargo metadata` exited with an error: Updating crates.io index error: failed to select我试着在网上寻找答案,但还没有找到成功的答案,我不知道下一步还能尝试什么。cargo metada...
ws_to_crate_graph () #6 0x00005b6b116a5aaf in rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::recreate_crate_graph () #7 0x00005b6b116a4f80 in rust_analyzer::reload::<impl rust_analyzer::global_state::GlobalState>::switch_workspaces () #8 0x00005b6b116...
ShowMessage::METHOD.to_string(), ShowMessageParams { typ: MessageType::WARNING, message: e.to_string() }, ); connection.sender.send(lsp_server::Message::Notification(not)).unwrap(); } }let server_capabilities = rust_analyzer::server_capabilities(&config);@...
(discovered via `rustc --print sysroot`) try installing the Rust source the same way you installed rustc)] [INFO rust_analyzer::reload] will switch workspaces cause=fetched workspace [ERROR rust_analyzer::lsp_utils] rust-analyzer failed to load workspace: Failed to find sysroot for Cargo....
That being said, I don't see why there can't be Cargo-style hierarchal configs with rust-project.json—I know some teams would want to set their own settings. When trying to add support for loading the build command to rust-analyzer yesterday, I found I could make the change to load ...
In a workspace with multiple crates, where some have a feature of a certain name but others don't, you may want to set "rust-analyzer.cargo.features": ["feature-name"] to have feature-gated code benefit from rust-analyzer's functionality. However, with that setting, when trying to use...