1 Star 0 Fork 0

programmerMonkey / racer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Racer - code completion for Rust

Build Status Build status

racer completion screenshot

racer eldoc screenshot

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.

Installation

NOTE From 2.1, racer needs nightly rust

Requirements

Current nightly Rust

If you're using rustup, run

rustup toolchain add nightly

Cargo

Internally, racer calls cargo as a CLI tool, so please make sure cargo is installed

With cargo install

Simply run:

cargo +nightly install racer

As mentioned in the command output, don't forget to add the installation directory to your PATH.

From sources

  1. Clone the repository: git clone https://github.com/racer-rust/racer.git

  2. cd racer; cargo +nightly build --release. The binary will now be in ./target/release/racer

  3. Add the binary to your PATH. This can be done by moving it to a directory already in your PATH (i.e. /usr/local/bin) or by adding the ./target/release/ directory to your PATH

Configuration

  1. Fetch the Rust sourcecode

    1. automatically via rustup and run rustup component add rust-src in 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 rustup update.

    2. manually from git: https://github.com/rust-lang/rust

    Note

    If you want to use racer with multiple release channels (Rust has 3 release channels: stable, beta and 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

  2. (Optional) Set RUST_SRC_PATH environment variable to point to the 'src' dir in the Rust source installation e.g. % export RUST_SRC_PATH=/usr/local/src/rust/src or % export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"

    It's recommended to set RUST_SRC_PATH for speed up, but racer detects it automatically if you don't set it.

  3. Test on the command line:

    racer complete std::io::B (should show some completions)

Note

To complete names in external crates, Racer needs Cargo.lock. So, when you add a dependency in your Cargo.toml, you have to run a build command such as cargo build or cargo test, to get completions.

Editors/IDEs Supported

RLS

Racer is used as a static library in RLS

Eclipse integration

Racer can be used with Eclipse through the use of RustDT. (User guide is linked in repo description)

Emacs integration

Emacs integration has been moved to a separate project: emacs-racer.

Gedit integration

Gedit integration can be found here.

Builder integration

Gnome Builder integration can be found here

Kate integration

The Kate community maintains a plugin. It is bundled with recent releases of Kate (tested with 16.08 - read more here).

  1. Enable 'Rust code completion' in the plugin list in the Kate config dialog;

  2. On the new 'Rust code completion' dialog page, make sure 'Racer command' and 'Rust source tree location' are set correctly.

Sublime Text integration

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

Vim integration has been moved to a separate project: vim-racer.

Visual Studio Code extension

Racer recommends the official Rust (rls) extension based on RLS, which uses Racer for completion.

Atom integration

You can find the racer package for Atom here

Kakoune integration

Kakoune comes with a builtin integration for racer auto completion.

Copyright (c) 2014 Phil Dawes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

rust的调试器 展开 收起
Rust
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Rust
1
https://gitee.com/programermonkey/racer.git
git@gitee.com:programermonkey/racer.git
programermonkey
racer
racer
master

搜索帮助