summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/core/infer.lua5
-rw-r--r--script/core/noder.lua15
-rw-r--r--script/core/searcher.lua4
-rw-r--r--script/parser/guide.lua2
4 files changed, 19 insertions, 7 deletions
diff --git a/script/core/infer.lua b/script/core/infer.lua
index 002a82a0..0c04e0cd 100644
--- a/script/core/infer.lua
+++ b/script/core/infer.lua
@@ -203,6 +203,11 @@ local function cleanInfers(infers)
infers['integer'] = nil
infers['number'] = true
end
+ -- stringlib 就是 string
+ if infers['stringlib'] then
+ infers['stringlib'] = nil
+ infers['string'] = true
+ end
-- 如果是通过 .. 来推测的,且结果里没有 number 与 integer,则推测为string
if infers[BE_CONNACT] then
infers[BE_CONNACT] = nil
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 11d20f40..9031dd07 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -155,11 +155,11 @@ local function getKey(source)
end
elseif source.type == 'doc.class'
or source.type == 'doc.type'
- or source.type == 'doc.alias'
or source.type == 'doc.param'
or source.type == 'doc.vararg'
or source.type == 'doc.field.name'
or source.type == 'doc.type.enum'
+ or source.type == 'doc.resume'
or source.type == 'doc.type.table'
or source.type == 'doc.type.array'
or source.type == 'doc.type.function' then
@@ -223,9 +223,6 @@ local function checkMode(source)
if source.type == 'doc.param' then
return 'dp:'
end
- if source.type == 'doc.alias' then
- return 'da:'
- end
if source.type == 'doc.type.function' then
return 'dfun:'
end
@@ -238,7 +235,8 @@ local function checkMode(source)
if source.type == 'doc.vararg' then
return 'dv:'
end
- if source.type == 'doc.type.enum' then
+ if source.type == 'doc.type.enum'
+ or source.type == 'doc.resume' then
return 'de:'
end
if source.type == 'generic.closure' then
@@ -436,6 +434,13 @@ function m.compileNode(noders, source)
for _, enumUnit in ipairs(source.enums) do
pushForward(noders, id, getID(enumUnit))
end
+ for _, resumeUnit in ipairs(source.resumes) do
+ pushForward(noders, id, getID(resumeUnit))
+ end
+ end
+ -- 分解 @alias
+ if source.type == 'doc.alias' then
+ pushForward(noders, getID(source.alias), getID(source.extends))
end
-- 分解 @class
if source.type == 'doc.class' then
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 254ab2ed..3f3d4036 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -72,6 +72,7 @@ function m.pushResult(status, mode, source, force)
or source.type == 'doc.alias.name'
or source.type == 'doc.field.name'
or source.type == 'doc.type.enum'
+ or source.type == 'doc.resume'
or source.type == 'doc.type.array'
or source.type == 'doc.type.table'
or source.type == 'doc.type.function' then
@@ -116,6 +117,7 @@ function m.pushResult(status, mode, source, force)
or source.type == 'doc.extends.name'
or source.type == 'doc.field.name'
or source.type == 'doc.type.enum'
+ or source.type == 'doc.resume'
or source.type == 'doc.type.array'
or source.type == 'doc.type.table'
or source.type == 'doc.type.function' then
@@ -460,7 +462,6 @@ function m.searchRefsByID(status, uri, expect, mode)
end
checkGlobal(id, node, field)
- checkClass(id, node, field)
checkMainReturn(id, node, field)
if node.call then
@@ -478,6 +479,7 @@ function m.searchRefsByID(status, uri, expect, mode)
if node then
searchNode(id, node, field)
end
+ checkClass(id, node, field)
local lastID = checkLastID(id, field)
if not lastID then
return
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index f5eb39f3..c0ecf4e3 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -65,7 +65,7 @@ m.childMap = {
['doc'] = {'#'},
['doc.class'] = {'class', '#extends', 'comment'},
- ['doc.type'] = {'#types', '#enums', 'name', 'comment'},
+ ['doc.type'] = {'#types', '#enums', '#resumes', 'name', 'comment'},
['doc.alias'] = {'alias', 'extends', 'comment'},
['doc.param'] = {'param', 'extends', 'comment'},
['doc.return'] = {'#returns', 'comment'},