diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-29 00:50:48 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2020-01-29 00:50:48 +0900 |
commit | 214d1192c8b1911e9c6b441f3acdfd6f9afe2467 (patch) | |
tree | 416a63e01c9bc17a55b673e0d0a8432693ac005d /autoload/lsp_settings.vim | |
parent | 3562d7b853a6fb2589631b42517348f5af8ab760 (diff) | |
download | vim-lsp-settings-214d1192c8b1911e9c6b441f3acdfd6f9afe2467.tar.gz vim-lsp-settings-214d1192c8b1911e9c6b441f3acdfd6f9afe2467.tar.bz2 vim-lsp-settings-214d1192c8b1911e9c6b441f3acdfd6f9afe2467.zip |
Check installer name
Diffstat (limited to 'autoload/lsp_settings.vim')
-rw-r--r-- | autoload/lsp_settings.vim | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim index e8419a8..536d993 100644 --- a/autoload/lsp_settings.vim +++ b/autoload/lsp_settings.vim @@ -100,7 +100,24 @@ function! lsp_settings#autocd(server_info) abort endif endfunction -function! lsp_settings#complete_installer(arglead, cmdline, cursorpos) abort +function! lsp_settings#complete_uninstall(arglead, cmdline, cursorpos) abort + let l:settings = json_decode(join(readfile(s:root_dir . '/settings.json'), "\n")) + call remove(l:settings, '$schema') + + let l:servers_dir = get(g:, 'lsp_settings_servers_dir', s:servers_dir) + let l:installers = [] + for l:ft in keys(l:settings) + for l:conf in l:settings[l:ft] + if !isdirectory(l:servers_dir . '/' . l:conf.command) + continue + endif + call add(l:installers, l:conf.command) + endfor + endfor + return filter(l:installers, 'stridx(v:val, a:arglead) == 0') +endfunction + +function! lsp_settings#complete_install(arglead, cmdline, cursorpos) abort let l:settings = json_decode(join(readfile(s:root_dir . '/settings.json'), "\n")) call remove(l:settings, '$schema') |