Hi, I'm try to configure the rust-analyzer
extension to work with VSCode, but I'm running into a rust-analyzer failed to discover workspace
error. I am on Windows 10, attempting a simple "hello world" project. rustc main.rs
works and compiles, program runs. I'm new to Rust; so maybe I'm missing something...
I've made sure rust-src
is installed (it was not installed automatically with the extension):
$ rustup component list
cargo-x86_64-pc-windows-msvc (installed)
clippy-x86_64-pc-windows-msvc (installed)
llvm-tools-preview-x86_64-pc-windows-msvc
rls-x86_64-pc-windows-msvc
rust-analysis-x86_64-pc-windows-msvc
rust-docs-x86_64-pc-windows-msvc (installed)
rust-src (installed)
...
I have tried on both "stable" and "nightly" update channels:
rust-analyzer version: 2020-08-17 (0b2b9a5)
rust-analyzer version: nightly (7d95a84)
I have configured the following recommended debugging settings:
"rust-analyzer.trace.extension": true,
"rust-analyzer.trace.server": "verbose",
as well as configuring RA_LOG=info
in the environment.
Trying to run Status
results in:
Command 'Rust Analyzer: Status' resulted in an error (cannot open rust-analyzer-status://status. Detail: Rust Analyzer is still loading...)
Output > Rust Analyzer Language Server
does not show up in the output panel, despite the environment variable being set (I'm assuming because RA isn't starting.)
Server Trace
is hammering the output window with tons of:
[Trace - 3:02:44 AM] Received response 'rust-analyzer/inlayHints - (142)' in 0ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 3:02:45 AM] Sending request 'rust-analyzer/inlayHints - (143)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/coryr/source/repos/rust-hello-world/main.rs"
}
}
Client
output window is peppered with tons of:
WARN [8/18/2020, 3:00:53 AM]: LSP request timed out {
method: 'rust-analyzer/inlayHints',
param: {
textDocument: {
uri: 'file:///c%3A/Users/coryr/source/repos/rust-hello-world/main.rs'
}
},
error: [ResponseError: Rust Analyzer is still loading...
at handleResponse (c:\Users\coryr\.vscode\extensions\matklad.rust-analyzer-0.2.281\out\src\main.js:3413:48)
at processMessageQueue (c:\Users\coryr\.vscode\extensions\matklad.rust-analyzer-0.2.281\out\src\main.js:3238:17)
at Immediate.<anonymous> (c:\Users\coryr\.vscode\extensions\matklad.rust-analyzer-0.2.281\out\src\main.js:3222:13)
at processImmediate (internal/timers.js:439:21)] {
code: -32801,
data: undefined
}
}
I've reinstalled the entire toolchain/rust-analyzer from scratch twice now; so I'm a little lost. Halp? Is there anything else useful to set for debugging? I've seen mentions of 100% CPU usage bringing RA down, but I've also confirmed that is not the case for me.
Edit: here's an entire startup output from Server Trace
.