From 2c688721092f1fe102514eed6a836ccfeb12a789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 26 Feb 2021 15:30:53 +0800 Subject: improve type_infer --- script/parser/guide.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'script') diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 91acb457..67a41d41 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -3512,6 +3512,17 @@ function m.inferCheckDoc(status, source) end return true end + if source.type == 'doc.type.function' + or source.type == 'doc.type.table' + or source.type == 'doc.type.array' then + local typeName = m.getDocTypeUnitName(status, source) + status.results[#status.results+1] = { + type = typeName, + source = source, + level = 100, + } + return true + end if source.type == 'doc.field' then local results = m.getDocTypeNames(status, source.extends) for _, res in ipairs(results) do -- cgit v1.2.3