summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/hover/label.lua4
-rw-r--r--script/vm/infer.lua5
-rw-r--r--test/hover/init.lua2
3 files changed, 6 insertions, 5 deletions
diff --git a/script/core/hover/label.lua b/script/core/hover/label.lua
index 37d4c730..01dd1143 100644
--- a/script/core/hover/label.lua
+++ b/script/core/hover/label.lua
@@ -48,8 +48,7 @@ local function asValue(source, title)
local cont
if not infer.hasType(source, 'string')
and not type:find('%[%]$') then
- if #vm.getRefs(source, '*') > 0
- or infer.hasType(source, 'table') then
+ if infer.hasType(source, 'table') then
cont = buildTable(source)
end
end
@@ -62,6 +61,7 @@ local function asValue(source, title)
if cont
and ( type == 'table'
or type == 'any'
+ or type == 'unknown'
or type == 'nil') then
type = nil
end
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index 4f6b1701..9a1b8276 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -249,8 +249,9 @@ function m.viewLiterals(source)
local literals = {}
for n in nodeMgr.eachNode(node) do
if n.type == 'string'
- or n.type == 'number' then
- literals[#literals+1] = util.viewLiteral(n)
+ or n.type == 'number'
+ or n.type == 'integer' then
+ literals[#literals+1] = util.viewLiteral(n[1])
end
end
if #literals == 0 then
diff --git a/test/hover/init.lua b/test/hover/init.lua
index bb1d02c3..f6172aa1 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -149,7 +149,7 @@ obj.<?xxx?>()
TEST [[
obj.<?xxx?>()
]]
-[[global obj.xxx: any]]
+[[global obj.xxx: unknown]]
TEST [[
local <?x?> = 1