@@ -5,6 +5,7 @@ let s:job = v:null
55function ! denops#cache#update (... ) abort
66 const l: options = extend (#{ reload: v: false }, a: 0 ? a: 1 : {})
77 const l: plugins = denops#_internal#plugin#list ()
8+ let l: failures = []
89
910 if ! l: options .reload
1011 echomsg ' [denops] Update cache of the following files. Call `denops#cache#update(#{reload: v:true})` to forcibly update.'
@@ -21,7 +22,7 @@ function! denops#cache#update(...) abort
2122
2223 let s: job = denops#_internal#job#start (l: args , #{
2324 \ on_stderr: funcref (' s:on_stderr' ),
24- \ on_exit: funcref (' s:on_exit' ),
25+ \ on_exit: funcref (' s:on_exit' , [ l: failures , l: entryfile ] ),
2526 \ env: #{
2627 \ NO_COLOR: 1 ,
2728 \ DENO_NO_PROMPT: 1 ,
@@ -30,7 +31,16 @@ function! denops#cache#update(...) abort
3031 call denops#_internal#wait#for (60 * 1000 , { - > s: job is # v: null }, 100 )
3132 endfor
3233
33- echomsg ' [denops] Deno cache is updated.'
34+ if empty (l: failures )
35+ echomsg ' [denops] Deno cache is updated.'
36+ else
37+ echohl WarningMsg
38+ echomsg printf (' [denops] Deno cache finished with errors: %d failure(s).' , len (l: failures ))
39+ for l: f in l: failures
40+ echomsg printf (' [denops] failed: %s' , l: f )
41+ endfor
42+ echohl None
43+ endif
3444endfunction
3545
3646function ! s: on_stderr (job, data, event ) abort
@@ -41,6 +51,9 @@ function! s:on_stderr(job, data, event) abort
4151 echohl None
4252endfunction
4353
44- function ! s: on_exit (job, status, event ) abort
54+ function ! s: on_exit (failures, entryfile, job, status, event ) abort
55+ if a: status != 0
56+ call add (a: failures , a: entryfile )
57+ endif
4558 let s: job = v: null
4659endfunction
0 commit comments