2017-07-09 21:39:33 +00:00
|
|
|
" Author: w0rp <devw0rp@gmail.com>
|
|
|
|
" Description: ghc for Haskell files, using Stack
|
|
|
|
|
2019-01-22 14:22:49 +00:00
|
|
|
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
|
|
|
|
|
|
|
|
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
|
2021-03-01 20:11:10 +00:00
|
|
|
return ale#handlers#haskell#GetStackExecutable(a:buffer)
|
2019-01-22 14:22:49 +00:00
|
|
|
\ . ' ghc -- '
|
|
|
|
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
|
|
|
|
\ . ' %t'
|
|
|
|
endfunction
|
|
|
|
|
2017-07-09 21:39:33 +00:00
|
|
|
call ale#linter#Define('haskell', {
|
2018-07-24 09:05:44 +00:00
|
|
|
\ 'name': 'stack_ghc',
|
|
|
|
\ 'aliases': ['stack-ghc'],
|
2017-07-09 21:39:33 +00:00
|
|
|
\ 'output_stream': 'stderr',
|
2019-02-22 18:05:04 +00:00
|
|
|
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
|
2021-03-01 20:11:10 +00:00
|
|
|
\ 'cwd': '%s:h',
|
2019-02-22 18:05:04 +00:00
|
|
|
\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'),
|
2017-07-09 21:39:33 +00:00
|
|
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
|
|
|
\})
|