mirror of https://github.com/dense-analysis/ale
Fix a bug with eslint parsing which mistakenly cleared markers
This commit is contained in:
parent
11c11e578f
commit
37065bb252
|
@ -9,24 +9,32 @@ function! ale_linters#javascript#eslint#Handle(lines)
|
||||||
"
|
"
|
||||||
" <text>:47:14: Missing trailing comma. [Warning/comma-dangle]
|
" <text>:47:14: Missing trailing comma. [Warning/comma-dangle]
|
||||||
" <text>:56:41: Missing semicolon. [Error/semi]
|
" <text>:56:41: Missing semicolon. [Error/semi]
|
||||||
let pattern = '^<text>:\(\d\+\):\(\d\+\): \(.\+\) \[\(.\+\)/\(.\+\)\]'
|
let pattern = '^<text>:\(\d\+\):\(\d\+\): \(.\+\) \[\(.\+\)\]'
|
||||||
let output = []
|
let output = []
|
||||||
|
|
||||||
for line in a:lines
|
for line in a:lines
|
||||||
let match = matchlist(line, pattern)
|
let l:match = matchlist(line, pattern)
|
||||||
|
|
||||||
if len(match) == 0
|
if len(l:match) == 0
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let text = l:match[3]
|
||||||
|
let marker_parts = l:match[4]
|
||||||
|
let type = marker_parts[0]
|
||||||
|
|
||||||
|
if len(marker_parts) == 2
|
||||||
|
let text = text . ' (' . marker_parts[1] . ')'
|
||||||
|
endif
|
||||||
|
|
||||||
" vcol is Needed to indicate that the column is a character.
|
" vcol is Needed to indicate that the column is a character.
|
||||||
call add(output, {
|
call add(output, {
|
||||||
\ 'bufnr': bufnr('%'),
|
\ 'bufnr': bufnr('%'),
|
||||||
\ 'lnum': match[1] + 0,
|
\ 'lnum': l:match[1] + 0,
|
||||||
\ 'vcol': 0,
|
\ 'vcol': 0,
|
||||||
\ 'col': match[2] + 0,
|
\ 'col': l:match[2] + 0,
|
||||||
\ 'text': match[3] . '(' . match[5] . ')',
|
\ 'text': text,
|
||||||
\ 'type': match[4] ==# 'Warning' ? 'W' : 'E',
|
\ 'type': type ==# 'Warning' ? 'W' : 'E',
|
||||||
\ 'nr': -1,
|
\ 'nr': -1,
|
||||||
\})
|
\})
|
||||||
endfor
|
endfor
|
||||||
|
|
Loading…
Reference in New Issue