diff options
Diffstat (limited to 'script/vm/infer.lua')
-rw-r--r-- | script/vm/infer.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua index bb06ee3a..35e17e5c 100644 --- a/script/vm/infer.lua +++ b/script/vm/infer.lua @@ -51,13 +51,20 @@ local viewNodeSwitch;viewNodeSwitch = util.switch() end) : case 'table' : call(function (source, infer, uri) - if source.type == 'table' then - if #source == 1 and source[1].type == 'varargs' then - local node = vm.getInfer(source[1]):view(uri) - return ('%s[]'):format(node) + local docs = source.bindDocs + if docs then + for _, doc in ipairs(docs) do + if doc.type == 'doc.enum' then + return 'enum ' .. doc.enum[1] + end end end + if #source == 1 and source[1].type == 'varargs' then + local node = vm.getInfer(source[1]):view(uri) + return ('%s[]'):format(node) + end + infer._hasTable = true end) : case 'function' |