summaryrefslogtreecommitdiff
path: root/script/core/linker.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-04-28 19:56:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-04-28 19:56:28 +0800
commit6aa90f4667b8470fe80889e5fe0f9ab4f96ae86b (patch)
treed15ff1aba4439025522c6441080887afb4e3765b /script/core/linker.lua
parent79979fede8d754ae12a21843f12e45b54acd24d0 (diff)
downloadlua-language-server-6aa90f4667b8470fe80889e5fe0f9ab4f96ae86b.zip
generic
Diffstat (limited to 'script/core/linker.lua')
-rw-r--r--script/core/linker.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/script/core/linker.lua b/script/core/linker.lua
index faf051ea..76d8bf35 100644
--- a/script/core/linker.lua
+++ b/script/core/linker.lua
@@ -287,6 +287,10 @@ local function pushBackward(id, backwardID)
link.backward[#link.backward+1] = backwardID
end
+local function findDocState()
+
+end
+
---前进
---@param source parser.guide.object
---@return parser.guide.object[]
@@ -438,7 +442,7 @@ local function compileLink(source)
)
pushForward(id, callID)
pushBackward(callID, id)
- getLink(id).callinfo = source.vararg
+ getLink(id).call = source.vararg
end
end
if source.type == 'doc.type.function' then
@@ -509,9 +513,12 @@ local function compileLink(source)
end
if doc.type == 'doc.param' then
local paramName = doc.param[1]
- for _, param in ipairs(source.args) do
- if param[1] == paramName then
+ if source.docParamMap then
+ local paramIndex = source.docParamMap[paramName]
+ local param = source.args[paramIndex]
+ if param then
pushForward(getID(param), getID(doc))
+ param.docParam = doc
end
end
end
@@ -537,7 +544,7 @@ end
-- 后退的关联ID
---@field backward string[]
-- 函数调用参数信息(用于泛型)
----@field callinfo parser.guide.object
+---@field call parser.guide.object
local m = {}