hlint.vim 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "============================================================================
  2. "File: hlint.vim
  3. "Description: Syntax checking plugin for syntastic.vim
  4. "Maintainer: Nicolas Wu <nicolas.wu at gmail dot com>
  5. "License: BSD
  6. "============================================================================
  7. if exists('g:loaded_syntastic_haskell_hlint_checker')
  8. finish
  9. endif
  10. let g:loaded_syntastic_haskell_hlint_checker = 1
  11. let s:save_cpo = &cpo
  12. set cpo&vim
  13. function! SyntaxCheckers_haskell_hlint_GetLocList() dict
  14. let makeprg = self.makeprgBuild({
  15. \ 'fname': syntastic#util#shexpand('%:p')})
  16. let errorformat =
  17. \ '%E%f:%l:%v: Error while reading hint file\, %m,' .
  18. \ '%E%f:%l:%v: Error: %m,' .
  19. \ '%W%f:%l:%v: Warning: %m,' .
  20. \ '%W%f:%l:%v: Suggestion: %m,' .
  21. \ '%C%m'
  22. return SyntasticMake({
  23. \ 'makeprg': makeprg,
  24. \ 'errorformat': errorformat,
  25. \ 'defaults': {'vcol': 1},
  26. \ 'postprocess': ['compressWhitespace'] })
  27. endfunction
  28. call g:SyntasticRegistry.CreateAndRegisterChecker({
  29. \ 'filetype': 'haskell',
  30. \ 'name': 'hlint'})
  31. let &cpo = s:save_cpo
  32. unlet s:save_cpo
  33. " vim: set sw=4 sts=4 et fdm=marker: