Skip to content

Add a Syntastic plugin for Rust. #14924

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

Closed
wants to merge 1 commit into from

Conversation

BurntSushi
Copy link
Member

This plugin used to be in the Syntastic tree, but it was removed. I'm hoping it can find its new home here.

cc @chris-morgan @kballard @wting

@lilyball
Copy link
Contributor

LGTM. I'll r+ it if others agree.

@BurntSushi
Copy link
Member Author

FYI, I've added the rust file type as pointed out by @lcd047.

@thehydroimpulse
Copy link
Contributor

+1 Thanks for doing this!

BurntSushi referenced this pull request in vim-syntastic/syntastic Jun 16, 2014
Between #947, #1114, and #1112, this checker is too controversial to
maintain in syntastic.  Please consider using it as an external checker
if you need it:

https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide#external
@chris-morgan
Copy link
Member

@BurntSushi Does putting the syntastic_extra_filetypes option inside the file actually work? I wouldn’t expect it to, but I haven’t tried it yet. I would expect it would need to be in autoload or similar.

@BurntSushi
Copy link
Member Author

@chris-morgan For me, the plugin works both with and without syntastic_extra_filetypes. Here's what the wiki says about it:

If your checker adds a filetype previously unknown to syntastic and you care about proper tab completion, you need to tell syntastic about it. The variable g:syntastic_extra_filetypes can be used for this purpose.

AFAIK, the line with g:SyntasticRegistry.CreateAndRegisterChecker is what is actually registering the syntax checker.

I'm not sure if any autoload commands are needed. It seems like both of these things are modifying some global state that Syntastic cares about. Presumably Syntastic handles the rest?

@lcd047
Copy link

lcd047 commented Jun 16, 2014

Does putting the syntastic_extra_filetypes option inside the file actually work?

It doesn't. The checker file is sourced only when syntastic tries to run a checker against a file with filetype rust. Variable g:syntastic_extra_filetypes has to be set always.

For me, the plugin works both with and without syntastic_extra_filetypes.

Syntax checking works. What doesn't work is tab completion. Say, you open a Python file, and you type

:SyntasticInfo r

and then press Tab: then only ruby racket r rst is offered for completion (provided that you have the corresponding binaries installed), rust isn't.

Just put syntastic_extra_filetypes in a file that is always sourced, f.i. etc/vim/syntax/rust.vim

@BurntSushi
Copy link
Member Author

OK, I've updated the PR with @lcd047's suggested changes. Thank you!

@lilyball
Copy link
Contributor

syntax/rust.vim isn't always sourced either (also, that's not a good place to put variables like this in the first place).

Just make a plugin/rust.vim and put it there.

@BurntSushi
Copy link
Member Author

@kballard Ah OK, all set. Sorry, my Vimscript is not so great.

wting referenced this pull request in wting/rust.vim Jun 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants