summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/parser/guide.lua35
1 files changed, 26 insertions, 9 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 925ee9ab..06e6949c 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -3725,18 +3725,35 @@ function m.inferByPCallReturn(status, source)
end
function m.cleanInfers(infers)
- local mark = {}
+ local hasDoc
for i = 1, #infers do
local infer = infers[i]
- if not infer then
- return
+ if infer.source.type == 'doc.class'
+ or infer.source.type == 'doc.type.name' then
+ hasDoc = true
end
- local key = ('%s|%p'):format(infer.type, infer.source)
- if mark[key] then
- infers[i] = infers[#infers]
- infers[#infers] = nil
- else
- mark[key] = true
+ end
+ if hasDoc then
+ for i = #infers, 1, -1 do
+ local infer = infers[i]
+ if infer.source.type == 'doc.class'
+ or infer.source.type == 'doc.type.name' then
+ else
+ infers[i] = infers[#infers]
+ infers[#infers] = nil
+ end
+ end
+ else
+ local mark = {}
+ for i = #infers, 1, -1 do
+ local infer = infers[i]
+ local key = ('%s|%p'):format(infer.type, infer.source)
+ if mark[key] then
+ infers[i] = infers[#infers]
+ infers[#infers] = nil
+ else
+ mark[key] = true
+ end
end
end
end