mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-12 20:35:54 +01:00
Listing installed servers
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user