summaryrefslogtreecommitdiff
path: root/script-beta/core/hover/label.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-17 18:29:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-17 18:29:47 +0800
commiteb822b74afdec570e500b8e6778f8d6d30a8d98a (patch)
tree0f5f96155033110c4f8952035ab6df2e269afbef /script-beta/core/hover/label.lua
parent1ad4e66d410ac0bbca7ebdd4ab1ec5f7dc47af1c (diff)
downloadlua-language-server-eb822b74afdec570e500b8e6778f8d6d30a8d98a.zip
整理代码
Diffstat (limited to 'script-beta/core/hover/label.lua')
-rw-r--r--script-beta/core/hover/label.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua
index 57b2ee8e..4f896bc7 100644
--- a/script-beta/core/hover/label.lua
+++ b/script-beta/core/hover/label.lua
@@ -18,9 +18,9 @@ end
local function asValue(source, title)
local name = buildName(source)
- local class = 'any'
- local infers = vm.getInfers(source)
+ local infers = vm.getInfers(source)
local type = vm.getType(source)
+ local class = vm.getClass(source)
local literal = vm.getLiteral(source)
local cont
if vm.hasType(source, 'table') then
@@ -34,12 +34,12 @@ local function asValue(source, title)
if cont then
type = nil
end
- if class == 'any' then
- pack[#pack+1] = type
- else
+ if class then
pack[#pack+1] = class
+ else
+ pack[#pack+1] = type
end
- if literal ~= '' then
+ if literal then
pack[#pack+1] = '='
pack[#pack+1] = literal
end