28bce98a68
Make SyntaxCheckers_*_GetLocList() dictionary functions. Pass a reference to the current checker to syntastic#makeprg#build(). Add an optional 'redirect' argument to CreateAndRegisterChecker(). Change the sh checker to use the new dictionary functions. Add a new registry method getLocListRaw() (needed for the sh checker).
36 lines
1.0 KiB
VimL
36 lines
1.0 KiB
VimL
"============================================================================
|
|
"File: hlint.vim
|
|
"Description: Syntax checking plugin for syntastic.vim
|
|
"Maintainer: Nicolas Wu <nicolas.wu at gmail dot com>
|
|
"License: BSD
|
|
"============================================================================
|
|
|
|
if exists('g:loaded_syntastic_haskell_hlint_checker')
|
|
finish
|
|
endif
|
|
let g:loaded_syntastic_haskell_hlint_checker = 1
|
|
|
|
function! SyntaxCheckers_haskell_hlint_IsAvailable()
|
|
return executable('hlint')
|
|
endfunction
|
|
|
|
function! SyntaxCheckers_haskell_hlint_GetLocList() dict
|
|
let makeprg = syntastic#makeprg#build({
|
|
\ 'exe': 'hlint',
|
|
\ 'checker': self })
|
|
|
|
let errorformat =
|
|
\ '%E%f:%l:%c: Error: %m,' .
|
|
\ '%W%f:%l:%c: Warning: %m,' .
|
|
\ '%C%m'
|
|
|
|
return SyntasticMake({
|
|
\ 'makeprg': makeprg,
|
|
\ 'errorformat': errorformat,
|
|
\ 'postprocess': ['compressWhitespace'] })
|
|
endfunction
|
|
|
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
|
\ 'filetype': 'haskell',
|
|
\ 'name': 'hlint'})
|