Fix an exception with notes with no previous message
This commit is contained in:
parent
7eb16836d0
commit
da365134b5
@ -82,8 +82,12 @@ function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
|
||||
" If the 'error type' is a note, make it detail related to
|
||||
" the previous error parsed in output
|
||||
if l:match[4] is# 'note'
|
||||
let l:output[-1]['detail'] = get(l:output[-1], 'detail', '')
|
||||
if !empty(l:output)
|
||||
let l:output[-1]['detail'] =
|
||||
\ get(l:output[-1], 'detail', '')
|
||||
\ . s:RemoveUnicodeQuotes(l:match[0]) . "\n"
|
||||
endif
|
||||
|
||||
continue
|
||||
endif
|
||||
|
||||
|
@ -128,3 +128,11 @@ Execute(The GCC handler should handle syntax errors):
|
||||
\ '<stdin>:4: error: ''cat'' was not declared in this scope',
|
||||
\ '<stdin>:12: error: expected `;'' before ''o''',
|
||||
\ ])
|
||||
|
||||
Execute(The GCC handler should handle notes with no previous message):
|
||||
AssertEqual
|
||||
\ [],
|
||||
\ ale#handlers#gcc#HandleGCCFormat(347, [
|
||||
\ '<stdin>:1:1: note: x',
|
||||
\ '<stdin>:1:1: note: x',
|
||||
\ ])
|
||||
|
Loading…
Reference in New Issue
Block a user