Add cabal-ghc linter

cabal-ghc calls ghc via cabal exec and so ghc has access to packages
in cabal sandboxes for example
This commit is contained in:
Eric Wolf
2018-07-20 16:30:16 +02:00
committed by erwo
parent 61a5880747
commit ac6bc6d0ae
5 changed files with 55 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
" 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
return 'cabal exec -- ghc '
\ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
\ . ' %t'
endfunction
call ale#linter#Define('haskell', {
\ 'name': 'cabal-ghc',
\ 'output_stream': 'stderr',
\ 'executable': 'cabal',
\ 'command_callback': 'ale_linters#haskell#cabal_ghc#GetCommand',
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
\})