From b249d1680af27af155913b6947f0c4a6ddafee7f Mon Sep 17 00:00:00 2001 From: ray-x Date: Sat, 21 May 2022 10:26:20 +1000 Subject: [PATCH] handle same lsp started multiple times (esp for those take long time to start ) issue #171 --- lua/navigator/lspclient/clients.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/navigator/lspclient/clients.lua b/lua/navigator/lspclient/clients.lua index 3b94272..8166fa0 100644 --- a/lua/navigator/lspclient/clients.lua +++ b/lua/navigator/lspclient/clients.lua @@ -461,11 +461,12 @@ local function update_capabilities() end -- run setup for lsp clients + +local loaded = {} local function lsp_startup(ft, retry, user_lsp_opts) retry = retry or false local clients = vim.lsp.get_active_clients() or {} - local loaded = {} local capabilities = update_capabilities() for _, client in ipairs(clients) do @@ -499,6 +500,7 @@ local function lsp_startup(ft, retry, user_lsp_opts) 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