mirror of
https://github.com/dense-analysis/ale
synced 2024-12-28 17:12:23 +00:00
9fe7b1fe6a
Working directories are now set seperately from the commands so they can later be swapped out when running linters over projects is supported, and also better support filename mapping for running linters on other machines in future.
22 lines
714 B
VimL
22 lines
714 B
VimL
" Author: w0rp <devw0rp@gmail.com>
|
|
" Description: ghc for Haskell files, using Stack
|
|
|
|
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
|
|
|
|
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
|
|
return ale#handlers#haskell#GetStackExecutable(a:buffer)
|
|
\ . ' ghc -- '
|
|
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
|
|
\ . ' %t'
|
|
endfunction
|
|
|
|
call ale#linter#Define('haskell', {
|
|
\ 'name': 'stack_ghc',
|
|
\ 'aliases': ['stack-ghc'],
|
|
\ 'output_stream': 'stderr',
|
|
\ 'executable': function('ale#handlers#haskell#GetStackExecutable'),
|
|
\ 'cwd': '%s:h',
|
|
\ 'command': function('ale_linters#haskell#stack_ghc#GetCommand'),
|
|
\ 'callback': 'ale#handlers#haskell#HandleGHCFormat',
|
|
\})
|