Created
March 23, 2015 22:15
-
-
Save yiding/f49fa5ee041206b99c0e to your computer and use it in GitHub Desktop.
syntastic checker for flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" requires vim-flow: https://github.com/facebook/vim-flow/ | |
" put this in a syntax_checkers/ directory, such as: | |
" .vim/bundle/flowtype/syntax_checkers/javascript/flow.vim | |
if exists("g:loaded_syntastic_javascript_flow_checker") | |
finish | |
endif | |
let g:loaded_syntastic_javascript_flow_checker = 1 | |
let s:save_cpo = &cpo | |
set cpo&vim | |
function! SyntaxCheckers_javascript_flow_IsAvailable() dict | |
return executable(self.getExec()) | |
endfunction | |
function! SyntaxCheckers_javascript_flow_GetLocList() dict | |
let makeprg = self.makeprgBuild({ | |
\ 'tail_after': '| awk ''{ RS="\n\n"; ORS="\n"; FS="\n"; OFS=" "; gsub("\n", " ", $0); print $0 }'''}) | |
let errorformat = '%f:%l:%c%[0-9:\,]%#: %m' | |
return SyntasticMake({ | |
\ 'makeprg': makeprg, | |
\ 'errorformat': errorformat }) | |
endfunction | |
call g:SyntasticRegistry.CreateAndRegisterChecker({ | |
\ 'filetype': 'javascript', | |
\ 'name': 'flow', | |
\ 'exec': 'flow' }) | |
let &cpo = s:save_cpo | |
unlet s:save_cpo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment