From f9dd5a9d8d3764ebed1e436bfb568391514b1f7a Mon Sep 17 00:00:00 2001 From: Ilya Ilyinykh Date: Mon, 25 Mar 2024 19:39:58 +0300 Subject: [PATCH 1/3] fix: specify buffer manually --- lua/go/codelens.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/go/codelens.lua b/lua/go/codelens.lua index f991c4bd4..9cb5eb159 100644 --- a/lua/go/codelens.lua +++ b/lua/go/codelens.lua @@ -53,7 +53,9 @@ function M.refresh() if _GO_NVIM_CFG.lsp_codelens == true then local found = false if not found then - for _, lsp in pairs(vim.lsp.get_active_clients()) do + for _, lsp in pairs(vim.lsp.get_client { + bufnr = 0 + }) do if lsp.name == 'gopls' then found = true break From fcde040fd897803c846b3de8fafc4f398b557b5d Mon Sep 17 00:00:00 2001 From: Ilya Ilyinykh Date: Mon, 25 Mar 2024 19:47:50 +0300 Subject: [PATCH 2/3] fix: name of the method --- lua/go/codelens.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/go/codelens.lua b/lua/go/codelens.lua index 9cb5eb159..cc949096d 100644 --- a/lua/go/codelens.lua +++ b/lua/go/codelens.lua @@ -53,7 +53,7 @@ function M.refresh() if _GO_NVIM_CFG.lsp_codelens == true then local found = false if not found then - for _, lsp in pairs(vim.lsp.get_client { + for _, lsp in pairs(vim.lsp.get_clients { bufnr = 0 }) do if lsp.name == 'gopls' then From c9504cd18a08d8d2ef297bc89907e5e69f3a20a3 Mon Sep 17 00:00:00 2001 From: Ilya Ilyinykh Date: Mon, 25 Mar 2024 22:01:33 +0300 Subject: [PATCH 3/3] fix: used method from latest stable vim previous solution worked only in nightly version --- lua/go/codelens.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/go/codelens.lua b/lua/go/codelens.lua index cc949096d..f6d2b9270 100644 --- a/lua/go/codelens.lua +++ b/lua/go/codelens.lua @@ -53,9 +53,7 @@ function M.refresh() if _GO_NVIM_CFG.lsp_codelens == true then local found = false if not found then - for _, lsp in pairs(vim.lsp.get_clients { - bufnr = 0 - }) do + for _, lsp in pairs(vim.lsp.buf_get_clients(0)) do if lsp.name == 'gopls' then found = true break