diff options
Diffstat (limited to 'script-beta/core/hover/class.lua')
-rw-r--r-- | script-beta/core/hover/class.lua | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/script-beta/core/hover/class.lua b/script-beta/core/hover/class.lua index 94c8fb99..5472ba7f 100644 --- a/script-beta/core/hover/class.lua +++ b/script-beta/core/hover/class.lua @@ -4,7 +4,8 @@ local function getClass(source, deep) if deep > 3 then return nil end - local class = vm.eachField(source, function (src) + local classes = {} + vm.eachField(source, function (src) local key = vm.getKeyName(src) local lkey = key:lower() if lkey == 's|type' @@ -12,19 +13,14 @@ local function getClass(source, deep) or lkey == 's|name' or lkey == 's|class' then if src.value and src.value.type == 'string' then - return src.value[1] + classes[#classes+1] = src.value[1] end end end) - if class then - return class + if #classes == 0 then + return end - return vm.eachMeta(source, function (meta) - local cl = getClass(meta, deep + 1) - if cl then - return cl - end - end) + return vm.mergeTypeViews(table.unpack(classes)) end return function (source) |