mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-12 20:35:54 +01:00
Add LspSettingsStatus
This commit is contained in:
@@ -29,3 +29,39 @@ function! lsp_settings#profile#edit_local() abort
|
||||
setlocal nomodified
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:color_map = {
|
||||
\ 'exited': 'Error',
|
||||
\ 'starting': 'MoreMsg',
|
||||
\ 'failed': 'WarningMsg',
|
||||
\ 'running': 'Keyword',
|
||||
\ 'not running': 'NonText'
|
||||
\}
|
||||
|
||||
function! lsp_settings#profile#status() abort
|
||||
let l:settings = lsp_settings#settings()
|
||||
let l:active_servers = lsp#get_whitelisted_servers()
|
||||
for l:ft in keys(l:settings)
|
||||
let l:servers = l:settings[l:ft]
|
||||
for l:v in l:servers
|
||||
if index(l:active_servers, l:v.command) != -1
|
||||
let l:status = lsp#get_server_status(l:v.command)
|
||||
echon l:v.command . ': '
|
||||
exec 'echohl' s:color_map[l:status]
|
||||
echon l:status
|
||||
echohl None
|
||||
elseif lsp_settings#executable(l:v.command)
|
||||
echon l:v.command . ': '
|
||||
echohl vimFilter
|
||||
echon 'not running'
|
||||
echohl None
|
||||
else
|
||||
echon l:v.command . ': '
|
||||
echohl vimOption
|
||||
echon 'not installed'
|
||||
echohl None
|
||||
endif
|
||||
echo ''
|
||||
endfor
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -10,6 +10,7 @@ let g:lsp_settings_root_markers = get(g:, 'lsp_settings_root_markers', [
|
||||
\ '.bzr/'
|
||||
\ ])
|
||||
|
||||
command! -nargs=0 LspSettingsStatus call lsp_settings#profile#status()
|
||||
command! -nargs=0 LspSettingsLocalEdit call lsp_settings#profile#edit_local()
|
||||
|
||||
call lsp_settings#init()
|
||||
|
||||
Reference in New Issue
Block a user