hdevtools.vim 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. "============================================================================
  2. "File: hdevtools.vim
  3. "Description: Syntax checking plugin for syntastic
  4. "Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>
  5. "License: This program is free software. It comes without any warranty,
  6. " to the extent permitted by applicable law. You can redistribute
  7. " it and/or modify it under the terms of the Do What The Fuck You
  8. " Want To Public License, Version 2, as published by Sam Hocevar.
  9. " See http://sam.zoy.org/wtfpl/COPYING for more details.
  10. "
  11. "============================================================================
  12. if exists('g:loaded_syntastic_haskell_hdevtools_checker')
  13. finish
  14. endif
  15. let g:loaded_syntastic_haskell_hdevtools_checker = 1
  16. let s:save_cpo = &cpo
  17. set cpo&vim
  18. function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
  19. if !exists('g:syntastic_haskell_hdevtools_args') && exists('g:hdevtools_options')
  20. call syntastic#log#oneTimeWarn('variable g:hdevtools_options is deprecated, ' .
  21. \ 'please use g:syntastic_haskell_hdevtools_args instead')
  22. let g:syntastic_haskell_hdevtools_args = g:hdevtools_options
  23. endif
  24. let buf = bufnr('')
  25. let makeprg = self.makeprgBuild({
  26. \ 'exe_after': 'check',
  27. \ 'fname': syntastic#util#shescape(fnamemodify(bufname(buf), ':p')) })
  28. let errorformat =
  29. \ '%-Z %#,'.
  30. \ '%W%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: Warning: %m,'.
  31. \ '%W%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: Warning:,'.
  32. \ '%E%\m%f:%l:%v%\%%(-%\d%\+%\)%\=: %m,'.
  33. \ '%E%>%\m%f:%l:%v%\%%(-%\d%\+%\)%\=:,'.
  34. \ '%+C %#%m,'.
  35. \ '%W%>%\m%f:%l:%v%\%%(-%\d%\+%\)%\=:,'.
  36. \ '%+C %#%tarning: %m,'
  37. return SyntasticMake({
  38. \ 'makeprg': makeprg,
  39. \ 'errorformat': errorformat,
  40. \ 'defaults': {'vcol': 1},
  41. \ 'postprocess': ['compressWhitespace'] })
  42. endfunction
  43. call g:SyntasticRegistry.CreateAndRegisterChecker({
  44. \ 'filetype': 'haskell',
  45. \ 'name': 'hdevtools'})
  46. let &cpo = s:save_cpo
  47. unlet s:save_cpo
  48. " vim: set sw=4 sts=4 et fdm=marker: