Handle linter callback functions being unknown or deleted

This commit is contained in:
w0rp 2018-07-13 09:47:26 +01:00
parent 6d6cd6663e
commit a782e06223
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83
2 changed files with 10 additions and 1 deletions

View File

@ -222,7 +222,12 @@ function! s:HandleExit(job_id, exit_code) abort
call ale#history#RememberOutput(l:buffer, a:job_id, l:output[:])
endif
try
let l:loclist = ale#util#GetFunction(l:linter.callback)(l:buffer, l:output)
" Handle the function being unknown, or being deleted.
catch /E700/
let l:loclist = []
endtry
call ale#engine#HandleLoclist(l:linter.name, l:buffer, l:loclist)
endfunction

View File

@ -2205,6 +2205,10 @@ ale#linter#Define(filetype, linter) *ale#linter#Define()*
defined, as LSP linters handle diagnostics
automatically. See |ale-lsp-linters|.
If the function named does not exist, including if
the function is later deleted, ALE will behave as if
the callback returned an empty list.
The keys for each item in the List will be handled in
the following manner:
*ale-loclist-format*