diff --git a/ale_linters/haskell/ghc.vim b/ale_linters/haskell/ghc.vim index fdf22f9..daf91c8 100644 --- a/ale_linters/haskell/ghc.vim +++ b/ale_linters/haskell/ghc.vim @@ -1,10 +1,18 @@ " Author: w0rp " Description: ghc for Haskell files +call ale#Set('haskell_ghc_options', '-fno-code -v0') + +function! ale_linters#haskell#ghc#GetCommand(buffer) abort + return 'ghc ' + \ . ale#Var(a:buffer, 'haskell_ghc_options') + \ . ' %t' +endfunction + call ale#linter#Define('haskell', { \ 'name': 'ghc', \ 'output_stream': 'stderr', \ 'executable': 'ghc', -\ 'command': 'ghc -fno-code -v0 %t', +\ 'command_callback': 'ale_linters#haskell#ghc#GetCommand', \ 'callback': 'ale#handlers#haskell#HandleGHCFormat', \}) diff --git a/doc/ale-haskell.txt b/doc/ale-haskell.txt index 0ea4037..9fab39b 100644 --- a/doc/ale-haskell.txt +++ b/doc/ale-haskell.txt @@ -12,6 +12,16 @@ g:ale_haskell_brittany_executable *g:ale_haskell_brittany_executable* This variable can be changed to use a different executable for brittany. +=============================================================================== +ghc *ale-haskell-ghc* + +g:ale_haskell_ghc_options *g:ale_haskell_ghc_options* + *b:ale_haskell_ghc_options* + Type: |String| + Default: `'-fno-code -v0'` + + This variable can be changed to modify flags given to ghc. + =============================================================================== hdevtools *ale-haskell-hdevtools*