summaryrefslogtreecommitdiff
path: root/script-beta/core/hover/label.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-17 17:55:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-17 17:55:12 +0800
commit1ad4e66d410ac0bbca7ebdd4ab1ec5f7dc47af1c (patch)
tree17a98ded980d958c6e7e31979bd28e106f158812 /script-beta/core/hover/label.lua
parentfaab8b0541b7eb3a955dfc231f91364f78d0fcb6 (diff)
downloadlua-language-server-1ad4e66d410ac0bbca7ebdd4ab1ec5f7dc47af1c.zip
整理 hover 的代码
Diffstat (limited to 'script-beta/core/hover/label.lua')
-rw-r--r--script-beta/core/hover/label.lua35
1 files changed, 7 insertions, 28 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua
index 12c175cd..57b2ee8e 100644
--- a/script-beta/core/hover/label.lua
+++ b/script-beta/core/hover/label.lua
@@ -19,36 +19,15 @@ end
local function asValue(source, title)
local name = buildName(source)
local class = 'any'
- local type = 'any'
- local literal = ''
- local cont
local infers = vm.getInfers(source)
- if infers then
- for _, value in ipairs(infers) do
- local src = value.source
- local tp = value.type
- class = guide.mergeTypes {class, vm.getClass(src)}
- type = guide.mergeTypes {type, tp}
- local sl = guide.getLiteral(src)
- if sl then
- literal = guide.mergeTypes {literal, util.viewLiteral(sl)}
- end
- if tp == 'table' then
- cont = buildTable(src)
- end
- end
+ local type = vm.getType(source)
+ local literal = vm.getLiteral(source)
+ local cont
+ if vm.hasType(source, 'table') then
+ cont = buildTable(source)
end
- vm.eachDef(source, function (src)
- class = guide.mergeTypes {class, vm.getClass(src)}
- type = guide.mergeTypes {type, vm.getType(src)}
- local sl = guide.getLiteral(src)
- if sl then
- literal = guide.mergeTypes {literal, util.viewLiteral(sl)}
- end
- if type == 'table' then
- cont = buildTable(src)
- end
- end)
+ --vm.eachDef(source, function (src)
+ --end)
local pack = {}
pack[#pack+1] = title
pack[#pack+1] = name .. ':'