diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-08 17:21:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-08 17:21:46 +0800 |
commit | 5dd886dfe1fa7bbaf8ca898d33e45b04513f6492 (patch) | |
tree | 7fb099d6e00399df0efdf8271597deb1fbeb8bc7 | |
parent | b1bd06c0a27426dab6d1e151b116eb7bb53ba03c (diff) | |
download | lua-language-server-5dd886dfe1fa7bbaf8ca898d33e45b04513f6492.zip |
update template
-rw-r--r-- | meta/template/basic.lua | 10 | ||||
-rw-r--r-- | meta/template/debug.lua | 18 | ||||
-rw-r--r-- | meta/template/string.lua | 2 |
3 files changed, 17 insertions, 13 deletions
diff --git a/meta/template/basic.lua b/meta/template/basic.lua index 6c3f7d46..c3916eba 100644 --- a/meta/template/basic.lua +++ b/meta/template/basic.lua @@ -55,7 +55,7 @@ _G = {} ---@version 5.1 ---#DES 'getfenv' ----@param f? function +---@param f? async fun(...):... ---@return table ---@nodiscard function getfenv(f) end @@ -148,7 +148,11 @@ function next(table, index) end function pairs(t) end ---#DES 'pcall' +---#if VERSION == 5.1 and not JIT then ---@param f function +---#else +---@param f async fun(...):... +---#end ---@param arg1? any ---@return boolean success ---@return any result @@ -193,7 +197,7 @@ function select(index, ...) end ---@version 5.1 ---#DES 'setfenv' ----@param f function|integer +---@param f async fun(...):...|integer ---@param table table ---@return function function setfenv(f, table) end @@ -259,7 +263,7 @@ function warn(message, ...) end function xpcall(f, err) end ---#else ---#DES 'xpcall>5.2' ----@param f function +---@param f async fun(...):... ---@param msgh function ---@param arg1? any ---@return boolean success diff --git a/meta/template/debug.lua b/meta/template/debug.lua index 3f8a91a4..bb31ee1a 100644 --- a/meta/template/debug.lua +++ b/meta/template/debug.lua @@ -63,7 +63,7 @@ function debug.gethook(co) end ---#DES 'debug.getinfo' ---@overload fun(f: integer|function, what?: infowhat):debuginfo ---@param thread thread ----@param f integer|function +---@param f integer|async fun(...):... ---@param what? infowhat ---@return debuginfo ---@nodiscard @@ -81,9 +81,9 @@ function debug.getinfo(thread, f, what) end function debug.getlocal(thread, level, index) end ---#else ---#DES 'debug.getlocal>5.2' ----@overload fun(f: integer|function, index: integer):string, any +---@overload fun(f: integer|async fun(...), index: integer):string, any ---@param thread thread ----@param f integer|function +---@param f integer|async fun(...):... ---@param index integer ---@return string name ---@return any value @@ -103,7 +103,7 @@ function debug.getmetatable(object) end function debug.getregistry() end ---#DES 'debug.getupvalue' ----@param f function +---@param f async fun(...):... ---@param up integer ---@return string name ---@return any value @@ -148,7 +148,7 @@ function debug.setfenv(object, env) end ---#DES 'debug.sethook' ---@overload fun(hook: function, mask: hookmask, count?: integer) ---@param thread thread ----@param hook function +---@param hook async fun(...):... ---@param mask hookmask ---@param count? integer function debug.sethook(thread, hook, mask, count) end @@ -170,7 +170,7 @@ function debug.setlocal(thread, level, index, value) end function debug.setmetatable(value, meta) end ---#DES 'debug.setupvalue' ----@param f function +---@param f async fun(...):... ---@param up integer ---@param value any ---@return string name @@ -202,7 +202,7 @@ function debug.traceback(thread, message, level) end ---@version >5.2, JIT ---#DES 'debug.upvalueid' ----@param f function +---@param f async fun(...):... ---@param n integer ---@return lightuserdata id ---@nodiscard @@ -210,9 +210,9 @@ function debug.upvalueid(f, n) end ---@version >5.2, JIT ---#DES 'debug.upvaluejoin' ----@param f1 function +---@param f1 async fun(...):... ---@param n1 integer ----@param f2 function +---@param f2 async fun(...):... ---@param n2 integer function debug.upvaluejoin(f1, n1, f2, n2) end diff --git a/meta/template/string.lua b/meta/template/string.lua index 97bae481..0673afa8 100644 --- a/meta/template/string.lua +++ b/meta/template/string.lua @@ -22,7 +22,7 @@ function string.byte(s, i, j) end function string.char(byte, ...) end ---#DES 'string.dump' ----@param f function +---@param f async fun(...):... ---@param strip? boolean ---@return string ---@nodiscard |