rust-lang / rust.vim

Vim configuration for Rust.
Apache License 2.0
3.91k stars 297 forks source link

syntastic integration does not seem to work with workspaces #276

Open sdroege opened 6 years ago

sdroege commented 6 years ago

Running rust.vim on e.g. https://github.com/sdroege/gstreamer-rs and saving e.g. gstreamer/src/lib.rs will give a syntastic error:

syntastic: error: exception running system('cd /home/slomo/Projects/rust/gstreamer-rs/gstreamer && cargo check '): Vim(let):E484: Cannot open file /tmp/v4Hn0xR/5

Running cargo check in the workspace root or inside the gstreamer sub-crate works fine. I assume the latter is what should happen.

syntastic works fine on other crates that are not workspaces.

da-x commented 6 years ago

Hi!

Is this latest version of rust.vim on which system? I tried to reproduce the issue with gstreamer/src/lib.rs inside and https://github.com/sdroege/gstreamer-rs , however it seems to work fine. I've tested with Vim-Plug, using only Syntastic and rust.vim as plugins, on Vim 8.

sdroege commented 6 years ago

That's with latest rust.vim (git master as of today), vim 8.1, syntastic (git master as of today) and both installed in ~/.vim/bundle

da-x commented 6 years ago

It may be a problem unrelated to rust.vim: https://groups.google.com/forum/#!topic/vim_use/SOtvjCOr7_Q

sdroege commented 6 years ago

That mentions setting $TMPDIR to some other place but that has no effect for me. If e.g. it tries to use /tmp/v4Hn0xR/5 then /tmp/v4Hn0xR exists but there's not 5 in there.

Only syntastic on Rust workspaces has this problem for me, normal crates and other languages work fine

n3vu0r commented 4 years ago

I'm not getting any errors but vim/syntastic doesn't make use of the advantage of a workspace. When I open a source file it triggers cd my-home/my-workspace/my-crate && cargo check. I would expect it to do cd my-home/my-workspace && cargo check. Is this configurable?

n3vu0r commented 4 years ago

RTFM solved it for me:

 let g:rust_cargo_avoid_whole_workspace = 0

Not sure but this might be the better default.