summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/completion/init.lua1
-rw-r--r--test/crossfile/completion.lua1
-rw-r--r--test/crossfile/diagnostic.lua1
-rw-r--r--test/crossfile/hover.lua1
-rw-r--r--test/diagnostics/init.lua37
-rw-r--r--test/document_symbol/init.lua1
-rw-r--r--test/full/example.lua1
-rw-r--r--test/full/projects.lua1
-rw-r--r--test/full/self.lua1
-rw-r--r--test/hover/init.lua25
-rw-r--r--test/signature/init.lua1
-rw-r--r--test/type_inference/init.lua5
12 files changed, 73 insertions, 3 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 58885149..11d39252 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -64,6 +64,7 @@ ContinueTyping = false
function TEST(script)
return function (expect)
+ ---@diagnostic disable: await-in-sync
files.removeAll()
local newScript, catched = catch(script, '?')
diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua
index 27acb15d..50ebad45 100644
--- a/test/crossfile/completion.lua
+++ b/test/crossfile/completion.lua
@@ -80,6 +80,7 @@ local function removeMetas(results)
util.tableMultiRemove(results, removes)
end
+---@diagnostic disable: await-in-sync
function TEST(data)
files.removeAll()
diff --git a/test/crossfile/diagnostic.lua b/test/crossfile/diagnostic.lua
index 7735f4c5..c2d043f4 100644
--- a/test/crossfile/diagnostic.lua
+++ b/test/crossfile/diagnostic.lua
@@ -29,6 +29,7 @@ local function founded(targets, results)
return true
end
+---@diagnostic disable: await-in-sync
function TEST(datas)
files.removeAll()
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index 35528446..6357ab50 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -37,6 +37,7 @@ local function eq(a, b)
return a == b
end
+---@diagnostic disable: await-in-sync
function TEST(expect)
files.removeAll()
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua
index ab55cd92..a46a6dd7 100644
--- a/test/diagnostics/init.lua
+++ b/test/diagnostics/init.lua
@@ -6,6 +6,7 @@ local catch = require 'catch'
config.get 'Lua.diagnostics.neededFileStatus'['deprecated'] = 'Any'
config.get 'Lua.diagnostics.neededFileStatus'['type-check'] = 'Any'
+config.get 'Lua.diagnostics.neededFileStatus'['await-in-sync'] = 'Any'
rawset(_G, 'TEST', true)
@@ -25,6 +26,7 @@ local function founded(targets, results)
return true
end
+---@diagnostic disable: await-in-sync
function TEST(script, ...)
files.removeAll()
local newScript, catched = catch(script, '!')
@@ -1348,12 +1350,41 @@ end
f()
]]
----TODO(arthur)
-do return end
-
TEST [[
---@type file*
local f
f:read '*a'
f:read('*a')
]]
+
+TEST [[
+function F()
+ <!coroutine.yield!>()
+end
+]]
+
+TEST [[
+---@async
+function F()
+ coroutine.yield()
+end
+]]
+
+TEST [[
+---@type async fun()
+local f
+
+function F()
+ <!f!>()
+end
+]]
+
+TEST [[
+---@type async fun()
+local f
+
+---@async
+function F()
+ f()
+end
+]]
diff --git a/test/document_symbol/init.lua b/test/document_symbol/init.lua
index d3168197..1324f29c 100644
--- a/test/document_symbol/init.lua
+++ b/test/document_symbol/init.lua
@@ -45,6 +45,7 @@ local function checkArcoss(symbols)
end
end
+---@diagnostic disable: await-in-sync
function TEST(script)
return function (expect)
files.removeAll()
diff --git a/test/full/example.lua b/test/full/example.lua
index 20de5528..0505f1a5 100644
--- a/test/full/example.lua
+++ b/test/full/example.lua
@@ -8,6 +8,7 @@ local luadoc = require "parser.luadoc"
local noder = require 'core.noder'
-- δΈ΄ζ—Ά
+---@diagnostic disable: await-in-sync
local function testIfExit(path)
config.set('Lua.workspace.preloadFileSize', 1000000000)
local buf = util.loadFile(path:string())
diff --git a/test/full/projects.lua b/test/full/projects.lua
index 316b554d..36d80baa 100644
--- a/test/full/projects.lua
+++ b/test/full/projects.lua
@@ -9,6 +9,7 @@ local fs = require 'bee.filesystem'
config.set('Lua.workspace.preloadFileSize', 1000000)
config.set('Lua.diagnostics.neededFileStatus', {})
+---@diagnostic disable: await-in-sync
local function doProjects(pathname)
files.removeAll()
diff --git a/test/full/self.lua b/test/full/self.lua
index 63e76d9a..67537a54 100644
--- a/test/full/self.lua
+++ b/test/full/self.lua
@@ -25,6 +25,7 @@ diag.start()
local clock = os.clock()
+---@diagnostic disable: await-in-sync
for uri in files.eachFile() do
local fileClock = os.clock()
diag.doDiagnostic(uri)
diff --git a/test/hover/init.lua b/test/hover/init.lua
index 36fbd6d2..d2a6e084 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -19,6 +19,7 @@ local accept = {
['function'] = true,
}
+---@diagnostic disable: await-in-sync
function TEST(script)
return function (expect)
files.removeAll()
@@ -1723,3 +1724,27 @@ local function <?f?>() end
function f()
-> nil
]]
+
+TEST [[
+---@async
+local function <?f?>() end
+]]
+[[
+async function f()
+]]
+
+TEST [[
+---@type function
+local <?f?>
+]]
+[[
+local f: function
+]]
+
+TEST [[
+---@type async fun()
+local <?f?>
+]]
+[[
+local f: async fun()
+]]
diff --git a/test/signature/init.lua b/test/signature/init.lua
index 1dbe61e8..8bc53f02 100644
--- a/test/signature/init.lua
+++ b/test/signature/init.lua
@@ -4,6 +4,7 @@ local catch = require 'catch'
rawset(_G, 'TEST', true)
+---@diagnostic disable: await-in-sync
function TEST(script)
return function (expect)
local newScript, catched1 = catch(script, '?')
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index ac300fcb..135f6749 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -925,3 +925,8 @@ local emit = {}
emit:on("died", function (<?i?>)
end)
]]
+
+TEST 'πŸ‘' [[
+---@class πŸ‘
+local <?x?>
+]]