From 1ad4e66d410ac0bbca7ebdd4ab1ec5f7dc47af1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 17 Aug 2020 17:55:12 +0800 Subject: =?UTF-8?q?=E6=95=B4=E7=90=86=20hover=20=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/core/hover/label.lua | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'script-beta/core/hover/label.lua') 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 .. ':' -- cgit v1.2.3