2017-07-09 21:39:33 +00:00
|
|
|
" Author: Jake Zimmerman <jake@zimmerman.io>
|
|
|
|
" Description: Like stack-ghc, but for entire projects
|
|
|
|
"
|
|
|
|
" Note: Ideally, this would *only* typecheck. Right now, it also does codegen.
|
|
|
|
" See <https://github.com/commercialhaskell/stack/issues/977>.
|
|
|
|
|
2017-07-11 12:05:13 +00:00
|
|
|
call ale#Set('haskell_stack_build_options', '--fast')
|
|
|
|
|
2017-09-10 23:47:10 +00:00
|
|
|
function! ale_linters#haskell#stack_build#GetCommand(buffer) abort
|
2017-07-11 12:05:13 +00:00
|
|
|
let l:flags = ale#Var(a:buffer, 'haskell_stack_build_options')
|
|
|
|
|
|
|
|
return 'stack build ' . l:flags
|
|
|
|
endfunction
|
|
|
|
|
2017-07-09 21:39:33 +00:00
|
|
|
call ale#linter#Define('haskell', {
|
2018-07-24 09:05:44 +00:00
|
|
|
\ 'name': 'stack_build',
|
|
|
|
\ 'aliases': ['stack-build'],
|
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'),
|
|
|
|
\ 'command': function('ale_linters#haskell#stack_build#GetCommand'),
|
2017-07-09 21:39:33 +00:00
|
|
|
\ 'lint_file': 1,
|
|
|
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
|
|
|
\})
|