I'm using Visual Studio 2015 v14 with VisualRust 0.1.2
Under Tools -> Options -> Text Editor -> Visual Rust
statement completion is greyed out and cannot be enabled.
Under Tools -> Options -> Visual Rust
I have selected Use bundled racer
and Read rust sources from environment variable
The racer that came bundled with VisualRust works correctly when called manually, that is racer-120e98b.exe complete std::io::
returns the relevant results.
In Visual Studio, writing let e = std::io::
and then pressing CTRL + Space
to trigger autocompletion will only return a list of the reserved keywords (such as if, while, struct, etc).
I'm guessing that the problem is that statement completion can't be turned on. How do I solve this?
I run Visual Studio 2015 Community, and this is how I did it:
Download the racer and the rust sources via
cargo install racer
rustup component add rust-src
However, the RUST_SRC_PATH
variable is not yet set, and I do not know who is supposed to set it. The following batch script will set the variable to its correct value, see this issue on github.
@ECHO OFF
FOR /F "tokens=* USEBACKQ" %%P IN (`rustc --print sysroot`) DO SET RS=%%P
SETX RUST_SRC_PATH "%RS%\lib\rustlib\src\rust\src"
After this, I still had to specify the path to racer.exe
manually instead of the Use bundled racer
option. By default, you can find it here:
%USERPROFILE%\.cargo\bin\racer.exe
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With