GHC Linter for Haskell Stack

https://haskellstack.org/
This commit is contained in:
Hong Minhee 2016-10-06 22:46:51 +09:00
parent 596a374c6e
commit 94842a257e

View file

@ -22,11 +22,16 @@ function! ale_linters#haskell#ghc#Handle(buffer, lines)
for line in a:lines
if len(matchlist(line, pattern)) > 0
call add(corrected_lines, line)
call add(corrected_lines, '')
if line !~ ': error:$'
call add(corrected_lines, '')
endif
elseif line == ''
call add(corrected_lines, line)
else
if len(corrected_lines) > 0
if corrected_lines[-1] =~ ': error:$'
let line = substitute(line, '\v^\s+', ' ', '')
endif
let corrected_lines[-1] .= line
endif
endif
@ -60,3 +65,11 @@ call ALEAddLinter('haskell', {
\ 'command': g:ale#util#stdin_wrapper . ' .hs ghc -fno-code -v0',
\ 'callback': 'ale_linters#haskell#ghc#Handle',
\})
call ALEAddLinter('haskell', {
\ 'name': 'stack-ghc',
\ 'output_stream': 'stderr',
\ 'executable': 'stack',
\ 'command': g:ale#util#stdin_wrapper . ' .hs stack ghc -- -fno-code -v0',
\ 'callback': 'ale_linters#haskell#ghc#Handle',
\})