|
|
@ -402,10 +402,10 @@ local function load_cfg(ft, client, cfg, loaded)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
for _, c in pairs(loaded) do
|
|
|
|
for k, c in pairs(loaded) do
|
|
|
|
if client == c then
|
|
|
|
if client == k then
|
|
|
|
-- loaded
|
|
|
|
-- loaded
|
|
|
|
trace(client, 'already been loaded for', ft, loaded)
|
|
|
|
log(client, 'already been loaded for', ft, loaded, c)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -465,16 +465,16 @@ end
|
|
|
|
local loaded = {}
|
|
|
|
local loaded = {}
|
|
|
|
local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
retry = retry or false
|
|
|
|
retry = retry or false
|
|
|
|
local clients = vim.lsp.get_active_clients() or {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local capabilities = update_capabilities()
|
|
|
|
local capabilities = update_capabilities()
|
|
|
|
|
|
|
|
|
|
|
|
for _, client in ipairs(clients) do
|
|
|
|
|
|
|
|
if client ~= nil then
|
|
|
|
|
|
|
|
table.insert(loaded, client.name)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
for _, lspclient in ipairs(servers) do
|
|
|
|
for _, lspclient in ipairs(servers) do
|
|
|
|
|
|
|
|
local clients = vim.lsp.get_active_clients() or {}
|
|
|
|
|
|
|
|
for _, client in ipairs(clients) do
|
|
|
|
|
|
|
|
if client ~= nil then
|
|
|
|
|
|
|
|
loaded[client.name] = true
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
-- check should load lsp
|
|
|
|
-- check should load lsp
|
|
|
|
|
|
|
|
|
|
|
|
if type(lspclient) == 'table' then
|
|
|
|
if type(lspclient) == 'table' then
|
|
|
@ -498,11 +498,6 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if _NG_Loaded[lspclient] then
|
|
|
|
|
|
|
|
log('client loaded', lspclient)
|
|
|
|
|
|
|
|
-- goto continue -- may create multiple lsp server
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if vim.tbl_contains(config.lsp.disable_lsp or {}, lspclient) then
|
|
|
|
if vim.tbl_contains(config.lsp.disable_lsp or {}, lspclient) then
|
|
|
|
log('disable lsp', lspclient)
|
|
|
|
log('disable lsp', lspclient)
|
|
|
|
goto continue
|
|
|
|
goto continue
|
|
|
@ -637,6 +632,9 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
log('lsp server not installed in path ' .. lspclient .. vim.inspect(cfg.cmd), vim.lsp.log_levels.WARN)
|
|
|
|
log('lsp server not installed in path ' .. lspclient .. vim.inspect(cfg.cmd), vim.lsp.log_levels.WARN)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if _NG_Loaded[lspclient] then
|
|
|
|
|
|
|
|
log('client loaded ?', lspclient)
|
|
|
|
|
|
|
|
end
|
|
|
|
load_cfg(ft, lspclient, cfg, loaded)
|
|
|
|
load_cfg(ft, lspclient, cfg, loaded)
|
|
|
|
|
|
|
|
|
|
|
|
_NG_Loaded[lspclient] = true
|
|
|
|
_NG_Loaded[lspclient] = true
|
|
|
|