deoplete-rust icon indicating copy to clipboard operation
deoplete-rust copied to clipboard

Automatic racer binary and rust source path detection

Open MasonAsh opened this issue 8 years ago • 1 comments

I think that deoplete-rust should attempt to find the racer binary and rust source path if the user doesn't specify.

I used the something similar to the following in my vimrc to do that:

if executable('racer')
  let g:deoplete#sources#rust#racer_binary = systemlist('which racer')[0]
endif

if executable('rustc')
    " if src installed via rustup, we can get it by running 
    " rustc --print sysroot then appending the rest of the path
    let rustc_root = systemlist('rustc --print sysroot')[0]
    let rustc_src_dir = rustc_root . '/lib/rustlib/src/rust/src'
    if isdirectory(rustc_src_dir)
        let g:deoplete#sources#rust#rust_source_path = rustc_src_dir
    endif
endif

I'm not sure if this project is actively maintained (last commit July 18?)

I could try to make a PR if you wish

MasonAsh avatar Oct 02 '17 00:10 MasonAsh

This would be nice in theory, but spawning a program at startup would significantly slow down start up time I think.

frankier avatar Mar 03 '18 10:03 frankier