summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2016-10-06 16:56:45 +0200
committerGitHub <noreply@github.com>2016-10-06 16:56:45 +0200
commitc5d3cc5bc7e7d31834b58c0422cd9fe4c5b616a2 (patch)
tree4d9d75a14a9f1430a7c5b1b2e6b788626aabdbc0
parent3cdd057b11c224316af4d889783ea9c2d12b27f5 (diff)
parent94842a257e170397913b41c91194487dcca42921 (diff)
downloadale-c5d3cc5bc7e7d31834b58c0422cd9fe4c5b616a2.zip
Merge pull request #53 from dahlia/haskell-stack
GHC Linter for Haskell Stack
-rw-r--r--ale_linters/haskell/ghc.vim15
1 files changed, 14 insertions, 1 deletions
diff --git a/ale_linters/haskell/ghc.vim b/ale_linters/haskell/ghc.vim
index 71988a21..0e6c2cf1 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',
+\})