mirror of
https://github.com/dense-analysis/ale
synced 2024-12-18 04:15:39 +00:00
Fix #1124 - Handle stack-build errors with leading spaces
This commit is contained in:
parent
d8abe0d6a2
commit
e71d831119
@ -19,7 +19,7 @@ function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
|
|||||||
" in Haskell error messages with the basename for this file.
|
" in Haskell error messages with the basename for this file.
|
||||||
let l:temp_filename_regex = s:temp_regex_prefix . l:basename
|
let l:temp_filename_regex = s:temp_regex_prefix . l:basename
|
||||||
|
|
||||||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):(\d+):(.*)?$'
|
let l:pattern = '\v^\s*([a-zA-Z]?:?[^:]+):(\d+):(\d+):(.*)?$'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
|
|
||||||
let l:corrected_lines = []
|
let l:corrected_lines = []
|
||||||
|
@ -76,3 +76,25 @@ Execute(The ghc handler should handle ghc 7 output):
|
|||||||
\ ale#path#Winify('src/Main.hs') . ':94:5:Error:',
|
\ ale#path#Winify('src/Main.hs') . ':94:5:Error:',
|
||||||
\ ' Some other error',
|
\ ' Some other error',
|
||||||
\ ])
|
\ ])
|
||||||
|
|
||||||
|
Execute(The ghc handler should handle stack 1.5.1 output):
|
||||||
|
call ale#test#SetFilename('src/Main.hs')
|
||||||
|
|
||||||
|
AssertEqual
|
||||||
|
\ [
|
||||||
|
\ {
|
||||||
|
\ 'lnum': 160,
|
||||||
|
\ 'col': 14,
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ 'text': '• Expecting one fewer arguments to ‘Exp’ Expected kind ‘k0 -> *’, but ‘Exp’ has kind ‘*’ • In the type ‘Exp a’ | 160 | pattern F :: Exp a | ^^^^^',
|
||||||
|
\ },
|
||||||
|
\ ],
|
||||||
|
\ ale#handlers#haskell#HandleGHCFormat(bufnr(''), [
|
||||||
|
\ ' ' . ale#path#Winify('src/Main.hs') . ':160:14: error:',
|
||||||
|
\ ' • Expecting one fewer arguments to ‘Exp’',
|
||||||
|
\ ' Expected kind ‘k0 -> *’, but ‘Exp’ has kind ‘*’',
|
||||||
|
\ ' • In the type ‘Exp a’',
|
||||||
|
\ ' |',
|
||||||
|
\ ' 160 | pattern F :: Exp a',
|
||||||
|
\ ' | ^^^^^',
|
||||||
|
\ ])
|
||||||
|
Loading…
Reference in New Issue
Block a user