summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/matcher/hover.lua5
-rw-r--r--server/test/hover/init.lua6
2 files changed, 11 insertions, 0 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua
index b4430b02..b997e8f8 100644
--- a/server/src/matcher/hover.lua
+++ b/server/src/matcher/hover.lua
@@ -145,6 +145,11 @@ local function buildValueName(result, source)
end
local parentName = declarat.parentName
+
+ if not parentName then
+ return result.key or ''
+ end
+
if parentName == '?' then
local parentType = result.parentValue and result.parentValue.type
if parentType == 'table' then
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua
index 45c4d8ed..348b5c8c 100644
--- a/server/test/hover/init.lua
+++ b/server/test/hover/init.lua
@@ -153,3 +153,9 @@ TEST [[
local <?v?> = collectgarbage()
]]
"nil v"
+
+TEST [[
+local <!type!>
+w2l:get_default()[<?type?>]
+]]
+"any type"