Skip to content

Commit 445c207

Browse files
authored
check deprecated function (#1562)
1 parent 2e03278 commit 445c207

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

autoload/health/lsp.vim

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ endf
88

99

1010
function! health#lsp#check() abort
11-
call health#report_start('server status')
11+
call s:report_start('server status')
1212
let l:server_status = lsp#collect_server_status()
1313

1414
let l:has_printed = v:false
@@ -17,21 +17,21 @@ function! health#lsp#check() abort
1717

1818
let l:status_msg = printf('%s: %s', l:k, l:report.status)
1919
if l:report.status == 'running'
20-
call health#report_ok(l:status_msg)
20+
call s:report_ok(l:status_msg)
2121
elseif l:report.status == 'failed'
2222
call health#report_error(l:status_msg, 'See :help g:lsp_log_verbose to debug server failure.')
2323
else
24-
call health#report_warn(l:status_msg)
24+
call s:report_warn(l:status_msg)
2525
endif
2626
let l:has_printed = v:true
2727
endfor
2828

2929
if !l:has_printed
30-
call health#report_warn('no servers connected')
30+
call s:report_warn('no servers connected')
3131
endif
3232

3333
for l:k in sort(keys(l:server_status))
34-
call health#report_start(printf('server configuration: %s', l:k))
34+
call s:report_start(printf('server configuration: %s', l:k))
3535
let l:report = l:server_status[l:k]
3636

3737
let l:msg = "\t\n"
@@ -54,12 +54,35 @@ function! health#lsp#check() abort
5454
call health#report_info(l:msg)
5555
endfor
5656

57-
call health#report_start('Performance')
57+
call s:report_start('Performance')
5858
if lsp#utils#has_lua() && g:lsp_use_lua
59-
call health#report_ok('Using lua for faster performance.')
59+
call s:report_ok('Using lua for faster performance.')
6060
else
61-
call health#report_warn('Missing requirements to enable lua for faster performance.')
61+
call s:report_warn('Missing requirements to enable lua for faster performance.')
6262
endif
6363

6464
endf
6565

66+
function! s:report_start(report) abort
67+
if has('nvim-0.10')
68+
call v:lua.vim.health.start(a:report)
69+
else
70+
call health#report_start(a:report)
71+
endif
72+
endf
73+
74+
function! s:report_warn(report) abort
75+
if has('nvim-0.10')
76+
call v:lua.vim.health.warn(a:report)
77+
else
78+
call health#report_warn(a:report)
79+
endif
80+
endf
81+
82+
function! s:report_ok(report) abort
83+
if has('nvim-0.10')
84+
call v:lua.vim.health.ok(a:report)
85+
else
86+
call health#report_ok(a:report)
87+
endif
88+
endf

0 commit comments

Comments
 (0)