31 stable releases
|2.1.5||Aug 27, 2018|
|2.1.3||Jul 29, 2018|
|2.0.13||Mar 20, 2018|
|2.0.12||Oct 31, 2017|
|0.0.1||Jan 14, 2015|
#8 in Command line utilities
34,259 downloads per month
Used in 2 crates (1 directly)
Racer - code completion for Rust
RACER = Rust Auto-Complete-er. A utility intended to provide Rust code completion for editors and IDEs. Maybe one day the 'er' bit will be exploring + refactoring or something.
NOTE From 2.1, racer needs nightly rust
If you're using rustup, run
rustup toolchain add nightly
From 2.1, racer depends on cargo, so you have to install its dependencies
- On Ubuntu run:
sudo apt install build-essential cmake pkg-config zlib1g-dev libssl-dev
- On Fedora run:
sudo dnf install make gcc cmake pkgconfig zlib-devel openssl-devel
- On Arch Linux run:
sudo pacman -S base-devel cmake zlib openssl
On Windows, you will need to have cmake installed.
It's a bit confusing and we're planning to remove this dependency in the future.
cargo +nightly install racer
As mentioned in the command output, don't forget to add the installation directory to your
Clone the repository:
git clone https://github.com/racer-rust/racer.git
cd racer; cargo +nightly build --release. The binary will now be in
Add the binary to your
PATH. This can be done by moving it to a directory already in your
/usr/local/bin) or by adding the
./target/release/directory to your
Fetch the Rust sourcecode
automatically via rustup and run
rustup component add rust-srcin order to install the source to
$(rustc --print sysroot)/lib/rustlib/src/rust/src. Rustup will keep the sources in sync with the toolchain if you run
manually from git: https://github.com/rust-lang/rust
If you want to use
racerwith multiple release channels (Rust has 3 release channels:
nightly), you have to also download Rust source code for each release channel you install.
e.g. (rustup case) Add a nightly toolchain build and install nightly sources too
rustup toolchain add nightly
rustup component add rust-src
RUST_SRC_PATHenvironment variable to point to the 'src' dir in the Rust source installation e.g.
% export RUST_SRC_PATH=/usr/local/src/rust/srcor
% export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
It's recommended to set
RUST_SRC_PATHfor speed up, but racer detects it automatically if you don't set it.
Test on the command line:
racer complete std::io::B(should show some completions)
To complete names in external crates, Racer needs
So, when you add a dependency in your
Cargo.toml, you have to run a build command
cargo build or
cargo test, to get completions.
Racer is used as a static library in RLS
Emacs integration has been moved to a separate project: emacs-racer.
Gedit integration can be found here.
Gnome Builder integration can be found here
Enable 'Rust code completion' in the plugin list in the Kate config dialog;
On the new 'Rust code completion' dialog page, make sure 'Racer command' and 'Rust source tree location' are set correctly.
The Sublime Text community maintains some packages that integrates Racer
- RustAutoComplete that offers auto completion and goto definition.
- AnacondaRUST from the anaconda plugins family that offers auto completion, goto definition and show documentation
Vim integration has been moved to a separate project: vim-racer.
You can find the racer package for Atom here
Kakoune comes with a builtin integration for racer auto completion.