Closed RalfJung closed 3 years ago
Can you try setting rust-analyzer.cargo.runBuildScripts
to false?
I did that, then reloaded the window, but behavior is still as described above.
@RalfJung you want
{
"rust-analyzer.cargo.runBuildScripts": false,
"rust-analyzer.procMacro.enable": false,
}
If you don't disable proc macros, we'll still run build scripts. The error message will be marginally better with #8670.
The UX about settings is unfriendly ( Part of the problem is that VS Code doesn't allow us to distinguish unset settings...
Yes, that does get rid of the error, thanks. :)
Is it expected that these features break when used in the rustc compiler workspace?
Yes at the moment. This features require tight integration with the build system. At the moment this is hard-coded to cargo check --workspace
, which fails for me in the rustc repo. There's a desire to make that configurable, so that one can plug ./x.py check
there, but we haven't done that yet.
(also, to give some more context -- rust-analyzer was in this partially-error state since we enabled proc macros by deafult a while ago. What changed is that we now actually report this error as bad good as we can :)
To reproduce this problem, open the rustc repository in vsocde with rust-analyzer installed. After some time the "rust-analyzer" text in the status bar at the bottom turns into a barely readable dark-gray-on-blue with a warning triangle in front of it. Hovering that item shows "cargo check failed" followed by some cargo output ending in "...". No error is visible in that text (I did not find a way to copy-paste all that text). Running
./x.py check
on the same code works just fine.I have no idea what this "error state" means, though...
My workspace settings JSON to make RA work on rustc looks as follows:
"Rust Analyzer Client" output says