1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:40:05 +08:00

perf(health): improve layer health checking

This commit is contained in:
wsdjeg 2022-11-13 15:41:15 +08:00
parent 667a25c8e8
commit 852add00b8

View File

@ -30,18 +30,13 @@ endfunction
function! s:check_layers() abort function! s:check_layers() abort
let report = [] let report = ['Checking SpaceVim layer health:']
for layer in SpaceVim#layers#get() for layer in SpaceVim#layers#get()
try try
call extend(report, [layer . ' layer health:', '']) let result = SpaceVim#layers#{layer}#health() ? 'ok' : 'failed'
let result = SpaceVim#layers#{layer}#health() ? ['ok', ''] : ['failed', ''] call extend(report, [' - `' . layer . '`:' . result])
call extend(report,result)
catch /^Vim\%((\a\+)\)\=:E117/ catch /^Vim\%((\a\+)\)\=:E117/
call extend(report,[ call extend(report, [' - `' . layer . '`: can not find function: SpaceVim#layers#' . layer . '#health()'])
\ '',
\ ' There is no function: SpaceVim#layers#' . layer . '#health()',
\ '',
\ ])
endtry endtry
endfor endfor
return report return report