2018-07-20 14:30:16 +00:00
|
|
|
" Author: Eric Wolf <ericwolf42@gmail.com>
|
|
|
|
" Description: ghc for Haskell files called with cabal exec
|
|
|
|
|
|
|
|
call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
|
|
|
|
|
|
|
|
function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort
|
2019-04-17 13:26:09 +00:00
|
|
|
return ale#path#BufferCdString(a:buffer)
|
|
|
|
\ . 'cabal exec -- ghc '
|
2018-07-20 14:30:16 +00:00
|
|
|
\ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
|
|
|
|
\ . ' %t'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('haskell', {
|
2018-07-24 09:05:44 +00:00
|
|
|
\ 'name': 'cabal_ghc',
|
|
|
|
\ 'aliases': ['cabal-ghc'],
|
2018-07-20 14:30:16 +00:00
|
|
|
\ 'output_stream': 'stderr',
|
|
|
|
\ 'executable': 'cabal',
|
2019-02-22 18:05:04 +00:00
|
|
|
\ 'command': function('ale_linters#haskell#cabal_ghc#GetCommand'),
|
2018-07-20 14:30:16 +00:00
|
|
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
|
|
|
\})
|