From 5d8801804180f7f0ab09b97bbdf8ae41e619c759 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 29 Aug 2023 17:45:09 +0200 Subject: fix hover result determination If the result is MarkedString[] the table must have a length > 0, because all returned object types are represented as lua tables. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index de98490..436fabe 100644 --- a/init.lua +++ b/init.lua @@ -774,7 +774,7 @@ local function lspc_handle_hover_method_response(win, result, old_pos) local hover_msg = '' -- result is MarkedString[] - if type(result.contents) == 'table' then + if type(result.contents) == 'table' and #result.contents > 0 then lspc.log('hover returned list of length ' .. #result.contents) for i, v in ipairs(result.contents) do if i == 1 then -- cgit v1.2.3