summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/completion.lua3
-rw-r--r--script/core/noder.lua3
-rw-r--r--test/definition/luadoc.lua2
3 files changed, 6 insertions, 2 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index c9420d85..acaaa276 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -1454,7 +1454,8 @@ local function tryTable(ast, text, offset, results)
if source.type ~= 'table' then
tbl = source.parent
end
- local defs = vm.getDefs(tbl, '*')
+ local parent = tbl.parent
+ local defs = vm.getDefs(parent, '*')
for _, field in ipairs(defs) do
local name = guide.getKeyName(field)
if name and not mark[name] then
diff --git a/script/core/noder.lua b/script/core/noder.lua
index e1c07afc..681f4209 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -685,6 +685,9 @@ function m.compileNode(noders, source)
if doc.type == 'doc.generic' then
source.isGeneric = true
end
+ if doc.type == 'doc.overload' then
+ pushForward(noders, id, getID(doc.overload))
+ end
end
end
-- 检查实体返回值
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index c556940a..5531e2e3 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -102,7 +102,7 @@ function f(<?...?>) end
]]
TEST [[
----@overload fun(y: boolean)
+---@overload <!fun(y: boolean)!>
---@param x number
---@param y boolean
---@param z string