From 93c34311581ed9db125b1c41c87b8d3af7dc4c41 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Mon, 28 Dec 2020 17:32:20 -0800 Subject: Remove all installers and install logic --- lua/lspconfig.lua | 65 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 63 deletions(-) (limited to 'lua/lspconfig.lua') diff --git a/lua/lspconfig.lua b/lua/lspconfig.lua index cc9b38bc..b6909f2a 100644 --- a/lua/lspconfig.lua +++ b/lua/lspconfig.lua @@ -4,71 +4,10 @@ local M = { util = require 'lspconfig/util'; } -function M.available_servers() - return vim.tbl_keys(configs) -end - -function M.installable_servers() - local res = {} - for k, v in pairs(configs) do - if v.install then table.insert(res, k) end - end - return res -end - M._root = {} --- Called from plugin/lspconfig.vim because it requires knowing that the last --- script in scriptnames to be executed is lspconfig. -function M._root._setup() - M._root.commands = { - LspInstall = { - function(name) - if configs[name] == nil then - pcall(require('lspconfig/'..name)) - end - local config = configs[name] - if not config then - return print("Invalid server name:", name) - end - if not config.install then - return print(name, "can't be automatically installed (yet)") - end - if config.install_info().is_installed then - return print(name, "is already installed") - end - config.install() - end; - "-nargs=1"; - "-complete=custom,v:lua.lsp_complete_installable_servers"; - description = '`:LspInstall {name}` installs a server under stdpath("cache")/lspconfig/{name}'; - }; - LspInstallInfo = { - function(name) - if name == nil then - local res = {} - for k, v in pairs(configs) do - if v.install_info then - res[k] = v.install_info() - end - end - return print(vim.inspect(res)) - end - if configs[name] == nil then - pcall(require('lspconfig/'..name)) - end - local config = configs[name] - if not config then - return print("Invalid server name:", name) - end - return print(vim.inspect(config.install_info())) - end; - "-nargs=?"; - "-complete=custom,v:lua.lsp_complete_servers"; - description = 'Print installation info for {name} if one is specified, or all installable servers.'; - }; - }; - M.util.create_module_commands("_root", M._root.commands) +function M.available_servers() + return vim.tbl_keys(configs) end local mt = {} -- cgit v1.2.3-70-g09d2