Rust with gvim on windows


#1

I couldn’t find any help online, so I try my luck here even though the problem is only partially related to rust. I have been trying to setup gvim on windows to support autocomplete for rust. I have tried both racer and YouCompleteMe. However, they both only show me suggestions for anything that I have already written in the file (omni complete?). What I am looking for are suggestions for things in the rust libraries. I would like to get some options rather than having to google everything.

e.g.
use std::fs::File;
let mut f = try!(File::open(“log.txt”));
f._____ // this should invoke autocomplete

I hope that makes sense. Did anyone here successfully setup gvim to do this?

Some info:
I have gvim 7.4
I did set all the environ variables necessary (as far as I can tell)
YouCompleteMe seams more bloated than what I need for now. I would prefer racer.

If anyone has a tip how to get autocomplete in gvim please let me know. Or if I should use another tool. Maybe rust 1.9 is not supported by racer or YouCompleteMe?


#2

I just figured it out. In case someone else stumbles upon the same problem here is what I needed to do (somewhat obvious in hindsight). I installed rust with the msi installer. However, for racer to work, you need the source… You can download the source from the same location as the msi. Just place it somewhere and adjust the environment variable RUST_SRC_PATH as described in the configuration section from the readme from racer. You will also need to adjust your vimrc. For the vim integration you need vim-racer. Just follow the link on the readme page and then follow the instructions for vim-racer.