1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:30:07 +08:00
SpaceVim/bundle/nvim-lspconfig/lua/lspconfig.lua

35 lines
918 B
Lua
Raw Normal View History

local configs = require 'lspconfig.configs'
2021-10-05 15:13:10 +08:00
local M = {
util = require 'lspconfig.util',
2021-10-05 15:13:10 +08:00
}
function M.available_servers()
vim.deprecate('lspconfig.available_servers', 'lspconfig.util.available_servers', '0.1.4', 'lspconfig')
return M.util.available_servers()
2021-10-05 15:13:10 +08:00
end
local mt = {}
function mt:__index(k)
if configs[k] == nil then
local success, config = pcall(require, 'lspconfig.server_configurations.' .. k)
if success then
configs[k] = config
else
vim.notify(
string.format(
'[lspconfig] Cannot access configuration for %s. Ensure this server is listed in '
.. '`server_configurations.md` or added as a custom server.',
k
),
vim.log.levels.WARN
)
-- Return a dummy function for compatibility with user configs
return { setup = function() end }
end
2021-10-05 15:13:10 +08:00
end
return configs[k]
end
return setmetatable(M, mt)