mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-12 20:35:54 +01:00
Don't consider servers that are disabled or excluded for suggestion
This commit is contained in:
@@ -91,11 +91,30 @@ function! s:vim_lsp_installer(ft, ...) abort
|
||||
let l:servers += s:settings['_']
|
||||
endif
|
||||
|
||||
let l:default = get(g:, 'lsp_settings_filetype_' . a:ft, '')
|
||||
|
||||
let l:name = get(a:000, 0, '')
|
||||
for l:conf in l:servers
|
||||
if !empty(l:name) && l:conf.command != l:name
|
||||
continue
|
||||
endif
|
||||
|
||||
if lsp_settings#get(l:conf.command, 'disabled', get(l:conf, 'disabled', 0))
|
||||
continue
|
||||
endif
|
||||
|
||||
if type(l:default) ==# v:t_list
|
||||
if len(l:default) ># 0 && index(l:default, l:server.command) == -1
|
||||
continue
|
||||
endif
|
||||
elseif type(l:default) ==# v:t_string
|
||||
if !empty(l:default) && l:default != l:server.command
|
||||
continue
|
||||
endif
|
||||
else
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:command = printf('%s/install-%s', s:installer_dir, l:conf.command)
|
||||
if has('win32')
|
||||
let l:command = substitute(l:command, '/', '\', 'g') . '.cmd'
|
||||
|
||||
Reference in New Issue
Block a user