From cee25503cd6df85366c5106c40cc5240634e647e Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 18 Oct 2021 13:59:43 +0200 Subject: speed up :LspInstall, :LspUninstall, :LspUninstallAll commands (#175) - `:LspUninstallAll` now just nukes the entire install directory immediately, instead of uninstalling each server one by one. There's also a confirmation prompt now. - `:LspInstall` & `:LspUninstall` now sources its autocompletion directly from a Lua table, instead of sourcing the server names from each server module (thus avoiding unnecessary `require` calls). --- plugin/nvim-lsp-installer.vim | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'plugin/nvim-lsp-installer.vim') diff --git a/plugin/nvim-lsp-installer.vim b/plugin/nvim-lsp-installer.vim index 2cd3485b..3050d865 100644 --- a/plugin/nvim-lsp-installer.vim +++ b/plugin/nvim-lsp-installer.vim @@ -4,16 +4,12 @@ let g:loaded_nvim_lsp_installer = v:true let s:save_cpo = &cpo set cpo&vim -function! s:MapServerName(servers) abort - return map(a:servers, {_, val -> val.name}) -endfunction - function! s:LspInstallCompletion(...) abort - return join(sort(s:MapServerName(luaeval("require'nvim-lsp-installer.servers'.get_available_servers()"))), "\n") + return join(luaeval("require'nvim-lsp-installer.servers'.get_available_server_names()"), "\n") endfunction function! s:LspUninstallCompletion(...) abort - return join(sort(s:MapServerName(luaeval("require'nvim-lsp-installer.servers'.get_installed_servers()"))), "\n") + return join(luaeval("require'nvim-lsp-installer.servers'.get_installed_server_names()"), "\n") endfunction function! s:LspInstall(server_names) abort -- cgit v1.2.3-70-g09d2