Answer the question
In order to leave comments, you need to log in
How to specify racer path for vs code?
I don’t understand anything, I decided to try a new language for myself (the experience was only in C, C ++, C #) and I sat in vs. My choice fell on rust. Installed rast, realized that I needed to write code somewhere, debug, etc. I took vs code and instructions and ran into the sediment, not understanding almost anything. I do everything almost by guesswork.
Unclear:
Add RUST_SRC_PATH environment variable
Executing "cargo install racer"
Executing "cargo install rustfmt"
Executing "cargo install rustsym"
Updating registry ` https://github.com/rust-lang/crates.io-index`
Blocking waiting for file lock on the registry index
Blocking waiting for file lock on the registry index
Updating registry ` https://github.com/rust-lang/crates.io-index`
Blocking waiting for file lock on the registry index
Updating registry ` https://github.com/rust- lang/crates.io-index`
Blocking waiting for file lock on the registry index
Blocking waiting for file lock on crate metadata
error: binary `racer.exe` already exists in destination as part of `racer v1.2.10`
Add --force to overwrite
error: binary `cargo-fmt.exe` already exists in destination as part of `rustfmt v0.6.2`
binary `rustfmt.exe` already exists in destination as part of `rustfmt v0.6.2`
Add --force to overwrite
error: binary `rustsym.exe` already exists in destination as part of `rustsym v0.3.1`
Add --force to overwrite
Answer the question
In order to leave comments, you need to log in
The easiest way to install rust is through rustup ( https://www.rustup.rs). It will install both rust and cargo and update them (via "rustup update", https://github.com/rust-lang-nursery/rustup.rs). We write the path to cargo / bin in PATH, although rustup itself can register it.
As for VSCode, you need to install the Rusty Code extension.
Next, install racer (for autocompletion), rustfmt (formats code when saving a file, https://github.com/rust-lang-nursery/rustfmt) , rustsym (for go to sym, https://github.com/trixnz /rustsym) , cargo-check (when saving the file, it will compile it on the fly and issue error messages in the VSCode console, https://github.com/rsolomo/cargo-check).It is better to install via the "cargo install" command, it's more convenient.
Those. in the console, simply execute the commands:
cargo install rustfmt
cargo install racer
cargo install rustsym
cargo install cargo-check
This will install everything in the cargo/bin directory, where we already have a path in PATH and therefore VSCode will easily find them.
I also install cargo install cargo-edit ( https://github.com/killercup/cargo-edit) , then crates in Cargo.toml for my projects can not be manually registered ( doc.crates.io/guide.html) , but "cargo add" command.
For racer, you need to set the RUST_SRC_PATH environment variable, specifying the path to the separately downloaded and unpacked rust sources (src subdirectory).
PS: You get errors because cargo install tries to install programs, and the binaries are already in the specified paths. You just need to manually remove them, or call the appropriate commands "cargo install --force ..." to update the binaries.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question