basex.vim 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. "============================================================================
  2. "File: basex.vim
  3. "Description: Syntax checking plugin for syntastic.vim
  4. "Maintainer: James Wright <james dot jw at hotmail 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. "
  10. "============================================================================
  11. if exists('g:loaded_syntastic_xquery_basex_checker')
  12. finish
  13. endif
  14. let g:loaded_syntastic_xquery_basex_checker = 1
  15. let s:save_cpo = &cpo
  16. set cpo&vim
  17. function! SyntaxCheckers_xquery_basex_GetLocList() dict
  18. let makeprg = self.makeprgBuild({
  19. \ 'args_after': '-z',
  20. \ 'fname_before': '-q',
  21. \ 'fname': syntastic#util#shescape('inspect:module("' . escape(expand('%:p', 1), '"') . '")') })
  22. let errorformat =
  23. \ '%f:%l:%c:%t:%n:%m,' .
  24. \ '%m'
  25. let loclist = SyntasticMake({
  26. \ 'makeprg': makeprg,
  27. \ 'errorformat': errorformat,
  28. \ 'preprocess': 'basex' })
  29. for e in loclist
  30. if e['type'] !=# 'W' && e['type'] !=# 'E'
  31. let e['type'] = 'E'
  32. endif
  33. endfor
  34. return loclist
  35. endfunction
  36. call g:SyntasticRegistry.CreateAndRegisterChecker({
  37. \ 'filetype': 'xquery',
  38. \ 'name': 'basex'})
  39. let &cpo = s:save_cpo
  40. unlet s:save_cpo
  41. " vim: set sw=4 sts=4 et fdm=marker: