From 94842a257e170397913b41c91194487dcca42921 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 6 Oct 2016 22:46:51 +0900 Subject: [PATCH] GHC Linter for Haskell Stack https://haskellstack.org/ --- ale_linters/haskell/ghc.vim | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ale_linters/haskell/ghc.vim b/ale_linters/haskell/ghc.vim index 71988a2..0e6c2cf 100644 --- a/ale_linters/haskell/ghc.vim +++ b/ale_linters/haskell/ghc.vim @@ -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', +\})