racer: racer does not complete crate from cargo

my env:

mac osx ---- 10.11.5 rustc --version ---- rustc 1.10.0-nightly (476fe6eef 2016-05-21) cargo --version ---- cargo 0.11.0-nightly (259324c 2016-05-20) racer --version ---- racer 1.2.10 rustup --version ---- rustup 0.1.12 (c6e430a 2016-05-12)

echo $CARGO_HOME
/Users/zyanho/.cargo
echo $RUST_SRC_PATH
/Users/zyanho/code/rust/rustc-nightly/src
racer complete std::time
MATCH time,1,0,/Users/zyanho/code/rust/rustc-nightly/src/libstd/time/mod.rs,Module,/Users/zyanho/code/rust/rustc-nightly/src/libstd/time/mod.rs
MATCH time,1,0,/Users/zyanho/code/rust/rustc-nightly/src/libstd/time/mod.rs,Module,/Users/zyanho/code/rust/rustc-nightly/src/libstd/time/mod.rs
ls ~/.cargo/registry/index/github.com-1ecc6299db9ec823/ir/on/iron
/Users/zyanho/.cargo/registry/index/github.com-1ecc6299db9ec823/ir/on/iron
racer complete iron:: 
show noting

thanks for help

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 21
  • Comments: 56

Most upvoted comments

This is one of the biggest issues I have working with Rust from Emacs. Lack of completion for third-party libraries makes it much more painful to use many of them than it should be.

Can anyone provide a good starting point for how one could debug/fix this issue? It seems that the relevant code is somewhere in nameres.rs/cargo.rs (or the interaction between them), but I haven’t found a good way to reliably test changes as I make them.

I had an issue where racer did not work at all for nightly for crates from within emacs until I set an environment variable. Racer did work for me on stable in emacs without having to do anything special.

To fix the issue, I set the CARGO_HOME environment variable to something like C:\users\David\.cargo

I found the fix by googling for the issue and came across people with similar issues and solutions in this thread on reddit: https://www.reddit.com/r/rust/comments/50w0q2/racer_not_autocompleting_on_with_third_party/

I am using rustup.

my environment is as follows: system: Windows 10 64bit rust toolchain: nightly-x86_64-pc-windows-msvc

RUST_BACKTRACE=1 CARGO_HOME=~/.cargo RUST_LOG=debug racer complete iron
DEBUG:racer::nameres: do_file_search iron
DEBUG:racer::nameres: do_file_search srcpaths ~/code/rust/rustc-nightly/src
DEBUG:racer::nameres: do_file_search v is ["~/code/rust/rustc-nightly/src", "."]

it seem not search in ~/.cargo/registry/src/