2020-02-22 15:32:56 -05:00
|
|
|
"============================================================================
|
2020-05-19 11:32:37 -04:00
|
|
|
"File: idris2.vim
|
2020-02-22 15:32:56 -05:00
|
|
|
"Description: Syntax checking plugin for syntastic.vim
|
|
|
|
"Maintainer: raichoo <raichoo at googlemail dot com>
|
|
|
|
"License: This program is free software. It comes without any warranty,
|
|
|
|
" to the extent permitted by applicable law. You can redistribute
|
|
|
|
" it and/or modify it under the terms of the Do What The Fuck You
|
|
|
|
" Want To Public License, Version 2, as published by Sam Hocevar.
|
|
|
|
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
|
|
|
"
|
|
|
|
"============================================================================
|
|
|
|
|
|
|
|
if exists("g:loaded_syntastic_idris_idris_checker")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let g:loaded_syntastic_idris_idris_checker=1
|
|
|
|
|
|
|
|
function! SyntaxCheckers_idris_idris_IsAvailable()
|
2020-05-19 11:32:37 -04:00
|
|
|
return executable("idris2")
|
2020-02-22 15:32:56 -05:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
if !exists("g:syntastic_idris_options")
|
|
|
|
let g:syntastic_idris_options = " "
|
|
|
|
endif
|
|
|
|
|
|
|
|
function! SyntaxCheckers_idris_idris_GetLocList() dict
|
|
|
|
let makeprg = self.makeprgBuild({
|
2020-05-19 11:32:37 -04:00
|
|
|
\ 'exe': 'idris2',
|
|
|
|
\ 'args': "--find-ipkg --client ':l". g:syntastic_idris_options,
|
2020-02-22 15:32:56 -05:00
|
|
|
\ 'post_args': "'",
|
2020-05-19 11:32:37 -04:00
|
|
|
\ 'filetype': 'idris2',
|
|
|
|
\ 'subchecker': 'idris2' })
|
2020-02-22 15:32:56 -05:00
|
|
|
|
|
|
|
let errorformat =
|
|
|
|
\ '"%f" (line %l\, column %c\):,' .
|
|
|
|
\ 'user error (%f\:%l\:%m\),' .
|
|
|
|
\ '%E%f:%l:%c: error: %m,' .
|
|
|
|
\ '%E%f:%l:%c-%*[0-9]: error: %m,' .
|
|
|
|
\ '%W%f:%l:%c: warning: %m,' .
|
|
|
|
\ '%W%f:%l:%c-%*[0-9]: warning: %m,' .
|
|
|
|
\ '%E%f:%l:%c:%m,' .
|
|
|
|
\ '%E%f:%l:%c-%*[0-9]:%m,' .
|
|
|
|
\ '%C%m,' .
|
|
|
|
\ '%m'
|
|
|
|
|
|
|
|
return SyntasticMake({
|
|
|
|
\ 'makeprg': makeprg,
|
|
|
|
\ 'errorformat': errorformat,
|
|
|
|
\ 'postprocess': ['compressWhitespace'] })
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
2020-05-19 11:32:37 -04:00
|
|
|
\ 'filetype': 'idris2',
|
|
|
|
\ 'name': 'idris2'})
|