aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-08-29 17:45:09 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-08-29 17:45:09 +0200
commit5d8801804180f7f0ab09b97bbdf8ae41e619c759 (patch)
tree3fb67f04fb0978ac88d0782ba237c45a0e3b1f92
parent795beac9e6a98794fd8320bd2317e01ed329148b (diff)
downloadvis-lspc-5d8801804180f7f0ab09b97bbdf8ae41e619c759.tar.gz
vis-lspc-5d8801804180f7f0ab09b97bbdf8ae41e619c759.zip
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.
-rw-r--r--init.lua2
1 files changed, 1 insertions, 1 deletions
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