diff options
| author | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-09-06 17:49:21 +0900 |
|---|---|---|
| committer | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-09-06 17:49:21 +0900 |
| commit | ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de (patch) | |
| tree | c301c7a765535dcb5387d76cc71e28d845dcce23 /lua/nvim_lsp.lua | |
| parent | Merge pull request #238 from steelsojka/angular-ls (diff) | |
| download | nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.gz nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.bz2 nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.lz nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.xz nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.tar.zst nvim-lspconfig-ddcd9e6aae50d6397e43e4fc9ba0cf7a82cc79de.zip | |
Rename nvim_lsp to lspconfig
Diffstat (limited to 'lua/nvim_lsp.lua')
| -rw-r--r-- | lua/nvim_lsp.lua | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/lua/nvim_lsp.lua b/lua/nvim_lsp.lua deleted file mode 100644 index 2b9154ad..00000000 --- a/lua/nvim_lsp.lua +++ /dev/null @@ -1,83 +0,0 @@ -local configs = require 'nvim_lsp/configs' - -local M = { - util = require 'nvim_lsp/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/nvim_lsp.vim because it requires knowing that the last --- script in scriptnames to be executed is nvim_lsp. -function M._root._setup() - M._root.commands = { - LspInstall = { - function(name) - if configs[name] == nil then - pcall(require('nvim_lsp/'..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")/nvim_lsp/{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('nvim_lsp/'..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) -end - -local mt = {} -function mt:__index(k) - if configs[k] == nil then - require('nvim_lsp/'..k) - end - return configs[k] -end - -return setmetatable(M, mt) --- vim:et ts=2 sw=2 |
