summaryrefslogtreecommitdiff
path: root/test/hover/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-26 01:31:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-26 01:31:45 +0800
commitc78fbf09aa4406db905a8a0e6dd5731871f2c262 (patch)
tree50d1c7005f1ab879608a5738d626370e1a01ac70 /test/hover/init.lua
parented64703ef9fec2b1c6736a0deb68bd567875a654 (diff)
downloadlua-language-server-c78fbf09aa4406db905a8a0e6dd5731871f2c262.zip
#1207
return names and parentheses can be used in `DocFunction`
Diffstat (limited to 'test/hover/init.lua')
-rw-r--r--test/hover/init.lua40
1 files changed, 37 insertions, 3 deletions
diff --git a/test/hover/init.lua b/test/hover/init.lua
index a97cf3ae..9cdf2ed4 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -247,7 +247,7 @@ TEST [[
<?print?>()
]]
[[
-function print(...: any)
+function print(...any)
]]
TEST [[
@@ -300,7 +300,7 @@ end
<?x?>(1, 2, 3, 4, 5, 6, 7)
]]
[[
-function x(a: any, ...: any)
+function x(a: any, ...any)
]]
TEST [[
@@ -1518,7 +1518,7 @@ TEST [[
local function f(<?callback?>) end
]]
[[
-(parameter) callback: fun(x: integer, ...: any)
+(parameter) callback: fun(x: integer, ...any)
]]
TEST [[
@@ -2030,3 +2030,37 @@ local t: A {
y: boolean = true,
}
]]
+
+TEST [[
+---@param ... boolean
+---@return number ...
+local function <?f?>(...) end
+]]
+[[
+function f(...boolean)
+ -> ...number
+]]
+
+TEST [[
+---@type fun():x: number
+local <?f?>
+]]
+[[
+local f: fun():(x: number)
+]]
+
+TEST [[
+---@type fun(...: boolean):...: number
+local <?f?>
+]]
+[[
+local f: fun(...boolean):...number
+]]
+
+TEST [[
+---@type fun():x: number, y: boolean
+local <?f?>
+]]
+[[
+local f: fun():(x: number, y: boolean)
+]]