diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-02 21:24:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-02 21:24:46 +0800 |
commit | 7a3b9a09737473efd80ba0539374e4c177bb27e7 (patch) | |
tree | aaa88295fc6eaf235664ce1e79ddd0deff34fea2 /test/diagnostics/init.lua | |
parent | fbb038b568fffe8ddbf6946cd0f7d49a624b496a (diff) | |
download | lua-language-server-7a3b9a09737473efd80ba0539374e4c177bb27e7.zip |
not-yieldable
Diffstat (limited to 'test/diagnostics/init.lua')
-rw-r--r-- | test/diagnostics/init.lua | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index a46a6dd7..1d8c4018 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -4,9 +4,10 @@ local config = require 'config' local util = require 'utility' local catch = require 'catch' -config.get 'Lua.diagnostics.neededFileStatus'['deprecated'] = 'Any' -config.get 'Lua.diagnostics.neededFileStatus'['type-check'] = 'Any' +config.get 'Lua.diagnostics.neededFileStatus'['deprecated'] = 'Any' +config.get 'Lua.diagnostics.neededFileStatus'['type-check'] = 'Any' config.get 'Lua.diagnostics.neededFileStatus'['await-in-sync'] = 'Any' +config.get 'Lua.diagnostics.neededFileStatus'['not-yieldable'] = 'Any' rawset(_G, 'TEST', true) @@ -1388,3 +1389,57 @@ function F() f() end ]] + +TEST [[ +---@param f async fun() +function CB(f) + <!f!>() +end +]] + +TEST [[ +local cb + +cb(function () ---@async + return nil +end) +]] + +TEST [[ +---@param f async fun() +function CB(f) + return f +end + +CB(function () ---@async + return nil +end) +]] + +TEST [[ +function CB(f) + return f +end + +<!CB!>(function () ---@async + return nil +end) +]] + +TEST [[ +---@type fun(f: async fun()) +local cb + +cb(function () ---@async + return nil +end) +]] + +TEST [[ +---@type fun(f: fun()) +local cb + +<!cb!>(function () ---@async + return nil +end) +]] |