summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-26 15:30:53 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-26 15:30:53 +0800
commit2c688721092f1fe102514eed6a836ccfeb12a789 (patch)
tree90fcdee55dce2530e57534858b19893aba3fe486 /script
parentcbc8e42f84fdb8468d2f31797fc8a2d6344c53d4 (diff)
downloadlua-language-server-2c688721092f1fe102514eed6a836ccfeb12a789.zip
improve type_infer
Diffstat (limited to 'script')
-rw-r--r--script/parser/guide.lua11
1 files changed, 11 insertions, 0 deletions
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