From 22d146760e136152b3fe72bdd7ae982f43f2751b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 17 Sep 2021 13:35:57 +0200 Subject: [PATCH] fix(diagnostic): don't convert diagnostic table twice The recursive implementation of vim.lsp.diagnostic.get() applied `diagnostic_vim_to_lsp` twice, and the second time gave wrong results because of the unexpected format. Fixes https://github.com/neovim/neovim/issues/15689 --- runtime/lua/vim/lsp/diagnostic.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index 48c0dd92cb..eef840bee5 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -265,7 +265,7 @@ function M.get(bufnr, client_id, predicate) table.insert(all_diagnostics, diagnostic) end end) - return diagnostic_vim_to_lsp(all_diagnostics) + return all_diagnostics end local namespace = M.get_namespace(client_id)