summaryrefslogtreecommitdiff
path: root/test/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-05 17:13:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-05 17:13:36 +0800
commitd6778d10edb8bf47a854098456421f746606996b (patch)
treef1a0962e52f1ff87af5efbff7772c195352d94f2 /test/diagnostics
parent32301f8de3d832d428bf75fe44269ed121f4ab4f (diff)
downloadlua-language-server-d6778d10edb8bf47a854098456421f746606996b.zip
fix
Diffstat (limited to 'test/diagnostics')
-rw-r--r--test/diagnostics/init.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua
index e20c129c..db4bbac9 100644
--- a/test/diagnostics/init.lua
+++ b/test/diagnostics/init.lua
@@ -31,9 +31,11 @@ function TEST(script, ...)
local newScript, catched = catch(script, '!')
files.setText('', newScript)
files.open('')
+ local origins = {}
local results = {}
core('', function (result)
results[#results+1] = { result.start, result.finish }
+ origins[#origins+1] = result
end)
if results[1] then
@@ -1416,6 +1418,49 @@ end)
]]
TEST [[
+---@param c any
+local function f(c)
+ return c
+end
+
+f(function () ---@async
+ return nil
+end)
+]]
+
+TEST [[
+---@param ... any
+local function f(...)
+ return ...
+end
+
+f(function () ---@async
+ return nil
+end)
+]]
+
+TEST [[
+---@vararg any
+local function f(...)
+ return ...
+end
+
+f(function () ---@async
+ return nil
+end)
+]]
+
+TEST [[
+local function f(...)
+ return ...
+end
+
+f(function () ---@async
+ return nil
+end)
+]]
+
+TEST [[
---@nodiscard
local function f()
return 1