Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Automatic racer binary and rust source path detection #13

Open
MasonAsh opened this issue Oct 2, 2017 · 1 comment
Open

Automatic racer binary and rust source path detection #13

MasonAsh opened this issue Oct 2, 2017 · 1 comment

Comments

@MasonAsh
Copy link

MasonAsh commented Oct 2, 2017

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

@frankier
Copy link

frankier commented Mar 3, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants