diff --git a/syntax_checkers/haskell/ghc-mod.vim b/syntax_checkers/haskell/ghc-mod.vim index 9340c381..f3677dc1 100644 --- a/syntax_checkers/haskell/ghc-mod.vim +++ b/syntax_checkers/haskell/ghc-mod.vim @@ -32,23 +32,14 @@ function! SyntaxCheckers_haskell_ghc_mod_GetLocList() let makeprg = syntastic#makeprg#build({ \ 'exe': 'ghc-mod check', - \ 'args': '--hlintOpt="--language=XmlSyntax"', \ 'filetype': 'haskell', \ 'subchecker': 'ghc_mod' }) - let loclist1 = SyntasticMake({ + + let loclist = SyntasticMake({ \ 'makeprg': makeprg, \ 'errorformat': errorformat }) - let makeprg = syntastic#makeprg#build({ - \ 'exe': 'ghc-mod lint', - \ 'args': '--hlintOpt="--language=XmlSyntax"', - \ 'filetype': 'haskell', - \ 'subchecker': 'ghc_mod' }) - let loclist2 = SyntasticMake({ - \ 'makeprg': makeprg, - \ 'errorformat': errorformat }) - - return loclist1 + loclist2 + return loclist endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({ diff --git a/syntax_checkers/haskell/hlint.vim b/syntax_checkers/haskell/hlint.vim new file mode 100644 index 00000000..c748b77c --- /dev/null +++ b/syntax_checkers/haskell/hlint.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: hlint.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Nicolas Wu +"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() + let errorformat = + \ '%E%f:%l:%c: Error: %m,' . + \ '%W%f:%l:%c: Warning: %m,' . + \ '%C%m' + + let makeprg = syntastic#makeprg#build({ + \ 'exe': 'hlint', + \ 'filetype': 'haskell', + \ 'subchecker': 'hlint' }) + + let loclist = SyntasticMake({ + \ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'postprocess': ['compressWhitespace'] }) + + return loclist +endfunction + +call g:SyntasticRegistry.CreateAndRegisterChecker({ + \ 'filetype': 'haskell', + \ 'name': 'hlint'})