Warn when user requests install of something disabled by config

This is now not possible thanks to the prior commit, but would also lead
to the user confused that they've installed something and it is still
disabled in vim-lsp-settings.
This commit is contained in:
Meredith Howard
2021-07-07 21:38:29 -05:00
committed by mattn
parent f6cbefe1db
commit f84d880d8a

View File

@@ -100,18 +100,30 @@ function! s:vim_lsp_installer(ft, ...) abort
endif
if lsp_settings#get(l:conf.command, 'disabled', get(l:conf, 'disabled', 0))
if !empty(l:name) && l:conf.command == l:name
call lsp_settings#utils#warning(l:name . ' requested but is disabled by global or local settings')
endif
continue
endif
if type(l:default) ==# v:t_list
if len(l:default) ># 0 && index(l:default, l:server.command) == -1
if !empty(l:name) && l:conf.command == l:name
call lsp_settings#utils#warning(l:name . ' requested but is disabled by g:lsp_settings_filetype_' . a:ft)
endif
continue
endif
elseif type(l:default) ==# v:t_string
if !empty(l:default) && l:default != l:server.command
if !empty(l:name) && l:conf.command == l:name
call lsp_settings#utils#warning(l:name . ' requested but is disabled by g:lsp_settings_filetype_' . a:ft)
endif
continue
endif
else
if !empty(l:name) && l:conf.command == l:name
call lsp_settings#utils#warning(l:name . ' requested but is disabled by g:lsp_settings_filetype_' . a:ft)
endif
continue
endif