8
8
9
9
10
10
function ! health#lsp#check () abort
11
- call health# report_start (' server status' )
11
+ call s: report_start (' server status' )
12
12
let l: server_status = lsp#collect_server_status ()
13
13
14
14
let l: has_printed = v: false
@@ -17,21 +17,21 @@ function! health#lsp#check() abort
17
17
18
18
let l: status_msg = printf (' %s: %s' , l: k , l: report .status)
19
19
if l: report .status == ' running'
20
- call health# report_ok (l: status_msg )
20
+ call s: report_ok (l: status_msg )
21
21
elseif l: report .status == ' failed'
22
22
call health#report_error (l: status_msg , ' See :help g:lsp_log_verbose to debug server failure.' )
23
23
else
24
- call health# report_warn (l: status_msg )
24
+ call s: report_warn (l: status_msg )
25
25
endif
26
26
let l: has_printed = v: true
27
27
endfor
28
28
29
29
if ! l: has_printed
30
- call health# report_warn (' no servers connected' )
30
+ call s: report_warn (' no servers connected' )
31
31
endif
32
32
33
33
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 ))
35
35
let l: report = l: server_status [l: k ]
36
36
37
37
let l: msg = " \t \n "
@@ -54,12 +54,35 @@ function! health#lsp#check() abort
54
54
call health#report_info (l: msg )
55
55
endfor
56
56
57
- call health# report_start (' Performance' )
57
+ call s: report_start (' Performance' )
58
58
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.' )
60
60
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.' )
62
62
endif
63
63
64
64
endf
65
65
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