My remote server environment is Windows.
After installing rust-analyzer in Visual Studio Code, I tried to use the plugin to generate Run test
commands in the code.
However, I encountered an error similar to the following:
Executing task: d:\path\to\projectA\cargo test --package projectA --bin projectA -- logic::test::tests::test_a_func --exact --nocapture
The terminal process failed to launch: Path to shell executable "d:\path\to\projectA\cargo" does not exist.
the d:\path\to\projectA\
was generated by cargo new projectA
.
and when I change to projectB
, do the same thing, I also encountered the similar error, but the path just change to projectB
:
Executing task: d:\path\to\projectB\cargo test --package projectB --bin projectB -- logic::test::tests::test_b_func --exact --nocapture
The terminal process failed to launch: Path to shell executable "d:\path\to\projectB\cargo" does not exist.
I have already made the following settings in VSCode, but didn't work:
{
"rust-analyzer.server.extraEnv": {
"RUSTUP_HOME": "C:/Users/name/.rustup",
"CARGO_HOME": "C:/Users/name/.cargo",
},
"terminal.integrated.defaultProfile.windows": "Windows PowerShell",
"rust-analyzer.runnableEnv": {
"PATH": "C:/Users/name/.cargo/bin"
},
}
Can I configure rust-analyzer to use the specific C:/Users/name/.cargo/bin/cargo.exe
file?
Or have any other solution?