-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a cargo checker for syntastic #132
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Hey @rhys-vdw, thanks for giving a try !
|
I had done a totally fresh rustup install in case that was the issue. I'm on:
Also I went into my bundles and confirmed that |
Hmmm, can you change your toolchain to nightly by runing I think it will do the job, now cargo is Actually |
Thanks @jlevesy. Working nicely! I can now see let g:syntastic_rust_checkers = ['cargo'] |
I'm using this new checker locally and it's working really well. One thing I'd really like is if syntastic somehow automatically switched to the correct checker (rustc for single rust files, cargo for projects with a Cargo.toml) but that might be out of scope. Anyway, this checker is good to go! |
Doesn't work for me. I get no errors and no reported problems with https://github.com/mckinnsb/rust.vim/blob/master/syntax_checkers/rust/cargo.vim This one works perfectly fine for me though. |
👍 Should also work with stable Rust as of Rust 1.16 |
Why isn't this merged yet? |
Sorry, I was away from my computer for a few months... @hasufell, can you give me your rustc, cargo, vim and Syntastic versions please ? |
\ '%C %#--> %f:%l:%c' | ||
|
||
return SyntasticMake({ | ||
\ 'makeprg': makeprg, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlevesy apparently, 'cwd': expand('%:p:h')
here is what solved the problem for @hasufell (taken from https://github.com/mckinnsb/rust.vim/blob/master/syntax_checkers/rust/cargo.vim#L40).
The current version doesn't work if you open a file from outside of the project it resides, because:
cargo check
needs to be called within the project,- but Syntastic inherits vim environment when
SyntasticMake
is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, thank you for the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that works
This seems like a great patch! It's essential to any Vim user actually -- the |
What prevents this from being merged? Anything we can do to help? The rustc checker is useless for cargo-based projects and I would expect that to be the overwhelming majority of projects? |
so, I've been kinda paralyzed. However, it seems this does work for lots of people, so I'm just going to merge it, and if it breaks stuff, well, people can send in new PRs to fix them. Sorry to everyone in this thread for not taking this on sooner, as I've said elsewhere, if people want to help maintain |
Hi there !
As cargo check has been merged in cargo (see rust-lang/cargo#3296), and the current rustc checker is facing some issues with external crates (see #130), I gave a try implementing a cargo checker for syntastic.
And here is the result. Please note it is my first time writing a syntastic checker, and I'm relatively new to the rust ecosystem, consequently I might have made mistakes, so any feedback will be greatly appreciated !
It currently works with cargo 0.16.0 nightly.
Thanks !