Listing installed servers

This commit is contained in:
Yasuhiro Matsumoto
2020-11-02 22:00:20 +09:00
parent 91bf8fbdc2
commit d25bdfb4c7
2 changed files with 19 additions and 4 deletions

View File

@@ -37,6 +37,25 @@ function! lsp_settings#global_settings_dir() abort
return substitute(l:path, '[\/]$', '', '')
endfunction
function! lsp_settings#intalled_servers() abort
let l:servers = []
for l:ft in sort(keys(s:settings))
for l:conf in s:settings[l:ft]
let l:path = lsp_settings#servers_dir() . '/' . l:conf.command . '/' . l:conf.command
if !executable(l:path)
continue
endif
let l:path = lsp_settings#servers_dir() . '/' . l:conf.command . '/.vim-lsp-settings-version'
let l:version = ''
if filereadable(l:path)
let l:version = trim(join(readfile(l:path), "\n"))
endif
call add(l:servers, {'name': l:conf.command, 'version': l:version})
endfor
endfor
return l:servers
endfunction
function! lsp_settings#executable(cmd) abort
if executable(a:cmd)
return 1

View File

@@ -86,10 +86,6 @@ function! lsp_settings#profile#status() abort
exec 'echohl' s:color_map[l:status]
echon l:status
echohl None
let l:server_info = lsp#get_server_info(l:server)
for [l:k, l:V] in items(l:server_info)
echo printf(' %s: %s', l:k, string(l:V))
endfor
endif
echo ''
endfor