diff options
-rw-r--r-- | server/src/matcher/hover.lua | 9 | ||||
-rw-r--r-- | server/test/hover/init.lua | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua index e34bec69..d2e7dd9c 100644 --- a/server/src/matcher/hover.lua +++ b/server/src/matcher/hover.lua @@ -406,7 +406,14 @@ return function (result, source, lsp, select) end local lib, fullKey, oo = findLib(result) - local valueType = lib and lib.type or result.value.type or 'nil' + local valueType = lib and lib.type + if valueType then + if type(valueType) == 'table' then + valueType = valueType[1] + end + else + valueType = result.value.type or 'nil' + end local name = fullKey or buildValueName(result, source) if valueType == 'function' then return getFunctionHover(name, result, source, lib, oo, select) diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua index 71e839ae..7a9ebe6f 100644 --- a/server/test/hover/init.lua +++ b/server/test/hover/init.lua @@ -221,3 +221,9 @@ TEST [[ local <?t?> = - 1000 ]] [[number t = -1000]] + +TEST [[ +for <?c?> in io.lines() do +end +]] +[[string c]] |