deoplete-rust
deoplete-rust copied to clipboard
Automatic racer binary and rust source path detection
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
This would be nice in theory, but spawning a program at startup would significantly slow down start up time I think.