summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-28 14:08:42 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-28 14:08:42 +0800
commit30ecf0d4475cf1e2b92f316d38311bab2d2095ab (patch)
tree2fa9b0924bb4d0c591fbd3ba80df79cc7cabef96
parent04264ad28a5cf727b96aa599150e8fe016df07c0 (diff)
downloadlua-language-server-30ecf0d4475cf1e2b92f316d38311bab2d2095ab.zip
doc.overload
-rw-r--r--script-beta/parser/guide.lua2
-rw-r--r--test-beta/definition/luadoc.lua10
-rw-r--r--test-beta/hover/init.lua11
3 files changed, 12 insertions, 11 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 0760c441..48eec0f0 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1456,6 +1456,8 @@ function m.checkSameSimpleByBindDocs(status, obj, start, queue, mode)
end
end
end
+ elseif doc.type == 'doc.overload' then
+ results[#results+1] = doc.overload
end
end
local mark = {}
diff --git a/test-beta/definition/luadoc.lua b/test-beta/definition/luadoc.lua
index d91c3dfe..a0881334 100644
--- a/test-beta/definition/luadoc.lua
+++ b/test-beta/definition/luadoc.lua
@@ -91,6 +91,16 @@ TEST [[
function t(<?<!f!>?>) end
]]
+TEST [[
+---@overload <!fun(y: boolean)!>
+---@param x number
+---@param y boolean
+---@param z string
+function <!f!>(x, y, z) end
+
+print(<?f?>)
+]]
+
-- TODO
do return end
TEST [[
diff --git a/test-beta/hover/init.lua b/test-beta/hover/init.lua
index 471ad2ce..6efbef55 100644
--- a/test-beta/hover/init.lua
+++ b/test-beta/hover/init.lua
@@ -1198,17 +1198,6 @@ local <?x?> = f()
local x: integer
]]
-TEST [[
----@overload fun(y: boolean)
----@param x number
----@param y boolean
----@param z string
-function <?f?>(x, y, z) end
-]]
-[=[
-function f(x: number, y: boolean, z: string)
-]=]
-
do return end
TEST [[
---@param x number {optional = 'after'}