I am using ALE
as LSP
client, and I would like to write a function to get the number of errors
and warnings
from the current location list.
I think that a possible solution would be to write a function that count all the lines containing the keyword error
and to count all the lines containing the keyword warning
in the location list
, and to call this function with some autocommand
that is triggers every time the location list is updated.
Is it correct?
But then, how to implement it?
Especially the part of reading from the location list
doesn’t sound straightforward.
:h :llist
or:h getloclist()
. The part about grepping for ERROR and WARNING should work. Try writing a function.ALE
, I could easily fix it by using adding` ale` to the airline extension, e.g.let g:airline_extensions = ['ale','tabline']