From 8e48c02061556b367071cf8bc2a2125e0b224221 Mon Sep 17 00:00:00 2001 From: Igor Lacerda Date: Thu, 21 Aug 2025 21:15:56 -0300 Subject: [PATCH] fix(lsp): handle array with empty string when checking empty hover (#35423) --- runtime/lua/vim/lsp/buf.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index b2dcb92937..c61ce958fb 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -70,8 +70,10 @@ function M.hover(config) elseif result and result.contents then -- Make sure the response is not empty if - (type(result.contents) == 'table' and #(vim.tbl_get(result.contents, 'value') or '') > 0) - or type(result.contents == 'string') and #result.contents > 0 + ( + type(result.contents) == 'table' + and #(vim.tbl_get(result.contents, 'value') or result.contents[1] or '') > 0 + ) or (type(result.contents) == 'string' and #result.contents > 0) then results1[client_id] = result else