diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-05-31 17:05:01 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-05-31 17:05:01 +0800 |
commit | faa16704fb8ce52dbc67a92834bf4bba9cc989e1 (patch) | |
tree | 1a77d697c10b474aa121de5223b98e98ccf4e8d4 /script/core | |
parent | b57354065e4a83171c6237b785907822d574fb50 (diff) | |
download | lua-language-server-faa16704fb8ce52dbc67a92834bf4bba9cc989e1.zip |
split types
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/noder.lua | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua index 55ceca72..86dafff3 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -437,16 +437,21 @@ function m.compileNode(noders, source) pushForward(noders, id, getID(src)) end end - for _, typeUnit in ipairs(source.types) do - pushForward(noders, id, getID(typeUnit)) - pushBackward(noders, getID(typeUnit), id) - end 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 + for _, typeUnit in ipairs(source.types) do + local unitID = getID(typeUnit) + pushForward(noders, id, unitID) + if source.bindSources then + for _, src in ipairs(source.bindSources) do + pushBackward(noders, unitID, getID(src)) + end + end + end end -- 分解 @alias if source.type == 'doc.alias' then @@ -650,7 +655,9 @@ function m.compileNode(noders, source) rtn.returnIndex ) pushForward(noders, fullID, getID(rtn)) - pushBackward(noders, getID(rtn), fullID) + for _, typeUnit in ipairs(rtn.types) do + pushBackward(noders, getID(typeUnit), fullID) + end hasDocReturn[rtn.returnIndex] = true end end @@ -896,6 +903,7 @@ function m.compileNodes(source) end) -- Special rule: ('').XX -> stringlib.XX pushBackward(noders, 'str:', 'dn:stringlib') + --pushBackward(noders, 'dn:string', 'dn:stringlib') return noders end |