Handle failing to connect to eslint_d

This commit is contained in:
w0rp
2018-09-17 17:32:57 +01:00
parent a4a4bba884
commit ddb3e6d57a
4 changed files with 27 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ endfunction
function! ale#fixers#eslint#ProcessEslintDOutput(buffer, output) abort
" If the output is an error message, don't use it.
for l:line in a:output[:10]
if l:line =~# '^Error:'
if l:line =~# '\v^Error:|^Could not connect'
return []
endif
endfor

View File

@@ -99,6 +99,13 @@ function! ale#handlers#eslint#Handle(buffer, lines) abort
\}]
endif
if a:lines == ['Could not connect']
return [{
\ 'lnum': 1,
\ 'text': 'Could not connect to eslint_d. Try updating eslint_d or killing it.',
\}]
endif
" Matches patterns line the following:
"
" /path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]